0

I have a bit of a predicament.

My Layout is currently this:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="@color/white"
              android:orientation="vertical">


  <android.support.v4.widget.NestedScrollView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:isScrollContainer="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

      <TextView
          android:id="@+id/item_shipping_shipping_description"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="start|left"
          android:padding="@dimen/margin_16"/>


      <View
          android:id="@+id/line43"
          android:layout_width="match_parent"
          android:layout_height="@dimen/line_height"
          android:background="@color/light_gray"/>
    </LinearLayout>

  </android.support.v4.widget.NestedScrollView>

  <android.support.v7.widget.RecyclerView
      android:id="@+id/item_shipping_fragment_recyclerview"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@color/white"
      android:isScrollContainer="true"/>
</LinearLayout>

The TextView is dynamic content set by the server and it can be really long sometimes.

The problem I am having is the TextView can take up the whole screen. This XML is a fragment that is in a TabLayout with a collapsable toolbar. So when I scroll the content I would like the TextView to scroll out the screen, if this is possible. I tried to embed the Textview in a scrollView but this doesn't work as you see about?

Got any ideas how I can still have the CollapsableToolbar collapse as well as scroll the Textview out the screen to reveal the RecyclerView?

Thank you

Stillie
  • 2,647
  • 6
  • 28
  • 50

1 Answers1

0
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="@color/white"
              android:orientation="vertical">




    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
 <android.support.v4.widget.NestedScrollView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:isScrollContainer="true">
      <TextView
          android:id="@+id/item_shipping_shipping_description"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="start|left"
          android:padding="@dimen/margin_16"/>
</android.support.v4.widget.NestedScrollView>

      <View
          android:id="@+id/line43"
          android:layout_width="match_parent"
          android:layout_height="@dimen/line_height"
          android:background="@color/light_gray"/>
    </LinearLayout>



  <android.support.v7.widget.RecyclerView
      android:id="@+id/item_shipping_fragment_recyclerview"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@color/white"
      android:isScrollContainer="true"/>
</LinearLayout>
Rohit Heera
  • 2,709
  • 2
  • 21
  • 31
  • Thank you for this, but this didnt work? the TextView doesnt slide under the collapsing toolbar? Im at a loss as to why this doesnt work – Stillie Feb 23 '16 at 06:22
  • In the fragment? because i have a coordinatorlayout in the Activity that is holding that TabLayout with Fragments? – Stillie Feb 23 '16 at 06:43