Pārlūkot izejas kodu

添加我的游戏列表界面;
暂时不使用鸿途信达广告;

zengjiebin 7 gadi atpakaļ
vecāks
revīzija
a44057c7a4
23 mainītis faili ar 289 papildinājumiem un 54 dzēšanām
  1. 1 1
      app/src/main/AndroidManifest.xml
  2. 0 1
      app/src/main/java/com/sheep/gamegroup/helper/DownloadHelper.java
  3. 9 0
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  4. 1 1
      app/src/main/java/com/sheep/gamegroup/model/api/IDownload.java
  5. 2 2
      app/src/main/java/com/sheep/gamegroup/model/entity/Applications.java
  6. 12 4
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskEty.java
  7. 2 2
      app/src/main/java/com/sheep/gamegroup/model/entity/XiaomiGameEntity.java
  8. 1 2
      app/src/main/java/com/sheep/gamegroup/module/ad_htxd/model/ArticleAd.java
  9. 6 12
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMyGame.java
  10. 171 0
      app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtMyGameList.java
  11. 4 2
      app/src/main/java/com/sheep/gamegroup/model/entity/FindAppReservation.java
  12. 26 3
      app/src/main/java/com/sheep/gamegroup/util/DownloadUtil.java
  13. 4 3
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  14. 4 1
      app/src/main/java/com/sheep/gamegroup/util/TestUtil.java
  15. 1 2
      app/src/main/java/com/sheep/gamegroup/util/js/KFZSJs.java
  16. 8 9
      app/src/main/java/com/sheep/gamegroup/view/activity/ActReservation.java
  17. 2 4
      app/src/main/java/com/sheep/gamegroup/view/activity/GamemakeMoneyAct.java
  18. 1 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment6.java
  19. 3 3
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMyGame.java
  20. 2 0
      app/src/main/java/org/afinal/simplecache/ApiKey.java
  21. 2 1
      app/src/main/res/layout/common_container.xml
  22. 2 1
      app/src/main/res/layout/common_srl_rv.xml
  23. 25 0
      app/src/main/res/layout/item_my_game.xml

+ 1 - 1
app/src/main/AndroidManifest.xml

@@ -931,7 +931,7 @@
             android:screenOrientation="portrait"
             android:theme="@style/AppActionTheme"/>
         <activity
-            android:name="com.sheep.gamegroup.view.activity.ActMyGame"
+            android:name="com.sheep.gamegroup.module.game.activity.ActMyGameList"
             android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
     </application>

+ 0 - 1
app/src/main/java/com/sheep/gamegroup/helper/DownloadHelper.java

@@ -102,7 +102,6 @@ public class DownloadHelper {
                     case IDLE://空闲的
                     case UNKNOWN:
                         downloadUtil.start(downLoadInfo);
-                        Jump2View.getInstance().startDownloadService(activity, downLoadInfo);
                         break;
                     case COMPLETED://有可能之前已经下载完成,但是数据库里已经没有数据了,这时只需要修改状态
                         if(task.getFile() != null) {

+ 9 - 0
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -1660,5 +1660,14 @@ public interface ApiService {
     @GET("app/user_address")
     Observable<BaseMessage> getUserAddress();
 //---------------------------end 小绵羊3.4.7新增 -- app/user_address 用户收货地址-------------------------------------
+//---------------------------start 小绵羊3.4.9新增 -- 游戏相关-------------------------------------
+
+    /**
+     * 获取我的游戏列表
+     * 返回 UserAddressInfo
+     */
+    @GET(ApiKey.getMyGmeList)
+    Observable<BaseMessage> getMyGameList(@Query("page") int page, @Query("per_page") int per_page);
+//---------------------------end 小绵羊3.4.9新增 -- 游戏相关-------------------------------------
 
 }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/model/api/IDownload.java

@@ -17,5 +17,5 @@ public interface IDownload {
 
     String getPackage_size();//任务的包大小
 
-    int getAcceptedTaskId();//任务的id
+    int getAppId();//应用的id
 }

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/model/entity/Applications.java

@@ -389,13 +389,13 @@ public class Applications implements IDownload, Serializable {
     public String getTask_name() {
         return name;
     }
-
     @Override
-    public int getAcceptedTaskId() {
+    public int getAppId() {
         return Id;
     }
 
 
+
     /**
      * 是否可以下载
      *

+ 12 - 4
app/src/main/java/com/sheep/gamegroup/model/entity/TaskEty.java

@@ -46,6 +46,7 @@ public class TaskEty implements Serializable, IDownload {
     private String qr_code;//二维码地址
     //用于自定义字段,如自定义手机号
     private String unique_identification;//UniqueIdentification string       `orm:"column(unique_identification);null" description:"唯一标识" json:"unique_identification"`
+    private int app_id;
 
     public String getQr_code() {
         return qr_code;
@@ -196,6 +197,11 @@ public class TaskEty implements Serializable, IDownload {
         return package_size;
     }
 
+    @Override
+    public int getAppId() {
+        return app_id;
+    }
+
     public void setPackage_size(String package_size) {
         this.package_size = package_size;
     }
@@ -337,11 +343,13 @@ public class TaskEty implements Serializable, IDownload {
         this.unique_identification = unique_identification;
     }
 
+    public void setApp_id(int app_id) {
+        this.app_id = app_id;
+    }
 
-
-
-
-
+    public int getApp_id() {
+        return app_id;
+    }
 
 
 

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/model/entity/XiaomiGameEntity.java

@@ -233,8 +233,8 @@ public class XiaomiGameEntity implements Serializable,IDownload {
     }
 
     @Override
-    public int getAcceptedTaskId() {
-        return 0;
+    public int getAppId() {
+        return Id;
     }
 
     public int getPackage_type() {

+ 1 - 2
app/src/main/java/com/sheep/gamegroup/module/ad_htxd/model/ArticleAd.java

@@ -5,7 +5,6 @@ import com.hoc.hoclib.adlib.NativeADDataInfo;
 import com.hoc.hoclib.adlib.PNative;
 import com.sheep.gamegroup.model.entity.Article;
 import com.sheep.gamegroup.util.ListUtil;
-import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 
 import rx.functions.Action1;
@@ -19,7 +18,7 @@ public class ArticleAd extends Article {
 
     public static final String FEED = "1D0JLRMA102V277730B60000552042FE";
     public static final int INDEX = 4;//放在position为4的位置,即第5个
-    public static final boolean showAd = TestUtil.isSheep();//是否显示广告
+    public static final boolean showAd = false;//是否显示广告
 
     private NativeADDataInfo nativeADDataInfo;
     private PNative pNative;

+ 6 - 12
app/src/main/java/com/sheep/gamegroup/view/activity/ActMyGame.java

@@ -1,29 +1,23 @@
-package com.sheep.gamegroup.view.activity;
+package com.sheep.gamegroup.module.game.activity;
 
-import android.content.Intent;
 import android.support.v4.app.Fragment;
 
 import com.sheep.gamegroup.absBase.BaseContainerActivity;
-import com.sheep.gamegroup.util.LogUtil;
-import com.sheep.gamegroup.view.fragment.FgtEveryDayShare;
-import com.sheep.gamegroup.view.fragment.FgtMyGame;
+import com.sheep.gamegroup.module.game.fragment.FgtMyGameList;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
-import com.umeng.socialize.UMShareAPI;
-import com.umeng.socialize.UMShareListener;
-import com.umeng.socialize.bean.SHARE_MEDIA;
 
 /**
  * Created by realicing on 2018/11/23.
  * realicing@sina.com
- * 小绵羊3.4.5新增--每日分享
+ *
+ * 小绵羊3.4.9新增--我的游戏列表
  */
-public class ActMyGame extends BaseContainerActivity {
+public class ActMyGameList extends BaseContainerActivity {
 
     @Override
     protected Fragment initFragment() {
-        return FgtMyGame.newInstance(2);
+        return new FgtMyGameList();
     }
 
     @Override

+ 171 - 0
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtMyGameList.java

@@ -0,0 +1,171 @@
+package com.sheep.gamegroup.module.game.fragment;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.sheep.gamegroup.absBase.AbsGetDownloadListener;
+import com.sheep.gamegroup.absBase.IApiRefresh;
+import com.sheep.gamegroup.absBase.NetApiRefresh;
+import com.sheep.gamegroup.event.BigEvent;
+import com.sheep.gamegroup.helper.DownloadHelper;
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.Applications;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.module.game.model.MyGame;
+import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.TimeUtil;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.fragment.BaseListFragment6;
+import com.sheep.jiuyan.samllsheep.R;
+
+import org.afinal.simplecache.ApiKey;
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import io.reactivex.Observable;
+
+/**
+ * Created by realicing on 2019/1/11.
+ * realicing@sina.com
+ * <p>
+ * 小绵羊3.4.9新增--我的游戏列表
+ */
+public class FgtMyGameList extends BaseListFragment6<MyGame> {
+    @Override
+    public int getLayoutId() {
+        return R.layout.common_srl_rv;
+    }
+
+    private NetApiRefresh<MyGame> apiRefresh;
+
+    @Override
+    protected void addApiRefresh(List<IApiRefresh> apiRefreshList) {
+        apiRefresh = new NetApiRefresh<MyGame>(this) {
+            @Override
+            public String getKey(int page, int per_page) {
+                return ApiKey.pageKeyUrl(ApiKey.getMyGmeList, page, per_page);
+            }
+
+            @Override
+            public Observable<BaseMessage> getApi(ApiService apiService) {
+                return apiService.getMyGameList(page, per_page);
+            }
+
+            @Override
+            public Class<MyGame> getTClass() {
+                return MyGame.class;
+            }
+        };
+        apiRefreshList.add(apiRefresh);
+    }
+
+    @Override
+    protected BaseQuickAdapter<MyGame, BaseViewHolder> getAdapter() {
+        BaseQuickAdapter<MyGame, BaseViewHolder> baseQuickAdapter = new BaseQuickAdapter<MyGame, BaseViewHolder>(R.layout.item_my_game, apiRefresh.getList()) {
+            @Override
+            protected void convert(BaseViewHolder helper, MyGame item) {
+                int position = helper.getAdapterPosition() - getHeaderLayoutCount();
+                Applications applications = item.getApplication();
+                ImageView find_information_game_icon = helper.getView(R.id.find_information_game_icon);
+                TextView find_information_game_name = helper.getView(R.id.find_information_game_name);
+                TextView find_information_game_surplus = helper.getView(R.id.find_information_game_surplus);
+                TextView find_information_game_time = helper.getView(R.id.find_information_game_time);
+                TextView find_information_game_task_center = helper.getView(R.id.find_information_game_task_center);
+                GlideImageLoader.setGameImage(find_information_game_icon, applications.getIcon());
+                ViewUtil.setText(find_information_game_name, applications.getName());
+                final boolean isNeedReservation = !applications.isCanDownload();//这里认为只有两种状态:可下载与预约下载
+                ViewUtil.setText(find_information_game_surplus);
+                if (isNeedReservation)
+                    ViewUtil.setText(find_information_game_time, String.format(Locale.CHINA, "开放时间:%s", TimeUtil.TimeStamp2Date(applications.getDownload_at(), "yyyy-MM-dd\u0020HH:mm")));
+                else
+                    ViewUtil.setText(find_information_game_time, String.format(Locale.CHINA, "厂商:%s\u0020包体大小:%sM", applications.getManufacturer(), applications.getPackage_size()));
+                find_information_game_task_center.setVisibility(View.VISIBLE);
+
+                updateView(getActivity(), applications, find_information_game_task_center);
+
+                ViewUtil.setVisibility(helper.getView(R.id.item_my_game_v), position > 0);
+            }
+        };
+        baseQuickAdapter.setOnItemClickListener((adapter, view, position) -> {
+            MyGame item = ListUtil.getItem(apiRefresh.getList(), position);
+            if(item != null)
+                Jump2View.getInstance().goFindGame(getActivity(), item.getApplication());
+        });
+        return baseQuickAdapter;
+    }
+
+    private Map<String, Applications> applicationMap = new HashMap<>();
+
+
+    private Map<String, TextView> downLoadTextViewMap = new HashMap<>();
+
+    //更新按钮状态与添加点击事件
+    private void updateView(Activity activity, Applications findApp, TextView textView) {
+        if (findApp.isCanDownload()) {//可下载
+            downLoadTextViewMap.put(findApp.getDownload_link(), textView);
+            downLoadTextViewMap.put(findApp.getPackage_name(), textView);
+            applicationMap.put(findApp.getDownload_link(), findApp);
+            applicationMap.put(findApp.getPackage_name(), findApp);
+            findApp.getFindAppHelper().updateDownloadTaskView(activity, findApp, textView);
+        } else {//预约下载
+            findApp.getFindAppHelper().updateReservationView(activity, findApp, textView);
+        }
+    }
+    private AbsGetDownloadListener absGetDownloadListener = new AbsGetDownloadListener(true) {
+        @Override
+        public String getDownloadUrl(String packageName) {
+            Applications item =  applicationMap.get(packageName);
+            return item != null ? item.getDownload_url() : null;
+        }
+
+        @Override
+        public TextView getTextView2(String packageName) {
+            return downLoadTextViewMap.get(packageName);
+        }
+
+        @Override
+        public TextView getTextView(String downloadUrl) {
+            return downLoadTextViewMap.get(downloadUrl);
+        }
+
+        @Override
+        public DownloadHelper getDownloadHelper(String downloadUrl) {
+            Applications item =  applicationMap.get(downloadUrl);
+            return item != null ? item.getDownloadHelper() : null;
+        }
+    };
+
+    @Subscribe
+    public void onEventMainThread(Intent intent) {
+        absGetDownloadListener.onEventMainThread(intent);
+    }
+
+    @Subscribe
+    public void onEventMainThread(BigEvent event) {
+        absGetDownloadListener.onEventMainThread(event);
+    }
+
+    @Override
+    public void initView() {
+        super.initView();
+        EventBus.getDefault().register(this);
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        EventBus.getDefault().unregister(this);
+    }
+}

+ 4 - 2
app/src/main/java/com/sheep/gamegroup/model/entity/FindAppReservation.java

@@ -1,10 +1,12 @@
-package com.sheep.gamegroup.model.entity;
+package com.sheep.gamegroup.module.game.model;
+
+import com.sheep.gamegroup.model.entity.Applications;
 
 /**
  * Created by realicing on 2018/6/29.
  * realicing@sina.com
  */
-public class FindAppReservation {
+public class MyGame {
     private int UserId;
 
     private int Type;//2:预约 1:下载

+ 26 - 3
app/src/main/java/com/sheep/gamegroup/util/DownloadUtil.java

@@ -1,6 +1,5 @@
 package com.sheep.gamegroup.util;
 
-import android.content.Context;
 import android.os.Build;
 import android.text.TextUtils;
 
@@ -9,16 +8,21 @@ import com.liulishuo.okdownload.OkDownload;
 import com.sheep.gamegroup.greendao.DDProviderHelper;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.model.api.IDownload;
+import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.DialogEntity;
 import com.sheep.gamegroup.model.entity.OrienteeringDetail;
-import com.sheep.gamegroup.model.entity.TaskEty;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
+import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 
 import java.io.File;
 import java.util.List;
 
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
 
 /**
  * The local database persistence if download task
@@ -148,7 +152,7 @@ public class DownloadUtil {
         if (downLoadInfo == null) {
             downLoadInfo = CommonUtil.getInstance()
                     .addNewDownloadTask(taskEty.getTask_name(), taskEty.getDownload_link(), taskEty.getPackage_names(),
-                            Build.VERSION.SDK_INT, taskEty.getIcon(), taskEty.getPackage_size(), taskEty.getAcceptedTaskId(), 1);
+                            Build.VERSION.SDK_INT, taskEty.getIcon(), taskEty.getPackage_size(), taskEty.getAppId(), 1);
         }
         return downLoadInfo;
     }
@@ -415,6 +419,25 @@ public class DownloadUtil {
             SpUtils.saveDownNotice(SheepApp.getInstance(), 0);
         }
         Jump2View.getInstance().startDownloadService(SheepApp.getInstance(), downLoadInfo);
+
+        //3.4.9添加 记录下载游戏,可通过我的游戏列表中获取游戏
+        if(downLoadInfo.getMGameID() != null && downLoadInfo.getMGameID() > 0)
+            SheepApp.getInstance().getNetComponent().getApiService().recordAppDownloads(downLoadInfo.getMGameID())
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        if(TestUtil.isDev())
+                            G.showToast(baseMessage);
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        if(TestUtil.isDev())
+                            G.showToast(baseMessage);
+                    }
+                });
     }
 
     /**

+ 4 - 3
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -92,7 +92,7 @@ import com.sheep.gamegroup.view.activity.ActMain;
 import com.sheep.gamegroup.view.activity.ActMiDong;
 import com.sheep.gamegroup.view.activity.ActModifyThird;
 import com.sheep.gamegroup.view.activity.ActMyFocus;
-import com.sheep.gamegroup.view.activity.ActMyGame;
+import com.sheep.gamegroup.module.game.activity.ActMyGameList;
 import com.sheep.gamegroup.view.activity.ActMyMoney;
 import com.sheep.gamegroup.view.activity.ActMyWelfare;
 import com.sheep.gamegroup.view.activity.ActNewAboutUs;
@@ -1751,8 +1751,9 @@ public class Jump2View {
         UMConfigUtils.Event.SHEEP_GAME_TASK.onEvent();
     }
 
-    public void goMyGame(Context activity) {
-        Intent intent = new Intent(activity, ActMyGame.class);
+    //3.4.9添加 跳转到我的游戏列表
+    public void goActMyGameList(Context activity) {
+        Intent intent = new Intent(activity, ActMyGameList.class);
         activity.startActivity(intent);
         UMConfigUtils.Event.SHEEP_GAME_TASK.onEvent();
     }

+ 4 - 1
app/src/main/java/com/sheep/gamegroup/util/TestUtil.java

@@ -257,7 +257,7 @@ public class TestUtil {
      */
     public static void test(final Activity activity) {
         final String[] items = {"复制token", "添加token", "复制打点数据", "从jenkins下载小绵羊安装包", "测试表情包",
-                "优惠券弹窗", "填写收件地址弹窗",
+                "我的游戏", "优惠券弹窗", "填写收件地址弹窗",
                 "朗读文字", "游戏搜索", "测试插件","测试bitmap", "剪切视频", "我的关注", "足迹",
                 "测试联通卡", "测试联通卡2", "测试签名1", "测试签名2", "测试孔剑秋faq正式服",
                 "跳转QQ1", "跳转QQ2", "跳转QQ3", "跳转白白QQ", "龙猫竞猜", "龙猫竞猜-scheme",
@@ -277,6 +277,9 @@ public class TestUtil {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
                         switch (items[which]) {
+                            case "我的游戏":
+                                Jump2View.getInstance().goActMyGameList(activity);
+                                break;
                             case "优惠券弹窗":
                                 ReceiveCouponsCheckResq receiveCouponsCheckResq = new ReceiveCouponsCheckResq();
                                 receiveCouponsCheckResq.setAmount(6.0f);

+ 1 - 2
app/src/main/java/com/sheep/gamegroup/util/js/KFZSJs.java

@@ -3,7 +3,6 @@ package com.sheep.gamegroup.util.js;
 import android.app.Activity;
 import android.content.Intent;
 import android.text.TextUtils;
-import android.util.Log;
 import android.webkit.JavascriptInterface;
 
 import com.alibaba.fastjson.JSONObject;
@@ -149,7 +148,7 @@ public class KFZSJs {
 
     @JavascriptInterface
     public void jumpMyGame() {
-        Jump2View.getInstance().goMyGame(activity);
+        Jump2View.getInstance().goActMyGameList(activity);
     }
 
     @JavascriptInterface

+ 8 - 9
app/src/main/java/com/sheep/gamegroup/view/activity/ActReservation.java

@@ -15,7 +15,7 @@ import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.Applications;
-import com.sheep.gamegroup.model.entity.FindAppReservation;
+import com.sheep.gamegroup.module.game.model.MyGame;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DownloadUtil;
@@ -42,7 +42,6 @@ import java.util.Map;
 
 import butterknife.BindView;
 import io.reactivex.android.schedulers.AndroidSchedulers;
-import rx.functions.Action1;
 import io.reactivex.schedulers.Schedulers;
 
 import static android.content.Intent.ACTION_PACKAGE_ADDED;
@@ -86,7 +85,7 @@ public class ActReservation extends BaseActivity {
         });
 
         view_list.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
-        view_list.setAdapter(new AdbCommonRecycler<FindAppReservation>(SheepApp.getInstance(), list) {
+        view_list.setAdapter(new AdbCommonRecycler<MyGame>(SheepApp.getInstance(), list) {
 
             @Override
             public int getItemViewType(int position) {
@@ -104,7 +103,7 @@ public class ActReservation extends BaseActivity {
             }
 
             @Override
-            public void convert(ViewHolder holder, FindAppReservation item) {
+            public void convert(ViewHolder holder, MyGame item) {
                 View find_reservation_item_center = holder.itemView.findViewById(R.id.find_reservation_item_center);
                 View find_reservation_item_bottom = holder.itemView.findViewById(R.id.find_reservation_item_bottom);
                 if (find_reservation_item_bottom != null) {
@@ -118,7 +117,7 @@ public class ActReservation extends BaseActivity {
         });
     }
 
-    private void loadItem(View itemView, final FindAppReservation item) {
+    private void loadItem(View itemView, final MyGame item) {
         ImageView find_information_game_icon = (ImageView) itemView.findViewById(R.id.find_information_game_icon);
         TextView find_information_game_name = (TextView) itemView.findViewById(R.id.find_information_game_name);
         TextView find_information_game_time = (TextView) itemView.findViewById(R.id.find_information_game_time);
@@ -172,7 +171,7 @@ public class ActReservation extends BaseActivity {
     }
 
     //预约下载
-    private void recordAppDownloads(final TextView find_information_game_bt2, int id, final FindAppReservation item) {
+    private void recordAppDownloads(final TextView find_information_game_bt2, int id, final MyGame item) {
         SheepApp.getInstance().getNetComponent().getApiService().recordAppDownloads(id)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
@@ -194,7 +193,7 @@ public class ActReservation extends BaseActivity {
     }
 
     //取消预约
-    private void deleteDownloads(final TextView find_information_game_bt2, final FindAppReservation item) {
+    private void deleteDownloads(final TextView find_information_game_bt2, final MyGame item) {
         SheepApp.getInstance().getNetComponent().getApiService().deleteDownloads(item.getId())
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
@@ -220,7 +219,7 @@ public class ActReservation extends BaseActivity {
 
     }
 
-    private List<FindAppReservation> list = ListUtil.emptyList();
+    private List<MyGame> list = ListUtil.emptyList();
 
     @Override
     public void initData() {
@@ -243,7 +242,7 @@ public class ActReservation extends BaseActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        List<FindAppReservation> newList = baseMessage.getDataList(FindAppReservation.class);
+                        List<MyGame> newList = baseMessage.getDataList(MyGame.class);
                         list.clear();
                         ListUtil.addAll(list, newList);
                         if (!list.isEmpty())

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

@@ -2,7 +2,6 @@ package com.sheep.gamegroup.view.activity;
 
 import android.app.Activity;
 import android.content.Intent;
-import android.os.Bundle;
 import android.support.design.widget.TabLayout;
 import android.support.v4.view.ViewPager;
 import android.view.View;
@@ -15,7 +14,7 @@ import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.adapter.AdpTryMakemoney;
-import com.sheep.gamegroup.view.fragment.FgtMyGame;
+import com.sheep.gamegroup.view.fragment.FgtGameConsumptionMyGame;
 import com.sheep.gamegroup.view.fragment.FgtTryMakeMoney;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
@@ -24,7 +23,6 @@ import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 
 import butterknife.BindView;
-import butterknife.ButterKnife;
 
 /**
  * 游戏任务
@@ -86,7 +84,7 @@ public class GamemakeMoneyAct extends BaseActivity {
 
         mAdapter = new AdpTryMakemoney(getSupportFragmentManager(), this);
         mAdapter.add(FgtTryMakeMoney.newInstance(0), getString(R.string.recommend_task));
-        mAdapter.add(FgtMyGame.newInstance(2), getString(R.string.my_games));
+        mAdapter.add(FgtGameConsumptionMyGame.newInstance(2), getString(R.string.my_games));
         pager.setAdapter(mAdapter);
         indicator.setupWithViewPager(pager);
 

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment6.java

@@ -119,6 +119,7 @@ public abstract class BaseListFragment6<T> extends BaseFragment implements IRefr
                 return R.id.load_more_load_end_view;
             }
         });
+        baseQuickAdapter.setEmptyView(R.layout.include_empty);
     }
 
     protected void initLoadMoreListener() {

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMyGame.java

@@ -41,7 +41,7 @@ import io.reactivex.schedulers.Schedulers;
  * Created by ljy on 2018/6/12.
  */
 
-public class FgtMyGame extends BaseFragment {
+public class FgtGameConsumptionMyGame extends BaseFragment {
 
     @BindView(R.id.empty_view_img)
     ImageView imgListEmpty;
@@ -58,8 +58,8 @@ public class FgtMyGame extends BaseFragment {
     private List<OrienteeringDetail> list = ListUtil.emptyList();
     private int type = 0;
 
-    public static FgtMyGame newInstance(int type) {
-        FgtMyGame fgtTryMakeMoney = new FgtMyGame();
+    public static FgtGameConsumptionMyGame newInstance(int type) {
+        FgtGameConsumptionMyGame fgtTryMakeMoney = new FgtGameConsumptionMyGame();
         Bundle bundle = new Bundle();
         bundle.putInt("type", type);
         fgtTryMakeMoney.setArguments(bundle);

+ 2 - 0
app/src/main/java/org/afinal/simplecache/ApiKey.java

@@ -80,6 +80,8 @@ public class ApiKey {
     public static final String withdraw = "app/withdraw";
     //消息中心列表
     public static final String system_notification = "app/message/system_notification/";
+    //获取我安装的游戏列表 3.4.9新增
+    public static final String getMyGmeList = "app/game_consumption/my_games_v2";
 
     public static final String getPackageVersion(String package_name, String type, int version){
         return String.format(Locale.CHINA, "%s?package_name=%s&type=%s&version=%d", getPackageVersion, package_name, type, version);

+ 2 - 1
app/src/main/res/layout/common_container.xml

@@ -2,4 +2,5 @@
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/frame_container"
     android:layout_width="match_parent"
-    android:layout_height="match_parent" />
+    android:layout_height="match_parent"
+    android:fitsSystemWindows="true"/>

+ 2 - 1
app/src/main/res/layout/common_srl_rv.xml

@@ -2,7 +2,8 @@
 <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/swipeRefreshLayout"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content">
+    android:layout_height="wrap_content"
+    android:background="@color/white">
 
     <LinearLayout
         android:layout_width="match_parent"

+ 25 - 0
app/src/main/res/layout/item_my_game.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@color/white"
+    android:orientation="vertical"
+    android:paddingStart="@dimen/content_padding"
+    android:paddingEnd="@dimen/content_padding">
+
+    <View
+        android:id="@+id/item_my_game_v"
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:background="@color/theme_app_divider_color" />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/content_padding" />
+
+    <include layout="@layout/find_information_bottom_item_game" />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/content_padding" />
+</LinearLayout>