ScrollableLayout

本文介绍了一个名为 ScrollableLayout 的 Android 组件,该组件支持共同头部+ViewPager+ListView、RecyclerView、ScrollView 和 WebView 的组合使用,并提供了下拉刷新功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

项目地址:https://github.com/cpoopc/ScrollableLayout

简介:共同头部+ViewPager+ListView http://blog.youkuaiyun.com/w7822938/article/details/47173047

共同头部+ViewPager+ListView(AdapterView)|RecyclerView|ScrollView|WebView
blog:http://blog.youkuaiyun.com/w7822938/article/details/47173047
安装包放在/demo-apk,可以直接安装看效果

UPDATE NOTE:

2015/12/18: 添加对 WebView 的支持.
2015/12/11: 添加 canPtr()方法,支持下拉刷新(demo 以https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh为例.
2015/8/31:
添加对 RecyclerView 的支持.

Usage

dependencies {
    compile 'com.github.cpoopc:scrollablelayoutlib:1.0.1' // 目前只发布到 jcenter
}

1.xml

<com.cpoopc.scrollablelayoutlib.ScrollableLayout
        android:id="@+id/scrollableLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
<-- header -->
  <-- header example -->
        <RelativeLayout
            android:id="@+id/rl_head"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#cdcdcd">
        </RelativeLayout>
  <-- header example -->

<-- content View -->
  <-- content View example -->
        <com.astuetz.PagerSlidingTabStrip
            android:id="@+id/pagerStrip"
            android:layout_width="match_parent"
            android:layout_height="@dimen/tab_height"
            android:layout_alignParentBottom="true" />
        <android.support.v4.view.ViewPager
            android:id="@+id/viewpager"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
  <-- content View example -->

    </com.cpoopc.scrollablelayoutlib.ScrollableLayout>

2.xxFragment|xxView|.. implements ScrollableHelper.ScrollableContainer

@Override
    public View getScrollableView() {
        return scrollView;
    }

3.设置当前 container

mScrollLayout.getHelper().setCurrentScrollableContainer(scrollableContainer)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值