navigation-drawer

Make fragment clickable when navigation drawer is opened

霸气de小男生 提交于 2019-12-04 21:45:37
问题 My problem is as follows: I lock the navigation drawer menu setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_OPEN) in the landscape mode of the tablet, but I need the fragment from the right to be active, so I can click it with navigation always opened. But I dont know how to do it. Please help. 回答1: There are a few things you need to do: Disable the layout fading by setting a transparent color: drawer.setScrimColor(Color.TRANSPARENT); Lock the drawer drawer.setDrawerLockMode(DrawerLayout.LOCK

Flutter navigation drawer hamburger icon color change

ぐ巨炮叔叔 提交于 2019-12-04 20:26:08
问题 Hamburger icon color of navigation drawer is not changing. Its black by default. I want to change the this icon color in flutter, I am stuck, help me to change this icon color. here is my code. class Test extends StatefulWidget { @override _TestState createState() => new _TestState(); } class _TestState extends State<Test> { @override Widget build(BuildContext context) { return new Scaffold( drawer: new Drawer(), appBar: new AppBar( title: new Text("Navigation Drawer") ), ), ); } } 回答1: Add

Android TabHost only inside one Fragment (NavigationDrawer)

雨燕双飞 提交于 2019-12-04 20:24:09
I'm currently coding an application that uses a lot of Fragments accessible using a Navigation Drawer. So far so good, but I also want to have a TabHost with 2 Tabs inside one of the Fragments. How do I best implement it? This is a code snippet: public class SectionFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { int position = getArguments().getInt("position"); if (position == 0) { rootView = inflater.inflate(R.layout.startmenu_layout, container, false); // die rootView zum Weiterarbeiten holen } else if

How to customise Navigation Drawer item height

别说谁变了你拦得住时间么 提交于 2019-12-04 19:04:49
Hello guys I'm trying to change the height of my Navigation Drawer items and I don't know how, I've looked everywhere and did my best but nothing seems to work.. This is my Navigation Drawer item which is customised to have a text under that image but also I want that image to be a little bigger. The result I am looking up to is this: With around 75dp of height for each item and also I want the menu to be shorter on the width to give that look in that image. I am using a custom layout for my items of course, which I named: menu_item.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout

Android CalenderView - change scroll direction to vertical

旧街凉风 提交于 2019-12-04 18:25:42
I'm using a calendarView in my app inside a navigation drawer to select different days and everything works fine except for swiping to the left on the calendarView to get to the next month (swiping to right changes to the previous month correctly), since this is the swipe gesture that closes the drawer. Is it possible to change the scroll direction of the calendar to vertical instead of horizontal? I want to implement this so users don't solemnly need to rely on the buttons to switch between months. This is the code from fragment_navigation_drawer.xml <?xml version="1.0" encoding="utf-8"?>

Avoid ViewPager going under Toolbar

£可爱£侵袭症+ 提交于 2019-12-04 16:56:52
Based on this answer I tried to make a solution for my Use Case. Instead of using a Collapsing toolbar I'm using a regular one but with a TabLayout . However, for the TabLayout I need to use a ViewPager and I have no idea where to place it in order to avoid trouble with the FrameLayout . ViewPager was in my Host Fragment and when its layout replaced the FrameLayout, the content went below the Toolbar and TabLayout for some reason... I tried putting it below that line <include layout="@layout/content_main" /> in the app_bar_main.xml but it messed up my UI. The real question is, if I need a

How to disable drawer option in specific fragments of an activity

℡╲_俬逩灬. 提交于 2019-12-04 16:18:59
I have an activity with 5 fragments, I used drawer layout in my activity for a drawer, but I want to use(enable) the drawer in only fragment 2 and I want to disable the drawer option in remaining fragments. Can any one help me how to do this? MichaelStoddart Put two methods in the your activity , one to disable the drawer and one to enable it again, like so: public void lockDrawer() { drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); } public void unlockDrawer() { drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED); } Then in your fragments onCreateView(...)

navigation drawer layout with include layout

▼魔方 西西 提交于 2019-12-04 14:51:34
i think my problem is actually quite simple, but i can't figure out how to solve it. a have a working navigation drawer with this code: <?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" android:padding="5dp" > <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent"> <ListView android:id="@+id/category_list_view" android:layout_width="match

NavigationDrawer RecyclerView selected items change color

有些话、适合烂在心里 提交于 2019-12-04 13:46:32
问题 I am trying to change the textColor in my NavigationDrawer when item is selected.I am using RecyclerView as my swipe layout. This is based on the tutorial: http://www.androidhive.info/2015/04/android-getting-started-with-material-design/ Anyone can suggest the solution Thanks in Advance. 回答1: Define a static int in NavigationDrawerAdapter class to represent the selected item In NavigationDrawerAdapter.java public class NavigationDrawerAdapter extends RecyclerView.Adapter

Android Navigation Drawer ListView Headers

£可爱£侵袭症+ 提交于 2019-12-04 13:02:36
I've made a navigation drawer in my app. Inside my navigation drawer is a ListView . It's a simple list view with text items. The Gmail android app has a ListView with headers. (source: phonedog.com ) As you can see, the words: INBOX, RECENT LABELS, ALL LABELS are headers. I would like to implement exactly those type of headers into my app. Is this feature an inbuilt android thing or do I have to create something custom. If yes then how. Let me know if you need any more info. Thanks in Advance. 来源: https://stackoverflow.com/questions/19341033/android-navigation-drawer-listview-headers