I've just decided to add swipe views on my android application. I searched for them on the web for tutorials but I found nothing but deprecated actionBar tutorials. Event in official Creating Swipe View from android developer is showing me that this is deprecated method for this purpose. So tell me guys - what's the best way to make a swipe tab view?
-
1What seems to be deprecated exactly? If you need to make tabs with swiping functionality, ViewPager is the way to go. – Alex Styl Feb 22 '15 at 12:07
-
actionBar.setNavigationMode() It's seems that this method is already deprecated. – Stanimir Yakimov Feb 22 '15 at 12:10
-
@AlexStyl Should I switch my targetSDK or minSDK? – Stanimir Yakimov Feb 22 '15 at 12:10
-
Check this http://stackoverflow.com/questions/17687717/tutorial-to-implement-the-use-of-tabhost-in-android-2-2-viewpager-and-fragment – Josef Feb 22 '15 at 12:13
3 Answers
I think you can use the templates included with ADT. Just create new "Android Application Project" and select "tabbed activity" during wizard flow, and select "Navigation Style" = "swipe views" on the last wizard screen.
You can either develop your application on base of code you received, or study it to understand how swipe and tabs are working together.

- 1,556
- 15
- 14
Action bar tab is now depreciated because of new toolbar facility . You can use now Sliding tab https://developer.android.com/samples/SlidingTabsBasic/src/com.example.android.common/view/SlidingTabLayout.html for creating swipe views using view pager

- 41
- 1
- 4
Use a Sliding tab Layout.
Get the Sliding Tab Layout & Sliding Tab Strip java file in the following link. https://github.com/google/iosched/tree/master/android/src/main/java/com/google/samples/apps/iosched/ui/widget
Copy the 2 into your project and follow the follwing tutorial. Note: Dont copy the one in the developers android website its not updated as far as I know
https://www.youtube.com/watch?v=Fl0xMuo10yA&index=26&list=PLonJJ3BVjZW6CtAMbJz1XD8ELUs1KXaTD
I had the same problem.