I am interested in doing a XML
to make the Parallax effect with the following items, using a third-party library called ObservableScrollView :
<ImageView/>
<CardView/> //ImageView y CardView creo que deben de ir en un mismo LinearLayout, quiero que ListView tape las dos cuando haga el 'Parallax'
<ListView/> o <ObservableScrollListView/> //Nose cual necesito
QUESTION : My idea is that the ListView
is hiding, as I drag up, the ImageView
and the CardView
, as simple as that.
The problem I have is that I do not use Toolbar
in the whole application since I'm not interested, that's why I turn to this library, I'm trying to do the effect in many ways, but the CardView
I can not manipulate it well because it overlaps the ImageView
or problems like that, I have also got uncoordinated results, also adding a height to ListView
, it is seen that limits the number of cells that I can see and if for example I do not put size (to the ListView), I only get a cell size, which I can scroll and see all the content.
I have continued trying other possibilities but wrong, I have been testing instead of ListView
,% ObservableScrollListView
, it may be something I need, I'm not sure ... I leave the code below:
XML
<?xml version="1.0" encoding="utf-8"?>
<com.github.ksoichiro.android.observablescrollview.ObservableScrollView
android:id="@+id/observable_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:contentDescription="@string/app_name" />
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/cv"
card_view:cardBackgroundColor="@color/cardview_shadow_start_color"
android:layout_width="match_parent"
android:layout_height="100dp"
android:fitsSystemWindows="true"
android:isScrollContainer="true"
card_view:cardCornerRadius="@dimen/cardview_default_radius"
card_view:cardElevation="@dimen/cardview_default_elevation"
card_view:cardUseCompatPadding="true">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_marginTop="20dp"
android:layout_marginBottom="12dp"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="12dp"
android:gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin">
<TextView
android:id="@+id/dv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.v7.widget.CardView>
<ListView
android:focusableInTouchMode="false"
android:drawSelectorOnTop="true"
android:background="@color/black"
android:layout_width="wrap_content"
android:layout_height="500dp"
android:id="@+id/listViewId"
android:fastScrollEnabled="true"/>
</LinearLayout>
</com.github.ksoichiro.android.observablescrollview.ObservableScrollView>