Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab and Viewpager in fragment ? #7

Open
amaydiam opened this issue Jul 27, 2015 · 0 comments
Open

Tab and Viewpager in fragment ? #7

amaydiam opened this issue Jul 27, 2015 · 0 comments

Comments

@amaydiam
Copy link

hai, how it's work, if Tab and Viewpager in fragment ? like this :

``<LinearLayout
            android:layout_width="match_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical"
            android:id="@+id/toolbarContainer">

            <include
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                layout="@layout/toolbar" />

            <FrameLayout
                android:id="@+id/content_frame"
                android:layout_width="wrap_content"
                android:layout_height="match_parent" />
        </LinearLayout>``

and this is layout fragment:

``<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bg_app"
    android:orientation="vertical">

    <com.astuetz.PagerSlidingTabStrip
        android:id="@+id/tabs"
        android:layout_height="@dimen/tabsHeight"
        android:layout_width="fill_parent"
        app:pstsIndicatorColor="@color/primary"
        app:pstsUnderlineColor="@color/grey"
        app:pstsTabSwitch="true"
        app:pstsActivateTextColor="#FF666666"
        app:pstsDeactivateTextColor="#FFAAAAAA"
        app:pstsTabPaddingLeftRight="14dip"
        android:background="@color/background_material_light" />

    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />

</LinearLayout>``

this is a child layout viewpager :

``<com.ad.xx.utils.GeneralSwipeRefreshLayout
        android:id="@+id/swipe_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
            <android.support.v7.widget.RecyclerView
                android:id="@+id/grid_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:clipToPadding="false"
                />
    </com.ad.xx.utils.GeneralSwipeRefreshLayout>``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant