castorflex / VerticalViewPager

Copy pasted version of the support ViewPager, but vertical!
1.11k stars 305 forks source link

key event bug #30

Open willqian opened 7 years ago

willqian commented 7 years ago

please patch the code

    public boolean executeKeyEvent(KeyEvent event) {
        boolean handled = false;
        if (event.getAction() == KeyEvent.ACTION_DOWN) {
            switch (event.getKeyCode()) {
            --case KeyEvent.KEYCODE_DPAD_LEFT:
            ++case KeyEvent.KEYCODE_DPAD_UP:
                    --handled = arrowScroll(FOCUS_LEFT);
                    ++handled = arrowScroll(FOCUS_UP);
                    break;
            --case KeyEvent.KEYCODE_DPAD_RIGHT:
            ++case KeyEvent.KEYCODE_DPAD_DOWN:
                    --handled = arrowScroll(FOCUS_RIGHT);
                    ++handled = arrowScroll(FOCUS_DOWN);
                    break;
                    ......
            }
        }
        return handled;
    }
thelou1s commented 4 years ago

Caused by java.lang.ClassNotFoundException Didn't find class "androidx.core.view.KeyEventCompat" on path: at fr.castorflex.android.verticalviewpager.VerticalViewPager.dispatchKeyEvent

Firebase crash logs:

Fatal Exception: java.lang.NoClassDefFoundError
Failed resolution of: Landroidx/core/view/KeyEventCompat;
Fatal Exception: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/view/KeyEventCompat;
       at fr.castorflex.android.verticalviewpager.VerticalViewPager.access$000(VerticalViewPager.java)
       at fr.castorflex.android.verticalviewpager.VerticalViewPager.dispatchKeyEvent(VerticalViewPager.java)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
       at com.android.internal.policy.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2395)
       at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1727)
       at androidx.core.view.KeyEventDispatcher.actionBarOnMenuKeyEventPre28(KeyEventDispatcher.java)
       at androidx.core.view.KeyEventDispatcher.actionBarOnMenuKeyEventPre28(KeyEventDispatcher.java)
       at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java)
       at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java)
       at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java)
       at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java)
       at com.android.internal.policy.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2310)
       at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4127)
       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4089)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3787)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3844)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3820)
       at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:3981)
       at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2253)
       at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1874)
       at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1865)
       at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2230)
       at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:323)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5417)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Caused by java.lang.ClassNotFoundException
Didn't find class "androidx.core.view.KeyEventCompat" on path: DexPathList[[zip file "/data/app/com.spmt.io-1/base.apk", zip file "/data/app/com.spmt.io-1/split_config.armeabi_v7a.apk", zip file "/data/app/com.spmt.io-1/split_config.en.apk", zip file "/data/app/com.spmt.io-1/split_config.xxhdpi.apk", zip file "/data/app/com.spmt.io-1/split_df_sound1.apk", zip file "/data/app/com.spmt.io-1/split_df_sound1.config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/com.spmt.io-1/lib/arm, /data/app/com.spmt.io-1/base.apk!/lib/armeabi-v7a, /data/app/com.spmt.io-1/split_config.armeabi_v7a.apk!/lib/armeabi-v7a, /data/app/com.spmt.io-1/split_config.en.apk!/lib/armeabi-v7a, /data/app/com.spmt.io-1/split_config.xxhdpi.apk!/lib/armeabi-v7a, /data/app/com.spmt.io-1/split_df_sound1.apk!/lib/armeabi-v7a, /data/app/com.spmt.io-1/split_df_sound1.config.xxhdpi.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
Caused by java.lang.ClassNotFoundException: Didn't find class "androidx.core.view.KeyEventCompat" on path: DexPathList[[zip file "/data/app/com.spmt.io-1/base.apk", zip file "/data/app/com.spmt.io-1/split_config.armeabi_v7a.apk", zip file "/data/app/com.spmt.io-1/split_config.en.apk", zip file "/data/app/com.spmt.io-1/split_config.xxhdpi.apk", zip file "/data/app/com.spmt.io-1/split_df_sound1.apk", zip file "/data/app/com.spmt.io-1/split_df_sound1.config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/com.spmt.io-1/lib/arm, /data/app/com.spmt.io-1/base.apk!/lib/armeabi-v7a, /data/app/com.spmt.io-1/split_config.armeabi_v7a.apk!/lib/armeabi-v7a, /data/app/com.spmt.io-1/split_config.en.apk!/lib/armeabi-v7a, /data/app/com.spmt.io-1/split_config.xxhdpi.apk!/lib/armeabi-v7a, /data/app/com.spmt.io-1/split_df_sound1.apk!/lib/armeabi-v7a, /data/app/com.spmt.io-1/split_df_sound1.config.xxhdpi.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
       at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
       at fr.castorflex.android.verticalviewpager.VerticalViewPager.access$000(VerticalViewPager.java)
       at fr.castorflex.android.verticalviewpager.VerticalViewPager.dispatchKeyEvent(VerticalViewPager.java)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640)
       at com.android.internal.policy.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2395)
       at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1727)
       at androidx.core.view.KeyEventDispatcher.actionBarOnMenuKeyEventPre28(KeyEventDispatcher.java)
       at androidx.core.view.KeyEventDispatcher.actionBarOnMenuKeyEventPre28(KeyEventDispatcher.java)
       at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java)
       at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java)
       at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java)
       at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java)
       at com.android.internal.policy.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2310)
       at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4127)
       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4089)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3787)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3844)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3820)
       at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:3981)
       at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2253)
       at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1874)
       at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1865)
       at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2230)
       at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:323)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5417)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)