navigation-drawer

Drawer indicator in lollipop play store

倖福魔咒の 提交于 2019-11-29 23:13:43
I am using a Nexus 7 with the Android 5.0 preview build. On this page http://developer.android.com/tools/support-library/index.html I see Changes for v7 appcompat library: Updated ActionBarDrawerToggle , which contains the menu-to-arrow animation Is this what the Google Play app uses? Am I reading too much into this statement? What do I need to change to get this behavior - I can't find it in the API documentation. I've posted a sample app here that uses the new Toolbar class and ActionBarToggle to provide an ActionBar with the Play Store style animating icon: https://github.com/03lafaye

Disable dark fading in Navigation Drawer

空扰寡人 提交于 2019-11-29 23:12:04
Is there a way to disable the dark fading effect for the background view in the Navigation Drawer View in Android? SocialError You can use setScrimColor(int color) method. As default color is used 0x99000000 . So if you don't want faded background, set transparent color in this method. mDrawerLayout.setScrimColor(getResources().getColor(android.R.color.transparent)); Addition to koso's answer: you can directly call the colors from Color class like this: mDrawerLayout.setScrimColor(Color.TRANSPARENT); Neo drawerLayout.setScrimColor(Color.parseColor("#99000000")); // For dark fading effect or

Action Bar Tabs using ViewPager with Navigation Drawer

ⅰ亾dé卋堺 提交于 2019-11-29 22:40:12
Requirement:- Action Bar Tabs using ViewPager with Navigation Drawer . I can create a Navigation Drawer example Action Bar Tabs using ViewPager separately. But when I try to use both at once I am having issue. I can create Navigation Drawer using fragments and Action Bar Tabs using Fragment. But the initial Activity of the both examples is Fragment Activity. How to implement the action bar tabs on a fragment which is part of the navigation drawer? jagmohan Use the following layout for your main activity. <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns

Change the color of Navigation Drawer indicator icon

帅比萌擦擦* 提交于 2019-11-29 22:07:45
I am using a toolbar in place of actionbar and i am also using a navigation drawer.My toolbar colour is black and i want my navigation drawer indicator colour to be white.So how to change the colour of the navigation drawer indicator or put a custom navigation indicator in v7.Can any one please help me? Try creating this style in your styles.xml <style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle"> <item name="color">@android:color/white</item> </style> And then add it to you Applications theme like so: <item name="drawerArrowStyle">@style/DrawerArrowStyle</item> In your

Hide ActionBar MenuItems when Navigation Drawer slides for any amount

时间秒杀一切 提交于 2019-11-29 21:23:35
I'm trying to implement a Navigation Drawer that hides the menu items in the ActionBar whenever the drawer is opened. I am following google's documentation, however their code does not produce the expected behavior. http://developer.android.com/training/implementing-navigation/nav-drawer.html Using this code, the menu items are hidden when the drawer becomes completely opened , and shown when the drawer becomes completely closed. However, the Gmail app behaves differently. The menu items are hidden as soon as the drawer opens by any amount . This is the behavior I want. Does anyone know how to

Change drawer icon back to back arrow

故事扮演 提交于 2019-11-29 20:45:59
I'm using the new DrawerLayout to have side navigation. I'm using the drawer icon (the 'hamburger') like this: @Override protected void onStart() { super.onStart(); mDrawerLayout = (DrawerLayout) findViewById(R.id.activity_main_drawerlayout); mDrawerToggle = new ActionBarDrawerToggle( this, mDrawerLayout, R.drawable.ic_navigation_drawer, R.string.app_name, R.string.app_name); mDrawerLayout.setDrawerListener(mDrawerToggle); getActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setHomeButtonEnabled(true); } However, when I add a Fragment to the backstack, I want to display the back

Removing and adding activities to the back stack

浪尽此生 提交于 2019-11-29 20:38:51
In the "System Back after cross navigation to lower hierarchy levels" section of the Navigation Drawer , they say: If the user navigates to a lower hierarchy screen from the navigation drawer and the screen has a direct parent, then the Back stack is reset and Back points to the target screen’s parent. This Back behavior is the same as when a user navigates into an app from a notification. I know the back stack can be reset by starting an activity with FLAG_ACTIVITY_CLEAR_TOP and FLAG_ACTIVITY_NEW_TASK, but that does not seem to be usable here, as it would not create a back stack for Lower 1.1

How to add title in Navigation drawer layout?

不羁的心 提交于 2019-11-29 20:19:42
[UPDATE] I solve the problem by adding addHeaderView : protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTitle = mDrawerTitle = getTitle(); mPlanetTitles = getResources().getStringArray(R.array.planets_array); mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawerList = (ListView) findViewById(R.id.left_drawer); LayoutInflater inflater = getLayoutInflater(); ViewGroup mTop = (ViewGroup)inflater.inflate(R.layout.header_listview_menu, mDrawerList, false); mDrawerList.addHeaderView(mTop, null, false)

Navigation drawer (menudrawer) Android 5 (lollipop) style

孤者浪人 提交于 2019-11-29 20:01:56
I'm using menudrawer library in my project (this one: https://github.com/SimonVT/android-menudrawer ). I'm updating my app to be compatible with API21 (Android 5 Lollipop) and Material Design. When you use this library with API21 menudrawer icon looks bad. I want to achieve transition you can see in the new Play Store (new menudrawer icon transition to arrow). What's the best way to do that? Is it possible with this library? The only solution I'm thinking at the moment is custom drawable. But maybe I can use native drawable some way? OK. I spent few hours with new API and I think that the best

How to add one section separator for Navigation Drawer in Android?

假装没事ソ 提交于 2019-11-29 19:04:29
I have a navigation drawer like this image. I want to add a section separator (like the line separating Neptune). It seems simple but I can't find anything on the web that was useful for my case. Here is my MainActivity: public class MainActivity extends Activity { private DrawerLayout mDrawerLayout; private ListView mDrawerList; private ActionBarDrawerToggle mDrawerToggle; private CharSequence mDrawerTitle; private CharSequence mTitle; private String[] mPlanetTitles; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout