navigation-drawer

Change color of Navigation Drawer Icon in Android Studio default template

纵饮孤独 提交于 2019-12-02 17:37:07
The new default Navigation Drawer Activity template in Android Studio defines its titles and icons in a menu file activity_main_drawer like this: <group android:checkableBehavior="single"> <item android:id="@+id/nav_camara" android:icon="@drawable/ic_action_emo_cool" android:title="Import" /> <item android:id="@+id/nav_gallery" android:icon="@android:drawable/ic_menu_gallery" android:title="Gallery" /> <item android:id="@+id/nav_slideshow" android:icon="@android:drawable/ic_menu_slideshow" android:title="Slideshow" /> ... The first item in my example uses a red icon: but when I run the app,

Android-like Navigation Drawer for iOS? [closed]

左心房为你撑大大i 提交于 2019-12-02 17:11:35
I'm looking for a way to implement in iOS something that works as closely as possible to the Android Navigation Drawer . That's basically a menu panel that slides in from the left and over the current view. I've looked at using ECSlidingViewController, MMDrawerController, etc . but I'd really want a drawer that appears on top of the current view, not like the Facebook app where the current view slides to reveal a menu underneath. How can I implement my desired functionality? You would need a SlideOverViewController that has a table view with width as much as you want to overlap, set the

how to create smooth navigation drawer

橙三吉。 提交于 2019-12-02 16:57:12
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. Paul Burke 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() { // update the main content by replacing fragments Fragment fragment = new PlanetFragment();

Android Change Navigation Drawer Menu Items Text programmatically

我是研究僧i 提交于 2019-12-02 16:36:48
I have the new Navigation Drawer in my app and I want to change the navigation view menu items title text dynamically from code. I have watched many posts but I can't figure out, how can I do this. How can I achieve this correctly? MainActivity.java @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() {

Implementing proper back navigation and home button handling using Toolbar in Android

时间秒杀一切 提交于 2019-12-02 16:21:38
I am using a single activity and multiple fragments(screenshot attached) within the same activity to provide a seamless navigation. But after implementing the latest toolbar and navigation view, it seems hard to handle the navigation and home buttons. I am having trouble with the following things. Managing the Hamburger/Back button at left top. Toggling the icon and functionality to Menu and Back nav. Page title - Changing the page titles whenever a fragment in pushed and popped. I have tried several things like overriding onBackPressed(), setHomeAsUpIndicator, popping fragments manually.

Hide a Navigation Drawer Menu Item - Android

徘徊边缘 提交于 2019-12-02 16:07:53
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 navMenuTitles = getResources().getStringArray(R.array.nav_drawer_items); // nav drawer icons from resources

Android: How to get Google+ Profile Image and Cover Photo into Navigation Drawer

若如初见. 提交于 2019-12-02 16:01:31
Assuming the user is logged into their Google+ account on the phone, How can one get the Google+ Image (circular) and the Google+ Cover Photo into the Navigation Drawer of an Android app? Is there an API for this? Also, how can we display the profile photo as a circle? I am trying to achieve the same navigation drawer UI as the Android INBOX app. usil You will need Enabling G+ API on google console. https://developers.google.com/+/mobile/android/getting-started#step_1_enable_the_google_api You will need to make custom navigation drawer: http://www.androidhive.info/2013/11/android-sliding-menu

Implementing Gmail Tablet like Navigation Drawer

こ雲淡風輕ζ 提交于 2019-12-02 15:38:54
I was looking into the tablet design of Gmail application. In that Navigation Drawer implementation is different from others. I have attached image for your reference. And also when I expand the the drawer it should happen like normal navigation drawer behavior. I would like to implement in the same way. I was searching but i found only this link Which is not so helpful. Can anyone give me suggestions how can I do this! You can use a SlidingPaneLayout with a margin on the main pane and custom listener for the cross fading. <com.sqisland.android.CrossFadeSlidingPaneLayout xmlns:android="http:/

Handling back press when using fragments in Android

廉价感情. 提交于 2019-12-02 15:19:16
I am using Android Sliding Menu using Navigation Drawer in my application and Fragments are used in the app instead of Activities. When I open the drawer, click on an item a Fragment appears. I move from one fragment to another fragment using the following code: Fragment fragment = null; fragment = new GalleryFragment(selectetdMainMenu.getCategoryID()); FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.addToBackStack("menuFrag"); ft.add(R.id.frame_container, fragment, "menuFrag"); ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); ft.commit(); In this way I can go

Add badge counter to hamburger navigation menu icon in Android

大兔子大兔子 提交于 2019-12-02 15:17:21
My question is the same as this question (which is not a duplicate of this question ). The only answer to that question does not work for me as, rather than changing the default hamburger icon to the left of the activity's title, it just adds an additional hamburger icon to the right of my activity's title. So how do I actually get this: I've been poking around at it all day, but have got nowhere. I see that Toolbar has a setNavigationIcon(Drawable drawable) method. Ideally, I would like to use a layout (that contains the hamburger icon and the badge view) instead of a Drawable , but I'm not