bottomnavigationview

How to create bottom navigation bar similar to instagram

元气小坏坏 提交于 2019-11-29 01:58:59
问题 I am an android newbie trying to create a bottom navigation bar for my new android app similar to one there in Instagram. Like this where clicking on the search icon adds a search bar in action bar. I am building an app for reminding the user about his medical appointments which has three navigation tabs at the bottom. I have created till this after this I am stuck. Should I use three activities to display the content of corresponding tabs or fragments and how can I achieve that. I need a

Solved: How to add dividers in Bottom Navigation View

折月煮酒 提交于 2019-11-29 01:00:06
问题 I'm trying to add divider in menu items of BottomNavigationView All items are showing horizontally in the bottom but I'm not able to add dividers into it. Bottom Navigation View xml: <android.support.design.widget.BottomNavigationView android:id="@+id/navigation" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:focusable="false" app:itemBackground="@color/colorPrimaryDark" app:itemIconTint="@color/bottom_navigation_selector" app:itemTextColor="@color

BottomNavigationView - Shadow and Ripple Effect

↘锁芯ラ 提交于 2019-11-28 20:45:29
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 displayed when we change the background color of the bottomnavigationview ( design:itemBackground="..." ).

Separate Back Stack for each tab in BottomNavigationView Android using Fragments

◇◆丶佛笑我妖孽 提交于 2019-11-28 18:49:25
I'm implementing BottomNavigationView for navigation in an Android app. I am using Fragments to set the content for each tab. I know how to set up one fragment for each tab and then switch fragments when a tab is clicked. But how can I have a separate back stack for each tab? Here is the code to set up one fragment: Fragment selectedFragment = ItemsFragment.newInstance(); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.replace(R.id.content, selectedFragment); transaction.commit(); For an example, Fragment A and B would be under Tab 1 and Fragment C

Background color change in BottomNavigationView

青春壹個敷衍的年華 提交于 2019-11-28 18:42:47
I have implemented BottomNavigationView which is available from the new support library 25.0.0. Here is my code for that <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="@drawable/text" app:itemTextColor="@drawable/text" app:menu="@menu/bottom_navigation_main" /> And text.xml drawable <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res

Set initially selected item index/id in BottomNavigationView

梦想的初衷 提交于 2019-11-28 18:14:58
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! 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. The only solution that worked for me is: View view = bottomNavigationView.findViewById(R.id.menu_action_dashboard); view.performClick();

BottomNavigationView display both icons and text labels at all times

我的梦境 提交于 2019-11-28 17:16:45
问题 I am using android.support.design.widget.BottomNavigationView from design support library version 25 compile 'com.android.support:design:25.0.0' <android.support.design.widget.BottomNavigationView android:id="@+id/bottomBar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_gravity="center" app:itemBackground="@color/colorPrimary" app:menu="@menu/bottom_navigation_main" android:forceHasOverlappingRendering="true"/>

BottomNavigationBar underneath NavBar

喜夏-厌秋 提交于 2019-11-28 07:15:16
问题 The Goal : 1) Make the status bar transparent - Done 2) Make the BottomNavigationView and the Navbar the same color. - Almost Done The Problem By adding the following code in my Activity , the status bar becomes transparent. BUT, BottomNavigationView falls underneath the NavBar . If I remove this line of code, the StatusBar no longer is transparent. You feel my pain here? Furthermore... How would I make the TOP of the layout go underneath the statusbar? The Code in the Activity: if (Build

Inflate Bottom Navigation View menu programmatically

南笙酒味 提交于 2019-11-28 03:12:21
问题 Bottom Navigation View has been added to version 25 of the Design Support Library. Tried and it's much easier to use now. But I am facing problem implementing it as per my app requirements. I want to inflate menu resource dynamically and change menu items/titles of the Bottom Navigation view programmatically. inflateMenu(int menuResource) — Inflate a menu for the bottom navigation view using a menu resource identifier. According to docs: inflateMenu: void inflateMenu (int resId) Inflate a

BottomNavigationView - How to uncheck all MenuItems and keep Titles being displayed?

你离开我真会死。 提交于 2019-11-28 02:53:54
问题 As I liked the design from BottomNavigationView I decided to implement a new Menu for my App with it, instead of just using simple buttons. I took this post as a guideline. According to BottomNavigationView 's documentation, its purpose is to provide quick navigation between top-level views of an app. It is primarily designed for use on mobile. In my case, I just want each MenuItem to launch an activity, but by default there is always one MenuItem selected: I tried to set the color to white