navigation-drawer

How to style Menu Items in Navigation Drawer in Android?

微笑、不失礼 提交于 2019-12-18 13:07:55
问题 I want to add style the Menu Items inside Navigation Drawer but I am unable to do so. I have looked up for some answers but couldn't done it. Can anyone help, I would be grateful. I am using the following theme Theme.AppCompat.Light.DarkActionBar <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:id="@+id/group1" android:checkableBehavior="single"> <item android:title="Book Now!"> <menu> <item android:title="item 1" android:id="@+id/item1" android:icon="@drawable

Android changing the width of the navigation drawer panel programmatically

╄→尐↘猪︶ㄣ 提交于 2019-12-18 12:01:55
问题 I've used the Navigation Drawer template presents in Android Studio. In the layout of my activity I have this following code: <fragment android:id="@+id/navigation_drawer" android:layout_width="@dimen/navigation_drawer_width" android:layout_height="match_parent" android:layout_gravity="start" android:name="com.smedilepaolo.newsfeed.NavigationDrawer.NavigationDrawerFragment" tools:layout="@layout/fragment_navigation_drawer" /> What I need is to change programmatically the width of the panel. I

Android changing the width of the navigation drawer panel programmatically

家住魔仙堡 提交于 2019-12-18 12:00:06
问题 I've used the Navigation Drawer template presents in Android Studio. In the layout of my activity I have this following code: <fragment android:id="@+id/navigation_drawer" android:layout_width="@dimen/navigation_drawer_width" android:layout_height="match_parent" android:layout_gravity="start" android:name="com.smedilepaolo.newsfeed.NavigationDrawer.NavigationDrawerFragment" tools:layout="@layout/fragment_navigation_drawer" /> What I need is to change programmatically the width of the panel. I

BaseActivity for Navigation

匆匆过客 提交于 2019-12-18 11:38:04
问题 I'm building a base activity for navigation and want something flexible so the Activity dictates to the Base Activity which layout to inflate. I have the following public abstract class BaseActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { private int mLayoutRes; protected void setLayout(int layoutRes) { mLayoutRes = layoutRes; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView

How to implement navigation drawer with fragments master detail

浪尽此生 提交于 2019-12-18 11:14:05
问题 i have get the sample navigation drawer from this site : http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/ and the master detail from here : http://wptrafficanalyzer.in/blog/itemclick-handler-for-listfragment-in-android/ the error LogCat oncreateview(inflac....) the view can not be created me i have try that //the main activiry as Activity: package in.wptrafficanalyzer.listfragmentitemclick; import in.wptrafficanalyzer.listfragmentitemclick.adapter

DrawerLayout getting stuck on swipe

此生再无相见时 提交于 2019-12-18 10:48:30
问题 I am playing around with DrawerLayout and I am encountering an issue. Basically sometimes when i swipe from the edge of the screen the DrawerLayout will get stuck until i lift my finger off the screen (See screenshot below) I am not sure what is up, I followed the code sample from the google sdk exactly. Any ideas? And here is the only thing i have in my FragmentActivity: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout

Removing and adding activities to the back stack

∥☆過路亽.° 提交于 2019-12-18 10:16:18
问题 In the "System Back after cross navigation to lower hierarchy levels" section of the Navigation Drawer, they say: If the user navigates to a lower hierarchy screen from the navigation drawer and the screen has a direct parent, then the Back stack is reset and Back points to the target screen’s parent. This Back behavior is the same as when a user navigates into an app from a notification. I know the back stack can be reset by starting an activity with FLAG_ACTIVITY_CLEAR_TOP and FLAG_ACTIVITY

Cannot resolve method getActivity()

心不动则不痛 提交于 2019-12-18 04:31:19
问题 I am new to Android and learning to create fragments in Android by following this example: Fragment Navigation Drawer The code between Navigating between Menu Items and Add Navigation Header consists a method getActivity() . As the author didn't mentioned where to paste this code, I pasted in my MainActivity.java file Is code between Navigating between Menu Items and Add Navigation Header pasted at correct location by me? In method selectDrawerItem(MenuItem menuItem) there is a comment //

How to Create Navigation Drawer Using Android Design Support Library?

浪尽此生 提交于 2019-12-18 04:25:12
问题 In google developer blog post . I read about new way to create navigation drawer using new dependency called compile 'com.android.support:design:22.2.0' but I didn’t found exact way to create navigation drawer using this new dependency. In build.gradle , I have added dependency compile 'com.android.support:design:22.2.0' compile 'com.android.support:appcompat-v7:22.0.0' in layout file added following code (based on google blog post) <android.support.v4.widget.DrawerLayout xmlns:android="http:

Navigation Drawer rendering error in ADT Layout Editor

孤者浪人 提交于 2019-12-18 03:54:29
问题 <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="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:background="#111" android:choiceMode="singleChoice" android:divider="@android:color/transparent" android:dividerHeight="0dp" /> Adding that to the layout xml as per Create a Navigation Drawer documentation produces Exception raised