最近项目中需要实现一个新闻资讯页,但是要求标签上面有轮播图,而且要支持刷新和加载,标签页要滑动到顶部固定
想必大家对Coordinayout 和AppbarLayout都比较熟悉了,这里我就不介绍了
我们这里要解决的问题是滑动刷新和加载的手势冲突
这里先上效果图
布局如下,分四个模块,
SwipeRefresh
Coordinayout
AppBarLayout
Indicator
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_width="match_parent" >
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:title="咨询"
app:titleTextColor="@color/white"
android:background="@color/color_gold_text"
android:layout_width="match_parent"
android:layout_height="@dimen/action_bar_size"/>
<com.coordinayout.tgy.myapplication.view.SwipeLayout
android:id="@+id/swipe_layout"
android:layout_width="match_parent"
app:load_more_enabled="false"
android:layout_height="match_parent">
<and