I have tested both login and Navigation Drawer by customizing my own and by using Android's built-in template. I can create the login and navigation separately on it's own and customize them and they work well. However, when I try putting them together in the same project, it refuses to work. If I customize my login and use Android's navigation template, I'm able to reach the navigation menu. However, I cannot customize the menus because it uses MutableLiveData variable. A check on google doesn't show any other examples e.g. how to use image, button, Edittext etc, so I can't use the template with my customized login.
I have also tried rare possibilities like making both login and navigation as Mainactivity but they don't work - in other words, there are 2 main activities in a project. To worsen the situation, whilst older navigation drawer code doesn't use fragments, they are too old and complete examples are not found anywhere. All recent navigation examples uses fragments. So can someone help? Is there a way to create and customize both login and navigation drawer - and put them in the same project and they work well?
Related
I have followed exact steps in the following tutorial for making navigation drawer using design support library. But i want to replace the default hamburger icon (using drawerToggle.syncState()). How can i do it?
https://github.com/codepath/android_guides/wiki/Fragment-Navigation-Drawer
Also I want to make Navigation drawer switch activities instead of fragments. For this, i have made a BaseActivity following above tutorial and extended all other activities from this BaseActivity. I am able to get the result but when a new activity is launched unable to preserve the highlighting of selected item in navigation drawer. Please suggest any solutions?
I am developing an Android project with Android Studio.
I would like to have the menu is always accessible in every view like Google Play Store (the Sidebar) and App Store (the Bottom selection bar).
I am thinking to do it in two ways:
Make my app have only one activity with Navigation Drawer, all the other views are above this activity using fragments.
Recreate the sidebar or bottom selection bar every time I switch to another activity.
Both of these two ways are very complex and cost a lot. Do you have some better ways?
PS: If not, could you suggest me some links about how to implement these two methods?
Thanks a lot.
you can create a MasterActivity that extend Activity and contain your sidebar. other Activity can extend from your MasterActivity by this way you can access your sidebar on each activity.
I think you should use the default navigation drawer and default action bar.
If you are using the Android Studio then
right click on your package and go to New/Activity/Navigation Drawer Activity.
That will create navigation drawer fragment and activity automatically.
But If you are using Eclipse then these links will be useful for you.Navigation Drawer
Action Bar
you can use include tag in other layout activity and call Navigation Drawer:
<include
android:id="#+id/nDrawer"
layout="#layout/your_NavigationDrawerLayoutName"/>
I'm trying to get a NavigationDrawer working with sliding tabs inside a fragment (just like google play music or the google i/o app). In all my reasearch I found that you can't use Action bar tabs + Navigation Drawer together because the Navigation drawer will look like in the back of the tabs (I notice that). Can anyone help me telling me how to get that done without use an external library such ActionBarSherlock or TabHost (according to the documentation is recommended the use of actionbar)?
Yes, you're right. It won't be possible using ActionBar tabs as the navigation drawer won't overlap them. I recently implemented a library called ViewPagerAddons which has a custom view called SlidingTabLayoutColors imitating the behavior seen in Google Play/Music.
But as you said you don't want to use any libraries, you can still have a look at the source code. Here's the link with instructions: https://bitbucket.org/enthusiast94/viewpageraddons
I am working on an application, in which I need to implement navigation drawer. We have two different ways of implement navigation drawer in android as shown in attached screen shots :
In first way the sliding list is over main content. In second type, sliding list becomes visible and make main content to slide left to right with Navigation Drawer list.
I goggled a lot about this and only got solution of first type. I want to implement Navigation drawer like second type in attached screenshot. So please tell me what changes I need to make.
Thanks.
For the first case google's official Navigation Drawer is there.
And for the second case there's a third party library on github.
here's the link: https://github.com/jfeinstein10/SlidingMenu
Also I feel you've to use ActionBarSherlock (again a third party library) in order to implement the second case.
Moreover the google's drawer method is the recommended one as it supports a stable action bar, from where you can choose items even when the drawer is open. Also the design + app flow is slick and faster in this case as compared to the third party lib.
I want to create a app with a menu at the bottom of the screen. This menu should be visible any time the app is started.
Im working with fragments, so the menu is one fragment.
So I have only one Activity as controller which loads different fragments above the menu fragment.
Because I want to create clean code, i dont know how to solve the problem that the Activity class is too big.
In other words, i want to create different controller within the same activity. How to do that?
Is there another approach to solve this issue?
You should be using the split action bar This allows you to put the Actions and overflow menu on the bottom of the screen. I believe you can use Action Bar Sherlock for backwards compatibility to older versions of Android. See their site for detail.
Another possibility is to look into using fragments with the ViewPager . Here is a library that works with compatability as well ViewPageIndicator . Here is a blog post , like I indicated in my comment I got this working with the tabs showing at the bottom and the pages above.