Reputation: 107
please mention the issue in my code. I've used a seekbar. On click of that it crashes straight away. i've used reset button also below the seekbar and I kept onstart tracking touch and onstop tracking touch empty.
val initialTextViewTranslationY = textView_progress.translationY
seekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
TODO("Not yet implemented")
textView_progress.text = progress.toString()
val translationdistance = (initialTextViewTranslationY + progress * resources.getDimension(R.dimen.text_anim_step) * -1)
textView_progress.animate().translationY(translationdistance)
if (!fromUser)
textView_progress.animate().setDuration(500).rotationBy(360f).translationY(initialTextViewTranslationY)
}
override fun onStartTrackingTouch(seekBar: SeekBar?) {
TODO("Not yet implemented")
}
override fun onStopTrackingTouch(seekBar: SeekBar?) {
TODO("Not yet implemented")
}
})
It generates the logcat as follows.
at android.widget.SeekBar.onStartTrackingTouch(SeekBar.java:113)
at android.widget.AbsSeekBar.startDrag(AbsSeekBar.java:1299)
at android.widget.AbsSeekBar.onTouchEvent(AbsSeekBar.java:1238)
at android.view.View.dispatchTouchEvent(View.java:10936)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2842)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2469)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:623)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1909)
at android.app.Activity.dispatchTouchEvent(Activity.java:3247)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:585)
at android.view.View.dispatchPointerEvent(View.java:11165)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5227)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5076)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4580)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4633)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4599)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4736)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4607)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4793)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4580)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4633)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4599)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4607)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4580)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7210)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7142)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7103)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:6816)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
Upvotes: 0
Views: 59
Reputation: 27236
You have to remove the TODO(...)
invocations.
It's a Kotlin function that throws an exception at runtime:
source:
/**
* Always throws [NotImplementedError] stating that operation is not implemented.
*
* @param reason a string explaining why the implementation is missing.
*/
@kotlin.internal.InlineOnly
public inline fun TODO(reason: String): Nothing = throw NotImplementedError("An operation is not implemented: $reason")
Upvotes: 1