Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with custom ticks #185

Closed
Pirokar opened this issue Jul 11, 2020 · 5 comments
Closed

Crash with custom ticks #185

Pirokar opened this issue Jul 11, 2020 · 5 comments
Labels
Bug report Participants report a bug

Comments

@Pirokar
Copy link

Pirokar commented Jul 11, 2020

speedView.tickNumber = 16
speedView.setTicks(0f, 1f, 2f, 3f, 5f, 10f, 20f, 30f, 50f, 100f, 200f, 300f, 500f, 1000f, 1500f, 2000f)

leading to crash:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.signalsense.signalsenseapp, PID: 11786
    java.lang.ClassCastException: kotlin.collections.ArraysKt___ArraysJvmKt$asList$5 cannot be cast to java.util.ArrayList
        at com.github.anastr.speedviewlib.Speedometer.setTicks(Speedometer.kt:664)
        at com.signalsense.signalsenseapp.framework.ui.fragments.speed_test_fragment.SpeedTestFragment.onViewCreated(SpeedTestFragment.kt:21)
        at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:332)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1187)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1356)
        at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1434)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1497)
        at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447)
        at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2169)
        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1992)
        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1947)
        at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1849)
        at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2629)
        at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2577)
        at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:247)
        at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:541)
        at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:201)
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1433)
        at android.app.Activity.performStart(Activity.java:7980)
        at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3578)
        at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
        at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2220)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8016)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
@Pirokar Pirokar added the Bug report Participants report a bug label Jul 11, 2020
@Pirokar
Copy link
Author

Pirokar commented Jul 11, 2020

This happened with pointer speedometer

@anastr
Copy link
Owner

anastr commented Jul 11, 2020

setTicks method has been removed c7ba3f7, please use direct setter for ticks:

speedView.ticks = arrayListOf(0f, ...)

Quick tip

you should not use tickNumber with set ticks, either use tickNumber or custom ticks!

@Pirokar
Copy link
Author

Pirokar commented Jul 11, 2020

Ok, I understand, thanks. But your setTicks method still available outside of the library. Then better to hide it.

@anastr
Copy link
Owner

anastr commented Jul 11, 2020

for sure, it will be perfectly disappear in the next version.

@anastr
Copy link
Owner

anastr commented Jul 27, 2020

fixed in v1.5.3.

@anastr anastr closed this as completed Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug report Participants report a bug
Projects
None yet
Development

No branches or pull requests

2 participants