<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Android實(shí)現(xiàn)下拉刷新水滴動(dòng)畫(huà)效果

          共 1828字,需瀏覽 4分鐘

           ·

          2022-01-04 11:26

          今天給大家介紹的是比較久之前的,第三方下拉刷新的水滴動(dòng)畫(huà)效果,具體功能就是下拉后產(chǎn)生一個(gè)水滴的效果,先看效果圖:



          由于是第三方框架,使用起來(lái)也比較方便簡(jiǎn)單,主要就是集成過(guò)程啦,大家也可以下載原作者的源碼研究一下,這里就簡(jiǎn)單介紹使用流程啦。


          1、在你module的build.gradle中添加依賴(lài)

          dependencies {    compile 'com.github.recruit-lifestyle:WaveSwipeRefreshLayout:1.6'   }
          repositories { maven { url "https://jitpack.io" }}


          2、在xml中用WaveSwipeRefreshLayout包裹你的控件

                    android:id="@+id/wave_swipe"        android:layout_width="match_parent"        android:layout_height="match_parent">
          android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="match_parent" />


          3、在Java代碼中使用

          public class MainActivity extends AppCompatActivity {
          @BindView(R.id.wave_swipe) WaveSwipeRefreshLayout mWaveSwipe;
          Handler mHandler = new Handler();
          @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); //設(shè)置小圓圈顏色 mWaveSwipe.setColorSchemeColors(Color.WHITE, Color.YELLOW,Color.RED,Color.GREEN); //設(shè)置背景色 mWaveSwipe.setWaveColor(Color.argb(255,63,81,181)); //設(shè)置刷新監(jiān)聽(tīng) mWaveSwipe.setOnRefreshListener(new WaveSwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { new Thread() { @Override public void run() { SystemClock.sleep(3000); //do something in background
          mHandler.post(new Runnable() { //stop refreshing @Override public void run() { //... mWaveSwipe.setRefreshing(false);//調(diào)用這個(gè)方法結(jié)束刷新小圓圈的顯示 } });
          } }.start();
          }????????});????}?}


          源碼地址:

          https://github.com/recruit-lifestyle/WaveSwipeRefreshLayout


          到這里就結(jié)束啦。

          瀏覽 127
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  亚洲一级片免费看 | 老司机天天综合网 | 大鸡巴操美女视频 | 中文字幕一区二区三区四区五区 | 日本视频一区二区三区 |