Prechádzať zdrojové kódy

无数据与无网络分离

zengjiebin 7 rokov pred
rodič
commit
81e29a836f
33 zmenil súbory, kde vykonal 123 pridanie a 93 odobranie
  1. 2 1
      app/src/main/java/com/kfzs/duanduan/fragment/AbsFgtMyMoney.java
  2. 2 1
      app/src/main/java/com/kfzs/duanduan/fragment/FgtCreditCardProgressQuery.java
  3. 2 1
      app/src/main/java/com/kfzs/duanduan/fragment/FgtCreditCardTaskList.java
  4. 1 2
      app/src/main/java/com/kfzs/duanduan/fragment/FgtFindChild.java
  5. 3 2
      app/src/main/java/com/kfzs/duanduan/fragment/FgtFriendExtractPage.java
  6. 3 2
      app/src/main/java/com/kfzs/duanduan/fragment/FgtSignRankings.java
  7. 1 2
      app/src/main/java/com/sheep/gamegroup/di/modules/NetModule.java
  8. 26 6
      app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java
  9. 1 2
      app/src/main/java/com/sheep/gamegroup/view/activity/ActFindInformation.java
  10. 3 3
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGameAccount.java
  11. 1 2
      app/src/main/java/com/sheep/gamegroup/view/activity/ActReservation.java
  12. 2 2
      app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchGame.java
  13. 3 2
      app/src/main/java/com/sheep/gamegroup/view/activity/GameTaskOrderListAct.java
  14. 2 1
      app/src/main/java/com/sheep/gamegroup/view/activity/SignRecordAct.java
  15. 13 5
      app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAct.java
  16. 2 2
      app/src/main/java/com/sheep/gamegroup/view/activity/TaskListAct.java
  17. 2 2
      app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalListAct.java
  18. 2 1
      app/src/main/java/com/sheep/gamegroup/view/dialog/DialogOrienteeringDetails.java
  19. 1 2
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGameMakeMoney.java
  20. BIN
      app/src/main/res/drawable-hdpi/wushuju.webp
  21. BIN
      app/src/main/res/drawable-xhdpi/wushuju.webp
  22. BIN
      app/src/main/res/drawable-xxhdpi/wushuju.webp
  23. 3 3
      app/src/main/res/layout/empty_view.xml
  24. 3 3
      app/src/main/res/layout/empty_view_bottom.xml
  25. 3 3
      app/src/main/res/layout/fgt_sign_rankings.xml
  26. 3 3
      app/src/main/res/layout/friend_list_empty.xml
  27. 3 3
      app/src/main/res/layout/list_has_empty.xml
  28. 3 3
      app/src/main/res/layout/sign_record_layout.xml
  29. 27 34
      app/src/main/res/layout/try_makemoney_item_recommend.xml
  30. BIN
      app/src/main/res/mipmap-xxhdpi/wushuju.webp
  31. BIN
      app/src/main/res/mipmap-xxhdpi/wushuju_net_error.webp
  32. 4 0
      app/src/main/res/values/dd_styles.xml
  33. 2 0
      app/src/main/res/values/str_network_strings.xml

+ 2 - 1
app/src/main/java/com/kfzs/duanduan/fragment/AbsFgtMyMoney.java

@@ -12,6 +12,7 @@ import com.googlecode.protobuf.format.util.TextUtils;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.ILog;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.TimeUtil;
 import com.sheep.gamegroup.view.adapter.ArrayAdapter;
@@ -170,7 +171,7 @@ public abstract class AbsFgtMyMoney extends BaseFragment {
     protected abstract Observable<BaseMessage> initObservable(int page, int per_page);
 
     private void notifyDataSetChanged() {
-        empty_view.setVisibility(list.isEmpty() ? View.VISIBLE : View.INVISIBLE);
+        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
         adapter.notifyDataSetChanged();
         swipe_container.setRefreshing(false);
         swipe_container.setLoading(false);

+ 2 - 1
app/src/main/java/com/kfzs/duanduan/fragment/FgtCreditCardProgressQuery.java

@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSON;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.CreditCardProgressQuery;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.view.adapter.CreditCardProgressQueryAdp;
 import com.sheep.gamegroup.view.customview.RefreshLayout;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
@@ -81,7 +82,7 @@ public class FgtCreditCardProgressQuery extends BaseFragment {
     }
 
     private void notifyDataSetChanged() {
-        empty_view.setVisibility(list.isEmpty() ? View.VISIBLE : View.INVISIBLE);
+        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
         adapter.notifyDataSetChanged();
         swipe_container.setRefreshing(false);
     }

+ 2 - 1
app/src/main/java/com/kfzs/duanduan/fragment/FgtCreditCardTaskList.java

@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSON;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.TaskReleaseEty;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.view.adapter.CreditCardTaskAdp;
 import com.sheep.gamegroup.view.customview.RefreshLayout;
@@ -99,7 +100,7 @@ public class FgtCreditCardTaskList extends BaseFragment {
                         });
     }
     private void notifyDataSetChanged() {
-        empty_view.setVisibility(list.isEmpty() ? View.VISIBLE : View.INVISIBLE);
+        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
         adapter.notifyDataSetChanged();
         swipe_container.setRefreshing(false);
     }

+ 1 - 2
app/src/main/java/com/kfzs/duanduan/fragment/FgtFindChild.java

@@ -306,8 +306,7 @@ public class FgtFindChild extends BaseCompatFragment {
     }
 
     private void notifyDataSetChanged(){
-        if(list.isEmpty())
-            empty_view.setVisibility(View.VISIBLE);
+        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
         refresh.setRefreshing(false);
         view_list.getAdapter().notifyDataSetChanged();
     }

+ 3 - 2
app/src/main/java/com/kfzs/duanduan/fragment/FgtFriendExtractPage.java

@@ -9,6 +9,7 @@ import android.widget.TextView;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.Friend;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.TimeUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.activity.AskGetMoneyAct;
@@ -75,7 +76,7 @@ public class FgtFriendExtractPage extends BaseFragment {
             }
         }
         if(list.isEmpty()){
-            download_mgr_empty_view.setVisibility(View.VISIBLE);
+            CommonUtil.getInstance().updateEmptyView(download_mgr_empty_view, true);
         } else {
             download_mgr_empty_view.setVisibility(View.GONE);
         }
@@ -111,7 +112,7 @@ public class FgtFriendExtractPage extends BaseFragment {
                     public void onError(BaseMessage baseMessage) {
                         G.showToast(baseMessage);
                         if(list.isEmpty()){
-                            download_mgr_empty_view.setVisibility(View.VISIBLE);
+                            CommonUtil.getInstance().updateEmptyView(download_mgr_empty_view, true);
                         } else {
                             download_mgr_empty_view.setVisibility(View.GONE);
                         }

+ 3 - 2
app/src/main/java/com/kfzs/duanduan/fragment/FgtSignRankings.java

@@ -22,6 +22,7 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.PunchEntity;
 import com.sheep.gamegroup.presenter.SignRankingsContract;
 import com.sheep.gamegroup.presenter.SignRankingsPresenter;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
@@ -112,7 +113,7 @@ public class FgtSignRankings extends BaseCompatFragment implements SignRankingsC
 
         if(ListUtil.isEmpty(list)){
             Log.d("Dream","empty type:"+type);
-            empty_view.setVisibility(View.VISIBLE);
+            CommonUtil.getInstance().updateEmptyView(empty_view, true);
             main_content.setVisibility(View.GONE);
         }else{
             Log.d("Dream","empty type:"+type);
@@ -154,7 +155,7 @@ public class FgtSignRankings extends BaseCompatFragment implements SignRankingsC
 
     @Override
     public void failPunch(BaseMessage o) {
-        empty_view.setVisibility(View.VISIBLE);
+        CommonUtil.getInstance().updateEmptyView(empty_view, true);
         main_content.setVisibility(View.GONE);
         G.showToast(o.getMsg());
     }

+ 1 - 2
app/src/main/java/com/sheep/gamegroup/di/modules/NetModule.java

@@ -34,8 +34,7 @@ public class NetModule {
         LogInterceptor loggingInterceptor = new LogInterceptor(BuildConfig.XXTEA_ENCRYPT);
         loggingInterceptor.setLevel(TestUtil.isSheep() ? LogInterceptor.ELevel.NONE : LogInterceptor.ELevel.BODY);
         OkHttpClient okhttpClient = new OkHttpClient.Builder()
-                .connectTimeout(30, TimeUnit.SECONDS)
-                .connectTimeout(20, TimeUnit.SECONDS)
+                .connectTimeout(5, TimeUnit.SECONDS)
                 .readTimeout(20,TimeUnit.SECONDS)
                 .addInterceptor(new AddPuplicParameIntercept())
                 .addInterceptor(new CacheInterceptor())

+ 26 - 6
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -1,6 +1,5 @@
 package com.sheep.gamegroup.util;
 
-import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.content.Context;
 import android.graphics.Color;
@@ -14,10 +13,10 @@ import android.text.TextUtils;
 import android.util.Log;
 import android.view.View;
 import android.view.ViewTreeObserver;
+import android.widget.ImageView;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alipay.sdk.app.PayTask;
 import com.arialyy.aria.core.Aria;
@@ -33,12 +32,8 @@ import com.sheep.gamegroup.model.api.BaseMessageConverter;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.GameAccountEntity;
-import com.sheep.gamegroup.model.entity.GamePayList;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
-import com.sheep.gamegroup.model.entity.RecyleObj;
-import com.sheep.gamegroup.model.entity.RecyleType;
 import com.sheep.gamegroup.model.entity.RequestParameEty;
-import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
 import com.sheep.gamegroup.model.entity.TaskChild;
 import com.sheep.gamegroup.model.entity.TaskDescEntity;
 import com.sheep.gamegroup.model.entity.TaskEty;
@@ -1426,4 +1421,29 @@ public class CommonUtil {
         ACache aCache = ACache.get(SheepApp.getInstance());
         return NumberFormatUtils.parseLong(aCache.getAsString(key + "saveTime"));
     }
+    //设置无数据显示
+    public void updateEmptyView(View empty_view, boolean showEmpty) {
+        if(showEmpty) {
+            empty_view.setVisibility(View.VISIBLE);
+            ImageView img_list_empty = empty_view.findViewById(R.id.img_list_empty);
+            if (img_list_empty == null) {
+                if (BuildConfig.DEBUG) G.showToast("无数据layout中找不到ImageView");
+                return;
+            }
+            TextView txt_list_empty = empty_view.findViewById(R.id.txt_list_empty);
+            if (txt_list_empty == null) {
+                if (BuildConfig.DEBUG) G.showToast("无数据layout中找不到TextView");
+                return;
+            }
+            if (NetUtil.isConnected(SheepApp.getInstance())) {
+                img_list_empty.setImageResource(R.mipmap.wushuju);
+                txt_list_empty.setText(R.string.wushuju);
+            } else {
+                img_list_empty.setImageResource(R.mipmap.wushuju_net_error);
+                txt_list_empty.setText(R.string.wushuju_net_error);
+            }
+        } else {
+            empty_view.setVisibility(View.GONE);
+        }
+    }
 }

+ 1 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/ActFindInformation.java

@@ -271,8 +271,7 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
     private FindItem findItem;
 
     private void notifyDataSetChanged(){
-        if(list.isEmpty())
-            empty_view.setVisibility(View.VISIBLE);
+        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
         refresh.setRefreshing(false);
         view_list.getAdapter().notifyDataSetChanged();
     }

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/view/activity/ActGameAccount.java

@@ -14,6 +14,7 @@ import com.sheep.gamegroup.model.entity.GameAccountSuper;
 import com.sheep.gamegroup.model.entity.RecyleObj;
 import com.sheep.gamegroup.model.entity.RecyleType;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.adapter.AdpGameAccount;
@@ -172,12 +173,11 @@ public class ActGameAccount extends BaseActivity {
         adpGameAccount.notifyDataSetChanged();
         refresh.setRefreshing(false);
         if(gameAccountSuper == null){
-            empty_view.setVisibility(View.VISIBLE);
+            CommonUtil.getInstance().updateEmptyView(empty_view, true);
             return;
         }
         if(ListUtil.isEmpty(gameAccountSuper.getPlatform()) && ListUtil.isEmpty(gameAccountSuper.getTengxun()) && ListUtil.isEmpty(gameAccountSuper.getXiaomi())){
-
-            empty_view.setVisibility(View.VISIBLE);
+            CommonUtil.getInstance().updateEmptyView(empty_view, true);
         }else {
             empty_view.setVisibility(View.GONE);
         }

+ 1 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/ActReservation.java

@@ -259,8 +259,7 @@ public class ActReservation extends BaseActivity {
 
 
     private void notifyDataSetChanged() {
-        if (list.isEmpty())
-            empty_view.setVisibility(View.VISIBLE);
+        CommonUtil.getInstance().updateEmptyView(empty_view, list.isEmpty());
         refresh.setRefreshing(false);
         view_list.getAdapter().notifyDataSetChanged();
     }

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchGame.java

@@ -242,7 +242,7 @@ public class ActSearchGame extends BaseActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        download_mgr_empty_view.setVisibility(View.VISIBLE);
+                        CommonUtil.getInstance().updateEmptyView(download_mgr_empty_view, true);
                         search_game_hot.setVisibility(View.GONE);
                         search_game_list.setVisibility(View.GONE);
                     }
@@ -314,7 +314,7 @@ public class ActSearchGame extends BaseActivity {
         adapter.notifyDataSetChanged();
         if (list.isEmpty()) {
             if(hotList.isEmpty()) {
-                download_mgr_empty_view.setVisibility(View.VISIBLE);
+                CommonUtil.getInstance().updateEmptyView(download_mgr_empty_view, true);
             } else {
                 search_game_hot.setVisibility(View.VISIBLE);
             }

+ 3 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/GameTaskOrderListAct.java

@@ -10,6 +10,8 @@ import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GameTaskOrderEnty;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.NetUtil;
 import com.sheep.gamegroup.view.adapter.AdpGameTaskOrderList;
 import com.sheep.gamegroup.view.customview.RefreshLayout;
 import com.sheep.jiuyan.samllsheep.R;
@@ -127,8 +129,7 @@ public class GameTaskOrderListAct extends BaseActivity {
                 });
     }
     private void notifyDataSetChanged(){
-        if(listData.isEmpty())
-            empty_view.setVisibility(View.VISIBLE);
+        CommonUtil.getInstance().updateEmptyView(empty_view, listData.isEmpty());
         hideProgress();
         swipe_container.setRefreshing(false);
         adp.notifyDataSetChanged();

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/SignRecordAct.java

@@ -17,6 +17,7 @@ import com.sheep.gamegroup.model.entity.PunchLogEntity;
 import com.sheep.gamegroup.model.entity.StatisticsEntity;
 import com.sheep.gamegroup.presenter.SignRecordContract;
 import com.sheep.gamegroup.presenter.SignRecordPresenter;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.MathUtil;
@@ -137,7 +138,7 @@ public class SignRecordAct extends BaseActivity implements SignRecordContract.Vi
         if(index == 3){
 
             if(ListUtil.isEmpty(mDatas)){
-                empty_view.setVisibility(View.VISIBLE);
+                CommonUtil.getInstance().updateEmptyView(empty_view, true);
                 recyclerview.setVisibility(View.GONE);
             }else{
                 empty_view.setVisibility(View.GONE);

+ 13 - 5
app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAct.java

@@ -771,7 +771,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
         hideProgress();
         G.showToast(baseMessage.getMsg() + "");
         isGetTaskDesc = false;
-        empty_view.setVisibility(View.VISIBLE);
+        CommonUtil.getInstance().updateEmptyView(empty_view, true);
     }
 
 
@@ -962,21 +962,29 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
         if (task.getKey().equals(taskEty.getDownload_link())) {
             //在这里处理任务完成的状态
             btnTaskItem.setText(CommonUtil.START_INSTALL);
-            onResume();
+            freshData();
         }
     }
 
     private boolean isGetTaskDesc = false;
 
-    @Override
-    protected void onResume() {
-        super.onResume();
+    public void freshData() {
         if (taskId != -1 && !isGetTaskDesc && !isFresh) {
             isGetTaskDesc = true;
             accepteTaskDetail(taskId);
         }
     }
 
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (taskReleaseEty == null){
+            freshData();
+        } else {
+            initWigget();
+        }
+    }
+
     /**
      * 子任务模块显示
      */

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/TaskListAct.java

@@ -14,6 +14,7 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
 import com.sheep.gamegroup.presenter.TaskListContract;
 import com.sheep.gamegroup.presenter.TaskListPresenter;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.adapter.TaskListItemAdp;
@@ -138,8 +139,7 @@ public class TaskListAct extends BaseActivity implements TaskListContract.View {
         notifyDataSetChanged();
     }
     private void notifyDataSetChanged(){
-        if(etyList.isEmpty())
-            empty_view.setVisibility(View.VISIBLE);
+        CommonUtil.getInstance().updateEmptyView(empty_view, etyList.isEmpty());
         hideProgress();
         swipe_container.setRefreshing(false);
         adp.notifyDataSetChanged();

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalListAct.java

@@ -12,6 +12,7 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.WithdrawalEty;
 import com.sheep.gamegroup.presenter.WithdrawalListContract;
 import com.sheep.gamegroup.presenter.WithdrawalListPresenter;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.view.adapter.WithdrawalListAdp;
 import com.sheep.gamegroup.view.customview.RefreshLayout;
 import com.sheep.jiuyan.samllsheep.R;
@@ -131,8 +132,7 @@ public class WithdrawalListAct extends BaseActivity implements WithdrawalListCon
     }
 
     private void notifyDataSetChanged(){
-        if(etyList.isEmpty())
-            empty_view.setVisibility(View.VISIBLE);
+        CommonUtil.getInstance().updateEmptyView(empty_view, etyList.isEmpty());
         hideProgress();
         swipe_container.setRefreshing(false);
         adp.notifyDataSetChanged();

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/view/dialog/DialogOrienteeringDetails.java

@@ -16,6 +16,7 @@ import com.alibaba.fastjson.JSON;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.OrienteeringDetail;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.LogUtil;
@@ -189,7 +190,7 @@ public class DialogOrienteeringDetails {
     private void noDatanotify(){
         RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, 6*gao);
         swipe_container.setLayoutParams(layoutParams);
-        empty_view.setVisibility(View.VISIBLE);
+        CommonUtil.getInstance().updateEmptyView(empty_view, true);
         swipe_container.setRefreshing(false);
         adapter.notifyDataSetChanged();
     }

+ 1 - 2
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtGameMakeMoney.java

@@ -80,8 +80,7 @@ public class FgtGameMakeMoney extends BaseFragment implements TryMakeMoneyContra
         checkAndInitView();
         tryMakeMoneyAdp.refreshAdapter();
         if(tryMakeMoneyAdp.isEmpty() && releaseEtyLists.isEmpty() && releaseEtyListsBegin.isEmpty()){
-
-            empty_view.setVisibility(View.VISIBLE);
+            CommonUtil.getInstance().updateEmptyView(empty_view, true);
         }else {
             empty_view.setVisibility(View.GONE);
         }

BIN
app/src/main/res/drawable-hdpi/wushuju.webp


BIN
app/src/main/res/drawable-xhdpi/wushuju.webp


BIN
app/src/main/res/drawable-xxhdpi/wushuju.webp


+ 3 - 3
app/src/main/res/layout/empty_view.xml

@@ -14,16 +14,16 @@
         android:background="@color/white"
         android:gravity="center"
         android:scaleType="centerInside"
-        android:src="@drawable/wushuju"
+        android:src="@mipmap/wushuju"
         android:visibility="visible" />
 
     <TextView
         android:id="@+id/txt_list_empty"
-        style="@style/G3"
+        style="@style/style_empty_text"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_below="@id/img_list_empty"
         android:layout_centerHorizontal="true"
         android:layout_marginTop="@dimen/content_padding_big"
-        android:text="暂无数据,稍后再试。" />
+        android:text="@string/wushuju" />
 </RelativeLayout>

+ 3 - 3
app/src/main/res/layout/empty_view_bottom.xml

@@ -17,18 +17,18 @@
         android:background="@color/white"
         android:gravity="center"
         android:scaleType="centerInside"
-        android:src="@drawable/wushuju"
+        android:src="@mipmap/wushuju"
         android:visibility="visible" />
 
     <TextView
         android:id="@+id/txt_list_empty"
-        style="@style/G3"
+        style="@style/style_empty_text"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_below="@id/img_list_empty"
         android:layout_centerHorizontal="true"
         android:layout_marginTop="@dimen/content_padding_big"
-        android:text="暂无数据,稍后再试。" />
+        android:text="@string/wushuju" />
     <View
         android:layout_width="match_parent"
         android:layout_height="@dimen/dp_10"

+ 3 - 3
app/src/main/res/layout/fgt_sign_rankings.xml

@@ -21,18 +21,18 @@
             android:background="@color/white"
             android:gravity="center"
             android:scaleType="centerInside"
-            android:src="@drawable/wushuju"
+            android:src="@mipmap/wushuju"
             android:visibility="visible" />
 
         <TextView
             android:id="@+id/txt_list_empty"
-            style="@style/G3"
+            style="@style/style_empty_text"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_below="@id/img_list_empty"
             android:layout_centerHorizontal="true"
             android:layout_marginTop="@dimen/content_padding_big"
-            android:text="暂无数据,稍后再试。" />
+            android:text="@string/wushuju" />
     </RelativeLayout>
 
     <LinearLayout

+ 3 - 3
app/src/main/res/layout/friend_list_empty.xml

@@ -21,18 +21,18 @@
             android:background="@color/white"
             android:gravity="center"
             android:scaleType="centerInside"
-            android:src="@drawable/wushuju"
+            android:src="@mipmap/wushuju"
             android:visibility="visible" />
 
         <TextView
             android:id="@+id/txt_list_empty"
-            style="@style/G3"
+            style="@style/style_empty_text"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_below="@id/img_list_empty"
             android:layout_centerHorizontal="true"
             android:layout_marginTop="@dimen/content_padding_5"
-            android:text="暂无数据,稍后再试。" />
+            android:text="@string/wushuju" />
     </RelativeLayout>
     <include layout="@layout/friend_list"/>
 </LinearLayout>

+ 3 - 3
app/src/main/res/layout/list_has_empty.xml

@@ -21,18 +21,18 @@
             android:background="@color/white"
             android:gravity="center"
             android:scaleType="centerInside"
-            android:src="@drawable/wushuju"
+            android:src="@mipmap/wushuju"
             android:visibility="visible" />
 
         <TextView
             android:id="@+id/txt_list_empty"
-            style="@style/G3"
+            style="@style/style_empty_text"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_below="@id/img_list_empty"
             android:layout_centerHorizontal="true"
             android:layout_marginTop="@dimen/content_padding_big"
-            android:text="暂无数据,稍后再试。" />
+            android:text="@string/wushuju" />
     </RelativeLayout>
     <com.sheep.gamegroup.view.customview.RefreshLayout
         android:id="@+id/swipe_container"

+ 3 - 3
app/src/main/res/layout/sign_record_layout.xml

@@ -116,18 +116,18 @@
                 android:background="@color/white"
                 android:gravity="center"
                 android:scaleType="centerInside"
-                android:src="@drawable/wushuju"
+                android:src="@mipmap/wushuju"
                 android:visibility="visible" />
 
             <TextView
                 android:id="@+id/txt_list_empty"
-                style="@style/G3"
+                style="@style/style_empty_text"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_below="@id/img_list_empty"
                 android:layout_centerHorizontal="true"
                 android:layout_marginTop="@dimen/content_padding_big"
-                android:text="暂无数据,稍后再试。" />
+                android:text="@string/wushuju" />
         </RelativeLayout>
 
 

+ 27 - 34
app/src/main/res/layout/try_makemoney_item_recommend.xml

@@ -49,8 +49,7 @@
 
     <android.support.constraint.ConstraintLayout
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:clipChildren="false">
+        android:layout_height="wrap_content">
 
         <TextView
             android:id="@+id/task_type_tv"
@@ -60,36 +59,30 @@
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
 
-        <RelativeLayout
-            android:id="@+id/icon_layout"
+        <ImageView
+            android:id="@+id/item_icon_iv"
             android:layout_width="@dimen/view_size_65"
             android:layout_height="@dimen/view_size_65"
-            android:background="@drawable/sp_bg_transparent_radius_transparent"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintTop_toTopOf="parent">
+            app:layout_constraintTop_toTopOf="parent"
+            android:src="@drawable/icon_lj" />
 
-            <ImageView
-                android:id="@+id/item_icon_iv"
-                android:layout_width="@dimen/view_size_65"
-                android:layout_height="@dimen/view_size_65"
-                android:layout_alignParentBottom="true"
-                android:src="@drawable/icon_lj" />
 
-            <TextView
-                android:id="@+id/end_of_time_tv"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_alignParentBottom="true"
-                android:layout_marginBottom="-4dp"
-                android:layout_marginEnd="@dimen/content_padding_4"
-                android:layout_marginStart="@dimen/content_padding_4"
-                android:background="@drawable/shape_ash_stroke_white_solid_rectangle"
-                android:gravity="center"
-                android:lines="1"
-                android:textColor="#989898"
-                android:textSize="12sp"
-                android:visibility="gone" />
-        </RelativeLayout>
+        <TextView
+            android:id="@+id/end_of_time_tv"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="@dimen/content_padding_4"
+            android:layout_marginStart="@dimen/content_padding_4"
+            android:background="@drawable/shape_ash_stroke_white_solid_rectangle"
+            android:gravity="center"
+            android:lines="1"
+            android:textColor="#989898"
+            android:layout_marginTop="55dp"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintStart_toStartOf="@+id/item_icon_iv"
+            app:layout_constraintEnd_toEndOf="@+id/item_icon_iv"
+            android:textSize="12sp"
+            android:visibility="gone"/>
 
         <TextView
             android:id="@+id/item_money"
@@ -98,7 +91,7 @@
             android:gravity="center"
             android:text=""
             android:textColor="@color/txt_red"
-            android:textSize="20dp"
+            android:textSize="20sp"
             app:layout_constraintBottom_toBottomOf="@+id/item_name_tv"
             app:layout_constraintEnd_toEndOf="parent" />
 
@@ -114,7 +107,7 @@
             android:lines="2"
             android:text=""
             app:layout_constraintRight_toLeftOf="@+id/task_type_tv"
-            app:layout_constraintStart_toEndOf="@+id/icon_layout"
+            app:layout_constraintStart_toEndOf="@+id/item_icon_iv"
             app:layout_constraintTop_toTopOf="parent" />
 
         <TextView
@@ -147,9 +140,9 @@
             android:layout_marginEnd="@dimen/content_padding_8"
             android:layout_marginTop="@dimen/content_padding_2"
             android:orientation="horizontal"
-            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintBottom_toBottomOf="@+id/item_icon_iv"
             app:layout_constraintEnd_toStartOf="@+id/detail_task_layout"
-            app:layout_constraintStart_toEndOf="@+id/icon_layout"
+            app:layout_constraintStart_toEndOf="@+id/item_icon_iv"
             app:layout_constraintStart_toStartOf="@+id/item_name_tv"
             app:layout_constraintTop_toBottomOf="@+id/item_num_tv">
 
@@ -177,7 +170,7 @@
             android:id="@+id/detail_task_layout"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintBottom_toBottomOf="@+id/item_icon_iv"
             app:layout_constraintEnd_toEndOf="parent">
 
             <TextView
@@ -201,7 +194,7 @@
             android:layout_centerInParent="true"
             android:text="取消任务"
             android:visibility="gone"
-            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintBottom_toBottomOf="@+id/item_icon_iv"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
     </android.support.constraint.ConstraintLayout>

BIN
app/src/main/res/mipmap-xxhdpi/wushuju.webp


BIN
app/src/main/res/mipmap-xxhdpi/wushuju_net_error.webp


+ 4 - 0
app/src/main/res/values/dd_styles.xml

@@ -372,4 +372,8 @@
         <item name="android:drawableEnd">@mipmap/x_ic_next</item>
         <item name="android:drawablePadding">7dp</item>
     </style>
+    <style name="style_empty_text">
+        <item name="android:textColor">@color/G</item>
+        <item name="android:textSize">15sp</item>
+    </style>
 </resources>

+ 2 - 0
app/src/main/res/values/str_network_strings.xml

@@ -9,4 +9,6 @@
     <string name="error_link">暂无地址,请稍候再试</string>
     <string name="error_download_link">暂无下载地址</string>
     <string name="error_package_link">暂无包名,请稍候再试</string>
+    <string name="wushuju">还没有数据哦</string>
+    <string name="wushuju_net_error">网络错误,请稍候再试</string>
 </resources>