navigationview

Navigation View Selected Menu Item Checked In Other Activity?

南楼画角 提交于 2020-01-05 12:58:26
问题 i am Using Material Design Navigation View..i created Menu item And linked activity(Activity2.java) with an item(Starred)...and in that activity i extend my Main activity in which there is navigation view so that i can slide the navigation view from that activity too.. but when i slide the navigation view from the second activity the item is not checked and if i press the back button and go to the Main activity the previously checked menu item is shown...how to update the check item in other

Java.lang.NoClassDefFoundError Issue when using Android Support Design NavigationView

怎甘沉沦 提交于 2020-01-03 09:07:16
问题 Getting the following issue when using NavigationView on a app: java.lang.NoClassDefFoundError: android.support.design.internal.NavigationMenuPresenter I got the same issue in this sample project: https://github.com/xamarin/monodroid-samples/tree/master/android5.0/Cheesesquare Test: Android 5.1 Extra information: ===================== Xamarin Studio Version 5.10.1 (build 6) Installation UUID: 4f372b0c-765f-463b-9408-1bd0211e4e94 Runtime: Mono 4.2.1 (explicit/6dd2d0d) GTK+ 2.24.23 (Raleigh

Open second drawerlayout as a sub drawerlayout over the first

巧了我就是萌 提交于 2020-01-01 09:38:09
问题 Android Studio 2.1.3 I have this design I am trying to follow. On the first drawerlayout I have a setttings options. When the user clicks, it will open a second drawerlayout like this below. The user can get back to the first by clicking on the arrow Main Menu . Is this possible? Many thanks for any suggestions 回答1: It's unclear how exactly you wish to implement your drawer UI, so the following solution is rather generic, in that it should work with NavigationView s, RecyclerView s, or pretty

Cannot resolve symbol 'NavigationView'

不羁的心 提交于 2020-01-01 08:55:47
问题 I made a NavigationView inside a DrawerLayout in an XML file - but when I try to initialize it in Java I get this error. // DrawerLayout initialises fine DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.nav_drawer); // Cannot resolve symbol 'NavigationView' NavigationView navView = (NavigationView) findViewById(R.id.navigation_view); I tried adding the import line import android.support.design.widget.NavigationView but this is also giving me errors. Any ideas? Haven't been able to

NavigationView Ripple Lost In Support Library 23.1.0 Update

纵然是瞬间 提交于 2019-12-30 06:48:09
问题 Using the Design Support Library version 23.0.1 , menu items within the NavigationView appear to, by the default, support the ripple animation when selected. However, when upgraded to Design Support Library version 23.1.0 the ripple animation appears to be lost. Is this a bug? Has anyone else noticed this as well and can replicate it? And, better yet, does anyone have a solution? I first discovered this issue while utilizing the NavigationView via Design Support Library version 23.4.0 and

Left margin between icons and NavigationView

怎甘沉沦 提交于 2019-12-23 17:53:18
问题 I have to add a left margin between the icons and the NavigationView , in arrow in the image bellow: I know that according to google specs, this margin must have 16dp but I need to change it. I have tried: <dimen tools:override="true" name="design_navigation_icon_padding">64dp</dimen> <dimen tools:override="true" name="design_navigation_separator_vertical_padding">20dp</dimen> But still not working. Any ideas? 回答1: The xml layout of that item is design_navigation_item.xml <android.support

How to position menu items in Navigation View?

空扰寡人 提交于 2019-12-23 08:47:26
问题 My question is related to recently released Navigation View from Design Support Library . I want to position Log In at the bottom of the Navigation View , how I can do this? My menu XML right now, look like this : <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/navigation_sub_item_1" android:icon="@drawable/ic_action_event" android:title="@string/home" /> <item android:id

listPreferredItemHeightSmall is not working on api 16

夙愿已清 提交于 2019-12-22 14:08:27
问题 I am using the code below and it's working fine on api 23 but not on another device on api 16(Jelly Bean) . Style: <style name="NavigationViewStyle"> <item name="android:textSize">20sp</item> <!-- menu item text size--> <item name="android:listPreferredItemHeightSmall">40dp</item><!-- menu item height--> </style> And then, apply this style to NavigationView using app:theme <android.support.design.widget.NavigationView ... ... app:theme="@style/NavigationViewStyle" ... ... </android.support

listPreferredItemHeightSmall is not working on api 16

╄→尐↘猪︶ㄣ 提交于 2019-12-22 14:05:41
问题 I am using the code below and it's working fine on api 23 but not on another device on api 16(Jelly Bean) . Style: <style name="NavigationViewStyle"> <item name="android:textSize">20sp</item> <!-- menu item text size--> <item name="android:listPreferredItemHeightSmall">40dp</item><!-- menu item height--> </style> And then, apply this style to NavigationView using app:theme <android.support.design.widget.NavigationView ... ... app:theme="@style/NavigationViewStyle" ... ... </android.support

Setting Navigation View MenuItem style programmatically

六眼飞鱼酱① 提交于 2019-12-22 10:48:39
问题 Is it possible to set the style of a MenuItem in the new navigation view programmatically? I am building the menu dynamically and cannot use a static XML file. I've been unable to find any information on this. UPDATE: I am familiar with setting title and icon, but not how I can e.g. set the alpha of the text. UPDATE 2: In the class NavigationView there is setItemTextColor(ColorStateList) . As far as I can tell it is not possible to set individual item colors? Thanks 回答1: If you want to set