android-navigationview

Add custom shape ripple with selector on navigationview menu item

假装没事ソ 提交于 2021-02-10 05:47:28
问题 I want to add a ripple effect with rounded corners rectangle with a selector for navigation view item. But it keeps adding the gray rectangle ripple effect. navigation view <android.support.design.widget.NavigationView android:id="@+id/navigation_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" app:itemIconTint="@color/drawer_item" app

Changing NavigationView background to round shape not working when pressed

人盡茶涼 提交于 2021-02-06 13:46:48
问题 I am setting navigation item background using app:itemBackground in layout: <android.support.design.widget.NavigationView android:id="@+id/nav_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:fitsSystemWindows="true" app:itemBackground="@drawable/nav_selector_background" app:headerLayout="@layout/nav_header_main" app:menu="@menu/activity_main_drawer"/> Here is nav_selector_background.xml <ripple xmlns:android="http://schemas

Navigation drawer rounded corner background for items

我是研究僧i 提交于 2021-02-06 12:13:37
问题 I want to have a rounded corner for the items in navigation drawer like this : it's an example of material design in material.io website is it possible ? 回答1: Just use the app:itemShapeAppearanceOverlay attribute: <com.google.android.material.navigation.NavigationView app:itemShapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Nav" ...> with: <style name="ShapeAppearanceOverlay.Nav" parent=""> <item name="cornerFamily">rounded</item> <item name="cornerSize">8dp</item> </style> 回答2: First, I

Navigation drawer rounded corner background for items

ε祈祈猫儿з 提交于 2021-02-06 12:11:08
问题 I want to have a rounded corner for the items in navigation drawer like this : it's an example of material design in material.io website is it possible ? 回答1: Just use the app:itemShapeAppearanceOverlay attribute: <com.google.android.material.navigation.NavigationView app:itemShapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Nav" ...> with: <style name="ShapeAppearanceOverlay.Nav" parent=""> <item name="cornerFamily">rounded</item> <item name="cornerSize">8dp</item> </style> 回答2: First, I

How to implement the navigation drawer in android with sub item menu [duplicate]

拈花ヽ惹草 提交于 2020-01-07 09:04:09
问题 This question already has answers here : How to open sub menu after click on menu-item in Navigation drawer? (3 answers) Closed 4 years ago . I am new in android and in my project I want to add the navigation drawer. I am selecting Navigation Drawer activity and create project in eclipse please help me how to develop navigation drawer below Here is the image of navigation drawer for item and sub item menu 回答1: Use NavigationView <android.support.design.widget.NavigationView android:id="@+id