bottomnavigationview

How to increase icon size in android bottom navigation layout?

一曲冷凌霜 提交于 2019-11-27 23:47:14
问题 I am using the bottom layout navigation style in android that was recently introduced by google in design library 25. In all the tutorials and questions i see, the images in their icons are a normal size, but mine are extra small, despite the fact that the image I'm saving to drawable folder is 72x72. Here is a screenshot: The icons should be at least 2, maybe even 3 times that size. How can I do it? Here is my code in my bottom_layout.xml: <?xml version="1.0" encoding="utf-8"?> <menu xmlns

How to combine BottomAppBar + FAB with BottomNavigationView

不羁的心 提交于 2019-11-27 22:28:08
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 top). <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res

Android: Bottom Navigation View - change icon of selected item

三世轮回 提交于 2019-11-27 19:01:00
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:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">

How to remove icon animation for bottom navigation view in android

北战南征 提交于 2019-11-27 18:23:15
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. Nabeel K got answer from this thread . To remove animation or shift mode. Implementation of BottomNavigationView has condition: when there is more than 3 items then use shift mode. Create

How to highlight the item when pressed using BottomNavigationView between activities?

流过昼夜 提交于 2019-11-27 17:42:50
问题 I have added Bottom Navigation View for my app but I need the Bottom Navigation View between activities instead of fragment so I have added this code to Java for all my 3 activities. When I select Second or Third in my phone all things are correct but the problem is the highlight goes to the First item. I need to highlight the item I press. I have used fragment and it works perfectly but I am still beginner for using fragment so I am using activities. The first activity code is:

Show/hide BottomNavigationView on scroll in CoordinatorLayout with AppBarLayout

筅森魡賤 提交于 2019-11-27 15:34:59
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:fitsSystemWindows="false"> <android.support.design.widget.AppBarLayout android:id="@+id/app_bar" android

How to hide the BottomNavigationView below keyboard with adjustResize set

本小妞迷上赌 提交于 2019-11-27 12:48:16
问题 According to the material design spec, when the keyboard appears, the BottomNavigationView should hide underneath it. However, if I set android:windowSoftInputMode="adjustResize" in the Activity's manifest then the BottomNavigationView moves above the keyboard. I need to set adjustResize to enable scrolling to the bottom of the screen while the keyboard is open. However, I do not want the BottomNavigationView to be visible. Can this be done? How it currently looks: The layout XML (in reality

How to make bottom navigation show menu items with icon and text except center item menu show only icon? [closed]

徘徊边缘 提交于 2019-11-27 11:51:35
I want to create bottom navigation bar show menu items icon and text except center item. eg. i have attached image Try below code: XML file: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="top" android:background="@color

Set initially selected item index/id in BottomNavigationView

邮差的信 提交于 2019-11-27 11:09:56
问题 I have implemented BottomNavigationView and have no idea how to set selection index or MenuItem id (in my case, middle item should be selected by default). I'm afraid there's no such possibility for now as far as it's too raw yet, but anyways any help will be appreciated. Thanks! 回答1: Set the selected menu item ID using setSelectedItemId: bottomNavigationView.setSelectedItemId(R.id.item_id); This method started being available from Android Support Library 25.3.0. 回答2: The only solution that

Remove Animation/Shifting mode from BottomNavigationView android [duplicate]

北城以北 提交于 2019-11-27 07:05:31
This question already has an answer here: How to disable BottomNavigationView shift mode? 19 answers 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 between them? My code: public class MainActivity extends AppCompatActivity { private BottomNavigationView