navigation-drawer

DrawerLayout on top of Actionbar

自闭症网瘾萝莉.ら 提交于 2019-11-30 04:40:13
问题 When using the drawer layout is there a way to overlay the drawer view over the action bar? I do not want to hide the action bar when the drawer is shown. I want the action bar to simply stay put, but be sent to the background. An example of this is the iOS Play Music app... My current implementation hides and shows the action bar when the drawer state changes, but I do not like this user experience. public void onDrawerClosed(View view) { getActionBar().show(); invalidateOptionsMenu(); }

BaseActivity for Navigation

本小妞迷上赌 提交于 2019-11-30 04:04:07
I'm building a base activity for navigation and want something flexible so the Activity dictates to the Base Activity which layout to inflate. I have the following public abstract class BaseActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { private int mLayoutRes; protected void setLayout(int layoutRes) { mLayoutRes = layoutRes; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(mLayoutRes); // Layout implements toolbar Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); if

ExpandableListView and the NavigationDrawer

谁说胖子不能爱 提交于 2019-11-30 03:57:00
I am having a pretty strange issue. My logic is simple, my app uses a NavigationDrawer for main application navigation, and due to the complexity of the options available, I want to use an ExpandableListViev to nest some navigation items. The issue? Simple too: The list of items loads on the drawer; however, they don't expand to show the children. The Question Is there any reason it wouldn't expand? Should I use a different UI widget for this? Some Notes : I added the same code on a different Activity, but instead of hosting the ExpandableListViev on the drawer, I had it added on a simple

Coloring Android Status Bar in Nav Drawer

﹥>﹥吖頭↗ 提交于 2019-11-30 03:50:16
问题 In this app I'm building, I've added a Navigation Drawer fragment into my activity. I'm using 5.0, so I've been able to set the primaryColor and primaryColorDark to get the right colors. I've decided to try and style my Nav Drawer to be very similar to Google Now's drawer in 5.0, where the Nav Drawer has it's own background for the status bar. (Can't post pictures, not enough reputation >.>) I've followed this question's recommendations here, which has helped quite a bit. I've achieved

How to change navigation drawer font?

大城市里の小女人 提交于 2019-11-30 03:43:26
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. Please help! How to change the menu font? How to make the layout RTL in right way?! Edited : My font

Android lollipop toolbar switch between open/close drawer and back button

好久不见. 提交于 2019-11-30 03:35:06
问题 I had standart navigation drawer, but now i'm trying to modify it, using toolbar. Earlier my code looked like: MainActivity.java @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.v("MAIN", "CREATE"); initViews(); setListeners(); getFragmentManager().addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener() { @Override public void onBackStackChanged() { shouldDisplayHomeUp(); } });

How to implement navigation drawer with fragments master detail

元气小坏坏 提交于 2019-11-30 02:29:33
i have get the sample navigation drawer from this site : http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/ and the master detail from here : http://wptrafficanalyzer.in/blog/itemclick-handler-for-listfragment-in-android/ the error LogCat oncreateview(inflac....) the view can not be created me i have try that //the main activiry as Activity: package in.wptrafficanalyzer.listfragmentitemclick; import in.wptrafficanalyzer.listfragmentitemclick.adapter.NavDrawerListAdapter; import in.wptrafficanalyzer.listfragmentitemclick.model.NavDrawerItem; import java.util

Overlapping shadow effect remains on Navigation Drawer's NavigationView

我的梦境 提交于 2019-11-30 01:51:14
问题 I have refined the Navigation Drawer Activity project template of Android Studio, which uses Toolbar , v7.app.ActionBarDrawerToggle and NavigationView instead of the NavigationDrawerFragment (and layout/fragment_navigation_drawer.xml). It is perfectly working. Then, I go further. I have my Navigation Drawer project in immersive-sticky (full screen) mode. @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if (hasFocus) { View decorationView =

How to make the Contextual ActionMode Bar overlay the appcompat-v7 Toolbar but not the navigation drawer?

我的梦境 提交于 2019-11-30 00:04:26
I have an activity with an app bar and a navigation drawer. The app bar is implemented using the new Toolbar class from appcompat-v7 library version 21.+, and the navigation drawer is displayed in front of it. The activity contains a list view with items which can be selected, so I am showing a contextual action bar (CAB). It is started by calling: ActionBarActivity.startSupportActionMode(android.support.v7.view.ActionMode.Callback callback) By default, the CAB is inserted above the Toolbar instead of overlaying it; it seems that the CAB will only overlay the true ActionBar by default. As show

DrawerLayout getting stuck on swipe

空扰寡人 提交于 2019-11-29 23:48:57
I am playing around with DrawerLayout and I am encountering an issue. Basically sometimes when i swipe from the edge of the screen the DrawerLayout will get stuck until i lift my finger off the screen (See screenshot below) I am not sure what is up, I followed the code sample from the google sdk exactly. Any ideas? And here is the only thing i have in my FragmentActivity: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final String[] names = getResources().getStringArray(R.array.nav_names); ArrayAdapter