Kaynağa Gözat

列表中没有数据时显示无数据,稍候重试的图片

zengjiebin 8 yıl önce
ebeveyn
işleme
1a821ac77d

+ 0 - 3
.idea/misc.xml

@@ -24,9 +24,6 @@
       </value>
     </option>
   </component>
-  <component name="ProjectPlainTextFileTypeManager">
-    <file url="file://$PROJECT_DIR$/app/src/main/assets/poster.html" />
-  </component>
   <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>

+ 0 - 2
app/build.gradle

@@ -55,8 +55,6 @@ android {
             signingConfig signingConfigs.config
         }
         debug {
-            minifyEnabled true
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
             signingConfig signingConfigs.config
         }
     }

+ 0 - 3
app/src/main/java/com/kfzs/duanduan/fragment/FgtCreditCardProgressQuery.java

@@ -32,8 +32,6 @@ public class FgtCreditCardProgressQuery extends BaseFragment {
     ListView credit_card_task_list;
     @BindView(R.id.swipe_container)
     RefreshLayout swipe_container;
-    @BindView(R.id.task_progress_iv)
-    ImageView task_progress_iv;
     @BindView(R.id.empty_view)
     View empty_view;
     @Override
@@ -46,7 +44,6 @@ public class FgtCreditCardProgressQuery extends BaseFragment {
     @Override
     public void onViewCreated() {
         ButterKnife.bind(this, mView);
-        task_progress_iv.setVisibility(View.GONE);
         swipe_container.setFooterView(getActivity(), credit_card_task_list, R.layout.listview_footer);
         adapter = new CreditCardProgressQueryAdp(getActivity(), list);
         credit_card_task_list.setAdapter(adapter);

+ 16 - 20
app/src/main/java/com/sheep/gamegroup/view/activity/AskGetMoneyAct.java

@@ -73,6 +73,10 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
     TextView friend_extract_count_tv;
     @BindView(R.id.friend_extract_page_tv)
     TextView friend_extract_page_tv;
+    @BindView(R.id.friend_extract_last_page_tv)
+    TextView friend_extract_last_page_tv;
+    @BindView(R.id.friend_extract_next_page_tv)
+    TextView friend_extract_next_page_tv;
 
     private FriendAndAwardEntity mEntity;
 
@@ -267,25 +271,17 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
 
             }
         });
-        if(BuildConfig.DEBUG) {
-            friend_extract_count_tv.setOnClickListener(new View.OnClickListener() {
-                @Override
-                public void onClick(View view) {
-                    friend_extract_vp.setCurrentItem(curPage - 2);
-                }
-            });
-            friend_extract_page_tv.setOnClickListener(new View.OnClickListener() {
-                @Override
-                public void onClick(View view) {
-                    friend_extract_vp.setCurrentItem(curPage);
-                }
-            });
-        }
-//
-//                mTestFragments.put(key++,TestFragment.newInstance("第"+key));
-//                mPagerAdapter.notifyDataSetChanged();
-//        ViewPager friend_extract_vp;
-//        TextView friend_extract_count_tv;
-//        TextView friend_extract_page_tv;
+        friend_extract_last_page_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                friend_extract_vp.setCurrentItem(curPage - 2);
+            }
+        });
+        friend_extract_next_page_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                friend_extract_vp.setCurrentItem(curPage);
+            }
+        });
     }
 }

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

@@ -2,66 +2,38 @@ package com.sheep.gamegroup.view.activity;
 
 import android.app.Activity;
 import android.content.Intent;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Bundle;
 import android.os.Handler;
-import android.os.Message;
-import android.provider.MediaStore;
-import android.support.v4.widget.SwipeRefreshLayout;
-import android.text.TextUtils;
 import android.view.View;
-import android.widget.AdapterView;
 import android.widget.ListView;
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.kfzs.appstore.utils.string.HexUtils;
 import com.kfzs.duanduan.event.BigEvent;
 import com.kfzs.duanduan.event.EventTypes;
-import com.kfzs.duanduan.react.upfile.UpFileListener;
-import com.kfzs.duanduan.react.upfile.UpFileUtils;
-import com.kfzs.duanduan.view.ListMore;
 import com.sheep.gamegroup.di.components.DaggerTaskListComponent;
 import com.sheep.gamegroup.di.modules.TaskListModule;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.DialogEntity;
-import com.sheep.gamegroup.model.entity.RecyleObj;
-import com.sheep.gamegroup.model.entity.RecyleType;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
-import com.sheep.gamegroup.model.entity.TaskEty;
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
-import com.sheep.gamegroup.model.entity.UploadResult;
-import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.presenter.TaskListContract;
 import com.sheep.gamegroup.presenter.TaskListPresenter;
-import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.view.adapter.TaskListItemAdp;
 import com.sheep.gamegroup.view.customview.RefreshLayout;
-import com.sheep.gamegroup.view.dialog.DialogShowLoading;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.AbsChooseImageActivity;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 
-import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
 import javax.inject.Inject;
 
 import butterknife.BindView;
-import butterknife.ButterKnife;
-import go.kfzssafe.Kfzssafe;
-import rx.android.schedulers.AndroidSchedulers;
-import rx.schedulers.Schedulers;
 
 /**
  * 任务列表
@@ -73,6 +45,8 @@ public class TaskListAct extends AbsChooseImageActivity implements TaskListContr
     ListView withdrawalListview;
     @BindView(R.id.swipe_container)
     RefreshLayout swipe_container;
+    @BindView(R.id.empty_view)
+    View empty_view;
 
     @Inject
     TaskListPresenter presenter;
@@ -173,34 +147,38 @@ public class TaskListAct extends AbsChooseImageActivity implements TaskListContr
     public void initData() {
 //        showProgress();
 //        swipe_container.setRefreshing(true);
+        empty_view.setVisibility(View.INVISIBLE);
         presenter.acceptedTask(page,per_page);
     }
 
     @Override
     public void updataView(Object o) {
-        hideProgress();
-        swipe_container.setRefreshing(false);
-        try{
+        try {
             BaseMessage baseMessage = (BaseMessage) o;
             List<TaskAcceptedEty> releaseEtyList = JSONArray.parseArray(JSONArray.toJSONString(baseMessage.getData()), TaskAcceptedEty.class);
-            for (TaskAcceptedEty ety: releaseEtyList){
-                if(!etyList.contains(ety)){
+            for (TaskAcceptedEty ety : releaseEtyList) {
+                if (!etyList.contains(ety)) {
                     etyList.add(ety);
                 }
 
             }
 //            etyList.addAll(releaseEtyList);
-            adp.notifyDataSetChanged();
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
         }
+        notifyDataSetChanged();
     }
-
-    @Override
-    public void failView(Object o) {
+    private void notifyDataSetChanged(){
+        if(etyList.isEmpty())
+            empty_view.setVisibility(View.VISIBLE);
         hideProgress();
         swipe_container.setRefreshing(false);
         adp.notifyDataSetChanged();
+    }
+
+    @Override
+    public void failView(Object o) {
+        notifyDataSetChanged();
         G.showToast(((BaseMessage) o).getMsg()+"");
     }
 

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

@@ -3,6 +3,7 @@ package com.sheep.gamegroup.view.activity;
 import android.app.Activity;
 import android.os.Bundle;
 import android.os.Handler;
+import android.view.View;
 import android.widget.ListView;
 
 import com.alibaba.fastjson.JSONArray;
@@ -40,6 +41,8 @@ public class WithdrawalListAct extends BaseActivity implements WithdrawalListCon
     ListView withdrawalListview;
     @BindView(R.id.swipe_container)
     RefreshLayout swipe_container;
+    @BindView(R.id.empty_view)
+    View empty_view;
 
     @Inject
     WithdrawalListPresenter presenter;
@@ -109,15 +112,13 @@ public class WithdrawalListAct extends BaseActivity implements WithdrawalListCon
 
     @Override
     public void initData() {
+        empty_view.setVisibility(View.INVISIBLE);
         presenter.goWithdrawal(page, per_page, 0+"",System.currentTimeMillis()+"");
 
     }
 
     @Override
     public void updataView(Object o) {
-
-        swipe_container.setRefreshing(false);
-        hideProgress();
         try{
             BaseMessage baseMessage = (BaseMessage) o;
             List<WithdrawalEty> releaseEtyList = JSONArray.parseArray(JSONArray.toJSONString(baseMessage.getData()), WithdrawalEty.class);
@@ -127,16 +128,22 @@ public class WithdrawalListAct extends BaseActivity implements WithdrawalListCon
                 }
 
             }
-//            etyList.addAll(releaseEtyList);
-            adp.notifyDataSetChanged();
         }catch (Exception e){
             e.printStackTrace();
         }
+        notifyDataSetChanged();
     }
 
+    private void notifyDataSetChanged(){
+        if(etyList.isEmpty())
+            empty_view.setVisibility(View.VISIBLE);
+        hideProgress();
+        swipe_container.setRefreshing(false);
+        adp.notifyDataSetChanged();
+    }
     @Override
     public void failView(Object o) {
-        swipe_container.setRefreshing(false);
+        notifyDataSetChanged();
         G.showToast(((BaseMessage) o).getMsg()+"");
     }
 }

+ 10 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java

@@ -496,4 +496,14 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
     public void refreshAdapter(){
         notifyDataSetChanged();
     }
+
+    public boolean isEmpty() {
+        switch (type){
+            case 0://推荐任务
+                return taskAcceptedEty == null;
+            case 2://即将开始
+                return true;
+        }
+        return false;
+    }
 }

+ 5 - 5
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtTryMakeMoney.java

@@ -58,8 +58,8 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
     RecyclerView recyclerview;
     @BindView(R.id.refresh)
     SwipeRefreshLayout refresh;
-    @BindView(R.id.download_mgr_empty_view)
-    RelativeLayout download_mgr_empty_view;
+    @BindView(R.id.empty_view)
+    View empty_view;
     Unbinder unbinder;
 
     @Inject
@@ -77,9 +77,9 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
 
             tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.RELEASE_TASK, releaseEtyLists),position);
             tryMakeMoneyAdp.refreshAdapter();
-            if(tryMakeMoneyAdp.getmListDatas() == null || tryMakeMoneyAdp.getmListDatas().size() <1){
+            if(tryMakeMoneyAdp.isEmpty() && releaseEtyLists.isEmpty()){
 
-//                download_mgr_empty_view.setVisibility(View.VISIBLE);
+                empty_view.setVisibility(View.VISIBLE);
             }
 //            recyclerview.setAdapter(tryMakeMoneyAdp);
         }
@@ -176,7 +176,7 @@ public class FgtTryMakeMoney extends BaseFragment implements TryMakeMoneyContrac
         });
     }
     public void initData() {
-        download_mgr_empty_view.setVisibility(View.GONE);
+        empty_view.setVisibility(View.GONE);
         position = 0;
         releaseEtyLists.clear();
         tryMakeMoneyAdp.clear();

+ 5 - 6
app/src/main/res/layout/fgt_try_makemoney_layout.xml

@@ -1,15 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:orientation="vertical"
     android:background="@color/bg_gray">
 
     <include
+        android:id="@+id/empty_view"
         layout="@layout/empty_view"
-        android:visibility="gone"/>
-
-
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
     <android.support.v4.widget.SwipeRefreshLayout
         android:id="@+id/refresh"
         android:layout_width="match_parent"
@@ -22,4 +21,4 @@
             android:layout_height="match_parent"
             android:orientation="vertical"></android.support.v7.widget.RecyclerView>
     </android.support.v4.widget.SwipeRefreshLayout>
-</LinearLayout>
+</RelativeLayout>

+ 20 - 9
app/src/main/res/layout/withdrawal_list.xml

@@ -1,24 +1,35 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/bg_gray"
-    android:orientation="vertical">
+    android:background="@color/bg_gray">
+
+    <include
+        android:id="@+id/title"
+        layout="@layout/title" />
+
+    <include
+        android:id="@+id/empty_view"
+        layout="@layout/empty_view"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_below="@+id/title" />
 
-    <include layout="@layout/title" />
     <com.sheep.gamegroup.view.customview.RefreshLayout
         android:id="@+id/swipe_container"
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
+        android:layout_height="match_parent"
+        android:layout_below="@+id/title">
 
         <ListView
             android:id="@+id/withdrawal_listview"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:listSelector="@color/transparent"
-            android:divider="@null"
+            android:layout_below="@+id/title"
             android:layout_margin="@dimen/content_padding_13"
-            android:scrollbars="none"/>
+            android:divider="@null"
+            android:listSelector="@color/transparent"
+            android:scrollbars="none" />
 
     </com.sheep.gamegroup.view.customview.RefreshLayout>
-</LinearLayout>
+</RelativeLayout>

+ 29 - 1
app/src/main/res/layout/x_ask_getmoney_act_layout.xml

@@ -333,8 +333,9 @@
                 android:textSize="11sp"
                 android:textColor="#a3282828"
                 android:text="共0条"/>
+
             <TextView
-                android:id="@+id/friend_extract_page_tv"
+                android:id="@+id/friend_extract_last_page_tv"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginStart="@dimen/content_padding_20"
@@ -345,7 +346,34 @@
                 android:paddingBottom="2dp"
                 android:textSize="12sp"
                 android:textColor="#282828"
+                android:text="@string/last_page"/>
+            <TextView
+                android:id="@+id/friend_extract_page_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/content_padding_10"
+                android:background="@drawable/shape_page"
+                android:paddingStart="7dp"
+                android:paddingEnd="7dp"
+                android:paddingTop="2dp"
+                android:paddingBottom="2dp"
+                android:textSize="12sp"
+                android:textColor="#282828"
                 android:text="1"/>
+
+            <TextView
+                android:id="@+id/friend_extract_next_page_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/content_padding_10"
+                android:background="@drawable/shape_page"
+                android:paddingStart="7dp"
+                android:paddingEnd="7dp"
+                android:paddingTop="2dp"
+                android:paddingBottom="2dp"
+                android:textSize="12sp"
+                android:textColor="#282828"
+                android:text="@string/next_page"/>
         </LinearLayout>
     </LinearLayout>
 

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

@@ -13,4 +13,6 @@
     <string name="no_bind_wx_notice_text">未绑定微信号,无法入账到你的微信零钱</string>
     <string name="no_bind_tel_notice_text">我们已将你的手机号与该帐号绑定,如有变更,请点击</string>
     <string name="coming_soon">敬请期待</string>
+    <string name="last_page"> &#060; </string>
+    <string name="next_page"> &#062; </string>
 </resources>