Android change layout by sliding left/right - android

I tried many times to create a layout that contain multiple layouts and switch between these layouts by sliding left or right like on WhatsApp or Facebook apps.
I have used some LinearLayout, TableLayout and ScrollView but I didn't found the way to achieve it.
Do you have any solution please ?

What do you want to do is a Material Design Sliding Tabs ? I implemented that functionality in my app following this guide

You probably want to use Androids ViewPager and set up your views as fragments, it has built in swipe gestures to transition through pages so should cover what you need.
Check out this example, it's also got a sample app you can download and test out:
http://developer.android.com/training/animation/screen-slide.html

Related

How to make side-scrollable screens in Android?

I am trying to practice different functionalities in Android using Android Studio.
Right now I wish to make it so I can swipe left/right between various components.
A good example of this is the app called Simple Workout Log. The top bar is scrollable (in a more localized way) whereas the bottom of the screen scrolls over entirely with each swipe.
I did notice something called HorizontalScrollView in Android Studio but couldn't figure out how to mimic the functionality.
How is something like this made?
Create tabbed activity and it will automatically implement view pager and FragmentPagerAdapter for you.
After that you can look up for tutorials on creating tabs using frgments such as this one

Android multistep welcome screen (tutorial for using the app)

How to implement those popular welcome guides, where you have:
3-5 slides (with those little dots indicating the process), in the end button with something like "got it" (take me to the app & never show again).
Here is example (Walkthroughs with Twine):
https://ux.stackexchange.com/questions/50723/android-multi-step-wizard-examples
A simple ViewPager and multiple contained View's or Fragments will help you achieve this. For the indicator you can use ViewPagerIndicator.
you can simply use ViewPager here is a good library will help you to implement that:
https://github.com/JakeWharton/ViewPagerIndicator
or you can use a horizontal GridViews and set its column to 1 or using tabs and here is a library for horizontal gridView :
https://github.com/jess-anders/two-way-gridview

Android ViewPager non-title page indicator

I'm using a ViewPager to host multiple views, and I want something to visually show where the user is currently located. I don't want to use PagerTitleStrip or PagerTabStrip cause I don't want titles.
I want something similar to the horizontal line in the default launcher of the Nexus 4 shown in here:
When you swipe left or right, there is a slightly bigger rectangle that shows your position relative to the pages.
How can I do this?
PS: I can't use any library cause the code is going to be written in C# with Xamarin, also can't use any Xamarin component cause license won't let it have any more components.
Use the ViewPagerIndicator Library. This has an option for your desire.
ADDITION
I found this official Xamarin ViewPagerIndicator Library. Maybe this would help.

Set a view with SlidingPaneLayout with two menu's- one to the left and one to the right

i'm trying to create a SlidingPaneLayout that can slide both ways, same as they have in the Facebook app.
i see in android SlidingPaneLayout docs, that it is only intended to have a left menu, but still i'm looking for a way to make the child view slide both ways.
any solutions?
You may want to try this library: https://github.com/jfeinstein10/SlidingMenu

Implementing swiping between different views

I've been updating an Android app today which so far had a single TableLayout-based View. Now, I'd like to duplicate that View with another set of backing data, and use horizontal swiping to switch between both. At some point I'd also like to add a third "page" with a different TableLayout.
I haven't really found any good ways to get this going. I've been looking at http://developer.android.com/training/implementing-navigation/lateral.html, and I actually copied the code fragment for the Tabs Pattern with NAVIGATION_MODE_TABS. That results in a little dropdown widget being added to the View title in the action bar, but clicking it doesn't show the tabs I set up (with actionBar.addTab()). I'm also not sure how to set up the view (XML) code to stick the TableLayouts in there.
I should mention that I don't have to care for pre-4.0 Android for this, so compatibility is not (much of) an issue.
Try to Use ViewPager Widget you can find useful links on the web, this widget handle the horizontal swiping between views.
http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
https://github.com/JakeWharton/Android-ViewPagerIndicator
http://blog.stylingandroid.com/archives/537#
I haven't really found any good ways to get this going.
Try ViewPager. Here is an Android Developers Blog post on ViewPager: http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
Here is a small sample app using ViewPager: https://github.com/commonsguy/cw-omnibus/tree/master/ViewPager/Fragments
None of the other answers ended up helping much. However, this one is pretty good:
http://thepseudocoder.wordpress.com/2011/10/05/android-page-swiping-using-viewpager/

Categories

Resources