Andorid 刷新样式一
生活随笔
收集整理的這篇文章主要介紹了
Andorid 刷新样式一
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、Gradle中的Build.gradle依賴項目
compile 'com.github.moduth:blockcanary-android:1.1.0'debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'//inspection GradleCompatiblecompile 'com.android.support:design:22.2.0'compile 'com.jakewharton:butterknife:8.4.0'annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'2、app中的Build.gradle依賴管理
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'3、布局文件
<com.lcodecore.tkrefreshlayout.TwinklingRefreshLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_below="@id/home_tab_rGroup"android:id="@+id/recommend_parent"><ListViewandroid:layout_width="match_parent"android:layout_height="wrap_content"android:id="@+id/recommend"/></com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout>4、代碼
private void refresh(View view,int id){TwinklingRefreshLayout refreshLayout = (TwinklingRefreshLayout) view.findViewById(id);ProgressLayout header = new ProgressLayout(getActivity());refreshLayout.setHeaderView(header);refreshLayout.setFloatRefresh(true);refreshLayout.setOverScrollRefreshShow(false);refreshLayout.setHeaderHeight(140);refreshLayout.setMaxHeadHeight(240);refreshLayout.setOverScrollHeight(200);refreshLayout.setEnableLoadmore(false);header.setColorSchemeResources(R.color.Blue, R.color.Orange, R.color.Yellow, R.color.Green);refreshLayout.startRefresh();refreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {@Overridepublic void onRefresh(final TwinklingRefreshLayout refreshLayout) {new Handler().postDelayed(new Runnable() {@Overridepublic void run() {refreshLayout.finishRefreshing();}}, 4000);}});}?
轉載于:https://www.cnblogs.com/QQ862668193/p/8080731.html
總結
以上是生活随笔為你收集整理的Andorid 刷新样式一的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Verilog中的UDP
- 下一篇: Hbase的shell命令学习