list_header.xml 2.27 KB
<?xml version="1.0" encoding="utf-8"?>
<com.ivt.plus.widget.PullToRefreshHeaderView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@color/config_background_color"
    android:orientation="horizontal">
    <!--
        gravity="bottom" is important, which ensures that
        the header view when shown, has an effect of being pulled from the bottom

        The following redundant RelativeLayouts are also necessary, which ensure that
        when the header view is being pulled(height is being increased), the ImageViews
        and TextViews inside will always remain the original height(not squeezed)
    -->
    <LinearLayout
        android:id="@+id/vg_header_container"
        android:layout_width="fill_parent"
        android:layout_height="@dimen/overscroll_listview_header_height"
        android:gravity="bottom">

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="@dimen/overscroll_listview_header_height"
            android:gravity="center">

            <ImageView
                android:id="@+id/iv_down_arrow"
                android:layout_width="17dp"
                android:layout_height="17dp"
                android:layout_centerVertical="true"
                android:contentDescription="@null"
                android:src="@drawable/overscroll_listview_arrow" />

            <ProgressBar
                android:id="@+id/pb_refreshing"
                style="?android:attr/progressBarStyleLarge"
                android:layout_width="32dp"
                android:layout_height="32dp"
                android:layout_centerVertical="true"
                android:indeterminate="true"
                android:visibility="gone" />

            <TextView
                android:id="@+id/tv_refresh"
                android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:layout_marginLeft="15dip"
                android:gravity="center"
                android:minWidth="120dip"
                android:textColor="@color/text_a9"
                android:textSize="14sp" />
        </RelativeLayout>
    </LinearLayout>
</com.ivt.plus.widget.PullToRefreshHeaderView>