I have this activity design, which shows a card view inside a scrollView
, But under that cardview
I need to put a listview
or recyclerview
. The problem is that I need the scroll of that list to coordinate with the main scroll. Osea that when lower in the content the cardview
will disappear and the list of the recyclerview
or listview will be crossed.
I need all the content to respond to the main scroll to show up and disappear after titlebar
, Which should I change or redesign?
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
app:cardElevation="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/post_coordinator"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/post_bg"
android:layout_width="match_parent"
android:layout_height="150dp"
android:scaleType="fitXY"
android:src="@drawable/default_profile" />
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fabSize="normal"
android:src="@drawable/ic_hot_black"
app:layout_anchorGravity="bottom"
android:layout_marginLeft="16dp"
app:layout_anchor="@id/post_bg"
android:tint="#FFF"
/>
<com.mikhaellopez.circularimageview.CircularImageView
android:layout_width="100dp"
android:layout_height="100dp"
app:layout_anchor="@id/post_bg"
app:layout_anchorGravity="center_horizontal|bottom"
android:src="@drawable/profile"
app:civ_border_color="#FFF"
app:civ_border_width="3dp"
/>
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fabSize="normal"
android:src="@drawable/ic_hot_black"
app:layout_anchorGravity="bottom|end"
android:layout_marginRight="16dp"
app:layout_anchor="@id/post_bg"
android:tint="#FFF"
/>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_marginTop="205dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingBottom="50dp"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Prepare your Anus Cersei Lanister, You Gonna Die"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Large"
android:textColor="#2d2d2d"
android:textAlignment="center"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:text="@string/emilia"
android:textColor="@color/secondary_text"
android:layout_marginTop="10dp"
/>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
</android.support.v7.widget.CardView>
<ListView
android:id="@+id/post_comments"
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
</ListView>
</LinearLayout>
</ScrollView>