navigation-drawer

Navigation graph with multiple top level destinations

▼魔方 西西 提交于 2019-11-30 15:05:54
问题 I am implementing an android app (in Kotlin, but that is not relevant to the Problem) in my free time and I try to use android jetpack and new libraries. I have a single Activity with a navigation drawer. I try to follow the sample sunflower app. It uses the following combination in the main activity to enable the logic behind the navigation drawer: appBarConfiguration = AppBarConfiguration(navController.graph, drawerLayout) setSupportActionBar(findViewById(R.id.toolbar))

Transition in navigation drawer android

强颜欢笑 提交于 2019-11-30 14:37:39
Anyone having idea that how to achieve this type of transition. When we open Navagation drawer full screen is getting animation like this. I also looked at reside menu but here menu is predefined not as i want. I also tried with NavigationDrawer but not got succeed. drawer.addDrawerListener(new DrawerLayout.DrawerListener() { @Override public void onDrawerSlide(View drawerView, float slideOffset) { float moveFactor = (linearLayout.getWidth() * slideOffset); float min = 0.9f; float max = 1.0f; float scaleFactor = (max - ((max - min) * slideOffset)); if (Build.VERSION.SDK_INT >= Build.VERSION

Android studio navigation drawer with fragment or activities

独自空忆成欢 提交于 2019-11-30 14:14:22
问题 I'm trying to develop an application using the Navigation drawer template of Android Studio. So, I created a new project using this template. But when I run the program and click on a menu item, the view doesn't change. I searched everywhere on internet, but I didn't see how I can handle this. This is the code provided by Android Studio: public boolean onNavigationItemSelected(MenuItem item) { // Handle navigation view item clicks here. int id = item.getItemId(); if (id == R.id.nav_camara) {

How to put navigation drawer below toolbar?

本小妞迷上赌 提交于 2019-11-30 13:46:03
Here my navigation drawer is above toolbar.I also added some xml code.Please help me. here is my activity.xml <?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" android:fitsSystemWindows="true" tools:openDrawer="start"> <include layout="@layout/app_bar_categories" android:layout_width="match_parent" android

android.content.res.Resources$NotFoundException: String array resource ID #0x7f070002

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 13:22:37
问题 I'm having problem getting a string array for strings.xml . The error is: android.content.res.Resources$NotFoundException: String array resource ID #0x7f070002 at android.content.res.Resources.getStringArray(Resources.java:472) at com.klh.lehava.MainActivity.onCreate(MainActivity.java:87) Basically what I'm trying to do is to get a string-array called planets_array , and store it into mPlanetTitles . This is one of google's examples for navigation drawer, and I downloaded it from their site

Navigation graph with multiple top level destinations

情到浓时终转凉″ 提交于 2019-11-30 13:01:13
I am implementing an android app (in Kotlin, but that is not relevant to the Problem) in my free time and I try to use android jetpack and new libraries. I have a single Activity with a navigation drawer. I try to follow the sample sunflower app . It uses the following combination in the main activity to enable the logic behind the navigation drawer: appBarConfiguration = AppBarConfiguration(navController.graph, drawerLayout) setSupportActionBar(findViewById(R.id.toolbar)) setupActionBarWithNavController(navController, appBarConfiguration) Note on this code : This automatically will navigate

How to change navigation drawer font?

放肆的年华 提交于 2019-11-30 12:45:00
问题 I want to use my own font for navigation drawer in android.I use the library comes with android studio according to this answer: https://stackoverflow.com/a/23632492/4393226. But I don't know how to change the font and make it RTL. I searched a lot and I found how to make the drawer RTL. I use this code: getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL); and Android - Is Navigation Drawer from right hand side possible? But as you know this only works in API 17 and above

Navigation drawer menu item with titles and sub titles

浪尽此生 提交于 2019-11-30 10:09:23
I have a navigation drawer prototype. we have heading and subheading in the same. am using menu group to include the titles. 1) just want to add sub title or help text for the navigation drawer. 2) want to customise the icon size to fit the whole heading and sub heading so it looks like the image below. <item android:id="@+id/nav_home" android:icon="@drawable/ic_menu_home" android:subtitle="View your biorhythm" <!-- This should be sub title. --> android:title="Home" /> Inside in DrawerLayout create ListView using below code <!-- List of Actions (pages) --> <ListView android:id="@+id/navList"

Android Navigation Drawer (calling activities) with AbstractMainActivity

半城伤御伤魂 提交于 2019-11-30 09:43:41
I want to have a AbstractMainActivity which creates the Navigation Drawer. In there I should also handle the clicks on the menu items and then call new activities. In those activities, I want to again use the same Navigation Drawer. I would extend in the Subclasses with the AbstractMainActivity and call the getLayoutResourceID differently from each subclass (as suggested here: android how to create my own Activity and extend it? ). The problem is, that now in the AbstractMainActivity where I want to build the Navigation Drawer, I do not have any access to the navigation drawer layout (xml)

Android centre title with navigation drawer

痴心易碎 提交于 2019-11-30 09:16:43
I currently have a navigation drawer with a toolbar that has a title, i wish to centre this title within the toolbar but the toolbar does not seem to take into consideration the drawer icon as you can see in the following picture. whereas when i use the same toolbar layout for other activities that are not inside the navigation drawer the title is centred perfectly, as show in this picture: So how do i get it to take into account this icon? Here is my layout: <android.support.design.widget.AppBarLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android