liujiangyao пре 8 година
родитељ
комит
e2aa2b92e0
48 измењених фајлова са 1414 додато и 32 уклоњено
  1. 0 6
      .idea/gradle.xml
  2. 8 5
      app/src/main/AndroidManifest.xml
  3. 16 0
      app/src/main/java/com/sheep/gamegroup/di/components/BindDataComponent.java
  4. 16 0
      app/src/main/java/com/sheep/gamegroup/di/components/HomePageComponent.java
  5. 16 0
      app/src/main/java/com/sheep/gamegroup/di/components/TryMakeMoneyComponent.java
  6. 22 0
      app/src/main/java/com/sheep/gamegroup/di/modules/BindDataModule.java
  7. 23 0
      app/src/main/java/com/sheep/gamegroup/di/modules/HomePageModule.java
  8. 22 0
      app/src/main/java/com/sheep/gamegroup/di/modules/TryMakeMoneyModule.java
  9. 17 0
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  10. 47 0
      app/src/main/java/com/sheep/gamegroup/model/entity/RequestParameEty.java
  11. 123 0
      app/src/main/java/com/sheep/gamegroup/model/util/ExceptionHandle.java
  12. 59 0
      app/src/main/java/com/sheep/gamegroup/model/util/MySubscriber.java
  13. 20 0
      app/src/main/java/com/sheep/gamegroup/presenter/BindDataContract.java
  14. 88 0
      app/src/main/java/com/sheep/gamegroup/presenter/BindDataPresenter.java
  15. 19 0
      app/src/main/java/com/sheep/gamegroup/presenter/HomePageContract.java
  16. 55 0
      app/src/main/java/com/sheep/gamegroup/presenter/HomePagePresenter.java
  17. 21 0
      app/src/main/java/com/sheep/gamegroup/presenter/TryMakeMoneyContract.java
  18. 78 0
      app/src/main/java/com/sheep/gamegroup/presenter/TryMakeMoneyPresenter.java
  19. 27 0
      app/src/main/java/com/sheep/gamegroup/presenter/WithdrawalPresenter.java
  20. 54 0
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  21. 34 0
      app/src/main/java/com/sheep/gamegroup/util/MyListview.java
  22. 155 0
      app/src/main/java/com/sheep/gamegroup/view/activity/BindDataAct.java
  23. 131 3
      app/src/main/java/com/sheep/gamegroup/view/activity/HomePageAct.java
  24. 42 2
      app/src/main/java/com/sheep/gamegroup/view/activity/TryMakeMoneyact.java
  25. 18 0
      app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalAct.java
  26. 2 2
      app/src/main/java/com/sheep/gamegroup/view/adapter/WithdrawalAdapter.java
  27. 1 1
      app/src/main/java/com/sheep/jiuyan/samllsheep/base/BaseActivity.java
  28. 1 1
      app/src/main/java/com/sheep/jiuyan/samllsheep/page/SplashActivity.java
  29. 87 0
      app/src/main/res/layout/bind_data_act_layout.xml
  30. 196 7
      app/src/main/res/layout/homepage_act_layout.xml
  31. 11 3
      app/src/main/res/layout/try_makemoney_act_layout.xml
  32. 1 2
      app/src/main/res/layout/withdrawal_gridview_item.xml
  33. BIN
      app/src/main/res/mipmap-xhdpi/couple_red_packets.png
  34. BIN
      app/src/main/res/mipmap-xhdpi/home_blue_bg.png
  35. BIN
      app/src/main/res/mipmap-xhdpi/home_couple_red_packets.png
  36. BIN
      app/src/main/res/mipmap-xhdpi/home_invitation_bg.png
  37. BIN
      app/src/main/res/mipmap-xhdpi/home_lying_bg.png
  38. BIN
      app/src/main/res/mipmap-xhdpi/home_right_arrow.png
  39. BIN
      app/src/main/res/mipmap-xhdpi/home_try_play_bg.png
  40. BIN
      app/src/main/res/mipmap-xxhdpi/couple_red_packets.png
  41. BIN
      app/src/main/res/mipmap-xxhdpi/home_blue_bg.png
  42. BIN
      app/src/main/res/mipmap-xxhdpi/home_couple_red_packets.png
  43. BIN
      app/src/main/res/mipmap-xxhdpi/home_invitation_bg.png
  44. BIN
      app/src/main/res/mipmap-xxhdpi/home_lying_bg.png
  45. BIN
      app/src/main/res/mipmap-xxhdpi/home_right_arrow.png
  46. BIN
      app/src/main/res/mipmap-xxhdpi/home_try_play_bg.png
  47. 1 0
      app/src/main/res/values/common.xml
  48. 3 0
      app/src/main/res/values/gamegroup_color.xml

+ 0 - 6
.idea/gradle.xml

@@ -5,12 +5,6 @@
       <GradleProjectSettings>
         <option name="distributionType" value="DEFAULT_WRAPPED" />
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
-        <option name="modules">
-          <set>
-            <option value="$PROJECT_DIR$" />
-            <option value="$PROJECT_DIR$/app" />
-          </set>
-        </option>
         <option name="resolveModulePerSourceSet" value="false" />
       </GradleProjectSettings>
     </option>

+ 8 - 5
app/src/main/AndroidManifest.xml

@@ -178,6 +178,11 @@
             android:name=".page.SplashActivity"
             android:screenOrientation="portrait">
 
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+
+                <category android:name="android.intent.category.LAUNCHER"/>
+            </intent-filter>
         </activity>
         <activity
             android:name="com.sheep.gamegroup.view.activity.AskRewardAct"
@@ -194,11 +199,6 @@
         <activity
             android:name="com.sheep.gamegroup.view.activity.AccountAndSecurityAct"
             android:screenOrientation="portrait">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-
-                <category android:name="android.intent.category.LAUNCHER"/>
-            </intent-filter>
         </activity>
 
         <!--2.0-->
@@ -208,6 +208,9 @@
         <activity android:name="com.sheep.gamegroup.view.activity.WithdrawalAct"/>
         <activity android:name="com.sheep.gamegroup.view.activity.WithdrawalResultAct"/>
         <activity android:name="com.sheep.gamegroup.view.activity.BindOrChangeWeixinAct"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.TryMakeMoneyact"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.HomePageAct"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.BindDataAct"/>
 
         <service android:name=".service.TopService"
                  android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"

+ 16 - 0
app/src/main/java/com/sheep/gamegroup/di/components/BindDataComponent.java

@@ -0,0 +1,16 @@
+package com.sheep.gamegroup.di.components;
+
+import com.sheep.gamegroup.di.modules.BindDataModule;
+import com.sheep.gamegroup.di.scopes.UserScope;
+import com.sheep.gamegroup.view.activity.BindDataAct;
+
+import dagger.Component;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+@UserScope
+@Component(modules = BindDataModule.class, dependencies = NetComponent.class)
+public interface BindDataComponent {
+    void inject(BindDataAct bindDataAct);
+}

+ 16 - 0
app/src/main/java/com/sheep/gamegroup/di/components/HomePageComponent.java

@@ -0,0 +1,16 @@
+package com.sheep.gamegroup.di.components;
+
+import com.sheep.gamegroup.di.modules.HomePageModule;
+import com.sheep.gamegroup.di.scopes.UserScope;
+import com.sheep.gamegroup.view.activity.HomePageAct;
+
+import dagger.Component;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+@UserScope
+@Component(modules = HomePageModule.class, dependencies = NetComponent.class)
+public interface HomePageComponent {
+    void inject(HomePageAct homePageAct);
+}

+ 16 - 0
app/src/main/java/com/sheep/gamegroup/di/components/TryMakeMoneyComponent.java

@@ -0,0 +1,16 @@
+package com.sheep.gamegroup.di.components;
+
+import com.sheep.gamegroup.di.modules.TryMakeMoneyModule;
+import com.sheep.gamegroup.di.scopes.UserScope;
+import com.sheep.gamegroup.view.activity.TryMakeMoneyact;
+
+import dagger.Component;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+@UserScope
+@Component(modules = TryMakeMoneyModule.class, dependencies = NetComponent.class)
+public interface TryMakeMoneyComponent {
+    void inject(TryMakeMoneyact tryMakeMoneyact);
+}

+ 22 - 0
app/src/main/java/com/sheep/gamegroup/di/modules/BindDataModule.java

@@ -0,0 +1,22 @@
+package com.sheep.gamegroup.di.modules;
+
+import com.sheep.gamegroup.presenter.BindDataContract;
+
+import dagger.Module;
+import dagger.Provides;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+@Module
+public class BindDataModule {
+    private BindDataContract.View view;
+
+    public BindDataModule(BindDataContract.View view) {
+        this.view = view;
+    }
+    @Provides
+    public BindDataContract.View provideView(){
+        return view;
+    }
+}

+ 23 - 0
app/src/main/java/com/sheep/gamegroup/di/modules/HomePageModule.java

@@ -0,0 +1,23 @@
+package com.sheep.gamegroup.di.modules;
+
+import com.sheep.gamegroup.presenter.HomePageContract;
+
+import dagger.Module;
+import dagger.Provides;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+
+@Module
+public class HomePageModule {
+    private HomePageContract.View view;
+
+    public HomePageModule(HomePageContract.View view) {
+        this.view = view;
+    }
+    @Provides
+    public HomePageContract.View providView(){
+        return view;
+    }
+}

+ 22 - 0
app/src/main/java/com/sheep/gamegroup/di/modules/TryMakeMoneyModule.java

@@ -0,0 +1,22 @@
+package com.sheep.gamegroup.di.modules;
+
+import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
+
+import dagger.Module;
+import dagger.Provides;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+@Module
+public class TryMakeMoneyModule {
+    private TryMakeMoneyContract.View view;
+
+    public TryMakeMoneyModule(TryMakeMoneyContract.View view) {
+        this.view = view;
+    }
+    @Provides
+    public TryMakeMoneyContract.View provideView(){
+        return view;
+    }
+}

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

@@ -67,6 +67,11 @@ public interface ApiService {
      */
     @PUT(ConnectAddress.V1+"app/user/bind_id_number/")
     Observable<BaseMessage> bindIdNumber(@Query("id_number") String id_number);
+    /**
+     * 绑定银行卡
+     */
+    @PUT(ConnectAddress.V1+"app/user/bind_bank_card/")
+    Observable<BaseMessage> bindBankCard(@Query("bank_card") String bank_card);
 
     /**
      * 用户提现
@@ -83,4 +88,16 @@ public interface ApiService {
     @GET(ConnectAddress.V1 + "app/user/bind_wx/")
     Observable<BaseMessage> bindWeixin(@Query("code") String code);
 
+    /**
+     * 获取已接受任务
+     */
+    @GET(ConnectAddress.V1 + "app/accepted_task/")
+    Observable<BaseMessage> acceptedTask(@Query("page") int page, @Query("per_page") int per_page);
+
+    /**
+     * 获取正在运行的任务
+     */
+    @GET(ConnectAddress.V1 + "/app/accepted_task/run_task/")
+    Observable<BaseMessage> returnTask();
+
 }

+ 47 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/RequestParameEty.java

@@ -0,0 +1,47 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * 请求公用参数
+ * Created by ljy on 2018/3/19.
+ */
+
+public class RequestParameEty {
+
+    private int page;
+    private int per_page;
+
+    public int getPage() {
+        return page;
+    }
+
+    public void setPage(int page) {
+        this.page = page;
+    }
+
+    public int getPer_page() {
+        return per_page;
+    }
+
+    public void setPer_page(int per_page) {
+        this.per_page = per_page;
+    }
+
+    private Object general_one;//预留字段
+    private Object general_two;//预留字段
+
+    public Object getGeneral_one() {
+        return general_one;
+    }
+
+    public void setGeneral_one(Object general_one) {
+        this.general_one = general_one;
+    }
+
+    public Object getGeneral_two() {
+        return general_two;
+    }
+
+    public void setGeneral_two(Object general_two) {
+        this.general_two = general_two;
+    }
+}

+ 123 - 0
app/src/main/java/com/sheep/gamegroup/model/util/ExceptionHandle.java

@@ -0,0 +1,123 @@
+package com.sheep.gamegroup.model.util;
+
+import android.util.Log;
+
+import com.alibaba.fastjson.JSONException;
+import com.google.gson.JsonParseException;
+
+import java.net.ConnectException;
+
+import retrofit2.adapter.rxjava.HttpException;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+
+public class ExceptionHandle {
+    private static final int UNAUTHORIZED = 401;
+    private static final int FORBIDDEN = 403;
+    private static final int NOT_FOUND = 404;
+    private static final int REQUEST_TIMEOUT = 408;
+    private static final int INTERNAL_SERVER_ERROR = 500;
+    private static final int BAD_GATEWAY = 502;
+    private static final int SERVICE_UNAVAILABLE = 503;
+    private static final int GATEWAY_TIMEOUT = 504;
+
+    public static ResponeThrowable handleException(Throwable e) {
+        ResponeThrowable ex;
+        Log.i("tag", "e.toString = " + e.toString());
+        if (e instanceof HttpException) {
+            HttpException httpException = (HttpException) e;
+            ex = new ResponeThrowable(e, ERROR.HTTP_ERROR);
+            switch (httpException.code()) {
+                case UNAUTHORIZED:
+                case FORBIDDEN:
+                case NOT_FOUND:
+                case REQUEST_TIMEOUT:
+                case GATEWAY_TIMEOUT:
+                case INTERNAL_SERVER_ERROR:
+                case BAD_GATEWAY:
+                case SERVICE_UNAVAILABLE:
+                default:
+                    //ex.code = httpException.code();
+                    ex.message = "网络错误";
+                    break;
+            }
+            return ex;
+        } else if (e instanceof ServerException) {
+            ServerException resultException = (ServerException) e;
+            ex = new ResponeThrowable(resultException, resultException.code);
+            ex.message = resultException.message;
+            return ex;
+        } else if (e instanceof JsonParseException
+                || e instanceof JSONException
+                /*|| e instanceof ParseException*/) {
+            ex = new ResponeThrowable(e, ERROR.PARSE_ERROR);
+            ex.message = "解析错误";
+            return ex;
+        } else if (e instanceof ConnectException) {
+            ex = new ResponeThrowable(e, ERROR.NETWORD_ERROR);
+            ex.message = "连接失败";
+            return ex;
+        } else if (e instanceof javax.net.ssl.SSLHandshakeException) {
+            ex = new ResponeThrowable(e, ERROR.SSL_ERROR);
+            ex.message = "证书验证失败";
+            return ex;
+        } else {
+            ex = new ResponeThrowable(e, ERROR.UNKNOWN);
+            ex.message = "未知错误";
+            return ex;
+        }
+    }
+
+
+    /**
+     * 约定异常
+     */
+    public class ERROR {
+        /**
+         * 未知错误
+         */
+        public static final int UNKNOWN = 1000;
+        /**
+         * 解析错误
+         */
+        public static final int PARSE_ERROR = 1001;
+        /**
+         * 网络错误
+         */
+        public static final int NETWORD_ERROR = 1002;
+        /**
+         * 协议出错
+         */
+        public static final int HTTP_ERROR = 1003;
+
+        /**
+         * 证书出错
+         */
+        public static final int SSL_ERROR = 1005;
+
+        /**
+         * 错误的请求
+         */
+        public static final int BAD_REQUEST_ERROR = 400;
+    }
+
+    public static class ResponeThrowable extends Exception {
+        public int code;
+        public String message;
+
+        public ResponeThrowable(Throwable throwable, int code) {
+            super(throwable);
+            this.code = code;
+        }
+    }
+
+    /**
+     * ServerException发生后,将自动转换为ResponeThrowable返回
+     */
+    class ServerException extends RuntimeException {
+        int code;
+        String message;
+    }
+}

+ 59 - 0
app/src/main/java/com/sheep/gamegroup/model/util/MySubscriber.java

@@ -0,0 +1,59 @@
+package com.sheep.gamegroup.model.util;
+
+import android.content.Context;
+import android.util.Log;
+import android.widget.Toast;
+
+import com.sheep.gamegroup.util.NetUtil;
+
+import rx.Subscriber;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+
+public abstract class MySubscriber<T> extends Subscriber<T> {
+
+    private Context context;
+
+    public MySubscriber(Context context) {
+        this.context = context;
+    }
+
+    @Override
+    public void onStart() {
+        super.onStart();
+        Log.i("tag","MySubscriber.onStart()");
+        //接下来可以检查网络连接等操作
+        if (!NetUtil.isConnected(context)) {
+
+            Toast.makeText(context, "当前网络不可用,请检查网络情况", Toast.LENGTH_SHORT).show();
+            // 一定好主动调用下面这一句,取消本次Subscriber订阅
+            if (!isUnsubscribed()) {
+                unsubscribe();
+            }
+            return;
+        }
+    }
+
+    @Override
+    public void onError(Throwable e) {
+        Log.e("tag","MySubscriber.throwable ="+e.toString());
+        Log.e("tag","MySubscriber.throwable ="+e.getMessage());
+
+        if(e instanceof Exception){
+            //访问获得对应的Exception
+            onError(ExceptionHandle.handleException(e));
+        }else {
+            //将Throwable 和 未知错误的status code返回
+            onError(new ExceptionHandle.ResponeThrowable(e,ExceptionHandle.ERROR.UNKNOWN));
+        }
+    }
+
+    public abstract void onError(ExceptionHandle.ResponeThrowable responeThrowable);
+
+    @Override
+    public void onCompleted() {
+        Log.i("tag","MySubscriber.onComplete()");
+    }
+}

+ 20 - 0
app/src/main/java/com/sheep/gamegroup/presenter/BindDataContract.java

@@ -0,0 +1,20 @@
+package com.sheep.gamegroup.presenter;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+
+public interface BindDataContract {
+
+    interface Presenter{
+        void submitData(Object o);
+        void submitDataRealname(Object o);
+        void submitDataBankcard(Object o);
+        void submitDataIdnumber(Object o);
+    }
+
+    interface View{
+        void upView(Object o);
+        void failView(Object o);
+    }
+}

+ 88 - 0
app/src/main/java/com/sheep/gamegroup/presenter/BindDataPresenter.java

@@ -0,0 +1,88 @@
+package com.sheep.gamegroup.presenter;
+
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.util.ExceptionHandle;
+import com.sheep.gamegroup.model.util.MySubscriber;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+
+import javax.inject.Inject;
+
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+
+public class BindDataPresenter implements BindDataContract.Presenter {
+    private BindDataContract.View view;
+    private ApiService apiService;
+
+    @Inject
+    public BindDataPresenter(BindDataContract.View view, ApiService apiService) {
+        this.view = view;
+        this.apiService = apiService;
+    }
+
+    @Override
+    public void submitData(Object o) {
+
+    }
+
+    @Override
+    public void submitDataRealname(Object o) {
+
+        apiService.bindRealname(o.toString())
+                .subscribeOn(Schedulers.io())
+                .subscribe(new MySubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(ExceptionHandle.ResponeThrowable responeThrowable) {
+                        view.failView(responeThrowable);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        view.upView(baseMessage);
+                    }
+                });
+
+    }
+
+    @Override
+    public void submitDataBankcard(Object o) {
+
+        apiService.bindBankCard(o.toString())
+                .subscribeOn(Schedulers.io())
+                .subscribe(new MySubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(ExceptionHandle.ResponeThrowable responeThrowable) {
+                        view.failView(responeThrowable);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        view.upView(baseMessage);
+                    }
+                });
+
+    }
+
+    @Override
+    public void submitDataIdnumber(Object o) {
+
+        apiService.bindIdNumber(o.toString())
+                .subscribeOn(Schedulers.io())
+                .subscribe(new MySubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(ExceptionHandle.ResponeThrowable responeThrowable) {
+                        view.failView(responeThrowable);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        view.upView(baseMessage);
+                    }
+                });
+
+    }
+}

+ 19 - 0
app/src/main/java/com/sheep/gamegroup/presenter/HomePageContract.java

@@ -0,0 +1,19 @@
+package com.sheep.gamegroup.presenter;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+
+public interface HomePageContract {
+
+    interface Persenter{
+
+        void getUserInfo();
+    }
+
+    interface View {
+
+        void updateData2View(Object o);
+        void failData2View(Object o);
+    }
+}

+ 55 - 0
app/src/main/java/com/sheep/gamegroup/presenter/HomePagePresenter.java

@@ -0,0 +1,55 @@
+package com.sheep.gamegroup.presenter;
+
+import android.util.Log;
+
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+
+import javax.inject.Inject;
+
+import rx.Observer;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+
+public class HomePagePresenter implements HomePageContract.Persenter {
+    private HomePageContract.View view;
+    private ApiService apiService;
+
+    @Inject
+    public HomePagePresenter(HomePageContract.View view, ApiService apiService) {
+        this.view = view;
+        this.apiService = apiService;
+    }
+
+    @Override
+    public void getUserInfo() {
+        String token = SpUtils.getOpenId(SheepApp.mContext);
+
+        Log.e("token---user",token+"");
+        apiService.getInfo()
+                .subscribeOn(Schedulers.io())
+                .subscribe(new Observer<BaseMessage>() {
+                    @Override
+                    public void onCompleted() {
+
+                    }
+
+                    @Override
+                    public void onError(Throwable throwable) {
+                        view.failData2View(throwable);
+                        Log.e("throwable",throwable+"");
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage o) {
+                        Log.e("token---user",o.toString()+"");
+                        view.updateData2View(o);
+                    }
+                });
+    }
+}

+ 21 - 0
app/src/main/java/com/sheep/gamegroup/presenter/TryMakeMoneyContract.java

@@ -0,0 +1,21 @@
+package com.sheep.gamegroup.presenter;
+
+import com.sheep.gamegroup.model.entity.RequestParameEty;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+
+public interface TryMakeMoneyContract {
+
+    interface Presenter{
+        void getData(Object o);
+        void acceptedTask(RequestParameEty o);//获取已接受的任务
+        void returnTask(RequestParameEty o);//获取正在运行的任务
+    }
+    interface View{
+
+        void updateData2View(Object o);
+        void failData2View(Object o);
+    }
+}

+ 78 - 0
app/src/main/java/com/sheep/gamegroup/presenter/TryMakeMoneyPresenter.java

@@ -0,0 +1,78 @@
+package com.sheep.gamegroup.presenter;
+
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.RequestParameEty;
+
+import javax.inject.Inject;
+
+import rx.Observer;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+
+public class TryMakeMoneyPresenter implements TryMakeMoneyContract.Presenter {
+    private TryMakeMoneyContract.View view;
+    private ApiService apiService;
+
+    @Inject
+    public TryMakeMoneyPresenter(TryMakeMoneyContract.View view, ApiService apiService) {
+        this.view = view;
+        this.apiService = apiService;
+    }
+
+    @Override
+    public void getData(Object o) {
+
+    }
+
+    @Override
+    public void acceptedTask(RequestParameEty o) {
+        apiService.acceptedTask(o.getPage(), o.getPer_page())
+                .subscribeOn(Schedulers.io())
+                .subscribe(new Observer<BaseMessage>() {
+                    @Override
+                    public void onCompleted() {
+
+                    }
+
+                    @Override
+                    public void onError(Throwable throwable) {
+                        view.failData2View(throwable);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        view.updateData2View(baseMessage);
+                    }
+                });
+
+    }
+
+    @Override
+    public void returnTask(RequestParameEty o) {
+
+        apiService.returnTask()
+                .subscribeOn(Schedulers.io())
+                .subscribe(new Observer<BaseMessage>() {
+                    @Override
+                    public void onCompleted() {
+
+                    }
+
+                    @Override
+                    public void onError(Throwable throwable) {
+                        view.failData2View(throwable);
+
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        view.updateData2View(baseMessage);
+
+                    }
+                });
+    }
+}

+ 27 - 0
app/src/main/java/com/sheep/gamegroup/presenter/WithdrawalPresenter.java

@@ -3,7 +3,11 @@ package com.sheep.gamegroup.presenter;
 import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.util.ExceptionHandle;
+import com.sheep.gamegroup.model.util.MySubscriber;
+import com.sheep.jiuyan.samllsheep.SheepApp;
 
+import javax.crypto.ExemptionMechanismException;
 import javax.inject.Inject;
 
 import rx.Observer;
@@ -28,6 +32,29 @@ public class WithdrawalPresenter implements WithdrawalContract.Presenter {
     public void goWithdrawal(JSONObject jsonObject) {
         apiService.goWithdrawal(jsonObject)
                 .subscribeOn(Schedulers.io())
+                .subscribe(new MySubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(ExceptionHandle.ResponeThrowable throwable) {
+                        int statusCode = throwable.code;
+                        switch (statusCode){
+                            case ExceptionHandle.ERROR.BAD_REQUEST_ERROR://400
+                                default:
+                                try {
+                                    view.failData(JSONObject.parseObject(throwable.message, BaseMessage.class));
+                                }catch (Exception e){
+                                    e.printStackTrace();
+                                }
+                                break;
+                        }
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        view.updateView(baseMessage);
+                    }
+                });
+        apiService.goWithdrawal(jsonObject)
+                .subscribeOn(Schedulers.io())
                 .subscribe(new Observer<BaseMessage>() {
                     @Override
                     public void onCompleted() {

+ 54 - 0
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -4,10 +4,13 @@ import android.content.Context;
 import android.content.Intent;
 
 import com.sheep.gamegroup.view.activity.AuthenticationAct;
+import com.sheep.gamegroup.view.activity.BindDataAct;
 import com.sheep.gamegroup.view.activity.BindOrChangeWeixinAct;
+import com.sheep.gamegroup.view.activity.HomePageAct;
 import com.sheep.gamegroup.view.activity.LoginAct;
 import com.sheep.gamegroup.view.activity.PersonalCenterAct;
 import com.sheep.gamegroup.view.activity.PhoneAct;
+import com.sheep.gamegroup.view.activity.TryMakeMoneyact;
 import com.sheep.gamegroup.view.activity.WithdrawalAct;
 import com.sheep.gamegroup.view.activity.WithdrawalResultAct;
 
@@ -49,6 +52,16 @@ public class Jump2View {
     }
 
     /**
+     * 跳到首页面
+     * @param context
+     * @param o
+     */
+    public void goHomePageView(Context context, Object o){
+        Intent intent = new Intent(context, HomePageAct.class);
+        context.startActivity(intent);
+    }
+
+    /**
      * 跳到手机登录页面
      * @param context
      * @param o
@@ -98,4 +111,45 @@ public class Jump2View {
         context.startActivity(intent);
     }
 
+    /**
+     * 跳到试玩界面
+     * @param context
+     * @param o
+     */
+    public void goTryplayView(Context context, Object o){
+        Intent intent = new Intent(context, TryMakeMoneyact.class);
+        context.startActivity(intent);
+    }
+
+    /**
+     * 跳到分享界面
+     * @param context
+     * @param o
+     */
+    public void goInvitationView(Context context, Object o){
+        Intent intent = new Intent(context, BindOrChangeWeixinAct.class);
+        context.startActivity(intent);
+    }
+
+    /**
+     * 跳到躺着界面
+     * @param context
+     * @param o
+     */
+    public void goLyingView(Context context, Object o){
+        Intent intent = new Intent(context, BindOrChangeWeixinAct.class);
+        context.startActivity(intent);
+    }
+
+    /**
+     * 跳到绑定数据页面
+     * @param context
+     * @param o
+     */
+    public void goBindDataView(Context context, Object o){
+        Intent intent = new Intent(context, BindDataAct.class);
+        intent.putExtra("stype", o.toString());
+        context.startActivity(intent);
+    }
+
 }

+ 34 - 0
app/src/main/java/com/sheep/gamegroup/util/MyListview.java

@@ -0,0 +1,34 @@
+package com.sheep.gamegroup.util;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.ListView;
+
+/**
+ * Created by ljy on 2018/3/19.
+ */
+
+public class MyListview extends ListView {
+    public MyListview(Context context) {
+        super(context);
+    }
+
+    public MyListview(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public MyListview(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+    }
+
+    public MyListview(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
+                MeasureSpec.AT_MOST);
+        super.onMeasure(widthMeasureSpec, expandSpec);
+    }
+}

+ 155 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/BindDataAct.java

@@ -0,0 +1,155 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.v7.widget.AppCompatEditText;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.presenter.BindDataContract;
+import com.sheep.gamegroup.presenter.BindDataPresenter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import javax.inject.Inject;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+/**
+ * 绑定数据
+ * Created by ljy on 2018/3/19.
+ */
+
+public class BindDataAct extends BaseActivity implements BindDataContract.View {
+    @BindView(R.id.text_notice_tv)
+    TextView textNoticeTv;
+    @BindView(R.id.text_et)
+    AppCompatEditText textEt;
+    @BindView(R.id.text_layout)
+    LinearLayout textLayout;
+    @BindView(R.id.number_notice_tv)
+    TextView numberNoticeTv;
+    @BindView(R.id.number_et)
+    AppCompatEditText numberEt;
+    @BindView(R.id.number_layout)
+    LinearLayout numberLayout;
+    @BindView(R.id.sure_text)
+    TextView sureText;
+    @Inject
+    BindDataPresenter presenter;
+    @BindView(R.id.img_baseactivity_title)
+    ImageView imgBaseactivityTitle;
+    @BindView(R.id.txt_baseactivity_title)
+    TextView txtBaseactivityTitle;
+    private Activity activity;
+
+    private int type = 0;
+    private String key = "real_name";
+    private String value = "real_name";
+    private String title = "绑定真实姓名";
+
+    @Override
+    public void upView(Object o) {
+        G.showToast("ok");
+        finish();
+
+    }
+
+    @Override
+    public void failView(Object o) {
+        G.showToast("error");
+    }
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.bind_data_act_layout;
+    }
+
+    @Override
+    public void initView() {
+        activity = this;
+        type = getIntent().getIntExtra("", 0);
+        assemblyData(type);
+        txtBaseactivityTitle.setText(title);
+    }
+
+    @Override
+    public void initListener() {
+
+    }
+
+    @Override
+    public void initData() {
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        // TODO: add setContentView(...) invocation
+        ButterKnife.bind(this);
+    }
+
+    @OnClick({R.id.sure_text, R.id.user_layout, R.id.img_baseactivity_title})
+    public void onViewClicked(View view) {
+        switch (view.getId()) {
+            case R.id.sure_text:
+                assemblyData(type);
+                submit();
+                break;
+            case R.id.user_layout:
+                finish();
+                break;
+        }
+    }
+
+    private void submit() {
+        JSONObject j = new JSONObject();
+        j.put(key, value);
+        showProgress();
+        presenter.submitData(j);
+        switch (type) {
+            case 40001:
+                presenter.submitDataRealname(value);
+                break;
+            case 40002:
+                presenter.submitDataIdnumber(value);
+                break;
+            case 40003:
+                presenter.submitDataBankcard(value);
+                break;
+        }
+    }
+
+    private String assemblyData(int type){
+        switch (type) {
+            case 40001:
+                key = "real_name";
+                title = "绑定真实姓名";
+                numberLayout.setVisibility(View.GONE);
+                textNoticeTv.setText("真实姓名");
+                value = textEt.getText().toString();
+                break;
+            case 40002:
+                key = "bank_card";
+                title = "绑定身份证";
+                textLayout.setVisibility(View.GONE);
+                numberNoticeTv.setVisibility(View.GONE);
+                value = numberEt.getText().toString();
+                break;
+            case 40003:
+                key = "id_number";
+                title = "绑定银行卡";
+                textNoticeTv.setText("真实姓名");
+                numberNoticeTv.setText("卡号");
+                value = numberEt.getText().toString();
+                break;
+        }
+        return value;
+    }
+}

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

@@ -1,20 +1,100 @@
 package com.sheep.gamegroup.view.activity;
 
+import android.app.Activity;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.util.Log;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.di.components.DaggerHomePageComponent;
+import com.sheep.gamegroup.di.modules.HomePageModule;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.UserEntity;
+import com.sheep.gamegroup.presenter.HomePageContract;
+import com.sheep.gamegroup.presenter.HomePagePresenter;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.MyDbManager;
+import com.sheep.gamegroup.util.MyListview;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import javax.inject.Inject;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+import de.hdodenhof.circleimageview.CircleImageView;
 
 /**
  * Created by ljy on 2018/3/19.
  */
 
-public class HomePageAct extends BaseActivity {
+public class HomePageAct extends BaseActivity implements HomePageContract.View{
+    @BindView(R.id.icon_img_iv)
+    CircleImageView iconImgIv;
+    @BindView(R.id.name_tv)
+    TextView nameTv;
+    @BindView(R.id.sheep_num_tv)
+    TextView sheepNumTv;
+    @BindView(R.id.user_layout)
+    RelativeLayout userLayout;
+    @BindView(R.id.withdrawal)
+    TextView withdrawal;
+    @BindView(R.id.my_price)
+    TextView myPrice;
+    @BindView(R.id.my_all_price)
+    TextView myAllPrice;
+    @BindView(R.id.couple_red_packets_iv)
+    ImageView coupleRedPacketsIv;
+    @BindView(R.id.try_play_layout)
+    LinearLayout tryPlayLayout;
+    @BindView(R.id.invitation_layout)
+    LinearLayout invitationLayout;
+    @BindView(R.id.lying_layout)
+    LinearLayout lyingLayout;
+    @BindView(R.id.listview)
+    MyListview listview;
+
+    @Inject
+    HomePagePresenter pagePresenter;
+    private Activity activity;
+    private UserEntity userEntity;
+
+
+    Handler mHanderl = new Handler(){
+        @Override
+        public void handleMessage(Message msg) {
+            super.handleMessage(msg);
+
+            myPrice.setText(userEntity.getBalance()+" 元");
+            myAllPrice.setText("累计资产 "+userEntity.getTotal_asset()+" 元");
+            nameTv.setText(userEntity.getNickname()+"");//绵阳号:123456789
+            sheepNumTv.setText("绵阳号:"+userEntity.getInvitation_code());
+        }
+    };
     @Override
     protected int getLayoutId() {
-        return 0;
+        return R.layout.homepage_act_layout;
     }
 
     @Override
     public void initView() {
-
+        ButterKnife.bind(this);
+        activity = this;
+        DaggerHomePageComponent.builder()
+                .netComponent(SheepApp.get(this).getNetComponent())
+                .homePageModule(new HomePageModule(this))
+                .build()
+                .inject(this);
     }
 
     @Override
@@ -24,6 +104,54 @@ public class HomePageAct extends BaseActivity {
 
     @Override
     public void initData() {
+        pagePresenter.getUserInfo();
+
+    }
+
+    @OnClick({R.id.icon_img_iv, R.id.user_layout, R.id.withdrawal, R.id.couple_red_packets_iv, R.id.try_play_layout, R.id.invitation_layout, R.id.lying_layout})
+    public void onViewClicked(View view) {
+        switch (view.getId()) {
+            case R.id.icon_img_iv:
+                break;
+            case R.id.user_layout:
+                Jump2View.getInstance().goPersonnalCenterView(activity, null);
+                break;
+            case R.id.withdrawal:
+                Jump2View.getInstance().goWithdrawal(activity, null);
+                break;
+            case R.id.couple_red_packets_iv:
+                break;
+            case R.id.try_play_layout:
+                Jump2View.getInstance().goTryplayView(activity, null);
+                break;
+            case R.id.invitation_layout:
+                break;
+            case R.id.lying_layout:
+                break;
+        }
+    }
+
+    @Override
+    public void updateData2View(Object o) {
+        if(o == null){
+            return;
+        }
+        BaseMessage baseMessage = (BaseMessage) o;
+        userEntity = JSON.parseObject(JSONObject.toJSONString(baseMessage.getData()), UserEntity.class);
+        try {
+            MyDbManager.getInstance().saveOrUpdateUser(userEntity);
+//            userEntity = MyDbManager.getInstance().dbFindUser();
+            Log.e("------userEntity",userEntity.getNickname()+"|"+userEntity.getMobile()+"");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        mHanderl.sendEmptyMessage(0);
+
+    }
+
+    @Override
+    public void failData2View(Object o) {
+        G.showToast("网络错误");
 
     }
 }

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

@@ -1,13 +1,37 @@
 package com.sheep.gamegroup.view.activity;
 
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.widget.RecyclerView;
+
+import com.sheep.gamegroup.di.components.DaggerTryMakeMoneyComponent;
+import com.sheep.gamegroup.di.modules.TryMakeMoneyModule;
+import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
+import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
 import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseActivity;
 
+import javax.inject.Inject;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
 /**
  * Created by ljy on 2018/3/10.
  */
 
-public class TryMakeMoneyact extends BaseActivity {
+public class TryMakeMoneyact extends BaseActivity implements TryMakeMoneyContract.View{
+    @BindView(R.id.recyclerview)
+    RecyclerView recyclerview;
+    @BindView(R.id.refresh)
+    SwipeRefreshLayout refresh;
+
+    @Inject
+    TryMakeMoneyPresenter presenter;
+    private Activity activity;
+
     @Override
     protected int getLayoutId() {
         return R.layout.try_makemoney_act_layout;
@@ -15,7 +39,13 @@ public class TryMakeMoneyact extends BaseActivity {
 
     @Override
     public void initView() {
-
+        ButterKnife.bind(this);
+        activity = this;
+        DaggerTryMakeMoneyComponent.builder()
+                .netComponent(SheepApp.get(this).getNetComponent())
+                .tryMakeMoneyModule(new TryMakeMoneyModule(this))
+                .build()
+                .inject(this);
     }
 
     @Override
@@ -27,4 +57,14 @@ public class TryMakeMoneyact extends BaseActivity {
     public void initData() {
 
     }
+
+    @Override
+    public void updateData2View(Object o) {
+
+    }
+
+    @Override
+    public void failData2View(Object o) {
+
+    }
 }

+ 18 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalAct.java

@@ -11,6 +11,7 @@ import android.widget.TextView;
 import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.di.components.DaggerWithdrawalComponent;
 import com.sheep.gamegroup.di.modules.WithdrawalModule;
+import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GridViewEntity;
 import com.sheep.gamegroup.presenter.WithdrawalContract;
 import com.sheep.gamegroup.presenter.WithdrawalPresenter;
@@ -66,6 +67,7 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
                 .build()
                 .inject(this);
         adapter = new WithdrawalAdapter(activity, assemblyData());
+        withdrawalGreidview.setVerticalSpacing(15);
         withdrawalGreidview.setAdapter(adapter);
         adapter.notifyDataSetChanged();
         withdrawalGreidview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@@ -136,9 +138,25 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
         return listData;
     }
 
+    /**
+     *40001 //没有绑定真实姓名
+     *40002 //没有绑定真实省份证
+     *40003 //没有绑定真实银行卡
+     * @param o
+     */
     @Override
     public void failData(Object o) {
         hideProgress();
+        BaseMessage baseMessage = (BaseMessage) o;
+        switch (baseMessage.getCode()){
+            case 40001:
+                break;
+            case 40002:
+                break;
+            case 40003:
+                break;
+        }
+        Jump2View.getInstance().goBindDataView(activity, baseMessage.getCode());
     }
 
     @Override

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/adapter/WithdrawalAdapter.java

@@ -54,10 +54,10 @@ public class WithdrawalAdapter extends BaseAdapter {
 
             // 获取屏幕宽度
             int W = G.WIDTH <G.HEIGHT ? G.WIDTH : G.HEIGHT;
-            int cricleRadius = W / 3  -50;
+            int cricleRadius = W / 4  -50;
             int h = cricleRadius  / 3;
             convertView.setLayoutParams(new AbsListView.LayoutParams(cricleRadius, h));
-            convertView.setPadding(15,15,0,20);
+//            convertView.setPadding(0,0,0,2);
             convertView.setTag(holder);
         }else {
             holder = (ViewHolder) convertView.getTag();

+ 1 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/base/BaseActivity.java

@@ -35,7 +35,7 @@ public abstract class BaseActivity extends AppActivity {
         initView();
         initListener();
         initData();
-        ButterKnife.bind(this);
+//        ButterKnife.bind(this);
     }
 
     protected void  showProgress(){

+ 1 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/page/SplashActivity.java

@@ -89,7 +89,7 @@ public class SplashActivity extends BaseActivity {
         SpUtils.login(getApplicationContext(), "12@1c421522bb7e44d3cd6a8d59a54df182");
         String openId = SpUtils.getOpenId(getApplicationContext());
         if (!TextUtils.isEmpty(openId)) {
-            Jump2View.getInstance().goPersonnalCenterView(SplashActivity.this, null);
+            Jump2View.getInstance().goHomePageView(SplashActivity.this, null);
             finish();
         } else {
             Jump2View.getInstance().goLoginView(SplashActivity.this, null);

+ 87 - 0
app/src/main/res/layout/bind_data_act_layout.xml

@@ -0,0 +1,87 @@
+<?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="match_parent"
+    android:orientation="vertical"
+    android:background="@color/bg_gray">
+
+    <include
+        layout="@layout/title"/>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@drawable/sp_rectangle_bg_white_radius"
+        android:layout_margin="@dimen/content_padding_15"
+        android:orientation="vertical">
+
+        <LinearLayout
+            android:id="@+id/text_layout"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_margin="@dimen/content_padding_small"
+            android:orientation="horizontal"
+            >
+            <TextView
+                android:id="@+id/text_notice_tv"
+                android:layout_width="0dp"
+                android:layout_weight="1"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center|center_vertical"
+                android:gravity="left"
+                android:text="持卡人"
+                style="@style/txt_style_15"
+                android:layout_marginLeft="@dimen/content_padding_10"/>
+
+            <android.support.v7.widget.AppCompatEditText
+                android:id="@+id/text_et"
+                style="@style/edt_style"
+                android:layout_width="0dp"
+                android:layout_height="@dimen/edt_heigh_default"
+                android:layout_weight="5"
+                android:hint="请输入"
+                android:paddingLeft="@dimen/content_padding_big"
+                android:textSize="@dimen/text_size_3"/>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/number_layout"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_margin="@dimen/content_padding_small"
+            android:orientation="horizontal">
+            <TextView
+                android:id="@+id/number_notice_tv"
+                android:layout_width="0dp"
+                android:layout_weight="1"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center|center_vertical"
+                android:text="卡 号"
+                style="@style/txt_style_15"
+                android:layout_marginLeft="@dimen/content_padding_10"
+                />
+
+            <android.support.v7.widget.AppCompatEditText
+                android:id="@+id/number_et"
+                style="@style/edt_style"
+                android:layout_width="0dp"
+                android:layout_height="@dimen/edt_heigh_default"
+                android:layout_weight="5"
+                android:hint="请输入"
+                android:inputType="number"
+                android:paddingLeft="@dimen/content_padding_big"
+                android:textSize="@dimen/text_size_3"/>
+
+        </LinearLayout>
+
+    </LinearLayout>
+
+    <TextView
+        android:id="@+id/sure_text"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        style="@style/txt_big_btn_style"
+        android:text="确 定"/>
+
+</LinearLayout>

+ 196 - 7
app/src/main/res/layout/homepage_act_layout.xml

@@ -5,15 +5,204 @@
     android:orientation="vertical"
     android:background="@color/bg_gray">
 
-    <RelativeLayout
+    <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="wrap_content"
+        android:scrollbars="none">
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@mipmap/home_blue_bg"
+                android:padding="@dimen/content_padding_20">
 
-        <de.hdodenhof.circleimageview.CircleImageView
-            android:id="@+id/icon_img_iv"
-            android:layout_width="@dimen/view_size_60"
-            android:layout_height="@dimen/view_size_60" />
+                <RelativeLayout
+                    android:id="@+id/user_layout"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
 
-    </RelativeLayout>
+                    <de.hdodenhof.circleimageview.CircleImageView
+                        android:id="@+id/icon_img_iv"
+                        android:layout_width="@dimen/view_size_45"
+                        android:layout_height="@dimen/view_size_45"
+                        android:src="@drawable/icon"/>
+
+                    <TextView
+                        android:id="@+id/name_tv"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="野蛮托举"
+                        android:textSize="@dimen/text_size_12"
+                        android:textColor="@color/txt_white"
+                        android:layout_toRightOf="@id/icon_img_iv"
+                        android:layout_marginLeft="@dimen/content_padding_15"
+                        android:layout_marginTop="@dimen/content_padding_small"
+                        android:layout_marginBottom="@dimen/content_padding_small"/>
+                    <TextView
+                        android:id="@+id/sheep_num_tv"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="绵阳号:123456789"
+                        android:textSize="@dimen/text_size_10"
+                        android:textColor="@color/txt_white"
+                        android:layout_toRightOf="@id/icon_img_iv"
+                        android:layout_below="@+id/name_tv"
+                        android:layout_marginLeft="@dimen/content_padding_15"
+                        android:layout_marginBottom="@dimen/content_padding_small"/>
+
+                    <ImageView
+                        android:id="@+id/right_arrow_iv"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:src="@mipmap/home_right_arrow"
+                        android:layout_alignParentRight="true"
+                        android:layout_centerVertical="true"/>
+
+                </RelativeLayout>
+
+                <RelativeLayout
+                    android:id="@+id/price_layout"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_below="@+id/user_layout"
+                    android:layout_marginTop="@dimen/content_padding_20">
+                    <TextView
+                        android:id="@+id/withdrawal"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:minWidth="100dp"
+                        android:layout_alignParentRight="true"
+                        android:layout_centerVertical="true"
+                        android:text="提 现"
+                        android:textColor="@color/blue_34a6e7"
+                        android:textSize="@dimen/text_size_4"
+                        android:background="@drawable/sp_rectangle_bg_white_radius"
+                        android:gravity="center"
+                        android:padding="5dp"/>
+                    <TextView
+                        android:id="@+id/my_property"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="我的资产"
+                        android:textColor="@color/txt_white"
+                        android:textSize="@dimen/text_size_12"/>
+                    <TextView
+                        android:layout_below="@+id/my_property"
+                        android:id="@+id/my_price"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:text="20.00 元"
+                        android:textColor="@color/txt_white"
+                        android:textSize="@dimen/text_size_25"
+                        android:layout_marginTop="12dp"
+                        android:layout_marginBottom="12dp"
+                        android:layout_toLeftOf="@id/withdrawal"/>
+                    <TextView
+                        android:layout_below="@+id/my_price"
+                        android:id="@+id/my_all_price"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="累计资产 60.00 元"
+                        android:textColor="@color/txt_white"
+                        android:textSize="@dimen/text_size_12"/>
+                </RelativeLayout>
+
+            </RelativeLayout>
+
+            <ImageView
+                android:id="@+id/couple_red_packets_iv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_margin="@dimen/content_padding_10"
+                android:src="@mipmap/couple_red_packets" />
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                android:background="@color/white"
+                android:padding="@dimen/content_padding_10">
+                <LinearLayout
+                    android:id="@+id/try_play_layout"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"
+                    android:gravity="center">
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:src="@mipmap/home_try_play_bg"/>
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="试玩赚钱"/>
+
+                </LinearLayout>
+                <LinearLayout
+                    android:id="@+id/invitation_layout"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"
+                    android:gravity="center">
+
+                    <ImageView
+                        android:id="@+id/imageView2"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:src="@mipmap/home_invitation_bg" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="邀请赚钱"/>
+
+                </LinearLayout>
+                <LinearLayout
+                    android:id="@+id/lying_layout"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"
+                    android:gravity="center">
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:src="@mipmap/home_lying_bg"/>
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="躺着赚钱"/>
+
+                </LinearLayout>
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@drawable/sp_rectangle_bg_white_radius"
+                android:orientation="vertical"
+                android:padding="@dimen/content_padding_10"
+                android:layout_margin="@dimen/content_padding_10">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="实时奖励"
+                    android:textSize="@dimen/text_size_15"
+                    android:textColor="@color/black_191919"/>
+
+                <com.sheep.gamegroup.util.MyListview
+                    android:id="@+id/listview"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:scrollbars="none"></com.sheep.gamegroup.util.MyListview>
+            </LinearLayout>
+        </LinearLayout>
+    </ScrollView>
 
 </LinearLayout>

+ 11 - 3
app/src/main/res/layout/try_makemoney_act_layout.xml

@@ -8,9 +8,17 @@
     <include
         layout="@layout/title"/>
 
-    <android.support.v7.widget.RecyclerView
+    <android.support.v4.widget.SwipeRefreshLayout
+        android:id="@+id/refresh"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:padding="12dp"></android.support.v7.widget.RecyclerView>
+        android:layout_height="wrap_content">
+
+        <android.support.v7.widget.RecyclerView
+            android:id="@+id/recyclerview"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:scrollbars="none"></android.support.v7.widget.RecyclerView>
+    </android.support.v4.widget.SwipeRefreshLayout>
 
 </LinearLayout>

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

@@ -9,7 +9,6 @@
     android:textSize="@dimen/text_size_3"
     android:textColor="@color/txt_black"
     android:padding="@dimen/content_padding_small"
-    android:background="@drawable/radidius_bg_tv_blue_gray_selector"
-    android:layout_marginBottom="@dimen/content_padding_15">
+    android:background="@drawable/radidius_bg_tv_blue_gray_selector">
 
 </TextView>

BIN
app/src/main/res/mipmap-xhdpi/couple_red_packets.png


BIN
app/src/main/res/mipmap-xhdpi/home_blue_bg.png


BIN
app/src/main/res/mipmap-xhdpi/home_couple_red_packets.png


BIN
app/src/main/res/mipmap-xhdpi/home_invitation_bg.png


BIN
app/src/main/res/mipmap-xhdpi/home_lying_bg.png


BIN
app/src/main/res/mipmap-xhdpi/home_right_arrow.png


BIN
app/src/main/res/mipmap-xhdpi/home_try_play_bg.png


BIN
app/src/main/res/mipmap-xxhdpi/couple_red_packets.png


BIN
app/src/main/res/mipmap-xxhdpi/home_blue_bg.png


BIN
app/src/main/res/mipmap-xxhdpi/home_couple_red_packets.png


BIN
app/src/main/res/mipmap-xxhdpi/home_invitation_bg.png


BIN
app/src/main/res/mipmap-xxhdpi/home_lying_bg.png


BIN
app/src/main/res/mipmap-xxhdpi/home_right_arrow.png


BIN
app/src/main/res/mipmap-xxhdpi/home_try_play_bg.png


+ 1 - 0
app/src/main/res/values/common.xml

@@ -67,6 +67,7 @@
 
     <!--APP中的主要内容的各种间距值pading默认值和较大值-->
     <dimen name="content_padding_small">6dp</dimen>
+    <dimen name="content_padding_8">8dp</dimen>
     <dimen name="content_padding">12dp</dimen>
     <dimen name="content_padding_big">18dp</dimen>
     <dimen name="content_padding_10">10dp</dimen>

+ 3 - 0
app/src/main/res/values/gamegroup_color.xml

@@ -3,7 +3,9 @@
     <color name="txt_black">#010101</color>
     <color name="txt_bg_yellow">#FDBD24</color>
     <color name="white_light">#F8F8F8</color>
+    <color name="txt_white">#FFFFFF</color>
     <color name="black">#000000</color>
+    <color name="black_191919">#191919</color>
     <color name="black_444444">#444444</color>
     <color name="white_bg_line">#dfdfdf</color>
     <color name="txt_red">#ff2d4b</color>
@@ -22,5 +24,6 @@
     <color name="blue_end">#1394e8</color>
     <color name="green_start">#76eab8</color>
     <color name="green_end">#02ca73</color>
+    <color name="blue_34a6e7">#34a6e7</color>
 
 </resources>