navigation-drawer

How to hide default hamburger icon of Navigation view android

[亡魂溺海] 提交于 2019-12-10 17:56:47
问题 I need to hide the hamburger icon This is my toolbar I need to hide the default hamburger icon of navigation bar and load it from another button click.The navigation bar need to appear on the attachment icon click in my toobar and need to disappear when i click outside(anywhere).Can this be done ? 回答1: if you are using ActionBarDrawerToggle then you can add a line toggle.setDrawerIndicatorEnabled(false); and opening and closing drawer you can write in your click event if (drawer.isDrawerOpen

Multiple activities (not fragments) with a NavigationDrawer. How to show currently selected Activity?

孤者浪人 提交于 2019-12-10 17:43:44
问题 I had an application with quite a few activities before it was decided that we will be using a Navigation Drawer or a hamburger menu. I did not want to redo the whole app using fragments so I decided to go with the approach used in this answer: Same Navigation Drawer in different Activities EDIT: And now, this one https://stackoverflow.com/a/23477100/1371585 And I created a base activity called NavDrawerBaseActivity . Here is the code: public class NavDrawerBaseActivity extends MyBaseActivity

Use smoothScrollTo in Fragment

心已入冬 提交于 2019-12-10 16:10:20
问题 I have following situation: I'm using a Navigation Drawer to make the user easily navigate between different topics. You can find a picture here: https://drive.google.com/file/d/0B2gMUEFwlGRfSHRzVlptYmFQTXc/edit?usp=sharing When clicking on a heading, like General the only the main content view is replaced, by using a fragment and a layout file. But when the user clicks on a subheading, like Gameplay , the layout changes, AND it should scroll down to a specifc view in the layout. So in my

Navigation-drawer group header - how to set up?

一世执手 提交于 2019-12-10 14:48:02
问题 I have a menu with groups like below. Is that possible to set a headers for each group? I know that's possible for submenus, but what about first level groups? <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single" android:id="@+id/main_group"> <item android:id="@+id/leagues_in_progress_item" android:icon="@drawable/ic_format_line_spacing_black_48dp" android:title="@string/title_activity_leagues_in_progress" /> <item android:id="@+id/last

close Navigation Drawer with no animation

邮差的信 提交于 2019-12-10 14:41:53
问题 I am trying to close my navigation drawer after I finish certain activities immediately, without the sliding animation. I don't close it on activity start because I would like it to stay open if the user backs out of the activity. However, I cannot get it to close without a brief flickering animation as it closes itself. I have tried variations of the following code: protected void closeDrawerImmediate() { mDrawerLayout.setVisibility(View.GONE); mDrawerLayout.closeDrawers(); mDrawerLayout

How to properly reset navigation to another view

不羁岁月 提交于 2019-12-10 14:28:21
问题 I am resetting the current view with this code NavigationActions.reset({ index: 0, key: null, actions: [ NavigationActions.navigate({ routeName: 'Login' }) ] }); Some times it works and some time I get a Signal Sigabrt error on the RCTUIManager.m file in Xcode. I can't figure out when did the problem occur. The error happens in this function - (void)setSize:(CGSize)size forView:(UIView *)view { RCTAssertMainQueue(); NSNumber *reactTag = view.reactTag; dispatch_async(RCTGetUIManagerQueue(), ^{

InflateException on inflater.inflate() method call

拜拜、爱过 提交于 2019-12-10 14:06:56
问题 I keep getting an InflateException upon trying to inflate a view in my MenuAdapter class. I've surrounded the troublesome code in a try-catch block and get the error Message: link to the entire project: https://docs.google.com/file/d/0B2Iwl4UysxOMa3E5a1l2SHZwOG8/edit?usp=sharing Binary XML file line #1: Error inflating class Here is the code: package com.example.sidemenututorial; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view

Navigation Drawer onNavigationDrawerItemSelected called before MainActivity onCreate?

大城市里の小女人 提交于 2019-12-10 12:55:41
问题 I have setup a new project with the template implementation of Navigation Drawer Fragment and a MainActivity. It provides me with the following relevant methods: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Intent intent = getIntent(); token = intent.getStringExtra(EXTRA_TOKEN); mNavigationDrawerFragment = (NavigationDrawerFragment) getSupportFragmentManager().findFragmentById(R.id.navigation_drawer)

See navigation drawer preview

旧城冷巷雨未停 提交于 2019-12-10 12:55:04
问题 I'm designing a native navigation drawer in Android Studio. I can't see the drawer in my preview because it is sitting left of the activity, out of range of the preview. For now I'm using a testlayout.xml file to see my changes, but a lot of times I forget to copy paste them into the right activity. Is there a way to preview the drawer layout? 回答1: If you want to be able to preview the drawer layout / navigation bar If you are following the tutorial at https://developer.android.com/training

Google map V2 and navigation drawer

心已入冬 提交于 2019-12-10 12:16:17
问题 PROBLEM I want to use Google Map V2 in Navigate Drawer but I can't disable Navigate Drawer and give touch handler to the map when it was touched. What should I do ??? NOTE I have experience the similar problem like this before... I would like to use SeekBar in Navigate Drawer and it can't scroll the SeekBar. At that time, I can archive it by using onTouchListener() for SeekBar directly but now it cannot. 回答1: SOLUTION So, here is my solution thank to this post, I have adapt some code to