Open fctaddia opened 3 years ago
Thank you for your comment. This method is available at support library 27 or lower (android.support.design.internal.BottomNavigationMenuView). You are using a new library (com.google.android.material.bottomnavigation.BottomNavigationMenuView) in your app. My code is incorrect at the import declaration.
Ok thanks for your reply. Will there be an update to support the new library?
If you want to use a Material Components, you have to migrate support library to AndroidX and add com.google.android.material:material:1.2.1
to the dependencies.
Check out this docs:
https://github.com/material-components/material-components-android/blob/master/docs/getting-started.md
I run the method to disable shiftMode and in the logs it shows me this: D/TADDA: class Zx E/BottomNavigationHelper: Unable to get shift mode field java.lang.NoSuchFieldException: No field mShiftingMode in class LZx; (declaration of 'Zx' appears in /data/app/it.kenble.freddy-LA1SlQO9Eo5FCUafCf-YOw==/base.apk) at java.lang.Class.getDeclaredField(Native Method) at JG.b(:12) at it.kenble.freddy.ui.MainActivity.onCreate(:39) at android.app.Activity.performCreate(Activity.java:7458) at android.app.Activity.performCreate(Activity.java:7448) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199) at android.os.Handler.dispatchMessage(Handler.java:112) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7625) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
TADDA is a custom name of my log
at it.kenble.freddy.ui.MainActivity.onCreate(:39) --> if (Build.VERSION.SDK_INT >= 27) binding.bottomNavigation.disableShiftMode()
I also added this in the proguard-roles file: -keepclassmembers class android.support.design.internal.BottomNavigationMenuView { boolean mShiftingMode; }
I'm using this as a global theme: Theme.MaterialComponents.Light.NoActionBar, I don't know if it affects anything.
Let me know if it can be fixed. Thanks