hanjing лет назад: 7
Родитель
Сommit
f4540e858e

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

@@ -180,24 +180,6 @@
             android:theme="@style/AppActionTheme"
             android:screenOrientation="portrait" />
 
-        <!-- 2.0 -->
-        <activity
-            android:name="com.sheep.gamegroup.view.activity.LoginAct"
-            android:configChanges="keyboardHidden|screenSize|orientation"
-            android:launchMode="singleTask"
-            android:screenOrientation="portrait"
-            android:theme="@style/FullScreenTheme" />
-        <!-- <activity -->
-        <!-- android:name=".ui.activity.SignActivity" -->
-        <!-- android:screenOrientation="portrait" -->
-        <!-- android:theme="@style/SplashTheme"> -->
-        <!-- <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.SplashAct"
             android:screenOrientation="portrait"

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

@@ -1,16 +0,0 @@
-package com.sheep.gamegroup.di.components;
-
-import com.sheep.gamegroup.di.modules.LoginModule;
-import com.sheep.gamegroup.di.scopes.UserScope;
-import com.sheep.gamegroup.view.activity.LoginAct;
-
-import dagger.Component;
-
-/**
- * Created by Administrator on 2018/3/10.
- */
-@UserScope
-@Component(modules = LoginModule.class, dependencies = NetComponent.class)
-public interface LoginComponent {
-    void inject(LoginAct loginAct);
-}

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/model/util/SheepSubscriber.java

@@ -7,12 +7,12 @@ import android.widget.Toast;
 import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.model.api.BaseMessageConverter;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.module.login.LoginAct;
 import com.sheep.gamegroup.util.ActivityManager;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.NetUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.util.ViewUtil;
-import com.sheep.gamegroup.view.activity.LoginAct;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 

+ 9 - 6
app/src/main/java/com/sheep/gamegroup/module/login/LoginAct.java

@@ -91,8 +91,7 @@ public class LoginAct extends BaseUMActivity implements LoginController {
                     || loginResult.getUser().getBirthday().startsWith("000")) {
                 getUserInfo(platform, loginResult);
             } else {
-                Jump2View.getInstance().checkCommendApp(this, EntityUtils.getUserCode(loginResult));
-                finish();
+                goMain(loginResult);
             }
         } else {
             CertificationUtil.newInstance().addCurUserToSdkLoginUser();
@@ -124,8 +123,7 @@ public class LoginAct extends BaseUMActivity implements LoginController {
 
                         @Override
                         public void onError(SHARE_MEDIA share_media, int i, Throwable throwable) {
-                            Jump2View.getInstance().checkCommendApp(LoginAct.this, EntityUtils.getUserCode(entity));
-                            finish();
+                            goMain(entity);
                         }
 
                         @Override
@@ -148,8 +146,13 @@ public class LoginAct extends BaseUMActivity implements LoginController {
         if (DDProviderHelper.getInstance().getAccount(entity.getUser().getId()) != null) {
             DDProviderHelper.getInstance().saveAccount(Account.generateByUser(entity.getUser()));
         }
-        Jump2View.getInstance().checkCommendApp(this, EntityUtils.getUserCode(entity));
-        finish();
+        goMain(entity);
+    }
+
+    private void goMain(LoginEntity entity){
+        showProgress();
+        Jump2View.getInstance().goHomePageView(this, EntityUtils.getUserCode(entity));
+        Jump2View.getInstance().checkCommendApp(this, EntityUtils.getUserCode(entity), false);
     }
 
     @Override

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/module/login/fragments/WelcomeFgt.java

@@ -26,7 +26,7 @@ public class WelcomeFgt extends AbsLoginFgt {
 
     @BindView(R.id.login_type_toggle_icon)
     ImageView loginToggleIconBtn;
-    @BindView(R.id.login_type_toggle_icon)
+    @BindView(R.id.login_type_toggle_text)
     TextView loginToggleTextBtn;
 
     public WelcomeFgt() {

+ 23 - 6
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -300,6 +300,10 @@ public class Jump2View {
      * @param object
      */
     public void checkCommendApp(final Context context, final Object object) {
+        checkCommendApp(context, object, true);
+    }
+
+    public void checkCommendApp(final Context context, final Object object, boolean jump) {
         if (DataUtil.getAsBoolean(ActMain.FIRST_SHOW_MAIN, true)) {
             String game_id = ChannelContent.getInstance().getGameId();
             SheepApp.getInstance().getNetComponent().getApiService().canGetCommendApp(game_id)
@@ -312,19 +316,19 @@ public class Jump2View {
                             if (!result.getNeed()) {//不需要展示
                                 DataUtil.putAsBoolean(ActMain.FIRST_SHOW_MAIN, false);
                             }
-                            goHomePageView(context, object);
+                            if (jump) goHomePageView(context, object);
                         }
 
                         @Override
                         public void onError(BaseMessage baseMessage) {
                             //默认不展示
                             DataUtil.putAsBoolean(ActMain.FIRST_SHOW_MAIN, false);
-                            goHomePageView(context, object);
+                            if (jump) goHomePageView(context, object);
                         }
                     });
             return;
         }
-        goHomePageView(context, object);
+        if (jump) goHomePageView(context, object);
     }
 
     /**
@@ -962,6 +966,7 @@ public class Jump2View {
         intent.putExtra(IJumpWeb.KEY_TITLE, TextUtils.isEmpty(title) ? "加载中..." : title);
         context.startActivity(intent);
     }
+
     /**
      * 跳到web页面
      *
@@ -985,7 +990,7 @@ public class Jump2View {
         intent.putExtra(IJumpWeb.KEY_NEEDJSINTERACT, jumpWeb.needJsInteract());
         //判断是否注入js
         boolean hasJsUrl = !TextUtils.isEmpty(jumpWeb.getJsUrl());
-        if(hasJsUrl){
+        if (hasJsUrl) {
             intent.putExtra(IJumpWeb.KEY_JSURL, jumpWeb.getJsUrl());
         }
         context.startActivity(intent);
@@ -1902,6 +1907,7 @@ public class Jump2View {
         activity.startActivity(intent);
         GAME_EVERY_DAY_MORE.onEvent("title", gameListType.getTitle());
     }
+
     /**
      * 点击游戏标签
      */
@@ -2246,17 +2252,18 @@ public class Jump2View {
     /**
      * 播放视频
      *
-     * @param url 播放地址
+     * @param url     播放地址
      * @param isCache 是否缓存,方便以后播放
      */
     public void goActPlayVideo(String url, boolean isCache) {
         Activity activity = ActivityManager.getInstance().currentActivity();
-        if(isCache) {
+        if (isCache) {
             HttpProxyCacheServer proxy = SheepApp.getHttpProxyCacheServer();
             url = proxy.getProxyUrl(url);
         }
         activity.startActivity(DataUtil.putObject(new Intent(activity, ActPlayVideo.class), url));
     }
+
     /**
      * 播放视频
      *
@@ -2278,6 +2285,7 @@ public class Jump2View {
         DataUtil.putObject(intent, data);
         activity.startActivity(intent);
     }
+
     /**
      * 编辑视频
      *
@@ -2301,6 +2309,7 @@ public class Jump2View {
 
     /**
      * 进入覆盖js的Web界面
+     *
      * @param activity
      * @param title
      * @param url
@@ -2323,6 +2332,7 @@ public class Jump2View {
         Intent intent = new Intent(activity, ActMyFocus.class);
         activity.startActivity(intent);
     }
+
     /**
      * 小绵羊3.4.5新增--跳转到足迹界面
      */
@@ -2331,6 +2341,7 @@ public class Jump2View {
         Intent intent = new Intent(activity, ActFootprint.class);
         activity.startActivity(intent);
     }
+
     /**
      * 小绵羊3.4.5新增--跳转到收徒红包界面
      */
@@ -2339,6 +2350,7 @@ public class Jump2View {
         Intent intent = new Intent(activity, ActApprenticeRedPacket.class);
         activity.startActivity(intent);
     }
+
     /**
      * 小绵羊3.4.5新增--跳转到兑换商城界面
      */
@@ -2347,6 +2359,7 @@ public class Jump2View {
         Intent intent = new Intent(activity, ActExchangeMall.class);
         activity.startActivity(intent);
     }
+
     /**
      * 小绵羊3.4.5新增--跳转到每日分享界面
      */
@@ -2355,6 +2368,7 @@ public class Jump2View {
         Intent intent = new Intent(activity, ActEveryDayShare.class);
         activity.startActivity(intent);
     }
+
     /**
      * 小绵羊3.4.5新增--跳转到娱乐抽奖界面
      */
@@ -2363,6 +2377,7 @@ public class Jump2View {
         Intent intent = new Intent(activity, ActEntertainmentLuckDraw.class);
         activity.startActivity(intent);
     }
+
     /**
      * 小绵羊3.4.5新增--跳转到金币中心界面
      */
@@ -2380,6 +2395,7 @@ public class Jump2View {
         Intent intent = new Intent(activity, ActPublishArticle.class);
         activity.startActivity(DataUtil.putObject(intent, type));
     }
+
     /**
      * 小绵羊3.4.5新增--跳转到发布发现内容的界面
      */
@@ -2388,6 +2404,7 @@ public class Jump2View {
         Intent intent = new Intent(activity, ActVideoComment.class);
         activity.startActivity(DataUtil.putObject(intent, video_id));
     }
+
     /**
      * 小绵羊3.4.5新增--跳转到选择视频与图片界面
      */

+ 0 - 487
app/src/main/java/com/sheep/gamegroup/view/activity/LoginAct.java

@@ -1,487 +0,0 @@
-package com.sheep.gamegroup.view.activity;
-
-import android.support.v7.widget.AppCompatCheckBox;
-import android.support.v7.widget.AppCompatEditText;
-import android.text.Editable;
-import android.text.InputFilter;
-import android.text.InputType;
-import android.text.TextUtils;
-import android.text.TextWatcher;
-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.absBase.BaseUMActivity;
-import com.sheep.gamegroup.di.components.DaggerLoginComponent;
-import com.sheep.gamegroup.di.modules.LoginModule;
-import com.sheep.gamegroup.greendao.DDProviderHelper;
-import com.sheep.gamegroup.greendao.download.SdkLoginUser;
-import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.LoginEntity;
-import com.sheep.gamegroup.model.entity.UserEntity;
-import com.sheep.gamegroup.model.util.EntityUtils;
-import com.sheep.gamegroup.model.util.SheepSubscriber;
-import com.sheep.gamegroup.presenter.LoginContract;
-import com.sheep.gamegroup.presenter.LoginPresenter;
-import com.sheep.gamegroup.util.ActivityManager;
-import com.sheep.gamegroup.util.CertificationUtil;
-import com.sheep.gamegroup.util.ChannelContent;
-import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.gamegroup.util.DataUtil;
-import com.sheep.gamegroup.util.Jump2View;
-import com.sheep.gamegroup.util.PreferenceUtils;
-import com.sheep.gamegroup.util.SelfCountDownTimer;
-import com.sheep.gamegroup.util.StringUtils;
-import com.sheep.gamegroup.util.TestUtil;
-import com.sheep.gamegroup.util.UMConfigUtils;
-import com.sheep.gamegroup.util.ViewUtil;
-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.SpUtils;
-import com.umeng.socialize.UMAuthListener;
-import com.umeng.socialize.UMShareAPI;
-import com.umeng.socialize.bean.SHARE_MEDIA;
-
-import java.util.Locale;
-import java.util.Map;
-
-import javax.inject.Inject;
-
-import butterknife.BindView;
-import butterknife.OnClick;
-import io.reactivex.android.schedulers.AndroidSchedulers;
-import rx.functions.Action1;
-import io.reactivex.schedulers.Schedulers;
-
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.LOGIN_QQ;
-import static com.sheep.gamegroup.util.UMConfigUtils.Event.LOGIN_WX;
-
-/**
- * Created by ljy on 2018/3/8.
- */
-
-public class LoginAct extends BaseUMActivity implements LoginContract.View {
-
-    @Inject
-    LoginPresenter mPresenter;
-    @BindView(R.id.login_agreement_cb)
-    AppCompatCheckBox loginAgreementCb;
-    @BindView(R.id.login_agreement_tv)
-    TextView loginAgreementTv;
-    @BindView(R.id.login_agreement_ll)
-    LinearLayout loginAgreementLl;
-    @BindView(R.id.iv_wx)
-    ImageView ivWx;
-    @BindView(R.id.iv_qq)
-    ImageView ivQq;
-    @BindView(R.id.login_other_ll)
-    LinearLayout loginOtherLl;
-    @BindView(R.id.login_et_account)
-    AppCompatEditText loginEtAccount;
-    @BindView(R.id.login_et_code)
-    AppCompatEditText loginEtCode;
-    @BindView(R.id.login_btn_code)
-    TextView loginBtnCode;
-//    @BindView(R.id.login_et_scope)
-    AppCompatEditText loginEtScope;
-    @BindView(R.id.test_change)
-    TextView testChange;
-    @BindView(R.id.test_change_user)
-    TextView testChangeUser;
-
-
-    @Override
-    protected int getLayoutId() {
-        return R.layout.login_act_layout;
-    }
-    private LoginAct activity;
-    private String channelName;
-    @Override
-    public void initView() {
-        activity = this;
-        DaggerLoginComponent.builder()
-                .netComponent(SheepApp.getInstance().getNetComponent())
-                .loginModule(new LoginModule(this))
-                .build()
-                .inject(this);
-        TestUtil.testChange(this, (TextView) findViewById(R.id.test_change));
-        TestUtil.testChangeUser(this, (TextView) findViewById(R.id.test_change_user));
-        channelName = ChannelContent.getInstance().getChannel_name();
-        if(loginEtScope != null) {
-            if (!TextUtils.isEmpty(channelName)) {
-                loginEtScope.setVisibility(View.GONE);
-            } else {
-                loginEtAccount.addTextChangedListener(new TextWatcher() {
-                    @Override
-                    public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
-
-                    }
-
-                    @Override
-                    public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
-
-                    }
-
-                    @Override
-                    public void afterTextChanged(Editable editable) {
-                        checkAccountScope(editable);
-                    }
-                });
-            }
-        }
-
-        if (TestUtil.isTest()) {
-            loginEtAccount.setInputType(InputType.TYPE_CLASS_TEXT);
-            loginEtAccount.setFilters(new InputFilter[]{new InputFilter.LengthFilter(1000)});
-        }
-    }
-
-    /**
-     * 根据输入的手机号检查账号有没有邀请码
-     */
-    private void checkAccountScope(Editable editable) {
-        if(loginEtScope == null)
-            return;
-        String mobile = editable.toString();
-        if(StringUtils.isMobile(mobile)){//是手机号才检查
-            //调用接口检查账号中的邀请码
-            SheepApp.getInstance().getNetComponent().getApiService().needCode(mobile)
-                            .subscribeOn(Schedulers.io())
-                            .observeOn(AndroidSchedulers.mainThread())
-                            .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                                @Override
-                                public void onNext(BaseMessage baseMessage) {
-                                    Boolean result = baseMessage.getData(Boolean.class);
-                                    if(result == null)
-                                        result = false;
-                                    ViewUtil.setVisibility(loginEtScope, result);
-                                }
-
-                                @Override
-                                public void onError(BaseMessage baseMessage) {
-                                }
-                            });
-        } else {
-            ViewUtil.setVisibility(loginEtScope, true);
-        }
-
-    }
-
-
-    @Override
-    public void initListener() {
-        selfCountDownTimer = new SelfCountDownTimer(60 * 1000, 1000, SelfCountDownTimer.FULL_SECOND) {
-            @Override
-            public void onTimerRest() {
-                canGetCaptchaPhone = true;
-                loginBtnCode.setText(getString(R.string.get_captcha));
-            }
-
-            @Override
-            public void onTimerTick(long millisUntilFinished, int countTime) {
-                loginBtnCode.setText(String.format(Locale.CHINA, "%d s", countTime));
-            }
-
-            @Override
-            public void onTimerFinish() {
-                canGetCaptchaPhone = true;
-                loginBtnCode.setText(getString(R.string.get_captcha));
-            }
-        };
-    }
-
-    @Override
-    public void initData() {
-
-    }
-
-    private void goWeixin() {
-        LOGIN_WX.onEvent();
-        UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.WEIXIN, new UMAuthListener() {
-            @Override
-            public void onStart(SHARE_MEDIA platform) {
-                showProgress();
-            }
-
-            @Override
-            public void onComplete(SHARE_MEDIA platform, int action, Map<String, String> data) {
-                mPresenter.logByAuther(1, data.get("access_token"), data.get("openid"));
-            }
-
-            @Override
-            public void onError(SHARE_MEDIA platform, int action, Throwable t) {
-                hideProgress();
-                String str = t.getMessage();
-                if (str.indexOf("2008") > 0) {
-                    G.showToast("微信授权失败,请先安装微信客户端 在登录吧!");
-
-                } else {
-                    G.showToast("微信授权失败  请检查网络是否正常");
-
-                }
-
-            }
-
-            @Override
-            public void onCancel(SHARE_MEDIA platform, int action) {
-                G.showToast("微信授权取消");
-                hideProgress();
-            }
-        });
-
-    }
-
-
-    private void loginQQ() {
-        LOGIN_QQ.onEvent();
-        UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.QQ, new UMAuthListener() {
-            @Override
-            public void onStart(SHARE_MEDIA platform) {
-                showProgress();
-            }
-
-            @Override
-            public void onComplete(SHARE_MEDIA platform, int action, Map<String, String> data) {
-//                mPresenter.logByAuther(2,data.get("openid"));
-                mPresenter.logByAuther(2, data.get("access_token"), data.get("openid"));
-
-            }
-
-            @Override
-            public void onError(SHARE_MEDIA platform, int action, Throwable t) {
-                G.showToast("QQ授权失败  请检查网络是否正常");
-                hideProgress();
-            }
-
-            @Override
-            public void onCancel(SHARE_MEDIA platform, int action) {
-
-                hideProgress();
-            }
-        });
-
-
-    }
-
-
-    @Override
-    public void NetSuccess(int code, String msg, String invitation_code) {
-        hideProgress();
-        if(TextUtils.isEmpty(SheepApp.getInstance().getGameCode())){
-            Jump2View.getInstance().checkCommendApp(this, invitation_code);
-        }else {
-            CertificationUtil.newInstance().addCurUserToSdkLoginUser();
-            CertificationUtil.newInstance().authCertificationCode(activity, SpUtils.getToken(SheepApp.getInstance()));
-        }
-
-
-    }
-
-    @Override
-    public void NetError(int code, String errorMsg) {
-        G.showToast(errorMsg);
-        hideProgress();
-
-    }
-
-
-    @OnClick({R.id.login_agreement_tv, R.id.iv_wx, R.id.iv_qq, R.id.login_btn_code, R.id.login_commit})
-    public void onViewClicked(View view) {
-        switch (view.getId()) {
-            case R.id.login_agreement_tv:
-                Jump2View.getInstance().tryShowAgreement(this, new Action1<String>() {
-                    @Override
-                    public void call(String msg) {
-                        if (!TextUtils.isEmpty(msg)) {
-                            G.showToast(msg);
-                        }
-                    }
-                });
-                break;
-            case R.id.iv_wx:
-                if (checkAgreement())
-                    goWeixin();
-                break;
-            case R.id.iv_qq:
-                if (checkAgreement())
-                    loginQQ();
-                break;
-            case R.id.login_btn_code:
-                etPhone = loginEtAccount.getText().toString().trim();
-                getCaptcha();
-                break;
-            case R.id.login_commit:
-                etPhone = loginEtAccount.getText().toString().trim();
-                etCode = loginEtCode.getText().toString().trim();
-                if (TestUtil.isTest() && TextUtils.isEmpty(etCode) && !TextUtils.isEmpty(etPhone)) {
-                    goMain(etPhone);
-                    TestUtil.addUser(etPhone);
-                    return;
-                }
-                loginByPhoneCaptcha();
-                break;
-        }
-    }
-    private void goMain(String openId) {
-        SpUtils.saveToken(getApplicationContext(), openId);
-        Jump2View.getInstance().checkCommendApp(this, null);
-        ActivityManager.getInstance().endActivity(LoginAct.class);
-        finish();
-    }
-
-    /**
-     * 登录
-     */
-    private void loginByPhoneCaptcha() {
-        if (!checkPhoneInput()) {
-            return;
-        }
-        if (!checkCodeInput()) {
-            return;
-        }
-        String scope;
-        if(loginEtScope == null){
-            scope = channelName;
-        } else {
-            scope = !TextUtils.isEmpty(channelName) ? channelName : loginEtScope.getText().toString();
-        }
-        showProgress();
-        JSONObject jsonObject = new JSONObject();
-        jsonObject.put("account", etPhone);
-        jsonObject.put("sec_code", etCode);
-        jsonObject.put("invitation_code", scope);
-        PreferenceUtils.setPrefString(SheepApp.getInstance(), UMConfigUtils.LOGIN_TYPE, UMConfigUtils.Source.SHEEP);
-        SheepApp.getInstance().getNetComponent().getApiService().loginByCaptcha(jsonObject)
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        hideProgress();
-                        G.showToast(baseMessage);
-                    }
-
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        hideProgress();
-                        if (baseMessage == null) {
-                            return;
-                        }
-                        LoginEntity loginEty = null;
-                        try {
-                            loginEty = JSONObject.parseObject(JSONObject.toJSONString(baseMessage.getData()), LoginEntity.class);
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        }
-                        if (loginEty != null) {
-                            SpUtils.saveToken(activity, loginEty.getToken());
-                            DataUtil.getInstance().initUserEntity(loginEty.getUser());
-                        }
-
-                        if(TextUtils.isEmpty(SheepApp.getInstance().getGameCode())){
-                            Jump2View.getInstance().checkCommendApp(activity, EntityUtils.getUserCode(loginEty));
-                        }else {
-                            CertificationUtil.newInstance().addCurUserToSdkLoginUser();
-                            CertificationUtil.newInstance().authCertificationCode(activity, SpUtils.getToken(SheepApp.getInstance()));
-                        }
-                        TestUtil.saveUser(loginEty);
-
-                    }
-                });
-
-    }
-    private String etPhone;
-    private String etCode;
-    private boolean canGetCaptchaPhone = true;
-    private SelfCountDownTimer selfCountDownTimer;
-    /**
-     * 获取验证码
-     */
-    private void getCaptcha() {
-
-        if (!canGetCaptchaPhone) {
-            return;
-        }
-        if (!checkPhoneInput()) {
-            return;
-        }
-        selfCountDownTimer.reset(SelfCountDownTimer.FULL_SECOND);
-        canGetCaptchaPhone = true;
-        getCaptcha(etPhone, new Action1<BaseMessage>() {
-            @Override
-            public void call(BaseMessage baseMessage) {
-                if(baseMessage != null)
-                    selfCountDownTimer.start();
-            }
-        });
-    }
-
-    public void getCaptcha(String etPhone, final Action1<BaseMessage> action1) {
-        JSONObject jsonObject = new JSONObject();
-        jsonObject.put("account", etPhone);
-        SheepApp.getInstance().getNetComponent().getApiService().getCaptcha(jsonObject)
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        G.showToast(baseMessage);
-                    }
-
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        action1.call(baseMessage);
-                    }
-                });
-
-    }
-    private boolean checkPhoneInput() {
-        if (TextUtils.isEmpty(etPhone)) {
-            G.showToast(getString(R.string.input_your_phone));
-            return false;
-        }
-        if (etPhone.length() != 11) {
-            G.showToast(getString(R.string.toast_warning_phone_number_size));
-            return false;
-        }
-        return true;
-    }
-
-    private boolean checkCodeInput() {
-        if (TextUtils.isEmpty(etCode)) {
-            G.showToast(getString(R.string.input_your_captcha));
-            return false;
-        }
-        if (etCode.length() != 6) {
-            G.showToast(getString(R.string.toast_warning_phone_captcha_image_code_size));
-            return false;
-        }
-        return true;
-    }
-    private boolean checkAgreement() {
-        if (loginAgreementCb.isChecked()) {
-            return true;
-        }
-        G.showToast("温馨提示:您必须同意用户协议才能继续体验小绵羊APP!");
-        return false;
-    }
-
-    @Override
-    protected void onDestroy() {
-        super.onDestroy();
-        if (selfCountDownTimer != null) {
-            selfCountDownTimer.cancel();
-        }
-    }
-
-    @Override
-    public void onBackPressed() {
-        super.onBackPressed();
-        if (!TextUtils.isEmpty(SheepApp.getInstance().getGamePackgeName())){
-            SheepApp.getInstance().setGameFlag(true);
-        }
-    }
-}

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

@@ -27,6 +27,7 @@ import com.qiniu.android.storage.UploadManager;
 import com.sheep.gamegroup.di.components.DaggerNetComponent;
 import com.sheep.gamegroup.di.components.NetComponent;
 import com.sheep.gamegroup.di.modules.NetModule;
+import com.sheep.gamegroup.module.login.LoginAct;
 import com.sheep.gamegroup.usage.AppUsageManager;
 import com.sheep.gamegroup.util.ActivityManager;
 import com.sheep.gamegroup.util.AppUtil;
@@ -46,7 +47,6 @@ import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.util.viewHelper.CacheImageUtil;
 import com.sheep.gamegroup.view.activity.GameCertificationActivity;
-import com.sheep.gamegroup.view.activity.LoginAct;
 import com.sheep.jiuyan.samllsheep.service.AutoCheckService;
 import com.sheep.jiuyan.samllsheep.service.DownloadService;
 import com.sheep.jiuyan.samllsheep.service.FloatShotScreenService;

+ 0 - 197
app/src/main/res/layout/login_act_layout.xml

@@ -1,197 +0,0 @@
-<?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">
-
-    <ImageView
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:adjustViewBounds="true"
-        android:scaleType="fitXY"
-        android:src="@mipmap/login_bg" />
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="60"/>
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginStart="48dp"
-            android:layout_marginEnd="48dp"
-            android:orientation="vertical">
-
-            <android.support.v7.widget.AppCompatEditText
-                android:id="@+id/login_et_account"
-                style="@style/style_login_et"
-                android:hint="请输入手机号"
-                android:inputType="phone"
-                android:maxLength="11"/>
-
-            <View
-                android:layout_width="match_parent"
-                android:layout_height="1dp"
-                android:layout_marginBottom="@dimen/content_padding"
-                android:background="@color/white" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="horizontal">
-
-                <android.support.v7.widget.AppCompatEditText
-                    android:id="@+id/login_et_code"
-                    style="@style/style_login_et"
-                    android:layout_width="0dp"
-                    android:layout_weight="1"
-                    android:hint="请输入验证码"
-                    android:inputType="number"
-                    android:maxLength="6" />
-
-                <TextView
-                    android:id="@+id/login_btn_code"
-                    style="@style/style_code_btn"/>
-
-            </LinearLayout>
-
-            <View
-                android:layout_width="match_parent"
-                android:layout_height="1dp"
-                android:layout_marginBottom="@dimen/content_padding"
-                android:background="@color/white" />
-            <android.support.v7.widget.AppCompatEditText
-                style="@style/style_login_et"
-                android:hint="请输入邀请码"
-                android:inputType="number"
-                android:maxLength="10"
-                android:visibility="gone"
-                android:gravity="center"/>
-        </LinearLayout>
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="7"/>
-        <TextView
-            android:id="@+id/login_commit"
-            android:layout_width="match_parent"
-            android:layout_height="36dp"
-            android:textColor="#36A5ED"
-            android:layout_marginStart="48dp"
-            android:layout_marginEnd="48dp"
-            android:textSize="18sp"
-            android:gravity="center"
-            android:background="@drawable/shape_white_solid_rectangle"
-            android:text="登录"/>
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="11"/>
-        <LinearLayout
-            android:id="@+id/login_other_ll"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center_horizontal"
-            android:orientation="horizontal">
-
-            <View
-                android:layout_width="10dp"
-                android:layout_height="1dp"
-                android:layout_gravity="center_vertical"
-                android:background="@color/txt_white" />
-
-            <ImageView
-                android:id="@+id/iv_wx"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="15dp"
-                android:background="@null"
-                android:src="@mipmap/x_ic_login_wx" />
-
-            <View
-                android:layout_width="2dp"
-                android:layout_height="2dp"
-                android:layout_gravity="center_vertical"
-                android:layout_marginLeft="15dp"
-                android:layout_marginRight="15dp"
-                android:background="@color/txt_white" />
-
-            <ImageView
-                android:id="@+id/iv_qq"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:background="@null"
-                android:src="@mipmap/x_ic_login_qq" />
-
-            <View
-                android:layout_width="10dp"
-                android:layout_height="1dp"
-                android:layout_gravity="center_vertical"
-                android:layout_marginLeft="15dp"
-                android:background="@color/txt_white" />
-        </LinearLayout>
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="4"/>
-        <LinearLayout
-            android:id="@+id/login_agreement_ll"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:gravity="center"
-            android:orientation="horizontal">
-
-            <android.support.v7.widget.AppCompatCheckBox
-                android:id="@+id/login_agreement_cb"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:button="@drawable/drawable_selector_check"
-                android:checked="true"
-                android:scaleX="1.4"
-                android:scaleY="1.4" />
-
-            <TextView
-                android:id="@+id/login_agreement_tv"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginStart="5dp"
-                android:text="我已阅读并同意《小绵羊平台用户协议》"
-                android:textColor="@color/white"
-                android:textSize="12sp" />
-        </LinearLayout>
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="5"/>
-    </LinearLayout>
-
-    <TextView
-        android:id="@+id/test_change"
-        style="@style/style_button_small_yellow"
-        android:layout_width="wrap_content"
-        android:layout_height="30dp"
-        android:layout_alignParentEnd="true"
-        android:layout_alignParentTop="true"
-        android:layout_margin="@dimen/dp_10"
-        android:paddingEnd="@dimen/dp_10"
-        android:paddingStart="@dimen/dp_10"
-        android:text="切换服务器"
-        android:visibility="gone" />
-
-    <TextView
-        android:id="@+id/test_change_user"
-        style="@style/style_button_small_yellow"
-        android:layout_width="wrap_content"
-        android:layout_height="30dp"
-        android:layout_alignParentEnd="true"
-        android:layout_below="@+id/test_change"
-        android:layout_margin="@dimen/dp_10"
-        android:paddingEnd="@dimen/dp_10"
-        android:paddingStart="@dimen/dp_10"
-        android:text="切换账号"
-        android:visibility="gone" />
-</RelativeLayout>