Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - How can I locate the tab indicator between the two tab TextViews?

As far as I know, there are components ViewPager and ActionBar can support "tab navigation" mode but they don't have intermediate tab indicator between the tabs, just only positioning below a tab TextView.

How the Google Play app implemented this feature: POSITIONING linked with transition ?

enter image description here

like image 287
tsohr Avatar asked May 10 '13 05:05

tsohr


People also ask

How to set tab layout in Android?

This example demonstrates how do I create a Tab Layout in android app. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 3 − Add the following code to res/layout/activity_main. xml.

What is the use of tab bar in Android?

It provides a horizontal layout to display tabs on the screen. We can display more screens on a single screen using tabs. We can quickly swipe between the tabs.

How to create tab View in Android studio?

Tabs are created using newTab() method of TabLayout class. The title and icon of Tabs are set through setText(int) and setIcon(int) methods of TabListener interface respectively. Tabs of layout are attached over TabLayout using the method addTab(Tab) method.


1 Answers

You can achieve this by implementing android:actionBarTabStyle using ActionBarSherlock library.

Update:

I don't have idea exactly about this, but hope you know Android team has integrated the same pattern in I/O 2013 Android app and it will open sourced soon.

Update 2:

I just came across one library which can fulfill your requirement, check this: https://github.com/astuetz/PagerSlidingTabStrip

like image 113
Paresh Mayani Avatar answered Sep 27 '22 18:09

Paresh Mayani