<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>

          DoingDaily多元日?qǐng)?bào)資訊閱讀客戶端

          聯(lián)合創(chuàng)作 · 2023-09-29 15:22

          多元化閱讀+深度閱讀,為用戶提供有價(jià)值的信息流,這是“多元日?qǐng)?bào)”的定位和理念,產(chǎn)品從0到1的過程,學(xué)習(xí)很很多,收獲了很多,如無意外地將會(huì)持續(xù)維護(hù)下去,未來的日子會(huì)增加一些有意思的功能,敬請(qǐng)期待。

          特征

          1、Material Design設(shè)計(jì)風(fēng)格

          Toolbar、Snackbar、RecycleView、SwipeRefreshLayout、Activity跳轉(zhuǎn)動(dòng)畫

          2、MVP架構(gòu)+單Activity多Fragment模式

          參考Googole MVP Demo加上自己的一些思考,搭建了一個(gè)屬于自己的項(xiàng)目架構(gòu),雖然不一定很準(zhǔn)確無誤,但起碼是我目前水平所能做到比較滿意的了

          項(xiàng)目結(jié)構(gòu)如下所示:

          • application :自定義的全局application類

          • commom :公共類庫

            • constants :常量類

            • data : 數(shù)據(jù)源,包括本地和遠(yuǎn)程

            • network :網(wǎng)絡(luò)請(qǐng)求封裝,使用Retrofit+rxJava

            • share :分享管理類

            • utlis :常用工具類

            • widgets :自定義的View,如TabLayout、RowView

          • framework :全局框架,使用時(shí)必須繼承相關(guān)基類,如BaseActivity、BaseFragment、RxBus

          • module :業(yè)務(wù)邏輯層,按照相關(guān)功能劃分模塊

          • wxapi :微信分享回調(diào)所必須的集成類

          3、首頁仿知乎上下滑動(dòng)隱藏菜單欄

          滑動(dòng)隱藏頂部Toolbar這種效果網(wǎng)上大多數(shù)Demo都可以看到,但隱藏底部的Tab就需要用到自定義Behavior了,注意這個(gè)Behavior是依賴于AppBarLayout的,當(dāng)AppBarLayout里的Toolbar發(fā)生位移的時(shí)候底部的Tab也跟隨著向下隱藏,在此附上自定義的TabBehavior:

          public class TabBehavior extends  CoordinatorLayout.Behavior<View> {
              public TabBehavior(Context context, AttributeSet attrs) {
                  super(context, attrs);
              }
          
              @Override
              public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) {
                  return dependency instanceof AppBarLayout;
              }
          
              @Override
              public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) {
          
                  float translationY = Math.abs(dependency.getTop());
                  child.setTranslationY(translationY);
                  return true;
              }
          }

          使用的時(shí)候引入這個(gè)Behavior即可

          4、封裝底部Tab、常用RowView、PullRecycleView等

          底部Tab封裝成TabLayout,添加一個(gè)Tab幾行代碼搞定:

                  ArrayList<TabLayout.Tab> tabs = new ArrayList<>();
                  tabs.add(new TabLayout.Tab(R.drawable.ic_bottomtabbar_news, R.string.tab_news, NewsFragment.class));
                  tabs.add(new TabLayout.Tab(R.drawable.ic_bottomtabbar_wechat, R.string.tab_wechat, WechatFragment.class));
                  tabs.add(new TabLayout.Tab(R.drawable.ic_bottomtabbar_about, R.string.tab_about, AboutFragment.class));
                  mTabLayout.setUpData(tabs, this);
                  mTabLayout.setCurrentTab(0);

          5、集成第三方:社會(huì)化分享、檢測(cè)更新、埋點(diǎn)統(tǒng)計(jì)

          主要是用到了友盟社會(huì)化分享,Bugly異常上報(bào)與應(yīng)用升級(jí),LeanCloud用戶反饋這些SDK,基本沒有什么大的技術(shù)含量,照著文檔集成就Ok了

          Banner

           
          瀏覽 38
          點(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>
                  天天干天天爱av 天天干天天骑AV 天天干天天色免费 | 久久艹免费视频 | 中文字幕日韩欧美在线 | 国产一级无码乳液 | 日韩婷婷 |