navigation-drawer

Navigation drawer (menudrawer) Android 5 (lollipop) style

大城市里の小女人 提交于 2019-11-28 15:52:57
问题 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

Disabling navigation drawer, toggling home-button/up-indicator in fragments

。_饼干妹妹 提交于 2019-11-28 15:35:18
The setup I have an activity whose contentView is an instance of a DrawerLayout , which has a navigation drawer with a drawer indicator displayed in the action bar. The activity contains a Fragment , let's call it ListFragment , which contains a list of options. When an option is clicked, I replace the ListFragment with a DetailFragment . At this point, I would like to display an "up" navigation option instead of the navigation drawer indicator. I'm able to display the "up" icon if I disable the drawer indicator by calling mDrawerToggle.setDrawerIndicatorEnabled(false) , but this only removes

How to stop Android navigation drawer from opening automatically?

会有一股神秘感。 提交于 2019-11-28 14:25:41
How to stop the navigation drawer in my Android app from opening automatically? It used to work fine. Out of sight at first and able to be swiped into visibility. But I needed a title for it. At first it was only a ListView. Soon after modifying the drawer xml (see below) to give it a title above a list view, it began opening automatically. I certainly didn't add anything to the code like my_nav_drawer.openOnStartup(). <!-- The navigation drawer --> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout

Navigation Drawer to switch between activities

心不动则不痛 提交于 2019-11-28 14:18:53
I have browsed the website for a bit and I can't find an answer to my problem, I am trying to get my Navigation Drawer to switch between activities instead of fragments. I have tried switch statements and all that does is crash the app, I don't know how to get the separate elements of the drawer in order to set them up so that if one is pressed, it will go to this page and if the other is pressed it will go to this page etc etc. Here's my code, package com.example.ColeraineTown; imports... public class HomeScreen extends Activity { private String[] drawerListViewItems; private DrawerLayout

How to add tabhost with navigation drawer?

删除回忆录丶 提交于 2019-11-28 13:06:05
I am new to android development,I used navigation drawer from this http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/ Now I want to add Tabhost with it..can anyone help me with this? The following is my code I tried..I do not know It is not showing why.. public class MainActivity extends FragmentActivity { private DrawerLayout mDrawerLayout; private ListView mDrawerList; private ActionBarDrawerToggle mDrawerToggle; // nav drawer title private CharSequence mDrawerTitle; // used to store app title private CharSequence mTitle; // slide menu items private String[]

Remove Padding between hamburger icon and toolbar.?

安稳与你 提交于 2019-11-28 12:38:13
问题 I am getting a gap between toolbar and hamburger icon.Even i have added app:contentInsetLeft , app:contentInsetStart , app:contentInsetStartWithNavigation ,still i am getting the gap. I added the following code to toolbar <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" app:contentInsetLeft="0dp" app:contentInsetStart=

navigation drawer issue (not showing layout preview)

半城伤御伤魂 提交于 2019-11-28 12:06:30
I created the app and I want to use navigation drawer menu, but when I tried to edit in navigation drawer xml, then the problem "Waiting for build to finish..." happened and I don't see layout previw on left side of android studio to relate layout_preview not found here I tried this soultion to solve this issue but unfortunately not working for me this is activity_main_drawer.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:showIn="navigation_view"> <group android:checkableBehavior=

problems with Fragment onBackPress

て烟熏妆下的殇ゞ 提交于 2019-11-28 11:55:03
问题 in my navigation drawer there are 5 menu items.one of them is about us item.when I click on this item, I call AboutUsFragment and show it(its content is just a text).but when I click onBackPress, fragment is gone but its texts remains on my activity.how can I solve this problem?what`s it related to?! select item of navigation drawer in my activity: public void selectItem(int position) { Fragment fragment = null; switch (position) { case 0: if (!Constants.login_state) { fragment = new

Android: Preference Fragment with a Navigation Drawer's Fragment

北城以北 提交于 2019-11-28 11:18:59
Hi I have an Android app that already uses a Navigation Drawer. My MainActivity extends Fragment Activity and my SettingFragment extends PreferenceFragment Settings Fragment : public class SettingsFragment extends PreferenceFragment { public SettingsFragment() {} @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Load the preferences from an XML resource addPreferencesFromResource(R.xml.prefs); } } and my MainActivity : PreferenceFragment preferenceFragment = new SettingsFragment(); FragmentTransaction ft = getSupportFragmentManager()

Adding a linear layout to Navigation drawer (ends up crashing with a ClassCastException)

廉价感情. 提交于 2019-11-28 10:17:23
I am trying to add a vertical linear layout (having a title, image, menu title, listview and an icon at the bottom)to the navigation drawer. However the app crashes displaying 'java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.support.v4.widget.DrawerLayout$LayoutParams' error. I am not sure if this is possible straight ways as I checked couple of links and the only close I got was this. Any help is appreciated. Thanks in advance. Here is my code. <!-- The main context view --> <FrameLayout android:id="@+id/content_frame" android:layout_width=