I am using an ObservableScrollView
as the parent layout and i am able to scroll the content depending on how i scroll the Parent(similar to Google I/O 2014 app). Everything was working as expected until i added the Tabhost with Viewpager
as a child of ObservableScrollView
. Now I am able to scroll the contents of Viewpager but not the Parent Scrollview
. The Problem I think is with the focus. How can i make the Parent ObservableScrollView
Scrollable along with Viewpager and Tabhost inside?
Thanks.
<com.rfit.views.ObservableScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/WhiteSmoke"
android:fillViewport="true"
android:overScrollMode="never">
<FrameLayout
android:id="@+id/scroll_view_child"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false">
<!-- Background photo -->
<FrameLayout
android:id="@+id/session_photo_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="@drawable/photo_banner_scrim">
<ImageView
android:id="@+id/session_photo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/LightGrey"
android:scaleType="centerCrop" />
</FrameLayout>
<LinearLayout
android:id="@+id/details_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/WhiteSmoke"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingLeft="@dimen/keyline_1"
android:paddingRight="@dimen/keyline_1"
android:paddingTop="16dp">
<TabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TabWidget
android:id="@android:id/tabs"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0">
</FrameLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom" />
</LinearLayout>
</TabHost>
</LinearLayout>
<!-- Title/subtitle bar (floating; position determined at run time as the content view scrolls) -->
<FrameLayout
android:id="@+id/header_session"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false">
<!-- height assigned dynamically -->
<View
android:id="@+id/header_background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/revofit_eat" />
<LinearLayout
android:id="@+id/header_session_contents"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/revofit_eat"
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingLeft="@dimen/keyline_2_session_detail"
android:paddingRight="@dimen/keyline_1"
android:paddingTop="16dp">
<!-- Session title -->
<TextView
android:id="@+id/session_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginBottom="0dp"
android:ellipsize="end"
android:fontFamily="@string/font_fontFamily_medium"
android:lineSpacingMultiplier="1.1"
android:maxLines="2"
android:text="Bacon ipsum dolor sit amet chicken beef ribs kielbasa, tail bacon porchetta ground round voluptate sed aute shank meatball. Swine in andouille, ex esse duis fatback laboris ullamco frankfurter landjaeger. Beef ribs excepteur filet mignon meatloaf, jerky sausage esse beef meatball strip steak sint sunt et turducken bresaola. "
android:textColor="@color/White"
android:textSize="@dimen/text_size_large" />
<!-- Session subtitle -->
<TextView
android:id="@+id/session_subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:ellipsize="end"
android:maxLines="2"
android:text="Dolor occaecat hamburger"
android:textColor="@color/wallet_hint_foreground_holo_dark"
android:textSize="16sp" />
</LinearLayout>
<View
android:id="@+id/header_shadow"
android:layout_width="match_parent"
android:layout_height="6dp"
android:layout_gravity="bottom"
android:layout_marginBottom="-6dp"
android:background="@drawable/bottom_shadow" />
</FrameLayout>
<!-- FAB -->
<include layout="@layout/include_add_schedule_fab" />
</FrameLayout></com.rfit.views.ObservableScrollView>