FAQ Database Discussion Community

How to make Drawer icon and logo two different button in ActionBar

I have a problem where I need to be able to click both the logo and the backarrow+hamburger/cater from my action bar. when i don't have anything in my backstack, Hamburger icon is displayed and is opening my left drawer (then via animation it changes to arrow to close the...

Polymer Main Text is displayed on top of the drawer

I played around with polymer again, so I created a basic page with the help of some great tutorials on youtube but I always get this issue when opening the drawer. As you can see the menu icon and the "Polymer" title is from the bottom toolbar. Maybe somebody knows...

Android Studio Share button

I wanted to make a share button on a Navigation drawer, when the user touches the button it will open up that black drawer with the list of all applications and the user can share the apps Google play link. Is there any generic code template? the only answers I...

Changing navigation drawer icon

I have a problem, I have different activity with different background color (white or blue), also the menu icon need to be white or blue (opposite to activity background), I can't find the correct way for change it after change activity, how can I do this?

Using MMDrawerConroller how to disable rotation is some ViewControllers?

I am using MMDrawerController in my application from this link I set the root ViewController in the AppDelegate this way: self.leftDrawerController = [[LeftDrawerViewController alloc] init]; self.homeViewController = [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil]; self.navigationController = [[UINavigationController alloc] initWithRootViewController:self.homeViewController]; // DrawerViewController setup self.drawerController = [[MMDrawerController alloc]...

How to show my layout below the navigation drawer?

I have implemented the navigation drawer following this. After adding in my xml the activity is not showing the imageview in center position. Following is my xml file <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#2ba886" app:contentInsetEnd="0dp" app:contentInsetStart="0dp" >...

navigation drawer how to add image view above list view

I am working on app where I need navigation drawer .I used the code of google to develop Navigation drawer <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <!-- Framelayout to display Fragments --> <FrameLayout android:id="@+id/frame_container" android:layout_width="match_parent" android:layout_height="match_parent" /> <!-- Listview to display slider menu -->...

How to prevent the user from intercepting the closing animation on a drawer

The title basically says it all: In my code i call drawer.closeDrawers(); but when the user pushes a button in the linearlayout from the left drawer while the closing animation is running, the left drawer reopens again. I tried to set focusable and clickable false on the linearlayout until the...

Null pointer exception on a navigation drawer in android app

I'm following this tutorial: http://codetheory.in/android-navigation-drawer/ When the app start I get: java.lang.RuntimeException: Unable to start activity ComponentInfo{pakage/pakage.MainActivity}: java.lang.NullPointerException ... Caused by: java.lang.NullPointerException at pakage.MainActivity.onPostCreate(MainActivity.java:138) line 138 is marked with a comment //line 138 The code: package net.udazz.udazz; import android.app.Fragment; import android.app.FragmentManager; import android.content.Context; import android.os.Bundle; import...

DrawerLayout + SurfaceView + TouchListener

I want to use a DrawerLayout together with a SurfaceView (MetaioSDK Augmented Reality View). Everything is working fine except the TouchListener for the SurfaceView. It looks like that the FrameLayout inside the DrawerlLayout blocks my Touch-Events for the SurfaceView. Is it possible to delegate the Event directly to the SurfaceView?...

Maps in fragment crashes in sliding drawer when clicked twice on Maps item

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.map_fine_tech, container, false); fragment = getFragmentManager().findFragmentById(R.id.map); return rootView; } ...

Android - Cannot find symbol variable drawer_open when implementing navigation bar

I'm trying to implement a navigation bar within my android application. However, my compilers complains with following errors: Error:(39, 25) error: cannot find symbol variable drawer_open Error:(39, 47) error: cannot find symbol variable drawer_close My code: import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem;...

Android navigation drawer always open on tablet

I have seen many examples around, but I could not understand how to have the navigation drawer, always open in the tablet. I'm using this navigation drawer https://github.com/kanytu/android-material-drawer-template. I will have to create another xml file? and in OnCreate () what kind of code I need to add? public class...