Default Navigation Drawer View to ExpandableListView

This is the code for expandable list adapter: public class ExpandListAdapter extends BaseExpandableListAdapter { private Context _context; private List<String> _listDataHeader; // header titles // child data in format of header title, child title private HashMap<String, List<String>> _listDataChild; public ExpandListAdapter(Context context, List<String> listDataHeader, HashMap<String, List<String>> listChildData) { this._context = context; this._listDataHeader = listDataHeader; this._listDataChild = listChildData; … Read more

Android support v23.1.0 update breaks NavigationView get/find header

With the design library v 23.1.0 the NavigationView works with a RecyclerView. Also the Header is now a type of row. It means that the header could not be immediately available in the view hierarchy. It can cause issues if you are using methods like navigationView.findViewById(XXX) to get a view inside the header. There is … Read more

Disable icon colorStateList in NavigationView

Is there no way for me to force NavigationView to stop tinting my icons? There sure is. You can do so programmatically using NavigationView.setItemIconTintList. And you can do so in your XML layout by using the NavigationView.itemIconTint attribute. Programmatically yourNavigationView.setItemIconTintList(null); From XML <android.support.design.widget.NavigationView … app:itemIconTint=”@android:color/black” … /> Results

How I can remove the unnecessary top padding of the Navigation view?

You can override predefined dimensions at your dimens.xml as; <dimen name=”design_navigation_padding_top_default” tools:override=”true”>0dp</dimen> <dimen name=”design_navigation_separator_vertical_padding” tools:override=”true”>0dp</dimen> <dimen name=”design_navigation_padding_bottom” tools:override=”true”>0dp</dimen> Other possible values are here: https://github.com/android/platform_frameworks_support/blob/master/design/res/values/dimens.xml

How can I change separator color in NavigationView?

just apply following line on style.xml <item name=”android:listDivider”>your_color</item> The below is just information for your knowledge … If you have seen design support library .. they are using following layout for NavigationView seprator.. <FrameLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”wrap_content”> <View android:layout_width=”match_parent” android:layout_height=”1dp” android:background=”?android:attr/listDivider”/> </FrameLayout> here, you can see android:background=”?android:attr/listDivider” .. So enjoy … and here is my … Read more

NavigationView and custom Layout

Here’s how I solved it, and worked perfectly: <android.support.design.widget.NavigationView android:id=”@+id/navigation” android:layout_width=”wrap_content” android:layout_height=”match_parent” android:layout_gravity=”start” android:fitsSystemWindows=”true”> <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical”> <include layout=”@layout/nav_header” /> <ListView android:id=”@+id/lst_menu_items” android:layout_width=”match_parent” android:layout_height=”0dp” android:layout_weight=”1″ /> </LinearLayout> </android.support.design.widget.NavigationView>