android-navigation

Customize back navigation

天大地大妈咪最大 提交于 2019-12-12 04:20:41
问题 First of all I read this article but is kind of complicated for me . All I need is to go to an activity I want (navigate if exist in back stack or start it with Intent if it's not ) in onBackPressed() override . should I manage back stack or something else ? if yes how ? and if no what is a simple way for that ? P.S : I dont use ActionBar 回答1: you should override the second activity's onBackPressed() method and add android:launchMode="singleInstance" to your first activity in AndroidManifest

Why does TabLayout leave a gap for the NavBar when in immersive mode?

陌路散爱 提交于 2019-12-12 02:45:11
问题 I'm making a tabbed app using the Tabbed Activity template in Android Studio. The client wants the tabs at the bottom and it's for use in a kiosk so I have enables immersive mode etc just fine. My draft layout looks like this: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/main_content" android:layout_width="match

Navigation drawer in all Activity

假如想象 提交于 2019-12-11 22:52:00
问题 Hi all i want to put navigation drawer in all activity. Layout file: <?xml version="1.0" encoding="utf-8"?> <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 android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> <ListView android:id="@+id/left_drawer" android:layout_width=

How to Handle Navigation between Dependent Activities

左心房为你撑大大i 提交于 2019-12-11 19:48:05
问题 My question is how to update an activity based on its child while maintaining the context supplied by its parent. See the example hierarchy below. There is a flow up and down. Using the app would go something like this: Select Team 1 on the Home activity --> Activity A inflates based on the selection. Select Player 2 on Activity A --> Activity B inflates based on the selection. Select to Add a Stat on Activity B --> Activity C inflates and allows a stat to be added. User returns to Activity B

Can't resolve the Context or Application while navigating from Adapter of a fragment(A) to another Fragment (B)

拈花ヽ惹草 提交于 2019-12-11 19:35:18
问题 Am trying to navigate from one fragment (A) to another (B), but the fragment, but the first fragment (A) has a recyclerView meaning when I click on any Item I should navigate to the next one. Am using android Navigation component but I couldn't resolve the method findNavController(xxx) since it requires the ApplicationContext of the fragment. , because I tried v.getContext() , v.getApplicationContext() , mContext , but there wasn't luck. How can I resolve this issue, below is the

How can I make a multi-level(more than 3 level) navigation drawer in android?

本小妞迷上赌 提交于 2019-12-11 13:07:22
问题 I am developing an android application where I need to put a navigation drawer which would have more than 3 levels. What I want to do: If I click one item of my list in the drawer, a whole new list comes up in the drawer. This new list should also do the same when items of this list are clicked. This could go on for many levels. What I have done till now: I am keeping an expandable list which expands when I click on any item. This design doesn't allow adding more levels. Application which

Action bar drawer toggle seizes to work with API 23 (appcompat_v7)

落花浮王杯 提交于 2019-12-11 12:48:54
问题 I recently included the appcompat v7 library to my project. In trying to get rid of bunch of errors, I updated most of my SDK files and changed my target SDK version to 23 from 21. The problem is, my old code for designing the Navigation Drawer Toggle (the hamburger sign/arrow sign) now doesn't work and throws and shows errors on the files through eclipse. Here's the code: <style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle"> <item name="spinBars">false</item> <item name

Android Navigation Drawer Open On Activity Create

牧云@^-^@ 提交于 2019-12-11 10:46:22
问题 I do have a simple requirement. I want new android Navigation Drawer to open upon start of Activity. I have tried mDrawerLayout.openDrawer(drawerListView); in onCreate of host activity. But it didn't work. Any kind of help would be appreciated. Thank you. 回答1: try to move the code to onResume() and set a flag that the action is done so it won't happen every time activity goes foreground 回答2: put this line mDrawerLayout.openDrawer(drawerListView); at the end of onCreate it workes fine. 来源:

Why Dialog does not have a NavController [Missing]?

扶醉桌前 提交于 2019-12-11 08:47:12
问题 I am trying to use the latest update of Nav Component in my application where i can add dialog( BottomSheetDialogFragment ) in my nav graph nav_version = "2.1.0-alpha05" Part of code from my nav_graph : <dialog android:id="@+id/settingFragment" android:name="com.andor.navigate.notepad.listing.fragment.SettingFragment" tools:layout="@layout/fragment_setting"> <action android:id="@+id/action_settingFragment_to_confirmationFragment" app:destination="@id/confirmationFragment" /> </dialog> <dialog

Android Toolbar “Up” Arrow in custom implementation

99封情书 提交于 2019-12-11 06:03:50
问题 I am making a very custom Toolbar (don't freak, it's for good, not evil, I promise), and I want to put the "Up" arrow (the arrow that appears when there is a parent Activity set or for other reasons and has the nice ripple touch effect on Lollipop) in a custom location. Is there a way to get this arrow as a View or asset to use somewhere else in the Toolbar? I could not even find the image asset for the arrow. Any ideas? For an example, I want top be able to do something like: mToolbar