navigation-drawer

navigation MenuItem in toolbar doesn't trigger onOptionsItemSelected

早过忘川 提交于 2019-12-02 04:31:15
I'm trying to use the navigation drawer with toolbar, but pressing the navigation button doesn't trigger the onOptionsItemSelected handler and the list doesn't open. Search button, however, trigger onOptionsItemSelected. This is my code and xml: EDIT: also onDrawerClosed() and onDrawerOpened() aren't called MainActivity.java: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mToolbar = (Toolbar) findViewById(R.id.tool_bar); setSupportActionBar(mToolbar); mAdapter = new ViewPagerAdapter

Cannot listen clicks on up caret

左心房为你撑大大i 提交于 2019-12-02 04:23:37
问题 I've a single activity(MainActivity) which extends actionbaractivity and implements NavigationDrawer. I've setup the drawertoggle in the activity itself. I'm creating new fragments from a fragment that was created by another fragment which is in turn created by the MainActivity. ( MainActivity -> HomeFragment ->AnotherFragment). MainActivity.java public class MainActivity extends ActionBarActivity implements FragmentDrawer.FragmentDrawerListener, TitleSetter, NavigationDrawerEnabler{

Creating a navigation drawer over action bar with header

拥有回忆 提交于 2019-12-02 04:04:34
I have a translation app that helps people to learn a language and play games to check their learning. The app already has a navigation drawer but it appears under the action bar with items. I want to change the navigation drawer to make it appear over the action bar. Very much preferred that the navigation drawer has a google play store style header. I have tried many solutions but I am not able to get it done. Here are some examples : [1] Android Navigation Drawer on top ActionBar 1st and 2nd solutions have been tried. [2] https://www.youtube.com/watch?v=HDYPgS0BM8c&feature=youtu.be Have

Illegal Argument Exception - DrawerLayout must be measured with MeasureSpec.EXACTLY

半世苍凉 提交于 2019-12-02 02:59:08
Stacktrace: 09-10 07:56:56.448 24867-24867/? E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.IllegalArgumentException: DrawerLayout must be measured with MeasureSpec.EXACTLY. at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:814) at android.view.View.measure(View.java:15848) at com.android.internal.widget.ActionBarView.onMeasure(ActionBarView.java:1098) at android.view.View.measure(View.java:15848) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5012) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at com.android.internal.widget

Gmail like navigation drawer (master page) in xamarin.forms

旧城冷巷雨未停 提交于 2019-12-02 02:28:48
I am currently using the master-detail page in xamarin.forms using MVVMlight and it renders based on the default behavior of os it renders perfectly what I wanted but in android master page starts below the navigation bar. I wanted master page to cover full height of screen just like ios do so is there any way or solution for it without custom renderer or is it necessary to write custom renderer for this Use FormsAppCompatActivity instead of FormsApplicationActivity. define your own toolbar.axml toolbar.axml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns

How to add two fragments together in a frameLayout in runtime

一个人想着一个人 提交于 2019-12-02 00:54:29
I am developing an andorid application with navigation drawer and I have a layout for contentview like this: <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"> <!-- As the main content view, the view below consumes the entire space available using match_parent in both dimensions. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height

Navigation Drawer listview not refreshing listitems

五迷三道 提交于 2019-12-01 23:43:48
问题 I am creating one app,and i am using NavigationDrawer and Fragments in my application,now issue is I have five ListItems in NavigationDrawer like this. -Home -Edit Profile -My orders -Signout -Help Now when user click on signout,all the listitems should hide and only signin should visible.. following is my snippet code public class MainActivity extends FragmentActivity { private DrawerLayout mDrawerLayout; private ListView mDrawerList; private ActionBarDrawerToggle mDrawerToggle; private

Android-NavigationView from right to left

旧街凉风 提交于 2019-12-01 22:55:45
问题 I'm using The last version of Android Studio (1.5) and I want to make a menu using Drawer Layout, for position its call GravityCompat. I'm trying to use this components and modify it, putting the Drawer out from right to left. Here is my code. public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);

Opening/Closing NavDrawer with invalidateOptionsMenu() cause onRestore call on SearchView and onQueryTextChange is called as well

社会主义新天地 提交于 2019-12-01 22:30:16
I have a MainActivity with callbacks implementation of: DrawerListFragment.Callback ItemListFragment.Callbacks SearchView.OnQueryTextListener I have also added an ActionBar SearchView, and finally implemented OnQueryTextListener to change the listView of the listFragment at each kb type, but this works! Also, clicking an item on navDrawer generates a new/replace FragmentList transaction for the new type of itemsList. Now the problem. The ActionBar SearchView actually filters the current itemList created. Opening/closing NavDrawer is made with the classic "new ActionBarDrawerToggle(){...}"

Android-NavigationView from right to left

安稳与你 提交于 2019-12-01 22:21:53
I'm using The last version of Android Studio (1.5) and I want to make a menu using Drawer Layout, for position its call GravityCompat. I'm trying to use this components and modify it, putting the Drawer out from right to left. Here is my code. public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); DrawerLayout