Explorar o código

添加我的预约功能

zengjiebin %!s(int64=7) %!d(string=hai) anos
pai
achega
c84c6462f2
Modificáronse 28 ficheiros con 863 adicións e 50 borrados
  1. 2 0
      app/src/main/AndroidManifest.xml
  2. 2 2
      app/src/main/java/com/kfzs/duanduan/fragment/FgtFindChild.java
  3. 4 1
      app/src/main/java/com/kfzs/duanduan/fragment/FgtPersonalCenter.java
  4. 2 1
      app/src/main/java/com/kfzs/duanduan/services/DownloadTaskService.java
  5. 21 1
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  6. 21 0
      app/src/main/java/com/sheep/gamegroup/model/api/ITask.java
  7. 68 7
      app/src/main/java/com/sheep/gamegroup/model/entity/FindApp.java
  8. 88 0
      app/src/main/java/com/sheep/gamegroup/model/entity/FindAppReservation.java
  9. 2 1
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskEty.java
  10. 104 0
      app/src/main/java/com/sheep/gamegroup/util/FindAppHelper.java
  11. 51 2
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  12. 1 0
      app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java
  13. 15 13
      app/src/main/java/com/sheep/gamegroup/view/activity/ActFindGame.java
  14. 11 9
      app/src/main/java/com/sheep/gamegroup/view/activity/ActFindInformation.java
  15. 255 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActReservation.java
  16. 2 1
      app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAct.java
  17. 11 0
      app/src/main/res/color/selector_color_main_tab2.xml
  18. 9 0
      app/src/main/res/drawable/selector_button_full_main2.xml
  19. 1 10
      app/src/main/res/layout/act_find_game.xml
  20. 1 1
      app/src/main/res/layout/act_understand_sheep.xml
  21. 40 0
      app/src/main/res/layout/fgt_personalcenter_item_center_two.xml
  22. 57 0
      app/src/main/res/layout/find_reservation_item.xml
  23. 5 0
      app/src/main/res/layout/find_reservation_item_bottom.xml
  24. 17 0
      app/src/main/res/layout/find_reservation_item_center.xml
  25. 22 0
      app/src/main/res/layout/find_reservation_item_top.xml
  26. 39 0
      app/src/main/res/layout/net_empty_fresh_list_not_wrap.xml
  27. BIN=BIN
      app/src/main/res/mipmap-xhdpi/personalc_ic_reservation.png
  28. 12 1
      app/src/main/res/values/dd_styles.xml

+ 2 - 0
app/src/main/AndroidManifest.xml

@@ -500,6 +500,8 @@
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActFindInformation"
             android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActReservation"
+            android:screenOrientation="portrait"/>
     </application>
 
 

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

@@ -267,6 +267,8 @@ public class FgtFindChild extends BaseCompatFragment {
                                 if(!ListUtil.isEmpty(newList)){
                                     list.clear();
                                     ListUtil.addAll(list, newList);
+                                    if(!list.isEmpty())
+                                        list.add(null);//底部部分----我是有底线的
                                     notifyDataSetChanged();
                                 }
                             }
@@ -282,8 +284,6 @@ public class FgtFindChild extends BaseCompatFragment {
     private void notifyDataSetChanged(){
         if(list.isEmpty())
             empty_view.setVisibility(View.VISIBLE);
-        else
-            list.add(null);//底部部分----我是有底线的
         refresh.setRefreshing(false);
         view_list.getAdapter().notifyDataSetChanged();
     }

+ 4 - 1
app/src/main/java/com/kfzs/duanduan/fragment/FgtPersonalCenter.java

@@ -214,7 +214,7 @@ public class FgtPersonalCenter extends BaseCompatFragment {
 
     @OnClick({R.id.icon_img_iv, R.id.account_detail_layout, R.id.personalcenter_price_layout, R.id.account_safe_layout,
             R.id.account_task_layout, R.id.proxy_service_layout, R.id.abourt_us_layout, R.id.feedbook_layout,
-            R.id.recommend_friend_layout, R.id.tv_submit, R.id.faq_layout,
+            R.id.recommend_friend_layout, R.id.tv_submit, R.id.faq_layout, R.id.reservation_layout,
             R.id.version_layout, R.id.clear_layout, R.id.change_layout, R.id.order_layout})
     public void onViewClicked(View view) {
         switch (view.getId()) {
@@ -243,6 +243,9 @@ public class FgtPersonalCenter extends BaseCompatFragment {
                 else
                     Jump2View.getInstance().goWeb(activity, "http://smallstation.kfzs.com/h5_faq/#/faq", "FAQ帮助");
                 break;
+            case R.id.reservation_layout://游戏预约
+                Jump2View.getInstance().goActReservation(activity);
+                break;
             case R.id.abourt_us_layout://关于我们
                 Jump2View.getInstance().goNewAboutUs(activity);
                 break;

+ 2 - 1
app/src/main/java/com/kfzs/duanduan/services/DownloadTaskService.java

@@ -11,6 +11,7 @@ import com.kfzs.duanduan.datashare.DDProviderHelper;
 import com.kfzs.duanduan.datashare.provider.download.DownLoadInfo;
 import com.kfzs.duanduan.event.BigEvent;
 import com.kfzs.duanduan.event.EventTypes;
+import com.sheep.gamegroup.model.api.ITask;
 import com.sheep.gamegroup.model.entity.DialogEntity;
 import com.sheep.gamegroup.model.entity.OrienteeringDetail;
 import com.sheep.gamegroup.model.entity.TaskEty;
@@ -156,7 +157,7 @@ public class DownloadTaskService {
     }
 
 
-    public DownLoadInfo getDownloadTaskByUrl(TaskEty taskEty) {
+    public DownLoadInfo getDownloadTaskByUrl(ITask taskEty) {
         DownLoadInfo downLoadInfo = getDownloadTaskByUrl(taskEty.getDownload_link());
         if(downLoadInfo == null){
             downLoadInfo = CommonUtil.getInstance()

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

@@ -8,6 +8,7 @@ import java.util.Map;
 
 import retrofit2.Call;
 import retrofit2.http.Body;
+import retrofit2.http.DELETE;
 import retrofit2.http.FieldMap;
 import retrofit2.http.FormUrlEncoded;
 import retrofit2.http.GET;
@@ -628,7 +629,26 @@ public interface ApiService {
      */
     @GET("app/find/applications/my_score")
     Observable<BaseMessage> getMyAppScore(@Query("id") int id);
-
+    /**
+     * 应用 下载/预约 时先调用此接口生成记录
+     */
+    @GET("app/find/applications/downloads")
+    Observable<BaseMessage> getDownloads(@Query("id") int id);
+    /**
+     * 取消  应用 下载/预约
+     */
+    @DELETE("app/find/applications/downloads")
+    Observable<BaseMessage> deleteDownloads(@Query("id") int id);
+    /**
+     * 获取预约未下载数量
+     */
+    @GET("app/find/applications/downloads/status")
+    Observable<BaseMessage> getFindAppDownloadsStatus();
+    /**
+     * 获取预约下载列表
+     */
+    @GET("app/find/applications/downloads_list")
+    Observable<BaseMessage> getFindAppReservationList(@Query("page") int page, @Query("per_page") int per_page);
     /**
      * 首页list
      */

+ 21 - 0
app/src/main/java/com/sheep/gamegroup/model/api/ITask.java

@@ -0,0 +1,21 @@
+package com.sheep.gamegroup.model.api;
+
+/**
+ * Created by realicing on 2018/6/29.
+ * realicing@sina.com
+ */
+public interface ITask {
+    String getPackage_names();//任务的包名
+
+    int getTask_type();//任务的类型
+
+    String getDownload_link();//任务的下载链接
+
+    String getTask_name();//任务的名称
+
+    String getIcon();//任务的图标
+
+    String getPackage_size();//任务的包大小
+
+    int getAcceptedTaskId();//任务的id
+}

+ 68 - 7
app/src/main/java/com/sheep/gamegroup/model/entity/FindApp.java

@@ -1,17 +1,19 @@
 package com.sheep.gamegroup.model.entity;
 
+import com.sheep.gamegroup.model.api.ITask;
+
 /**
  * Created by realicing on 2018/6/28.
  * realicing@sina.com
  */
-public class FindApp {
+public class FindApp implements ITask{
     private int updated_at;
 
     private float score;//评分
 
     private String download_url;//下载地址
 
-    private int package_size;//包d大小单位M
+    private String package_size;//包d大小单位M
 
     private int Id;
 
@@ -43,6 +45,8 @@ public class FindApp {
 
     private int download_count;//下载数量
 
+    private int download;//1:可以下载
+
     public void setUpdated_at(int updated_at){
         this.updated_at = updated_at;
     }
@@ -61,10 +65,10 @@ public class FindApp {
     public String getDownload_url(){
         return this.download_url;
     }
-    public void setPackage_size(int package_size){
+    public void setPackage_size(String package_size){
         this.package_size = package_size;
     }
-    public int getPackage_size(){
+    public String getPackage_size(){
         return this.package_size;
     }
     public void setId(int Id){
@@ -158,12 +162,69 @@ public class FindApp {
         return this.download_count;
     }
 
+    public int getDownload() {
+        return download;
+    }
+
+    public void setDownload(int download) {
+        this.download = download;
+    }
+
+
+
+
+
+
+
+
+
+
+
+    @Override
+    public String getPackage_names() {
+        return package_name;
+    }
+
+    @Override
+    public int getTask_type() {
+        return 3;
+    }
+
+    @Override
+    public String getDownload_link() {
+        return download_url;
+    }
+
+    @Override
+    public String getTask_name() {
+        return name;
+    }
+
+    @Override
+    public int getAcceptedTaskId() {
+        return Id;
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
     /**
-     * 是否是预约下载
+     * 是否可以下载
      * @return
      */
-    public boolean isReservationDownload(){
-        return download_type == 2;//1:非预约下载 2:预约下载
+    public boolean isCanDonload(){
+        return download == 1;//可以下载
     }
 }

+ 88 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/FindAppReservation.java

@@ -0,0 +1,88 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by realicing on 2018/6/29.
+ * realicing@sina.com
+ */
+public class FindAppReservation {
+    private int UserId;
+
+    private int Type;//1:预约 2:下载--------------实际上效果是反的
+
+    private int UpdatedAt;
+
+    private int ApplicationId;
+
+    private FindApp application;
+
+    private int Id;
+
+    private int Status;//预约下载状态:1:预约未下载 2:预约已下载 (直接下载默认0)
+
+    private int CreatedAt;
+
+    public void setUserId(int UserId){
+        this.UserId = UserId;
+    }
+    public int getUserId(){
+        return this.UserId;
+    }
+    public void setType(int Type){
+        this.Type = Type;
+    }
+    public int getType(){
+        return this.Type;
+    }
+    public void setUpdatedAt(int UpdatedAt){
+        this.UpdatedAt = UpdatedAt;
+    }
+    public int getUpdatedAt(){
+        return this.UpdatedAt;
+    }
+    public void setApplicationId(int ApplicationId){
+        this.ApplicationId = ApplicationId;
+    }
+    public int getApplicationId(){
+        return this.ApplicationId;
+    }
+    public void setApplication(FindApp application){
+        this.application = application;
+    }
+    public FindApp getApplication(){
+        return this.application;
+    }
+    public void setId(int Id){
+        this.Id = Id;
+    }
+    public int getId(){
+        return this.Id;
+    }
+    public void setStatus(int Status){
+        this.Status = Status;
+    }
+    public int getStatus(){
+        return this.Status;
+    }
+    public void setCreatedAt(int CreatedAt){
+        this.CreatedAt = CreatedAt;
+    }
+    public int getCreatedAt(){
+        return this.CreatedAt;
+    }
+
+
+
+
+
+
+
+    private boolean cancel;//取消预约状态:默认没有取消预约为false
+
+    public boolean isCancel() {
+        return cancel;
+    }
+
+    public void setCancel(boolean cancel) {
+        this.cancel = cancel;
+    }
+}

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

@@ -4,6 +4,7 @@ import android.text.TextUtils;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.model.api.ITask;
 import com.sheep.gamegroup.util.ListUtil;
 
 import java.io.Serializable;
@@ -14,7 +15,7 @@ import java.util.List;
  * Created by ljy on 2018/3/20.
  */
 
-public class TaskEty implements Serializable{
+public class TaskEty implements Serializable, ITask {
     private String boot_address;//private String string",
     private String create_time;// 0,
     private String download_link;//private String string",

+ 104 - 0
app/src/main/java/com/sheep/gamegroup/util/FindAppHelper.java

@@ -0,0 +1,104 @@
+package com.sheep.gamegroup.util;
+
+import android.app.Activity;
+import android.view.Gravity;
+import android.view.View;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.kfzs.duanduan.services.DownloadTaskService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.DialogConfig;
+import com.sheep.gamegroup.model.entity.FindApp;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.view.activity.TaskDetailAct;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import java.util.Locale;
+
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by realicing on 2018/6/29.
+ * realicing@sina.com
+ */
+public class FindAppHelper {
+    private boolean isCommitAppDownloadsSuccess = false;//是否提交预约
+    private Activity activity;
+    private FindApp findApp;
+    private TextView find_game_down_tv;
+    public void updateView(Activity activity, final FindApp findApp, final TextView find_game_down_tv) {
+        this.activity = activity;
+        this.findApp = findApp;
+        this.find_game_down_tv = find_game_down_tv;
+
+        if(findApp.isCanDonload()){//可下载
+            if(mDownloadTaskService == null){
+                mDownloadTaskService = new DownloadTaskService(activity);
+            }
+            TaskDetailAct.setBtnStr(findApp, mDownloadTaskService, new Action1<Object>() {
+                @Override
+                public void call(Object o) {
+//                    find_game_down_tv.setText("立即下载");
+                }
+            });
+            find_game_down_tv.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    commitAppDownloads(false, findApp);
+                    downloadApp(findApp);
+                }
+            });
+        } else {//预约下载
+            find_game_down_tv.setText("预约下载");
+            find_game_down_tv.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    if(isCommitAppDownloadsSuccess){//已经提交成功
+                    } else {//没有提交过或者提交失败的
+                        find_game_down_tv.setEnabled(false);
+                        commitAppDownloads(true, findApp);
+                    }
+                }
+            });
+        }
+    }
+    private DownloadTaskService mDownloadTaskService;
+    //下载应用
+    private void downloadApp(FindApp findApp) {
+    }
+
+    //点击预约下载与立即下载时,需要调用这个接口记录到服务器
+    private void commitAppDownloads(final boolean isNeedReservation, final FindApp findApp) {
+        SheepApp.getInstance().getNetComponent().getApiService().getDownloads(findApp.getId())
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        LogUtil.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
+                        if(isNeedReservation){//提交预约成功
+                            find_game_down_tv.setText("预约成功");
+                            find_game_down_tv.setEnabled(false);
+                            ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("预约成功")
+                                    .setMsg(String.format(Locale.CHINA, "请在%s准时到小绵羊下载哦", TimeUtil.TimeStamp2Date(findApp.getDownload_at(), "yyyy年MM月dd日\tHH时mm分")))
+                                    .setMsgGravity(Gravity.START).setBtnLeftText("我知道了"));
+                        } else {//提交下载成功
+                            find_game_down_tv.setEnabled(true);
+                        }
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
+                        if(isNeedReservation) {
+                            G.showToast("预约失败");
+                        }
+                        find_game_down_tv.setEnabled(true);
+                    }
+                });
+    }
+}

+ 51 - 2
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -10,6 +10,7 @@ import android.os.Bundle;
 import android.provider.Settings;
 import android.support.v7.app.AlertDialog;
 import android.text.TextUtils;
+import android.view.Gravity;
 import android.view.View;
 
 import com.alibaba.fastjson.JSON;
@@ -24,6 +25,7 @@ import com.sheep.gamegroup.model.entity.Container;
 import com.sheep.gamegroup.model.entity.CreditCard;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.DialogEntity;
+import com.sheep.gamegroup.model.entity.FindApp;
 import com.sheep.gamegroup.model.entity.FindItem;
 import com.sheep.gamegroup.model.entity.NewbieTask;
 import com.sheep.gamegroup.model.entity.NewbieTaskRecord;
@@ -49,6 +51,7 @@ import com.sheep.gamegroup.view.activity.ActMyMoney;
 import com.sheep.gamegroup.view.activity.ActNewAboutUs;
 import com.sheep.gamegroup.view.activity.ActNewbieTaskList;
 import com.sheep.gamegroup.view.activity.ActNotice;
+import com.sheep.gamegroup.view.activity.ActReservation;
 import com.sheep.gamegroup.view.activity.ActUnderstandSheep;
 import com.sheep.gamegroup.view.activity.ActUserLabelList;
 import com.sheep.gamegroup.view.activity.ActWeb;
@@ -1167,6 +1170,35 @@ public class Jump2View {
                     @Override
                     public void onError(BaseMessage baseMessage) {
                         LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
+                        tryShowReservation(activity);
+                    }
+                });
+    }
+    public void tryShowReservation(final Activity activity) {
+        SheepApp.getInstance().getNetComponent().getApiService().getFindAppDownloadsStatus()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(activity) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
+                        if(baseMessage.getData() instanceof Integer){
+                            if((int)baseMessage.getData() > 0){//该提示在弹窗广告后显示,且必须有可下载的游戏,弹出弹窗
+                                ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("预约下载提示")
+                                        .setMsg("你有可下载的预约游戏请及时下载,不要错过优先时机哦。").setMsgGravity(Gravity.START)
+                                        .setBtnLeftText("去下载").setBtnLeftOnClickListener(new View.OnClickListener() {
+                                            @Override
+                                            public void onClick(View view) {
+                                                goActReservation(activity);//点击去下载到游戏预约列表
+                                            }
+                                        }).setBtnRightText("我知道了"));
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                     }
                 });
     }
@@ -1297,9 +1329,17 @@ public class Jump2View {
      * @param activity
      * @param item
      */
-    public void goFindGame(Activity activity, FindItem item) {
+    public void goFindGame(Activity activity, Object item) {
         Intent intent = new Intent(activity, ActFindGame.class);
-        intent.putExtra("id", item.getApplication_id());
+        int applicationId = 0;
+        if(item instanceof FindItem){
+            applicationId = ((FindItem) item).getApplication_id();
+        } else if(item instanceof FindApp){
+            applicationId = ((FindApp) item).getId();
+        } else if(item instanceof Integer){
+            applicationId = (int) item;
+        }
+        intent.putExtra("id", applicationId);
         activity.startActivity(intent);
     }
     /**
@@ -1313,4 +1353,13 @@ public class Jump2View {
         intent.putExtra("title", item.getTitle());
         activity.startActivity(intent);
     }
+
+    /**
+     * 进入游戏预约列表界面
+     * @param activity
+     */
+    public void goActReservation(Activity activity) {
+        Intent intent = new Intent(activity, ActReservation.class);
+        activity.startActivity(intent);
+    }
 }

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -568,6 +568,7 @@ public class ViewUtil {
                     if (finalTimer != null) {
                         finalTimer.clear();
                     }
+                    Jump2View.getInstance().tryShowReservation(activity);
                 }
             });
             if(TextUtils.isEmpty(advertising.getDesc())) {

+ 15 - 13
app/src/main/java/com/sheep/gamegroup/view/activity/ActFindGame.java

@@ -6,6 +6,7 @@ import android.support.design.widget.AppBarLayout;
 import android.support.v7.widget.AppCompatRatingBar;
 import android.support.v7.widget.Toolbar;
 import android.text.TextUtils;
+import android.view.Gravity;
 import android.view.View;
 import android.webkit.WebView;
 import android.widget.ImageView;
@@ -24,6 +25,7 @@ import com.kfzs.duanduan.utils.StatusBarUtils;
 import com.kfzs.duanduan.utils.dlg.HelperUtils;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.FindApp;
 import com.sheep.gamegroup.model.entity.FindAppScore;
 import com.sheep.gamegroup.model.entity.MyFindAppCore;
@@ -31,10 +33,12 @@ import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.Conversion2;
+import com.sheep.gamegroup.util.FindAppHelper;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.ImageGlarryDrawable;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.LogUtil;
+import com.sheep.gamegroup.util.TimeUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.customview.SheepViewPager;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
@@ -261,27 +265,23 @@ public class ActFindGame extends BaseActivity {
     TextView find_game_name_tv;
     @BindView(R.id.find_game_info_tv)
     TextView find_game_info_tv;
-    @BindView(R.id.find_game_size_tv)
-    TextView find_game_size_tv;
     @BindView(R.id.find_game_xin)
     RatingBar find_game_xin;
     @BindView(R.id.find_game_down_tv)
     TextView find_game_down_tv;
-
+    private FindAppHelper findAppHelper = new FindAppHelper();
     private void loadData(final FindApp findApp) {
         //游戏简介与下载
         ViewUtil.setImage(find_game_iv, findApp.getIcon());
         ViewUtil.setText(find_game_name_tv, findApp.getName());
-        ViewUtil.setText(find_game_info_tv, String.format(Locale.CHINA, "厂商:%s | 版本号:%s", findApp.getManufacturer(), findApp.getVersions()));
-        ViewUtil.setText(find_game_size_tv, String.format(Locale.CHINA, "包体大小:%sM", findApp.getPackage_size()));
+        final boolean isNeedReservation = !findApp.isCanDonload();//这里认为只有两种状态:可下载与预约下载
+        if(isNeedReservation)
+            ViewUtil.setText(find_game_info_tv, String.format(Locale.CHINA, "开放时间:%s", TimeUtil.TimeStamp2Date(findApp.getDownload_at(), "yyyy-MM-dd\tHH:mm")));
+        else
+            ViewUtil.setText(find_game_info_tv, String.format(Locale.CHINA, "厂商:%s | 版本号:%s\n包体大小:%sM", findApp.getManufacturer(), findApp.getVersions(), findApp.getPackage_size()));
+
         find_game_xin.setRating(findApp.getScore()/2);
-        find_game_down_tv.setText(findApp.isReservationDownload() ? "预约下载" : "立即下载");
-        find_game_down_tv.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
-                G.showToast("您点击了"+(findApp.isReservationDownload() ? "预约下载" : "立即下载"));
-            }
-        });
+        findAppHelper.updateView(this, findApp, find_game_down_tv);
         //游戏图片banner
         String pictures = findApp.getPictures();
         if(!TextUtils.isEmpty(pictures) && pictures.contains(";")){
@@ -303,11 +303,11 @@ public class ActFindGame extends BaseActivity {
         //游戏介绍
         loadAppInfo(findApp);
     }
+
     private void resetData() {
         //游戏简介与下载
         ViewUtil.setText(find_game_name_tv);
         ViewUtil.setText(find_game_info_tv);
-        ViewUtil.setText(find_game_size_tv);
         ViewUtil.setText(find_game_down_tv);
         find_game_xin.setRating(0.0f);
         //应用评分情况
@@ -426,4 +426,6 @@ public class ActFindGame extends BaseActivity {
     private void loadAppInfo(final FindApp findApp) {
         ViewUtil.loadDataWithBaseURL(find_game_info_wv, findApp.getIntro());
     }
+
+
 }

+ 11 - 9
app/src/main/java/com/sheep/gamegroup/view/activity/ActFindInformation.java

@@ -19,6 +19,7 @@ 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.util.SheepSubscriber;
+import com.sheep.gamegroup.util.FindAppHelper;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.LogUtil;
@@ -170,6 +171,7 @@ public class ActFindInformation extends BaseActivity {
             }
         });
     }
+    private FindAppHelper findAppHelper = new FindAppHelper();
     private void loadGame(View itemView) {
         itemView.setVisibility(View.VISIBLE);
         ImageView find_information_game_icon = (ImageView)itemView.findViewById(R.id.find_information_game_icon);
@@ -180,16 +182,16 @@ public class ActFindInformation extends BaseActivity {
         TextView find_information_game_task = (TextView)itemView.findViewById(R.id.find_information_game_task);
         ViewUtil.setImage(find_information_game_icon, findApp.getIcon());
         ViewUtil.setText(find_information_game_name, findApp.getName());
-        ViewUtil.setText(find_information_game_surplus, String.format(Locale.CHINA, "厂商:%s", findApp.getManufacturer()));
-        ViewUtil.setText(find_information_game_time, String.format(Locale.CHINA, "包体大小:%sM", findApp.getPackage_size()));
+        final boolean isNeedReservation = !findApp.isCanDonload();//这里认为只有两种状态:可下载与预约下载
+        ViewUtil.setText(find_information_game_surplus);
+        if(isNeedReservation)
+            ViewUtil.setText(find_information_game_time, String.format(Locale.CHINA, "开放时间:%s", TimeUtil.TimeStamp2Date(findApp.getDownload_at(), "yyyy-MM-dd\tHH:mm")));
+        else
+            ViewUtil.setText(find_information_game_time, String.format(Locale.CHINA, "厂商:%s \n包体大小:%sM", findApp.getManufacturer(),findApp.getPackage_size()));
+//        ViewUtil.setText(find_information_game_surplus, String.format(Locale.CHINA, "厂商:%s", findApp.getManufacturer()));
+//        ViewUtil.setText(find_information_game_time, String.format(Locale.CHINA, "包体大小:%sM", findApp.getPackage_size()));
         find_information_game_yuan.setVisibility(View.GONE);
-        find_information_game_task.setText("立即下载");
-        find_information_game_task.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
-                G.showToast("点击立即下载");
-            }
-        });
+        findAppHelper.updateView(this, findApp, find_information_game_task);
 
         itemView.setOnClickListener(new View.OnClickListener() {
             @Override

+ 255 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActReservation.java

@@ -0,0 +1,255 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.FindApp;
+import com.sheep.gamegroup.model.entity.FindAppReservation;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.LogUtil;
+import com.sheep.gamegroup.util.SysAppUtil;
+import com.sheep.gamegroup.util.TimeUtil;
+import com.sheep.gamegroup.util.ViewHolder;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import java.util.List;
+import java.util.Locale;
+
+import butterknife.BindView;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by realicing on 2018/5/10.
+ * realicing@sina.com
+ */
+public class ActReservation extends BaseActivity {
+    @Override
+    protected int getLayoutId() {
+        return R.layout.net_empty_fresh_list_not_wrap;
+    }
+
+    @BindView(R.id.refresh)
+    SwipeRefreshLayout refresh;
+    @BindView(R.id.empty_view)
+    View empty_view;
+    @BindView(R.id.check_net_ll)
+    View check_net_ll;
+    @BindView(R.id.view_list)
+    RecyclerView view_list;
+
+    @Override
+    public void initView() {
+        TitleBarUtils.getInstance()
+                .setTitle(this, "游戏预约")
+                .setTitleFinish(this);
+
+        refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+            @Override
+            public void onRefresh() {
+                initData();
+                refresh.setRefreshing(false);
+            }
+        });
+
+        view_list.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
+        view_list.setAdapter(new AdbCommonRecycler<FindAppReservation>(SheepApp.getInstance(), list) {
+
+            @Override
+            public int getItemViewType(int position) {
+                return position;
+            }
+
+            @Override
+            public int getViewIdByType(int type) {//type来源于 getItemViewType 返回的值
+                switch (type) {
+                    case 0:
+                        return R.layout.find_reservation_item_top;
+                    default:
+                        if(type + 1 == list.size())
+                            return R.layout.find_reservation_item_bottom;
+                        else
+                            return R.layout.find_reservation_item_center;
+                }
+            }
+
+            @Override
+            public void convert(ViewHolder holder, FindAppReservation item) {
+                if(item != null)
+                    loadItem(holder.itemView, item);
+            }
+        });
+    }
+
+    private void loadItem(View itemView, final FindAppReservation 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);
+        TextView find_information_game_bt1 = (TextView) itemView.findViewById(R.id.find_information_game_bt1);
+        final TextView find_information_game_bt2 = (TextView) itemView.findViewById(R.id.find_information_game_bt2);
+
+        if(item != null && item.getApplication() != null){
+            final FindApp findApp = item.getApplication();
+
+            ViewUtil.setImage(find_information_game_icon, findApp.getIcon());
+            ViewUtil.setText(find_information_game_name, findApp.getName());
+            ViewUtil.setText(find_information_game_time, String.format(Locale.CHINA, "开放时间:%s", TimeUtil.TimeStamp2Date(findApp.getDownload_at(), "yyyy-MM-dd\tHH:mm")));
+            if(findApp.isCanDonload()){//可以下载
+                find_information_game_bt1.setEnabled(true);
+                find_information_game_bt1.setText("立即下载");
+                find_information_game_bt1.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        G.showToast("点击立即下载");
+                    }
+                });
+
+                find_information_game_bt2.setEnabled(false);
+            } else {
+                find_information_game_bt1.setEnabled(false);
+                find_information_game_bt1.setText("即将开始");
+
+                find_information_game_bt2.setEnabled(true);
+                find_information_game_bt2.setText(item.isCancel() ? "立即预约" : "取消预约");
+                find_information_game_bt2.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        find_information_game_bt2.setEnabled(false);
+                        if(item.isCancel()){//已经取消预约则进行预约
+                            commitAppDownloads(find_information_game_bt2, findApp.getId());
+                        } else {//取消预约
+                            deleteDownloads(find_information_game_bt2, item.getId());
+                        }
+                    }
+                });
+            }
+            itemView.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    Jump2View.getInstance().goFindGame(ActReservation.this, findApp);
+                }
+            });
+        } else {
+
+            ViewUtil.setText(find_information_game_name);
+            ViewUtil.setText(find_information_game_time);
+            find_information_game_bt1.setEnabled(false);
+            find_information_game_bt2.setEnabled(false);
+        }
+    }
+
+    //预约下载
+    private void commitAppDownloads(final TextView find_information_game_bt2, int id) {
+        SheepApp.getInstance().getNetComponent().getApiService().getDownloads(id)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
+                        find_information_game_bt2.setEnabled(true);
+                        find_information_game_bt2.setText("取消预约");
+                        G.showToast("预约成功");
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
+                        G.showToast("预约失败");
+                        find_information_game_bt2.setEnabled(true);
+                    }
+                });
+    }
+    //取消预约
+    private void deleteDownloads(final TextView find_information_game_bt2, int id) {
+        SheepApp.getInstance().getNetComponent().getApiService().deleteDownloads(id)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
+                        find_information_game_bt2.setEnabled(true);
+                        find_information_game_bt2.setText("立即预约");
+                        G.showToast("取消预约成功");
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
+                        G.showToast("取消预约失败");
+                        find_information_game_bt2.setEnabled(true);
+                    }
+                });
+    }
+    @Override
+    public void initListener() {
+
+    }
+
+    private List<FindAppReservation> list = ListUtil.emptyList();
+
+    @Override
+    public void initData() {
+        empty_view.setVisibility(View.INVISIBLE);
+        SysAppUtil.checkNet(new Action1<Integer>() {
+            @Override
+            public void call(Integer result) {
+                if (result != 0) {//无网络
+                    if (check_net_ll != null)
+                        check_net_ll.setVisibility(View.VISIBLE);
+                } else {
+                    if (check_net_ll != null)
+                        check_net_ll.setVisibility(View.GONE);
+                }
+            }
+        });
+        SheepApp.getInstance().getNetComponent().getApiService().getFindAppReservationList(1, 100)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
+                        List<FindAppReservation> newList = baseMessage.getDataList(FindAppReservation.class);
+                        if (ListUtil.isEmpty(newList)) {
+                        } else {
+                            list.clear();
+                            ListUtil.addAll(list, newList);
+                            if(!list.isEmpty())
+                                list.add(null);//底部圆角
+                            notifyDataSetChanged();
+                        }
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
+                        notifyDataSetChanged();
+                    }
+                });
+    }
+
+
+    private void notifyDataSetChanged() {
+        if (list.isEmpty())
+            empty_view.setVisibility(View.VISIBLE);
+        refresh.setRefreshing(false);
+        view_list.getAdapter().notifyDataSetChanged();
+    }
+}

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

@@ -34,6 +34,7 @@ import com.kfzs.duanduan.utils.ApkUtils;
 import com.sheep.gamegroup.absBase.AbsChooseImageActivity;
 import com.sheep.gamegroup.di.components.DaggerTaskDetailComponent;
 import com.sheep.gamegroup.di.modules.TaskDetailModule;
+import com.sheep.gamegroup.model.api.ITask;
 import com.sheep.gamegroup.model.entity.AppRecord;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.DialogEntity;
@@ -431,7 +432,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
 
     }
 
-    public static void setBtnStr(TaskEty taskEty, DownloadTaskService mDownloadTaskService, Action1<Object> action1) {
+    public static void setBtnStr(ITask taskEty, DownloadTaskService mDownloadTaskService, Action1<Object> action1) {
         boolean isInstalled = PackageUtil.isAppInstalled(SheepApp.getInstance(), taskEty.getPackage_names());
         boolean isExistApk = !TextUtils.isEmpty(PackageUtil.isExistsFile(taskEty.getPackage_names()));
         String buttonStr;

+ 11 - 0
app/src/main/res/color/selector_color_main_tab2.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:state_enabled="false" android:color="@color/main_tab" />
+    <item android:state_activated="true" android:color="@color/main_tab" />
+    <item android:state_focused="true" android:color="@color/main_tab" />
+    <item android:state_checked="true" android:color="@color/main_tab"/>
+    <item android:state_selected="true" android:color="@color/main_tab"/>
+    <item android:state_pressed="true" android:color="@color/main_tab"/>
+    <item android:color="@color/main_tab_activated"/>
+</selector>

+ 9 - 0
app/src/main/res/drawable/selector_button_full_main2.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android" >
+  <item android:state_enabled="false" android:drawable="@drawable/button_full_normal_gray" />
+  <item android:state_focused="true" android:drawable="@drawable/btn_main_stroke_no_check" />
+  <item android:state_checked="true" android:drawable="@drawable/btn_main_stroke_no_check"/>
+  <item android:state_selected="true" android:drawable="@drawable/btn_main_stroke_no_check"/>
+  <item android:state_pressed="true" android:drawable="@drawable/btn_main_stroke_no_check"/>
+  <item android:drawable="@drawable/layer_list_check_rectgangle"/>
+</selector>

+ 1 - 10
app/src/main/res/layout/act_find_game.xml

@@ -60,20 +60,11 @@
                     android:layout_height="wrap_content"
                     android:layout_marginTop="5dp"
                     android:gravity="center"
+                    android:lineSpacingExtra="5dp"
                     android:text="厂商:网易 | 版本号:7.9"
                     android:textColor="@color/black_666666"
                     android:textSize="15sp" />
 
-                <TextView
-                    android:id="@+id/find_game_size_tv"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginTop="5dp"
-                    android:gravity="center"
-                    android:text="包体大小:856M"
-                    android:textColor="@color/black_666666"
-                    android:textSize="15sp" />
-
                 <android.support.v7.widget.AppCompatRatingBar
                     android:id="@+id/find_game_xin"
                     style="@style/style_rating_bar"

+ 1 - 1
app/src/main/res/layout/act_understand_sheep.xml

@@ -681,7 +681,7 @@
                         android:layout_height="wrap_content"
                         android:layout_marginTop="190dp"
                         android:gravity="center"
-                        android:text="享受额外收益"
+                        android:text="享受额外收益"
                         android:textColor="@color/white"
                         android:textSize="12sp"
                         app:layout_constraintEnd_toEndOf="@+id/understand_sheep_e_tv_1"

+ 40 - 0
app/src/main/res/layout/fgt_personalcenter_item_center_two.xml

@@ -9,6 +9,46 @@
     android:layout_marginStart="@dimen/content_padding_15"
     android:layout_marginEnd="@dimen/content_padding_15">
     <RelativeLayout
+        android:id="@+id/reservation_layout"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:padding="15dp"
+        android:gravity="center">
+        <ImageView
+            android:id="@+id/reservation_item_icon_iv"
+            android:layout_width="@dimen/content_padding_20"
+            android:layout_height="@dimen/content_padding_20"
+            android:src="@mipmap/personalc_ic_reservation"
+            android:layout_marginRight="12dp"
+            android:layout_centerVertical="true"/>
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="游戏预约"
+            android:lines="1"
+            android:textColor="@color/black"
+            android:textSize="14dp"
+            android:layout_centerVertical="true"
+            android:layout_toEndOf="@+id/reservation_item_icon_iv" />
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@mipmap/x_ic_next"
+            android:layout_alignParentRight="true"
+            android:layout_marginLeft="12dp"
+            android:layout_centerVertical="true"/>
+
+    </RelativeLayout>
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1px"
+        android:background="@color/white_bg_line"
+        android:layout_marginLeft="15dp"
+        android:layout_marginRight="15dp"
+        />
+
+    <RelativeLayout
         android:id="@+id/abourt_us_layout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"

+ 57 - 0
app/src/main/res/layout/find_reservation_item.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <ImageView
+        android:id="@+id/find_information_game_icon"
+        android:layout_width="80dp"
+        android:layout_height="80dp"
+        android:src="@mipmap/icon"/>
+
+    <TextView
+        android:id="@+id/find_information_game_name"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="5dp"
+        android:maxLines="2"
+        android:lines="2"
+        android:text="小绵羊小绵羊小绵羊小绵羊小小绵羊小绵羊小绵羊小绵羊小小绵羊小绵羊小绵羊小绵羊小小绵羊小绵羊小绵羊小绵羊小"
+        android:textColor="#020202"
+        android:textSize="15sp"
+        app:layout_constraintBottom_toTopOf="@+id/find_information_game_time"
+        app:layout_constraintEnd_toStartOf="@+id/find_information_game_bt2"
+        app:layout_constraintStart_toEndOf="@+id/find_information_game_icon"
+        app:layout_constraintTop_toTopOf="@+id/find_information_game_icon" />
+
+    <TextView
+        android:id="@+id/find_information_game_time"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/app_name"
+        android:textColor="#989898"
+        android:textSize="13sp"
+        app:layout_constraintBottom_toBottomOf="@+id/find_information_game_icon"
+        app:layout_constraintStart_toStartOf="@+id/find_information_game_name"
+        app:layout_constraintTop_toBottomOf="@+id/find_information_game_name" />
+
+
+    <TextView
+        android:id="@+id/find_information_game_bt1"
+        style="@style/style_button_wrap"
+        android:text="立即下载"
+        app:layout_constraintBottom_toTopOf="@+id/find_information_game_bt2"
+        app:layout_constraintEnd_toEndOf="@+id/find_information_game_bt2"
+        app:layout_constraintStart_toStartOf="@+id/find_information_game_bt2"
+        app:layout_constraintTop_toTopOf="@+id/find_information_game_icon"/>
+    <TextView
+        android:id="@+id/find_information_game_bt2"
+        style="@style/style_button_wrap2"
+        android:text="立即预约"
+        app:layout_constraintBottom_toBottomOf="@+id/find_information_game_icon"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/find_information_game_name"
+        app:layout_constraintTop_toBottomOf="@+id/find_information_game_bt1" />
+
+</android.support.constraint.ConstraintLayout>

+ 5 - 0
app/src/main/res/layout/find_reservation_item_bottom.xml

@@ -0,0 +1,5 @@
+<?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="@dimen/content_padding"
+    android:background="@drawable/shape_white_solid_rectangle_small_bottom"/>

+ 17 - 0
app/src/main/res/layout/find_reservation_item_center.xml

@@ -0,0 +1,17 @@
+<?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">
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_marginTop="@dimen/content_padding"
+        android:layout_marginBottom="@dimen/content_padding"
+        android:background="#F2F2F2" />
+
+    <include layout="@layout/find_reservation_item" />
+
+</LinearLayout>

+ 22 - 0
app/src/main/res/layout/find_reservation_item_top.xml

@@ -0,0 +1,22 @@
+<?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:paddingTop="@dimen/content_padding"
+    android:paddingStart="@dimen/content_padding"
+    android:paddingEnd="@dimen/content_padding"
+    android:background="@drawable/shape_white_solid_rectangle_small_top"
+    android:orientation="vertical">
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="@dimen/content_padding"
+        android:layout_marginBottom="@dimen/content_padding"
+        android:text="推荐"
+        android:textColor="@color/black"
+        android:textSize="15sp" />
+
+    <include layout="@layout/find_reservation_item" />
+
+</LinearLayout>

+ 39 - 0
app/src/main/res/layout/net_empty_fresh_list_not_wrap.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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">
+
+    <include
+        android:id="@+id/title"
+        layout="@layout/title"/>
+
+    <include
+        android:id="@+id/check_net_ll"
+        layout="@layout/check_net_view"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/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/check_net_ll" />
+    <android.support.v4.widget.SwipeRefreshLayout
+        android:id="@+id/refresh"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:padding="@dimen/content_padding"
+        android:layout_below="@+id/check_net_ll" >
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+            <android.support.v7.widget.RecyclerView
+                android:id="@+id/view_list"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"/>
+        </LinearLayout>
+    </android.support.v4.widget.SwipeRefreshLayout>
+</RelativeLayout>

BIN=BIN
app/src/main/res/mipmap-xhdpi/personalc_ic_reservation.png


+ 12 - 1
app/src/main/res/values/dd_styles.xml

@@ -32,10 +32,21 @@
         <item name="android:paddingEnd">@dimen/content_padding_20</item>
         <item name="android:paddingStart">@dimen/content_padding_20</item>
         <item name="android:paddingTop">5dp</item>
-        <item name="android:text">下载游戏</item>
         <item name="android:textColor">@color/btn_color_main</item>
         <item name="android:textSize">@dimen/text_size_15</item>
     </style>
+    <style name="style_button_wrap2">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:background">@drawable/selector_button_full_main2</item>
+        <item name="android:gravity">center</item>
+        <item name="android:paddingBottom">5dp</item>
+        <item name="android:paddingEnd">@dimen/content_padding_20</item>
+        <item name="android:paddingStart">@dimen/content_padding_20</item>
+        <item name="android:paddingTop">5dp</item>
+        <item name="android:textColor">@color/selector_color_main_tab2</item>
+        <item name="android:textSize">@dimen/text_size_15</item>
+    </style>
     <style name="style_button_show" parent="button">
         <item name="android:layout_width">0dp</item>
         <item name="android:layout_height">30dp</item>