I am working on my first actual app in Android Studio (have only done some hello world stuff). I want to add a navigation drawer to my swipe view activity (which is my main activity), but I do not know how. Could someone help me with my little problem?
This is very basic question so writing same thing again and again is some kind of time consuming thing so i will suggest you to search for some things like "Navigation Drawer in Activity" or you can go for this link.
Related
I have an activity with a left pane and I need to change input fields when a different item is selected from the left pane.
I tried by adding a new activity but when the new activity show up the left pane disappears and the only way to get it back is by hitting the back button and I donĀ“t want that; the left pane must hide but must remain to select a new activity and let the user jump from one activity to any other that he choose.
How I cant get that?
I read also about something called fragments but since I'm new on this it looks a bit more complex.
I would review the documentation on Navigation, particularly on using a NavigationDrawer.
Hope that helps!
Refer to below Google Navigation Drawer Sample where you could find the correct way of implementing it.
https://github.com/googlesamples/android-NavigationDrawer
In addition I would recommend exploring bottom navigation, which is like the new navigation trends user enjoys.
Here is a code lab for it:
https://codelabs.developers.google.com/codelabs/android-navigation/#0
To choose which component to use for your app follow this material design guideline: https://material.io/design/navigation/understanding-navigation.html#lateral-navigation
Tip: To Speed up your development you can directly add Navigation Drawer Activity that will help you save a lot of time by adding the base code. Just add new Navigation Drawer activity by right clicking the package.
Hmm. Yes using fragments is the best solution. But you can also play around with hiding and showing views.
So I created a simple slide tab app using this reference via Android Studio: http://www.exoguru.com/android/material-design/navigation/android-sliding-tabs-with-material-design.html
The only difference between this and my app is that my app has more than 2 tabs (8). This is the link to my app via zip: https://www.dropbox.com/s/ipe4zz1u3r0lnqt/App.zip?dl=0
Anyway to the question. I am interested in implementing infinite scroll like this: ViewPager as a circular queue / wrapping
(The sliding tab continues after the end...|A|-->|B|-->|C|-->|A|-->|B|) So you can keep sliding right either in the page or in the tab.
However, I am not sure if or how it can be implemented as I am having a hard time understanding it. Any pointers/advice/clarification will be greatly appreciated as I am stuck.
I'm not an Android ninja developer and I'd like to implement an app which has a Drawer Navigation and includes a tutorial.
Basically if you are in "My App" you should see a 5-6 steps tutorial.
The question is:
How can I implement that app?
I'd like to know how to organize it and which components I should use.
I'd really appreciate a step-by-step guide.
Thanks a lot.
This is a weird mockup of what I'm trying to implement :)
You can make an activity on top of drawer and then you can simply put view pager in Activity for tutorial. When user will finish tutorial you can move user to Drawer Navigation.
So you can use following method.
Check if user is visiting application for first time then show tutorial activity then move to Navigation Drawer. If user is visiting application for second time or more then you can directly move user to Navigation Drawer and start app.
If your tutorial is for the overall app, Jayesh's answer is right: you should put it in a separate Activity.
If the tutorial only demonstrates part of your app, i.e. only the drawer your are in, I suggest you use:
One MainActivity with a DrawerLayout. The latest SDK tools have a real cool template for NavigationDrawer, that will save you a lot of time!
In your TutorialFragment, write a layout with a ViewPager and the fixed bar at the bottom.
Add pages for your tutorial to this ViewPager.
In my application, I want to have behavior like facebook app wherein on click of icon I'd like to shift the whole screen towards right and display some menus on the left as shown below:
Before Clicking Menu Button
After Clicking Menu Button
One way is to have a layout with those menu in black color and set its visibility to gone
But in that case, the shifting animation won't be there like it is there in facebook. So is there any way we can do this?
This UI Pattern is currently being referred to as Side Navigation and discussed in some detail here:
http://www.androiduipatterns.com/2012/06/emerging-ui-pattern-side-navigation.html
The article also links to several projects that have implemented this navigation:
https://github.com/korovyansk/android-fb-like-slideout-navigation
https://github.com/darvds/RibbonMenu
https://bitbucket.org/jfeinstein10/slidingmenu/overview
https://github.com/Gregadeaux/android-fly-in-app-navigation
It is worth reading the article for its discussion about the issues with this kind of navigation also, though.
I have not implemented it but give you an exact idea that you have to use fragment for this.
Go through this link
This is the best that I've found https://github.com/DWorkS/ActionBarToggle because it's implementation is similar to DrawerLayout from google using ActionBarToggle. Although, it has a problem with open method but I wrote to its owner and he said that he will solve.
This is a bit difficult to explain, so I'll try to give a simple example to what I'd want to implement.
A. When the menu button is pressed in the Market app there are some kind of tabs on the buttom, how can I implement this ?
B.now press the settings (after you press the menu button in the Market app),
Is there a way to create this kind of a layout or I have to start from scratch (I would really appreciate code example for this if there is no 'easy' way to do this).
What you are referring to here is not a layout. This is the standard way of creating menues in Android applications.
Have a look at the following topic in the Android developer guide: http://developer.android.com/guide/topics/ui/menus.html
And regarding your second question: for settings/preferences, you can use a PreferenceScreen/PreferenceActivity. This is shown pretty well here: http://www.javacodegeeks.com/2011/01/android-quick-preferences-tutorial.html
If, by tabs you mean the buttons that pop up after clicking menu, you will have create your own options menu.
http://developer.android.com/guide/topics/ui/menus.html
EDIT: For B, check out the PreferenceScreen/PreferenceActivity, as mention in an answer to this post. Just updating here with link for convinience.
http://developer.android.com/reference/android/preference/PreferenceScreen.html
http://developer.android.com/reference/android/preference/PreferenceActivity.html