bottomnavigationview

Is there a way to keep fragment alive when using BottomNavigationView with new NavController?

空扰寡人 提交于 2019-11-27 06:12:40
I'm trying to use the new navigation component. I use a BottomNavigationView with the navController : NavigationUI.setupWithNavController(bottomNavigation, navController) But when I'm switching fragments, they are each time destroy/create even if they were previously used. Is there a way to keep alive our main fragments link to our BottomNavigationView? Try this. Navigator Create custom navigator. @Navigator.Name("custom_fragment") // Use as custom tag at navigation.xml class CustomNavigator( private val context: Context, private val manager: FragmentManager, private val containerId: Int ) :

BottomNavigationView - Shadow and Ripple Effect

谁说胖子不能爱 提交于 2019-11-27 01:37:49
问题 I was really happy when BottomNavigationView was released one week ago but I am facing some problems which makes me unable to solve it, like to see a shadow over the BottomNavigationView, on the same way as Google Photos Android App shows us: If we tap on an Google Photos menu item, we can see a ripple effect which is tinted blue like the icon and text color (when selected). Implementing the solution provided by Google only is displayed a gray ripple effect color, and worse, it is not

How to remove icon animation for bottom navigation view in android

眉间皱痕 提交于 2019-11-26 22:38:46
问题 I have implemented Bottom Navigation View from Design Support Library 25 in my project. I have 5 icons in the view. whenever an icon is selected it's having some animation. But when 3 or fewer icons is not showing any animations. I want to remove that animation and need only some color change for the icon. How can I achieve this? Done enough googling, but couldn't find the solution. Please help. Thanks. 回答1: got answer from this thread. To remove animation or shift mode. Implementation of

Remove BottomNavigationView labels

こ雲淡風輕ζ 提交于 2019-11-26 22:18:31
Google released new support library v25 with BottomNavigationView is there any way to remove items labels ? I hope I am not too late to the party here. But as of Design Support Library 28.0.0-alpha1 you can use the property app:labelVisibilityMode="unlabeled" you can use other values "auto", "labeled" and "selected" as well. ittianyu Would you want to this style ? If so, I recommend you try BottomNavigationViewEx . Unfortunately this first version of BottomNavigationView came with a lot of limitations. And for now you can't remove the titles just using the support design API. So to solve this

Set selected item in Android BottomNavigationView

对着背影说爱祢 提交于 2019-11-26 22:05:17
I am using the new android.support.design.widget.BottomNavigationView from the support library. How can I set the current selection from code? I realized, that the selection is changed back to the first item, after rotating the screen. Of course it would also help, if someone could tell me, how to "save" the current state of the BottomNavigationView in the onPause function and how to restore it in onResume . Thanks! From API 25.3.0 it was introduced the method setSelectedItemId(int id) which let's you mark an item as selected as if it was tapped. From docs: Set the selected menu item ID. This

Android: Bottom Navigation View - change icon of selected item

蓝咒 提交于 2019-11-26 19:41:57
问题 I have added BottomNavigationView in my application like. main.xml <android.support.design.widget.BottomNavigationView android:id="@+id/bottom_navigation" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" app:itemBackground="@color/colorPrimary" app:itemIconTint="@color/white" app:itemTextColor="@color/white" app:menu="@menu/bottom_navigation_main" /> bottom_navigation_main.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns

Show/hide BottomNavigationView on scroll in CoordinatorLayout with AppBarLayout

不羁的心 提交于 2019-11-26 18:32:31
问题 I am trying to use both AppBarLayout and BottomNavigationLayout in a single CoordinatorLayout and I'm having difficulties hiding the BottomNavigationLayout as required by the material guideline. I mean something like this: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android

Remove Animation/Shifting mode from BottomNavigationView android [duplicate]

心不动则不痛 提交于 2019-11-26 13:02:27
问题 This question already has answers here : How to disable BottomNavigationView shift mode? (19 answers) Closed 2 years ago . i am building an application in which i have a BottomNavigationView. Everything works fine until i get to the Activity. The Navigation is this: The problem is that it has this default animation so it pushes the active element everytime higher than the rest. Another Example: So my question is how to get rid of this default animation and every item is aligned when i switch

Is there a way to keep fragment alive when using BottomNavigationView with new NavController?

五迷三道 提交于 2019-11-26 12:51:17
问题 I\'m trying to use the new navigation component. I use a BottomNavigationView with the navController : NavigationUI.setupWithNavController(bottomNavigation, navController) But when I\'m switching fragments, they are each time destroy/create even if they were previously used. Is there a way to keep alive our main fragments link to our BottomNavigationView? 回答1: Try this. Navigator Create custom navigator. @Navigator.Name("custom_fragment") // Use as custom tag at navigation.xml class

How to combine BottomAppBar + FAB with BottomNavigationView

这一生的挚爱 提交于 2019-11-26 11:18:17
问题 I want to use the FloatingActionButton , along with its behaviour when anchored on a BottomAppBar, on top of a BottomNavigationView. I came up with a rather \"hacky\" trick to just place the BottomNavigationView on top of the BottomAppBar without providing a background thus making it transparent. This seemed to work well at first sight but I found out that the fab button can only be clicked when touching the upper half of the button (So where there is no transparent BottomNavigationView on