jpardogo / PagerSlidingTabStrip

An interactive indicator to navigate between the different pages of a ViewPager
2.19k stars 353 forks source link

missing attribute #67

Closed lub0s closed 9 years ago

lub0s commented 9 years ago

Is there an attribute which will allow me to have indicator not on bottom of the PagerSlidingTabStrip layout but instead it will have some kind of padding from botom ? I mean like it will float beneath the text like this :

ICON TEXT SPACE INDICATOR SPACE

Sorry for bad issue, but I can't express myself properly. It could look like this : https://imgur.com/haT6OeA

ataulm commented 9 years ago

It's difficult to tell what you mean from a screen cap of one tab - are you trying to emulate the style of an existing pager tab strip?

jpardogo commented 9 years ago

That would be an example. The parent view is the one that specify the bottom padding.

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/green"
        android:orientation="vertical"
        android:paddingBottom="8dp"> <!--The bottom space is defined here--> 

        <include layout="@layout/toolbar" />

        <com.astuetz.PagerSlidingTabStrip
            android:id="@+id/tabs"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="@android:color/transparent"
            app:pstsPaddingMiddle="true" />
    </LinearLayout>

You will need to define a custom tab for you approach.

If you want to have an image as a background you will need a dipper hierarchy in your layout:

  <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:src="@drawable/exam_back"
            android:scaleType="centerCrop"/> <!--Important to centerCrop to keep proportions of the image and crop the rest-->

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingBottom="8dp"> <!--The bottom space is defined here--> 

            <include layout="@layout/toolbar" />

            <com.astuetz.PagerSlidingTabStrip
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="@android:color/transparent"
                app:pstsPaddingMiddle="true" />
        </LinearLayout>
    </FrameLayout>