navigation-drawer

Disable animation of drawer icon in double navigation drawer for right drawer

纵饮孤独 提交于 2019-12-20 19:46:39
问题 I have a Double Navigation Drawer I have two problems. 1) The navigation drawer icon on the left (3 bars) animate when opening or closing the navigation drawer on the right. 2) I do not know how to add the icon to the right and have it animate only for the right drawer. 回答1: You need to override the onDrawerSlide method of ActionBarDrawerToggle and set the slideOffset to 0 if the drawer is right drawer. So this would disable the animation of the navigation drawer image for right drawer.

How to make background Activity smaller while opening the Navigation Drawer?

微笑、不失礼 提交于 2019-12-20 10:39:46
问题 I want to make my background Activity a little bit smaller while opening the Navigation Drawer , Simulate the effect that exists in the Airbnb application. I guess the best explanation would be a screenshot: But the point is not to make the View just smaller, but to make it an animation that is synchronized to the Drawer Open/Close animation. So if you started to open the Drawer an in the middle decided to stop and go back, the background Activity scale will be affected accordingly. How can

ActionBarDrawerToggle is not setting Drawer Indicator

谁说胖子不能爱 提交于 2019-12-20 10:33:33
问题 I am trying to add the navigation drawer in my app.. Everything is working fine But now I still got the arrow icon although I replaced it with the ic_drawer from Android? Here's my code: private ActionBarDrawerToggle mDrawerToggle; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); DrawerLayout mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); ExpandableListView mDrawerList =

Hide navigation drawer when user presses back button

隐身守侯 提交于 2019-12-20 10:04:49
问题 I've followed Google's official developer tutorials here to create a navigation drawer. At the moment, everything works fine, except for when the user uses the native back button Android provides at the bottom of the screen (along with the home and recent app buttons). If the user navigates back using this native back button, the navigation drawer will still be open. If the user instead navigates back using the ActionBar, the navigation drawer will be closed like I want it to be. My code is

Android: Is it better to create a new fragment every time a navigation drawer item is clicked, or load up previously created fragments?

元气小坏坏 提交于 2019-12-20 09:13:10
问题 I am implementing the standard navigation drawer pattern for android, with about 10 fragments the user can navigate to from the drawer. Currently, I am creating a new Fragment every time a different navigation drawer item is clicked like so: // When a new navigation item at index is clicked FragmentTransaction ft = fragmentManager.beginTransaction(); ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); Fragment newFragment = null; if (index == 0) fragment = new Fragment0(); ... ft

Hide a Navigation Drawer Menu Item - Android

雨燕双飞 提交于 2019-12-20 08:32:06
问题 I have a navigation drawer. When an event is called, I want to hide one of my navigation menu item for user. How can I do that? protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sliding_menu); if (android.os.Build.VERSION.SDK_INT > 9) { StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); } mTitle = mDrawerTitle = getTitle(); // load slide menu items

how to create smooth navigation drawer

可紊 提交于 2019-12-20 08:21:22
问题 I am using this example for navigation drawer. When clicking on of item of left drawer listview it shows some images but drawerLayout closes not smoothly. What should I do here for smoothly close left drawer layout after clicking of the item of listview. 回答1: Not sure this is the best route, but the way I solved this was to create a pending Runnable that runs in onDrawerClosed . Eg: private void selectItem(final int position) { mPendingRunnable = new Runnable() { @Override public void run() {

How to change action bar background and text colors

北战南征 提交于 2019-12-20 07:41:29
问题 I am using navigation drawer from this tutorial http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/ and i am trying to change action bar background from this selected answer Set title background color but when i run my app app got crash and shows error Manifest <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="info.androidhive.slidingmenu

Different NavigationDrawer items for Different activities in android

自作多情 提交于 2019-12-20 07:32:18
问题 Here i am using NavigationDrawer for my activities.It is working fine.i am using Recyclerview for displaying NavigationDrawer items. Now i want to display different NavigationDrawer Item for different Activity..Here i am using nav_drawer_labels in FragmentDrawer to display items.How to display nav_drawer_labels1 in another activity.I mean i have to display different NavigationDrawer in each activity..here is my code. CompProfileDisplay.java public class CompProfileDisplay extends

How to set navigation drawer in preferenceActivity

半腔热情 提交于 2019-12-20 06:41:14
问题 In my app i have each activity with drawer, but when i set drawer in my Preference activity, my activity working fine, but drawer not appear. here is my code.. public class SettingActivity extends PreferenceActivity implements NavigationView.OnNavigationItemSelectedListener { private AppCompatDelegate mDelegate; private NavigationView mDrawer; private DrawerLayout mDrawerLayout; private ActionBarDrawerToggle mDrawerToggle; @Override public void onCreate(Bundle savedInstanceState) {