android-navigation

Navigation Drawer without Actionbar

不问归期 提交于 2019-11-29 12:25:05
问题 I searched many sites (stackoverflow as well) but couldn't understand how to implement the navigation drawer without the action bar. I know that this question has already been asked here but it doesn't have a proper explanation and code. I am a beginner in android development so can anyone please explain me with code How to make a navigation drawer without an action bar Thanks in advance! 回答1: Just add your DrawerLayout like @mohan did, then if you have a button or something you tap on and

How do I add navigation drawer to my existing code?

冷暖自知 提交于 2019-11-29 09:55:10
I have an app in which I have a navigation panel with menu buttons on which I want to apply navigation drawer, currently it takes up the entire screen,but I want to restrict it to 3/4th of the screen by applying navigation drawer on it, but i have never touched navigation drawer before so have no clue, any help or guidance will be great.Also went through some documentation and got confused :( Here is my code: and here is my layout class for navigation panel: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:foo="http:/

Android Navigation view: Scroll the menu items only issue

余生颓废 提交于 2019-11-29 04:49:15
I want to scroll only the menu items of the navigation view but it also scroll the header with it. Please any body tell me how to achieve this... Here is my code: activity_main.xml <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" ....... <android.support.design.widget.NavigationView android:id="@+id/navigation_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" app:headerLayout="@layout/header" app:menu="@menu/drawer" /> </android.support.v4.widget.DrawerLayout> header.xml <?xml version=

How to highlight the item when pressed using BottomNavigationView between activities?

老子叫甜甜 提交于 2019-11-29 03:14:41
I have added Bottom Navigation View for my app but I need the Bottom Navigation View between activities instead of fragment so I have added this code to Java for all my 3 activities. When I select Second or Third in my phone all things are correct but the problem is the highlight goes to the First item. I need to highlight the item I press. I have used fragment and it works perfectly but I am still beginner for using fragment so I am using activities. The first activity code is: BottomNavigationView mBottomNavigation; mBottomNavigation =(BottomNavigationView) findViewById(R.id.BottomNavigator)

Must I specify the parent activity name in the Android Manifest?

我的梦境 提交于 2019-11-29 01:29:44
I have an activity that starts another activity. Is it mandatory that I specify the parent activity in the Android Manifest? Im asking this because there might be other activities that will start this one as well, so should I specify all of them? android:parentActivityName="com.example.myfirstapp.MainActivity" Szymon As per docs -> section android:parentActivityName : The system reads this attribute to determine which activity should be started when the user presses the Up button in the action bar. The system can also use this information to synthesize a back stack of activities with

Tool bar setNavigationOnClickListener breaks ActionbarDrawerToggle functionality

删除回忆录丶 提交于 2019-11-28 23:58:05
I'm swapping out the action bar for the tool bar, and I nearly have every piece of the puzzle in place. My issue is specifically if I navigate 'up' and restore the navigation drawer, the drawer toggle button no longer works. I figured out if I set the drawer mode to unlocked I have the ability to swipe to open the drawer, but can't click to open the drawer. So I load fragment A, drawer behaviour is fine, go down to fragment B and apply the up icon, hit up to go back to A, and the drawer won't open with a click any more. Entering Fragment B: Toolbar t = mHostingActivity.getToolbar();

Detect soft navigation bar availability in android device progmatically?

妖精的绣舞 提交于 2019-11-28 18:15:05
I am trying to determine soft navigation bar through the android program. I didn't find straight way to determine. Is there anyway to find the navigation bar availability. Soft Navigation bar image is here. Following method worked for me and tested in many devices. public boolean hasNavBar (Resources resources) { int id = resources.getIdentifier("config_showNavigationBar", "bool", "android"); return id > 0 && resources.getBoolean(id); } Note: Verified this method in real device As i know you can detect it by boolean hasSoftKey = ViewConfiguration.get(context).hasPermanentMenuKey(); But it

Listview containing checkbox and text is getting reset on scrolling

天涯浪子 提交于 2019-11-28 12:58:38
问题 I have drawn a customized navigation drawer with ListView and header but when i scroll the List the checkbox in the List are getting unchecked. Secondly when i click on the reset button in the header part I want that all the checkbox in the Listview should get get unchecked. I have been trying this to get it working but unable to find any solution.. The snippets are public class NavigationDrawer extends Fragment{ @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,

How to Call FrameLayout slider in Different Activities in Android

回眸只為那壹抹淺笑 提交于 2019-11-28 12:51:49
问题 I have 3 activity say first_activity , second_activity , third_activity .I have used FrameLayout to open a slider .! Now what I want to open the slider on click of button that is available on all three activities. So now like in the Test 1 there is a button on the left side in the same way i have on all three activities so on click of that i want to open the slider. This my slider code public class MainActivity extends Activity { // Within which the entire activity is enclosed private

Swapable tabs in Slider Menu fragment

风格不统一 提交于 2019-11-28 09:22:31
I have implemented Navigation Drawer by Referring this tutorial and now what I want to do is to display swiping tabs inside a fragment. i.e. when i click on an item in navigation drawer, lets say the first one, it should display swiping tabs for that items.( I have 6 fragments in my list view.(likewise :- A,B,C,D,E,F). and I need 3 swapable tabs on my A Fragment.) If the item1 is Events, when i click on it, then it should display swiping tabs. But I am facing the following issues:- How can I implement view pager inside fragment? It is possible that a fragment extends a fragment. when A