Open mobile-sergey opened 3 years ago
Any update on this?
+1
The same for me, maybe it's time to switch to a navigation pattern :|
Same as me, after updating to 1.4.0 this issue found.
+1
+1
I did not receive a response from the developer, so I decided to replace BottomNavigationViewEx with standard BottomNavigationView. It's easy. May be it will be useful for somebody.
First of all I delete dependency from build.gradle:
implementation 'com.github.ittianyu:BottomNavigationViewEx:2.0.4'
Delete all BottomNavigationViewEx from ProGuard
-keep public class com.google.android.material.bottomnavigation.BottomNavigationView { *; }
-keep public class com.google.android.material.bottomnavigation.BottomNavigationMenuView { *; }
-keep public class com.google.android.material.bottomnavigation.BottomNavigationPresenter { *; }
-keep public class com.google.android.material.bottomnavigation.BottomNavigationItemView { *; }
Replace in layouts (and delete all specific attributes):
com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
change to:
com.google.android.material.bottomnavigation.BottomNavigationView
Run project and delete all specific code from modules that get errors: For example: enableShiftingMode(), enableItemShiftingMode(), setTextVisibility(), setIconSizeAt(), setIconMarginTop()
Delete dependency from build.gradle:
implementation 'q.rorbin:badgeview:1.1.0'
Replace all imports Badge to imports BadgeDrawable For example:
import q.rorbin.badgeview.Badge;
import q.rorbin.badgeview.QBadgeView;
replace to:
import com.google.android.material.badge.BadgeDrawable;
Replace using class Badge into class BadgeDrawable and refactoring all code with Badge and BadgeView For example:
Badge badge = new QBadgeView(context).bindTarget(context.binding.navigation.getBottomNavigationItemView(position));
badge.setBadgeNumber(number);
if (number == 0) {
badge.hide(true);
}
replace to:
BadgeDrawable badge = context.binding.navigation.getOrCreateBadge(R.id.navigation_tab1);
badge.setNumber(number);
badge.setVisible(number > 0);
我也遇到了类似的问题
java.lang.RuntimeException: Unable to start activity ComponentInfo{io.github.haodongling.ppjokenew/io.github.haodongling.ppjokenew.MainActivity}: android.view.InflateException: Binary XML file line #14 in io.github.haodongling.ppjokenew:layout/activity_main: Binary XML file line #23 in io.github.haodongling.ppjokenew:layout/fragment_main: Binary XML file line #23 in io.github.haodongling.ppjokenew:layout/fragment_main: Error inflating class com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3782)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3961)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:8178)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
appcomat 和materil 版本如下 const val material = "1.3.0-alpha03" const val appcompat = "1.2.0"
+1
+1
On 'com.google.android.material:material:1.3.0' all working good.
But when I update to 'com.google.android.material:material:1.4.0' I get error in BottomNavigationViewEx:
Error on this line:
Layout with error from line #81: