navigationview

NavigationView menu items with counter on the right

不问归期 提交于 2019-12-17 05:40:06
问题 The new NavigationView in the new Design Support Library works really great. They use " menu-items " to display the options. But how can I display a counter to the right of the menu item? Like in this picture: Or like in the GMail app. 回答1: Starting from version 23 of appcompat-v7 NavigationView supports action views, so it is quite easy to implement counter yourself. Create counter layout, i.e. menu_counter.xml : <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas

Navigation View's selectors behave incorrectly

社会主义新天地 提交于 2019-12-14 02:19:22
问题 I'm following this color scheme of Navigation View. I created 3 selectors, for background, text and icon. When I set the selectors, my navigation view looked like this: The problem is that no item is shown selected and if I press one item, all items' background color changes to gray. Icon never gets the primary color. Here is are the XMLs: <android.support.design.widget.NavigationView android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start"

Multiple checkable groups in NavigationDrawer stopped working after upgrading support design library

心不动则不痛 提交于 2019-12-13 01:04:27
问题 I am using NavigationView to display menu.xml data to my NavigationDrawer. It had two groups of checkable items. The first group could have any number of items checked at the same time, the second one could have only one checked. Support library versions used: compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.android.support:design:22.2.0' xml code used for NavigationView <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns

Android: How to remove borders around navview menu items?

江枫思渺然 提交于 2019-12-12 18:22:51
问题 Using android studio 2.1.2 I added navigation activity from standard library. It inflates menu with some default items: How can I remove those borders from menu items? Device: Asus padfone 2 Android 4.1.1 Compilation: compileSdkVersion 23 buildToolsVersion "23.0.2" minSdkVersion 16 targetSdkVersion 23 com.android.support:appcompat-v7:23.4.0 来源: https://stackoverflow.com/questions/38042866/android-how-to-remove-borders-around-navview-menu-items

Android Activity using navigation view in full screen mode shows at the bottom a grey translucent area

不想你离开。 提交于 2019-12-12 03:02:28
问题 I have an activity which is using the following method to enable fullscreen mode. protected void hideSystemUI() { View decorView = getWindow().getDecorView(); decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); } In this activity I am also using the NavigationView and when the

Error inflating class NavigationView from XML

和自甴很熟 提交于 2019-12-12 02:27:59
问题 I'm using NavigationView in my MainActivity. Now, My App runs fine in Android 5.0 and above. but, It doesn't run in Android 4.0.4 . It shows me XML error in <NavigationView /> . I've than added multidex support by thinking it should help. but, it didn't. Currently I've 4 icon in NavigationView & 1 launcher icon in header_layout . so, I don't think it should OutOfMemoryError . Here's My Code build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion

Get selected radio button id placed in navigation view

别来无恙 提交于 2019-12-12 01:43:57
问题 I have taken radio group in the navigation view of drawer layout like this <android.support.design.widget.NavigationView app:headerLayout="@layout/header" app:menu="@menu/drawer"> <RadioGroup> <RadioButton/> <RadioButton/> </RadioGroup> </android.support.design.widget.NavigationView> I want to get the selected radio button text or id but I am not getting any logs or Toast and no errors also.. Code for getting selected radio button: rg.setOnCheckedChangeListener(new RadioGroup

UWP change NavigationViewItem height

余生颓废 提交于 2019-12-11 18:04:57
问题 On the image above, you can see my app (left) and Groove Player (right). I want to make NavigationViewItem height big like Groove Player, but I don't know how. I tried playing with Padding and MinHeight but it doesn't look the same. I want to do the same for the AutoSuggestBox and the Settings button, that are part of NavigationView. <NavigationView x:Name="navView" IsSettingsVisible="True"> <NavigationView.AutoSuggestBox> <AutoSuggestBox QueryIcon="Find" PlaceholderText="Search"><

cant use NavigationView and BottomNavigationView at the same activity

强颜欢笑 提交于 2019-12-11 17:21:31
问题 I can't use BottomNavigationView and NavigationView at the same activity. NavigationView click listener doesn't work when I use BottomNavigationView but BottomNavigationView click listener works. BottomNavigationView is blocking NavigationView 's click listener somehow. ty for help bottomnavid.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) { if(menuItem.getItemId()=

Inflating a custom view below header view in Navigation view android

主宰稳场 提交于 2019-12-11 14:25:44
问题 I have a DrawerLayout with NavigationView as shown below <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" tools:openDrawer="start"> <include layout="@layout/app_bar_dynamic_screen" android:layout_width=