Help to figure out how to do this: There is a list of something, for example, news and at the top of this list there is a picture, which if I make a swipe down, it will increase and a new batch of news will load. Tell me how to make the increase itself when svaype down, I can not think of anything. In the pictures, what I need approximately


UPD:
Thanks pavlofff for the link. But I can't do SwipeRefreshLayout with StretchLayout . I tried many races, but the error. Here is my xml
<menuobject.StretchLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/swipe" android:layout_width="wrap_content" android:layout_height="match_parent" > <ImageView android:id="@+id/menuImageI" android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="centerCrop" /> <RelativeLayout android:id="@+id/front_view" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#f1f1f1" android:orientation="vertical" > <ListView android:id="@+id/listCategoryMenu" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scrollbars="vertical" /> </RelativeLayout> </android.support.v4.widget.SwipeRefreshLayout> </menuobject.StretchLayout> In the StretchLayout class StretchLayout changed the lines:
mStretchView = getChildAt(0); mFrontView = getChildAt(1); on
mStretchView = getChildAt(1); mFrontView = getChildAt(2); And errors:
06-09 23:33:02.597: E/AndroidRuntime(20015): FATAL EXCEPTION: main 06-09 23:33:02.597: E/AndroidRuntime(20015): java.lang.NullPointerException 06-09 23:33:02.597: E/AndroidRuntime(20015): at menuobject.StretchLayout.onLayout(StretchLayout.java:68) 06-09 23:33:02.597: E/AndroidRuntime(20015): at android.view.View.layout(View.java:11315) 06-09 23:33:02.597: E/AndroidRuntime(20015): at android.view.ViewGroup.layout(ViewGroup.java:4314) 06-09 23:33:02.597: E/AndroidRuntime(20015): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1633) 68 line:
mMargin = mStretchView.getMeasuredHeight()*mRatio;
StretchLayoutwill notStretchLayoutI changed the answer, uncheck that it is correct, if this option does not suit you. - pavlofff