Sliding pages inside an activity through touch swiping - java

I want to have an activity in which the user can navigate from left to right and vice versa to move through fragments.
This navigation desired to occur through a horizontal touch swiping.
What is the best way?

You can use ViewPager to do this. you may want to view this.

According to me implementing #viewFlipper class will be better.

Related

How to re-use same fragment across viewPager

I have a fragment with a textView. I want the textView to change when I scroll across the viewPager.I want to reuse the same fragment rather than creating a new fragment for displaying each text.How do I do this? I hope pro developers can understand what I mean.
You cannot attach a same fragment into activity twice simultaneously. If you want the behavior you mentioned don't use ViewPager. Just use swipe gesture detection in a layout and maybe some animations.

Android: i need to do a menu like the image

i'm developing an application for android that is already done for IOS, is not big problem.
the thing is that my boss want it to be exactly the same, but one of the menus is the problem, is like a slide menu but with zoom and a background image, anyone have any idea how can i do this, i already google it but no results :(, a library would help.
here is a picture with the menu for IOS.
I don't think if it would be an effective solution but you can use a RelativeLayout.
Put the selection part behind in a LinearLayout then put a framelayout front to contain list fragments. This way you shouldn't use an action bar to have absolutely same looking with iOs version.
When someone clicks open button apply an animation to your framelayout. scale it by %75 and move it 25% in y coordinate and move it %50 in x coordinate. When buttons in your LinearLayout apply a reverse animation to your FrameLayout. If swap button clicked change your fragment with new one. You can also aply a transaction animation to your fragments.
I hope you know how to handle this stuff. If no I can do my best to code an example.
EDIT:
Don't forget to set your flame layout unclickable when you move it to right side.
https://github.com/SpecialCyCi/AndroidResideMenu
I think I found your answer. I came across this in a list of libraries it is 3.8 on the list https://github.com/Trinea/android-open-project/tree/master/English%20Version
Cheers!

Overlap a layout with viewPager

maybe you can help me. I want to use viewPager to overlap an other layout. so for example: I the first Fragment. On this Fragment is a picture, than I swipe to the right and then the second Fragment should just go over the first Fragment. It's like in the Android Youtube App in which you swipe from left to right and the settings and etc go over the main layout(like in the picture). Can you tell me what i have to do?
Thanks a lot, Vinzenz.
picture:
http://i.stack.imgur.com/CQ8gL.png
What you're asking for is actually not related to ViewPager. There is another layout you can use to implement the same navigation pane overlay: DrawerLayout link: http://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html

flip board menu style for android

In my app,first activity if we click one button it should open sencond activity with transparence only at the end some part. So when we are in second activity, the content of first activity should visible some part. Its like exactly Flipboard style menu in android, in flip board if we click top red button we will get another screen in that we can visible previous screen at the bottom like this i need. If any one having ideas please share with me how to do flip board style menu.
Use Fragments for this problem that's what they are made for.
If you want to use API 8, I still recomment Fragments but then you need to use ActionBarSherlock it provides you with all features you need.

How can i change the List XML via a swipe gesture

at the moment i'm trying to write an app which has a listview, and if i swipe especially left the listitem switches to another xml like it's used in the twitter app.
Especially i have a list of items only with some text and when i swipe left on a single item it changes to an other item (via a xml-file) especially with some buttons or anything else.
I hope anyone, has an idea how i can do this?
Thanks.
I have seen this done using a Gallery set to fill_parent. Care has to be taken to allow child views to pass on touch events appropriately for swiping to work. Note that Gallery is a subclass of ViewGroup.
EDIT: see comment below, i should've checked the twitter app first!

Categories

Resources