Shift the screen to right on click of menu; like facebook - android

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.

Related

I need advice about what path to take in the creation of a new App

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.

Ideas for android navigation bar (below action bar)

I have a design for an app that will have a row of buttons below the action bar. Each button will open a different fragment. I am aware of ViewPagers, but I do not want the swipe between fragments functionality. I know that I can disable this functionality, but at that point is it worth using a ViewPager? I know this is a pretty common design paradigm, so how do most apps handle this sort of thing?
It seems like the ViewPager will provide some nice functionality out of the box, like switching between fragments and what not. So, I am leaning towards using one, but was hoping someone could provide some feedback on this approach.
Thanks!
Keep the buttons in the layout of your main activity. Have them call a function lets say loadFragment(Button button) on click.
This function then handles switching of the fragments, and you can change the display of the navigation buttons inside this function itself to highlight the appropriate button or something equivalent.
Google Design is always worth the reading.
Check http://developer.android.com/design/patterns/swipe-views.html for details.
Personally I have used ViewPager with tab layout for swiping purpose and it makes it easy to me to synchronise the transitions ( tabs and pages) where I put a red circle to the tab corresponding to the viewed page. With this approach I got a clean separated code.

How to implement a tutorial with Drawer Navigation

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.

Sliding in the android app home screen

I am looking to create an app where some categories that the user can choose from will be shown. The best UI I could find is shown in this image:
https://lh3.ggpht.com/swzmwICOMNjKmLH_HyAWh0VQ49BN7vU6PG3qEpsSnF1HWcG1CmpQi1BTBxdVczZx8pY
The screenshot is of the "Parenting Ages & Stages" android app. The best part of the above shown home page is that there is no scroll bar at the bottom and the user can use swipe gestures to see various categories.
Any idea how I can achieve the same effect?
It would be better to use ViewPager in your case
http://developer.android.com/reference/android/support/v4/view/ViewPager.html
It may Help you!

How to create tabs on the button, and a setting page?

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

Categories

Resources