Commit 1dee521f25d608076cf126467ae132f98a18e461

Authored by YangShuai
1 parent c95b1011

1 新增登录对话框

Showing 29 changed files with 1529 additions and 63 deletions
app/strike/src/main/AndroidManifest.xml
... ... @@ -17,10 +17,11 @@
17 17 android:roundIcon="@mipmap/ic_launcher_round"
18 18 android:supportsRtl="true"
19 19 android:theme="@style/AppTheme">
  20 +
20 21 <activity
21 22 android:name=".LoginSuccessActivity"
22 23 android:label="UserAPI"
23   - android:theme="@style/AppTheme.NoTitleTranslucentTheme" />
  24 + android:theme="@style/AppTheme.TranslucentFullScreenTheme" />
24 25 />
25 26 <activity android:name=".demo.activity.DemoActivity" />
26 27 <activity android:name=".MyActivity"></activity>
... ...
app/strike/src/main/java/com/cnlive/strike/LoginSuccessActivity.java
1 1 package com.cnlive.strike;
2 2  
  3 +import android.content.Intent;
  4 +import android.net.Uri;
  5 +import android.text.TextUtils;
  6 +import android.util.Log;
  7 +
3 8 import com.alibaba.android.arouter.facade.annotation.Autowired;
4 9 import com.alibaba.android.arouter.facade.annotation.Route;
5 10 import com.alibaba.android.arouter.launcher.ARouter;
6 11 import com.cnlive.core.libs.base.frame.activity.BaseActivity;
  12 +import com.cnlive.moudle.pedometer.commonInfo.CommonInfo;
  13 +import com.cnlive.moudle.pedometer.ui.activity.RunLineActivity;
  14 +import com.cnlive.strike.user.auth.UserService;
  15 +import com.cnlive.strike.user.model.LoginSuccessInfo;
  16 +import com.cnlive.strike.user.ui.activity.FirstLoginActivity;
  17 +import com.cnlive.strike.user.util.UserRouterHelper;
7 18  
8 19 @Route(path = "/cloud/user/LoginSuccessActivity")
9 20 public class LoginSuccessActivity extends BaseActivity {
10   - @Autowired(name = "isNewUser")
11   - boolean isNewUser;
  21 + @Autowired(name = "eventType")
  22 + int eventType;//传递类型
  23 + @Autowired(name = "isHasOtherUserInfo")
  24 + boolean isHasOtherUserInfo;//是否有第三方数据
  25 + @Autowired(name = "isChangeUserNickName")
  26 + boolean isChangeUserNickName;//是否修改用户昵称
  27 + @Autowired(name = "nickName")
  28 + String nickName;//用户昵称
  29 + @Autowired(name = "nickName")
  30 + String faceUrl;//用户头像地址
  31 + @Autowired(name = "successInfo")
  32 + LoginSuccessInfo successInfo;//登录成功后需要传递的数据
  33 +
12 34 @Override
13 35 protected void initCreate() {
14 36 super.initCreate();
  37 + //不显示默认空视图
  38 + setEnableCreateDefultEmptyView(false);
15 39 }
16 40  
17 41 @Override
18   - protected void initView() {
19   - super.initView();
20   - logError("是否新用户"+isNewUser);
  42 + protected void initParam() {
  43 + super.initParam();
  44 + initAction();
  45 + }
  46 +
  47 + private void initAction() {
  48 + switch (eventType) {
  49 + case UserRouterHelper.SHOW_MAIN_VIEW://显示主界面
  50 + CommonInfo.setUserInfo(this, UserService.getUid(this), UserService.getInstance(this).getAppAccount().getNickName(), UserService.getInstance(this).getAppAccount().getFaceUrl(), UserService.getInstance(this).getAppAccount().getMobile());
  51 + RunLineActivity.newInstance(this, null, null, null, null);
  52 + finish();
  53 + break;
  54 +
  55 + case UserRouterHelper.MODIFY_USER_IMAGE://修改用户头像
  56 + Log.e(TAG, "修改用户头像");
  57 + //todo
  58 +// LoginManager.modifyUserImage(UserService.getUid(this), faceUrl);
  59 + finish();
  60 + break;
  61 +
  62 + case UserRouterHelper.USER_INVALID://用户失效
  63 + Log.e(TAG, "用户失效");
  64 + //todo
  65 + // UserOfflineUtil.userInvalid(context);
  66 + finish();
  67 + case UserRouterHelper.MODIFY_USER_NAME://修改用户名称
  68 + //todo
  69 + Log.e(TAG, "修改用户名称");
  70 + // LoginManager.modifyUserName( UserService.getUid(context), nickName);
  71 +
  72 + finish();
  73 + break;
  74 + case UserRouterHelper.COIN_RAIN_ACTION://下金币
  75 + Log.e(TAG, "下金币");
  76 + //todo
  77 +// taskId = getIntent().getExtras().getString("taskId");
  78 +// contentId = getIntent().getExtras().getString("contentId");
  79 +// addtype = getIntent().getExtras().getString("addtype");
  80 +// isDouyin = getIntent().getExtras().getBoolean("isDouyin");
  81 +// if (TextUtils.isEmpty(taskId)) {
  82 +// taskId = "";
  83 +// }
  84 +// if (TextUtils.isEmpty(contentId)) {
  85 +// contentId = "";
  86 +// }
  87 +// if (TextUtils.isEmpty(addtype)) {
  88 +// addtype = "";
  89 +// }
  90 + //CoinRainAction.code(activity, UserService.getUid(activity), taskId,contentId, addtype,isDouyin);
  91 +
  92 + break;
  93 + }
21 94 }
22 95 }
... ...
app/strike/src/main/java/com/cnlive/strike/MainActivity.java
... ... @@ -2,6 +2,7 @@ package com.cnlive.strike;
2 2  
3 3  
4 4 import android.Manifest;
  5 +import android.app.Activity;
5 6 import android.content.Context;
6 7 import android.content.Intent;
7 8 import android.os.Bundle;
... ... @@ -16,7 +17,9 @@ import com.cnlive.strike.demo.activity.DemoActivity;
16 17 import com.cnlive.strike.demo.activity.DemoMvpActivity;
17 18 import com.cnlive.strike.imgutil.ImgActivity;
18 19 import com.cnlive.strike.user.auth.UserService;
  20 +import com.cnlive.strike.user.ui.activity.FirstLoginActivity;
19 21 import com.cnlive.strike.user.ui.activity.LoginActivity;
  22 +import com.cnlive.strike.user.ui.activity.LoginDialogActivity;
20 23 import com.cnlive.strike.xiaojiaspeaker.ui.activity.AllDeviceActivity;
21 24  
22 25 import androidx.annotation.NonNull;
... ... @@ -35,10 +38,13 @@ public class MainActivity extends AppCompatActivity {
35 38 public void onClick(View v) {
36 39 // if (TextUtils.isEmpty(UserService.getUid(MainActivity.this))) {
37 40 startActivity(new Intent(MainActivity.this, LoginActivity.class));
38   -// finish();
  41 +//// finish();
39 42 // } else {
40   -// startActivity(new Intent(MainActivity.this, LoginSuccessActivity.class));
  43 +// startActivity(new Intent(MainActivity.this, FirstLoginActivity.class));
41 44 // }
  45 +// Intent intent = new Intent(MainActivity.this, LoginDialogActivity.class);
  46 +// startActivity(intent);
  47 +// overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
42 48 }
43 49 });
44 50 findViewById(R.id.to_img).setOnClickListener(view -> startActivity(new Intent(this, ImgActivity.class)));
... ...
app/strike/src/main/res/values/strings.xml
1 1 <resources>
2 2 <!-- <string name="app_name">strike</string>-->
3 3  
4   -
5   - <!-- TODO: Remove or change this placeholder text -->
6   - <string name="hello_blank_fragment">Hello blank fragment</string>
7 4 </resources>
... ...
app/strike/src/main/res/values/styles.xml
... ... @@ -4,9 +4,9 @@
4 4 <style name="AppTheme" parent="QMUI.Compat.NoActionBar">
5 5  
6 6 <!-- Customize your theme here. -->
7   - <item name="colorPrimary">@color/colorPrimary</item>
8   - <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
9   - <item name="colorAccent">@color/colorAccent</item>
  7 +<!-- <item name="colorPrimary">@color/colorPrimary</item>-->
  8 +<!-- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>-->
  9 +<!-- <item name="colorAccent">@color/colorAccent</item>-->
10 10 </style>
11 11  
12 12 </resources>
... ...
cloud/user/src/main/AndroidManifest.xml
... ... @@ -40,6 +40,11 @@
40 40 android:value="weibo" />
41 41  
42 42 <activity
  43 + android:name=".ui.activity.LoginDialogActivity"
  44 + android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
  45 + android:launchMode="singleTop"
  46 + android:theme="@style/ProcessHtmlDialogActivityTheme" />
  47 + <activity
43 48 android:name=".ui.activity.LoginActivity"
44 49 android:configChanges="keyboardHidden|screenSize|orientation|smallestScreenSize|screenLayout"
45 50 android:launchMode="singleTop"
... ...
cloud/user/src/main/java/com/cnlive/strike/user/frame/presenter/FirstLoginPresenter.java
... ... @@ -15,6 +15,7 @@ import com.cnlive.core.network.model.FaceData;
15 15 import com.cnlive.core.network.model.TokenData;
16 16 import com.cnlive.core.network.model.UserData;
17 17 import com.cnlive.strike.user.router.user.UserOfflineUtil;
  18 +import com.cnlive.strike.user.util.UserRouterHelper;
18 19  
19 20 import java.io.File;
20 21  
... ... @@ -97,7 +98,7 @@ public class FirstLoginPresenter extends BasePresenter&lt;FirstLoginView&gt; {
97 98 public void onSuccess(BaseResult<UserData> data) {
98 99 userService.setUserInfo(data.getData());
99 100  
100   -// HelperUtil.modifyUserName(context, nickName);
  101 + UserRouterHelper.modifyUserName(context, nickName);
101 102 userService.setUserNickName(nickName);
102 103 ifViewAttached(view -> view.showMainPage());
103 104 }
... ... @@ -106,7 +107,7 @@ public class FirstLoginPresenter extends BasePresenter&lt;FirstLoginView&gt; {
106 107 public void onFailure(String errCode, String errMsg) {
107 108 if ("8".equals(errCode) || "9".equals(errCode)) {
108 109 // UserOfflineUtil.userInvalid(context);
109   -// HelperUtil.userInvalid(context);
  110 + UserRouterHelper.userInvalid(context);
110 111 } else if (errCode.equals(UserUtilAction.TOKEN_ERROR_CODE)) {
111 112 ifViewAttached(view -> view.showTokenErrorDialog());
112 113 } else {
... ... @@ -147,7 +148,7 @@ public class FirstLoginPresenter extends BasePresenter&lt;FirstLoginView&gt; {
147 148  
148 149 @Override
149 150 public void onSuccess(BaseResult<FaceData> data) {
150   -// HelperUtil.modifyUserImage(context, data.getData().getFaceUrl());
  151 + UserRouterHelper.modifyUserImage(context, data.getData().getFaceUrl());
151 152 // LoginManager.modifyUserImage( UserService.getUid(context), data.getData().getFaceUrl());
152 153 userService.setUserFaceUrl(data.getData().getFaceUrl(), data.getData().getBigFaceUrl());
153 154 ifViewAttached(view -> view.photoChange(data.getData().getFaceUrl()));
... ... @@ -157,7 +158,7 @@ public class FirstLoginPresenter extends BasePresenter&lt;FirstLoginView&gt; {
157 158 public void onFailure(String errCode, String errMsg) {
158 159 if ("8".equals(errCode) || "9".equals(errCode)) {
159 160 UserOfflineUtil.userInvalid(context);
160   -// HelperUtil.userInvalid(context);
  161 + UserRouterHelper.userInvalid(context);
161 162 } else if (UserUtilAction.TOKEN_ERROR_CODE.equals(errCode)) {
162 163 ifViewAttached(view -> view.showTokenErrorDialog());
163 164 } else {
... ...
cloud/user/src/main/java/com/cnlive/strike/user/frame/presenter/LoginDialogPresenter.java 0 → 100644
  1 +package com.cnlive.strike.user.frame.presenter;
  2 +
  3 +import android.accounts.Account;
  4 +import android.content.Context;
  5 +import android.text.TextUtils;
  6 +
  7 +import com.cnlive.core.libs.base.application.AppConfig;
  8 +import com.cnlive.core.libs.base.frame.presenter.BasePresenter;
  9 +import com.cnlive.core.libs.base.util.TimerWaitUtil;
  10 +import com.cnlive.core.network.HttpConn;
  11 +import com.cnlive.core.network.NetCallBack;
  12 +import com.cnlive.core.network.model.BaseResult;
  13 +import com.cnlive.strike.user.R;
  14 +import com.cnlive.strike.user.UserUtilAction;
  15 +import com.cnlive.strike.user.auth.UserService;
  16 +import com.cnlive.strike.user.frame.data.OtherUserInfo;
  17 +import com.cnlive.strike.user.frame.data.QuickLoginData;
  18 +import com.cnlive.strike.user.frame.view.LoginDialogView;
  19 +import com.cnlive.strike.user.model.CNLiveUserInfo;
  20 +import com.cnlive.strike.user.router.user.UserAction;
  21 +import com.cnlive.strike.user.ui.activity.LoginDialogActivity;
  22 +import com.cnlive.strike.user.ui.fragment.QuickLoginFragment;
  23 +import com.cnlive.strike.user.util.RegexUtils;
  24 +import com.cnlive.strike.user.util.TimeEvent;
  25 +
  26 +import java.util.Arrays;
  27 +import java.util.Collections;
  28 +
  29 +import io.reactivex.disposables.Disposable;
  30 +
  31 +/**
  32 + * 作者: 吴奎庆
  33 + * <p>
  34 + * 时间: 2019/11/5
  35 + * <p>
  36 + * 简介:
  37 + */
  38 +public class LoginDialogPresenter extends BasePresenter<LoginDialogView> {
  39 +
  40 +
  41 + private static final String TAG = "QuickLoginPresenter";
  42 +
  43 + private Disposable event;
  44 + private Disposable sendMsgBefQuickLogin;
  45 + private TimerWaitUtil timerUtil; //计时工具类
  46 +
  47 + public void deleteUserInfo(Context context, String userName) {
  48 + UserService.getInstance(context).removeUser(userName, future -> {
  49 + if (getView() == null) return;
  50 + //获取已登录用户列表
  51 + Account[] accounts = UserService.getInstance(context).getUserList();
  52 + //倒序输出最近登录用户
  53 +
  54 + Collections.reverse(Arrays.asList(accounts));
  55 + getView().uploadListData(accounts);
  56 + });
  57 + }
  58 +
  59 + public void init(Context context) {
  60 + UserService us = UserService.getInstance(context);
  61 + //获取已登录用户列表
  62 + Account[] accounts = us.getUserList();
  63 + //倒序输出最近登录用户
  64 + Collections.reverse(Arrays.asList(accounts));
  65 + //获取最近登录用户数据
  66 + Account account = accounts.length > 0 ? accounts[0] : null;
  67 + String name = account == null ? "" : account.name;
  68 + //页面填充数据
  69 + ifViewAttached(view -> view.uploadInputData(name));
  70 + ifViewAttached(view -> view.uploadListData(accounts));
  71 + }
  72 +
  73 + private void startTimer() {
  74 + if (timerUtil != null) timerUtil.cancel();
  75 +
  76 + timerUtil = new TimerWaitUtil();
  77 + timerUtil.setTotalTime(60_000);//设置毫秒数
  78 + timerUtil.setIntervalTime(500);//设置间隔数
  79 + timerUtil.start();
  80 + timerUtil.setTimerLiener(new TimerWaitUtil.TimeListener() {
  81 + @Override
  82 + public void onFinish() {
  83 + if (getView() != null) getView().onTimerFinish();
  84 + }
  85 +
  86 + @Override
  87 + public void onInterval(long remainTime) {
  88 + if (getView() != null) getView().onTimerInterval(remainTime / 1000);
  89 + }
  90 + });
  91 + }
  92 +
  93 + public void sendCode(Context context, String phone, String countryCode) {
  94 + if (getView() == null) return;
  95 + if (TimeEvent.debounce(2_000)) return;
  96 + if (TextUtils.isEmpty(phone)) {
  97 + ifViewAttached(view -> view.showToast(context.getString(R.string.user_toast_quick_login_empty_phone)));
  98 + return;
  99 + }
  100 + if ("86".equals(countryCode) && !RegexUtils.isMobileSimple(phone)) {
  101 + ifViewAttached(view -> view.showToast(context.getString(R.string.user_toast_quick_login_error_phone)));
  102 + return;
  103 + }
  104 + if (sendMsgBefQuickLogin != null && !sendMsgBefQuickLogin.isDisposed()) {
  105 + getView().showToast("处理中请稍后...");
  106 + } else {
  107 + sendMsgBefQuickLogin = HttpConn.action(UserUtilAction.sendMsgBefQuickLoginAction(context, phone, countryCode), new NetCallBack<BaseResult>() {
  108 + @Override
  109 + public void onRequestState(int state) {
  110 +
  111 + }
  112 +
  113 + @Override
  114 + public void onSuccess(BaseResult data) {
  115 + startTimer();
  116 + ifViewAttached(view -> view.showToast("验证码已发送"));
  117 + }
  118 +
  119 + @Override
  120 + public void onFailure(String errCode, String errMsg) {
  121 + ifViewAttached(view -> view.showToast(errMsg));
  122 +
  123 + }
  124 + });
  125 + }
  126 + }
  127 +
  128 + public void login(LoginDialogActivity context, QuickLoginData data, String countryCode) {
  129 + if (TextUtils.isEmpty(data.getPhone())) {
  130 + ifViewAttached(view -> view.showToast(context.getString(R.string.user_toast_quick_login_empty_phone)));
  131 + } else if (TextUtils.isEmpty(data.getCode())) {
  132 + ifViewAttached(view -> view.showToast(context.getString(R.string.user_toast_quick_login_empty_code)));
  133 + } else {
  134 + context.isLogin = true;
  135 +// UserAction.mobileLogin(context.getActivity(), data.getPhone(), data.getCode(), countryCode, initLoginEvent(context, true));
  136 + event = UserAction.mobileLogin(context, data.getPhone(), data.getCode(), countryCode, new UserAction.CallBack() {
  137 + @Override
  138 + public void callback(int state, String msg, Object object) {
  139 + initLoginEvent(context, state, msg, true, null);
  140 + }
  141 + });
  142 +
  143 + }
  144 + }
  145 + private void initLoginEvent(LoginDialogActivity context, int state, String msg, Boolean retry, OtherUserInfo otherUserInfo) {
  146 + switch (state) {
  147 + //请求成功
  148 + case 0:
  149 + CNLiveUserInfo user = UserService.getInstance(context).getAppAccount();
  150 + if (user == null || (user != null && TextUtils.isEmpty(user.getToken()))) {
  151 + ifViewAttached(view -> view.showToast("用户登陆失败,再试一次吧."));
  152 + } else if (user.isNewUser()) {
  153 + //是新用户
  154 + //TODO 必须设置用户头像
  155 + //OpenInstall用户注册统计
  156 +// OpenInstall.reportRegister();
  157 + //友盟账号登录统计,暂时只有平台登录,后续对接三方登录
  158 +// MobclickAgent.onProfileSignIn("CNLive", user.getUid());
  159 + //三方登陆不需要重新设置头像 otherUserInfo不为空表示三方登陆
  160 + if (otherUserInfo != null) {
  161 + ifViewAttached(view -> view.showMainView());
  162 + } else {
  163 + ifViewAttached(view -> view.showEditView());
  164 + }
  165 + } else {
  166 + //友盟账号登录统计,暂时只有平台登录,后续对接三方登录
  167 +// MobclickAgent.onProfileSignIn("CNLive", user.getUid());
  168 + ifViewAttached(view -> view.showMainView());
  169 + //todo 测试首次用户
  170 +// ifViewAttached(view -> view.showEditView(false));
  171 + }
  172 + AppConfig.setCountryCode("");
  173 + AppConfig.setVerificationCode("");
  174 + AppConfig.setUserPhone("");
  175 + context.hasLogin = true;
  176 + if (context != null) {
  177 + context.isLogin = false;
  178 + }
  179 + break;
  180 + case HttpConn.ON_START:
  181 + ifViewAttached(view -> view.showProgress());
  182 + break;
  183 + case HttpConn.ON_END:
  184 + ifViewAttached(view -> view.hideProgress());
  185 + break;
  186 + case 41010: //手机号无效
  187 + ifViewAttached(view -> view.showToast(msg));
  188 + break;
  189 + case 41002: //验证码为6位数字
  190 + ifViewAttached(view -> view.showToast(msg));
  191 + break;
  192 + case 41009: //验证码错误
  193 + ifViewAttached(view -> view.showToast(msg));
  194 + break;
  195 + case 41006: //手机号已存在
  196 + ifViewAttached(view -> view.showToast(msg));
  197 + break;
  198 + case 42013: //此帐号未注册,请先注册
  199 + ifViewAttached(view -> view.bindPhone(otherUserInfo));
  200 + break;
  201 + case 6208: //当前用户在其他地点登陆
  202 + if (retry) {
  203 + if (otherUserInfo == null) {
  204 + UserAction.mobileLogin(context, context.data.getPhone(), context.data.getCode(), "", new UserAction.CallBack() {
  205 + @Override
  206 + public void callback(int state, String msg, Object object) {
  207 + initLoginEvent(context, state, msg, false, null);
  208 + }
  209 + });
  210 + }
  211 + return;
  212 + } else {
  213 + ifViewAttached(view -> view.showToast("用户登录失败,再试一次吧."));
  214 + }
  215 + break;
  216 + default: //其他错误
  217 + ifViewAttached(view -> view.showToast(msg));
  218 + break;
  219 + }
  220 + }
  221 +// /**
  222 +// * 三方登陆
  223 +// *
  224 +// * @param context
  225 +// * @param otherUserInfo
  226 +// */
  227 +// public void otherLogin(LoginDialogActivity context, OtherUserInfo otherUserInfo) {
  228 +// if (otherUserInfo == null) {
  229 +// getView().showToast(context.getString(R.string.user_toast_other_info_error));
  230 +// } else {
  231 +// cancelLoad();
  232 +// context.isLogin = true;
  233 +//
  234 +// UserAction.otherLogin(context, context.otherUserInfo.getLoginType(), context.otherUserInfo.getThirdPartyId(), initLoginEvent(context, false, otherUserInfo));
  235 +// }
  236 +// }
  237 +//
  238 +// private Event<CNLiveUserInfo> initLoginEvent(LoginDialogActivity context, Boolean retry) {
  239 +// return initLoginEvent(context, retry, null);
  240 +// }
  241 +
  242 +
  243 + public void cancelLoad() {
  244 + if (event != null) {
  245 + if (!event.isDisposed()) {
  246 + event.dispose();
  247 + }
  248 + event = null;
  249 + }
  250 + }
  251 +
  252 + /**
  253 + * 销毁
  254 + */
  255 + public void destroy() {
  256 + if (timerUtil != null) {
  257 + timerUtil.cancel();
  258 + }
  259 + }
  260 +}
... ...
cloud/user/src/main/java/com/cnlive/strike/user/frame/presenter/QuickLoginPresenter.java
... ... @@ -154,14 +154,14 @@ public class QuickLoginPresenter extends BasePresenter&lt;QuickLoginView&gt; {
154 154 // MobclickAgent.onProfileSignIn("CNLive", user.getUid());
155 155 //三方登陆不需要重新设置头像 otherUserInfo不为空表示三方登陆
156 156 if (otherUserInfo != null) {
157   - ifViewAttached(view -> view.showMainView(true, true));
  157 + ifViewAttached(view -> view.showMainView());
158 158 } else {
159   - ifViewAttached(view -> view.showEditView(false));
  159 + ifViewAttached(view -> view.showEditView());
160 160 }
161 161 } else {
162 162 //友盟账号登录统计,暂时只有平台登录,后续对接三方登录
163 163 // MobclickAgent.onProfileSignIn("CNLive", user.getUid());
164   - ifViewAttached(view -> view.showMainView(false, false));
  164 + ifViewAttached(view -> view.showMainView());
165 165 //todo 测试首次用户
166 166 // ifViewAttached(view -> view.showEditView(false));
167 167 }
... ...
cloud/user/src/main/java/com/cnlive/strike/user/frame/view/LoginDialogView.java 0 → 100644
  1 +package com.cnlive.strike.user.frame.view;
  2 +
  3 +import android.accounts.Account;
  4 +import android.content.Context;
  5 +import android.content.Intent;
  6 +import android.text.Editable;
  7 +import android.text.Spannable;
  8 +import android.text.SpannableStringBuilder;
  9 +import android.text.TextPaint;
  10 +import android.text.TextUtils;
  11 +import android.text.TextWatcher;
  12 +import android.text.method.LinkMovementMethod;
  13 +import android.text.style.ClickableSpan;
  14 +import android.text.style.ForegroundColorSpan;
  15 +import android.view.View;
  16 +
  17 +import com.cnlive.core.libs.base.application.AppConfig;
  18 +import com.cnlive.core.libs.base.frame.view.BaseView;
  19 +import com.cnlive.core.libs.base.util.AlertUtil;
  20 +import com.cnlive.core.libs.base.util.DoublePressed;
  21 +import com.cnlive.strike.user.R;
  22 +import com.cnlive.strike.user.frame.data.OtherUserInfo;
  23 +import com.cnlive.strike.user.sms.OnSmsCatchListener;
  24 +import com.cnlive.strike.user.sms.SmsVerifyCatcher;
  25 +import com.cnlive.strike.user.ui.activity.FirstLoginActivity;
  26 +import com.cnlive.strike.user.ui.activity.LoginActivity;
  27 +import com.cnlive.strike.user.ui.activity.LoginDialogActivity;
  28 +import com.cnlive.strike.user.util.UserRouterHelper;
  29 +
  30 +import java.util.regex.Matcher;
  31 +import java.util.regex.Pattern;
  32 +
  33 +/**
  34 + * 作者: 吴奎庆
  35 + * <p>
  36 + * 时间: 2019/11/5
  37 + * <p>
  38 + * 简介:
  39 + */
  40 +public class LoginDialogView extends BaseView {
  41 + public LoginDialogActivity mActivity;
  42 +
  43 + public LoginDialogView(LoginDialogActivity mActivity) {
  44 + this.mActivity = mActivity;
  45 + }
  46 +
  47 + /**
  48 + * 更新用户信息点击事件
  49 + */
  50 + public void onUploadLoginUser(String name) {
  51 + uploadInputData(name);
  52 + }
  53 +
  54 +
  55 + /**
  56 + * 删除用户记录
  57 + */
  58 + public void onDeleteLoginUser(String name) {
  59 + mActivity.getPresenter().deleteUserInfo(mActivity, name);
  60 + }
  61 +
  62 + //更新输入信息
  63 + public void uploadInputData(String phone) {
  64 + mActivity.data.setPhone(phone);
  65 + if (!TextUtils.isEmpty(phone)) {
  66 + mActivity.binding.ivDelete.setVisibility(View.VISIBLE);
  67 + }
  68 + mActivity.data.setCode("");
  69 + //通过DataBinding更新文字后无法立即设置光标位置
  70 + if (!TextUtils.isEmpty(phone)) {
  71 + mActivity.binding.userName.setText(phone);
  72 + mActivity.binding.userName.setSelection(phone.length());
  73 + }
  74 + String contryCode = AppConfig.getCountryCode();
  75 + //设置区号
  76 +// CNLiveUserInfo userInfo = UserService.getInstance(mActivity.getActivity()).getAppAccount();
  77 + if (!TextUtils.isEmpty(contryCode)) {
  78 + mActivity.binding.tvCountry.setText("+ " + contryCode);
  79 + } else {
  80 + mActivity.binding.tvCountry.setText("+ " + "86");
  81 + }
  82 + String contryName = AppConfig.getCountryName();
  83 + if (TextUtils.isEmpty(contryName)) {
  84 + mActivity.binding.tvCountryName.setText("中国");
  85 + } else {
  86 + mActivity.binding.tvCountryName.setText(contryName);
  87 + }
  88 +
  89 +
  90 + }
  91 +
  92 + public void uploadInputData(String phone, String countryCode, String verficatinCode) {
  93 + mActivity.data.setPhone(phone);
  94 + if (!TextUtils.isEmpty(phone)) {
  95 + mActivity.binding.ivDelete.setVisibility(View.VISIBLE);
  96 + }
  97 +// mActivity.data.setCode(TextUtils.isEmpty(verficatinCode) ? "" : verficatinCode);
  98 + //通过DataBinding更新文字后无法立即设置光标位置
  99 + if (!TextUtils.isEmpty(phone)) {
  100 + mActivity.binding.userName.setText(phone);
  101 + mActivity.binding.userName.setSelection(phone.length());
  102 + }
  103 +
  104 + //设置区号
  105 +// CNLiveUserInfo userInfo = UserService.getInstance(mActivity.getActivity()).getAppAccount();
  106 +// if (userInfo != null && !TextUtils.isEmpty(userInfo.getCountryCode())) {
  107 +// mActivity.binding.tvCountry.setText("+ " + userInfo.getCountryCode());
  108 +// } else {
  109 +// mActivity.binding.tvCountry.setText("+ " + "86");
  110 +// }
  111 + mActivity.binding.tvCountry.setText("+ ".concat(TextUtils.isEmpty(countryCode) ? "86" : countryCode));
  112 +
  113 + }
  114 +
  115 + public void initView() {
  116 + if (mActivity == null) return;
  117 + mActivity.smsVerifyCatcher = new SmsVerifyCatcher(mActivity, new OnSmsCatchListener<String>() {
  118 + @Override
  119 + public void onSmsCatch(String message) {
  120 + String code = parseCode(message);
  121 + mActivity.binding.etSms.setText(code);
  122 + }
  123 + });
  124 + mActivity.binding.userName.addTextChangedListener(new TextWatcher() {
  125 + @Override
  126 + public void beforeTextChanged(CharSequence s, int start, int count, int after) {
  127 + }
  128 +
  129 + @Override
  130 + public void onTextChanged(CharSequence s, int start, int before, int count) {
  131 + }
  132 +
  133 + @Override
  134 + public void afterTextChanged(Editable s) {
  135 + if (s.length() > 0) {
  136 + mActivity.binding.ivDelete.setVisibility(View.VISIBLE);
  137 + } else {
  138 + mActivity.binding.ivDelete.setVisibility(View.GONE);
  139 + }
  140 + }
  141 + });
  142 +
  143 + mActivity.binding.etSms.addTextChangedListener(new TextWatcher() {
  144 + @Override
  145 + public void beforeTextChanged(CharSequence s, int start, int count, int after) {
  146 + }
  147 +
  148 + @Override
  149 + public void onTextChanged(CharSequence s, int start, int before, int count) {
  150 + }
  151 +
  152 + @Override
  153 + public void afterTextChanged(Editable s) {
  154 + if (s.length() > 0) {
  155 + mActivity.binding.ivDeleteYzm.setVisibility(View.VISIBLE);
  156 + } else {
  157 + mActivity.binding.ivDeleteYzm.setVisibility(View.GONE);
  158 + }
  159 + }
  160 + });
  161 +
  162 +
  163 + }
  164 +
  165 + //更新用户列表
  166 + public void uploadListData(Account[] list) {
  167 + mActivity.adapter.clear();
  168 + if (list.length > 0) mActivity.adapter.addAll(list);
  169 + }
  170 +
  171 + public void showToast(String msg) {
  172 + if (mActivity == null) return;
  173 + Context context = mActivity;
  174 + AlertUtil.showDeftToast(context, msg);
  175 + }
  176 +
  177 +
  178 + public void showEditView() {
  179 + if (mActivity == null) return;
  180 + Intent intent = new Intent(mActivity, FirstLoginActivity.class);
  181 + intent.putExtra(LoginActivity.TAG_MSG, TextUtils.isEmpty(mActivity.tagMsg) ? "" : mActivity.tagMsg);
  182 + intent.putExtra(LoginActivity.TAG_CLICK_AD, mActivity.clickAd);
  183 + mActivity.startActivity(intent);
  184 + mActivity.finish();
  185 + }
  186 +
  187 + public void showMainView() {
  188 + if (mActivity == null) return;
  189 + //判断如果是因为token为空跳转到的登录页面则不需要跳转到MainActivity,直接关闭登录页面即可
  190 + if (mActivity.fromTokenError) {
  191 + mActivity.finish();
  192 + return;
  193 + }
  194 + UserRouterHelper.showMainView(mActivity, null);
  195 +
  196 +// Intent intent = new Intent(mActivity, MainActivity.class);
  197 +// intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
  198 +// intent.putExtra("type", "login");
  199 +// intent.putExtra("uri", mActivity.uri);
  200 +// intent.putExtra(LoginActivity.TAG_CLICK_AD, mActivity.clickAd);
  201 +// intent.putExtra("sharetype", mActivity.tagShare);
  202 +// if (!TextUtils.isEmpty(mActivity.tagMsg))
  203 +// intent.putExtra("classifyTagMsg", mActivity.tagMsg);
  204 +// if (!TextUtils.isEmpty(mActivity.tagUrl)) {
  205 +// intent.putExtra(LoginActivity.TAG_URL, mActivity.tagUrl);
  206 +// }
  207 +// mActivity.startActivity(intent);
  208 + }
  209 +
  210 + public void showProgress() {
  211 + if (!mActivity.mProgressDialog.isShowing()) mActivity.mProgressDialog.show();
  212 + }
  213 +
  214 + public void hideProgress() {
  215 + if (mActivity.mProgressDialog.isShowing()) {
  216 + mActivity.isLogin = false;
  217 + mActivity.mProgressDialog.dismiss();
  218 + }
  219 + }
  220 +
  221 + public void onTimerFinish() {
  222 + mActivity.data.setTime(0);
  223 + mActivity.binding.codeRequest.setTextColor(mActivity.getResources().getColor(R.color.white));
  224 + }
  225 +
  226 + public void onTimerInterval(long l) {
  227 + mActivity.data.setTime((int) l);
  228 + mActivity.binding.codeRequest.setTextColor(mActivity.getResources().getColor(R.color.color_f2f2f2));
  229 + }
  230 +
  231 + public void setAgreementText() {
  232 + String textContent = "登录即代表阅读并同意《用户协议》 及 《隐私政策》";
  233 + SpannableStringBuilder ssb = new SpannableStringBuilder(textContent);
  234 + ssb.setSpan(new ClickableSpan() {
  235 + @Override
  236 + public void onClick(View widget) {
  237 + if (!mActivity.isLogin) {
  238 + startWebView("yhxy");
  239 + }
  240 + }
  241 +
  242 + @Override
  243 + public void updateDrawState(TextPaint ds) {
  244 + ds.setUnderlineText(false);
  245 + }
  246 + }, 11, 15, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
  247 +
  248 + ssb.setSpan(new ClickableSpan() {
  249 + @Override
  250 + public void onClick(View widget) {
  251 + if (!mActivity.isLogin) {
  252 + startWebView("yszc");
  253 + }
  254 + }
  255 +
  256 + @Override
  257 + public void updateDrawState(TextPaint ds) {
  258 + ds.setUnderlineText(false);
  259 + }
  260 + }, 20, 24, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
  261 +
  262 + ssb.setSpan(new ForegroundColorSpan(mActivity.getResources().getColor(R.color.color_23d41e)), 11, 15, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
  263 + ssb.setSpan(new ForegroundColorSpan(mActivity.getResources().getColor(R.color.color_23d41e)), 20, 24, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
  264 + mActivity.binding.tvAgreement.setMovementMethod(LinkMovementMethod.getInstance());
  265 + mActivity.binding.tvAgreement.setText(ssb);
  266 + }
  267 +
  268 + private void startWebView(String type) {
  269 +// WWebView wWebView = new WWebView.Builder()
  270 +// .urlType(type)
  271 +// .isOther(true)
  272 +// .enableJump(true)
  273 +// .enableRefresh(false)
  274 +// .enableImageLongClick(false)
  275 +// .builder();
  276 +// wWebView.startWebViewActivity(mActivity);
  277 + }
  278 +
  279 + public void startWeb() {
  280 + if (mActivity == null) return;
  281 + //浏览入口
  282 + if (DoublePressed.onDoublePressed()) return;
  283 +// WWebView wWebView = new WWebView.Builder()
  284 +// // TODO: 2018/12/28 浏览页面h5地址
  285 +// .url(AppConfig.isDebug() ? "http://wjjh5test.cnlive.com/cnLogoutPreview.html" : "http://wjjh5.cnlive.com/cnLogoutPreview.html")
  286 +// .enableTitleLayout(false)
  287 +// .enableTitle(false)
  288 +// .enableJump(true)
  289 +// .enableImageLongClick(false)
  290 +// .enableClose(false)
  291 +// .enableRefresh(false)
  292 +// .from(WWebViewOptions.FROM_PRE_BROWSE)
  293 +// .builder();
  294 +// wWebView.startWebViewActivity(mActivity);
  295 + }
  296 +
  297 +
  298 + private String parseCode(String message) {
  299 + Pattern p = Pattern.compile("\\b\\d{6}\\b");
  300 + Matcher m = p.matcher(message);
  301 + String code = "";
  302 + while (m.find()) {
  303 + code = m.group(0);
  304 + }
  305 + return code;
  306 + }
  307 +
  308 + public void bindPhone(OtherUserInfo otherUserInfo) {
  309 + if (mActivity == null) return;
  310 +// BindPhoneNumberActivity.startActivity(mActivity,
  311 +// otherUserInfo, mActivity.fromTokenError, mActivity.tagMsg, mActivity.tagShare, mActivity.clickAd);
  312 + }
  313 +}
... ...
cloud/user/src/main/java/com/cnlive/strike/user/frame/view/QuickLoginView.java
... ... @@ -28,6 +28,7 @@ import com.cnlive.strike.user.sms.SmsVerifyCatcher;
28 28 import com.cnlive.strike.user.ui.activity.FirstLoginActivity;
29 29 import com.cnlive.strike.user.ui.activity.LoginActivity;
30 30 import com.cnlive.strike.user.ui.fragment.QuickLoginFragment;
  31 +import com.cnlive.strike.user.util.UserRouterHelper;
31 32  
32 33 import java.util.regex.Matcher;
33 34 import java.util.regex.Pattern;
... ... @@ -179,14 +180,8 @@ public class QuickLoginView extends BaseView {
179 180 }
180 181  
181 182  
182   - public void showEditView(boolean isHasOtherUserInfo) {
  183 + public void showEditView() {
183 184 if (getContext() == null) return;
184   - //设置跳转信息
185   -// LoginSuccessInfo successInfo = new LoginSuccessInfo();
186   -// successInfo.setTagMsg(TextUtils.isEmpty(fragment.tagMsg) ? "" : fragment.tagMsg);
187   -// successInfo.setClickAd(fragment.clickAd);
188   -// HelperUtil.isNewUser(fragment.getActivity(), successInfo, isHasOtherUserInfo);
189   -
190 185 Intent intent = new Intent(getContext(), FirstLoginActivity.class);
191 186 intent.putExtra(LoginActivity.TAG_MSG, TextUtils.isEmpty(fragment.tagMsg) ? "" : fragment.tagMsg);
192 187 intent.putExtra(LoginActivity.TAG_CLICK_AD, fragment.clickAd);
... ... @@ -194,7 +189,7 @@ public class QuickLoginView extends BaseView {
194 189 getContext().finish();
195 190 }
196 191  
197   - public void showMainView(boolean isNewUser, boolean isHasOtherUserInfo) {
  192 + public void showMainView() {
198 193 if (getContext() == null) return;
199 194 //判断如果是因为token为空跳转到的登录页面则不需要跳转到MainActivity,直接关闭登录页面即可
200 195 if (fragment.fromTokenError) {
... ... @@ -206,26 +201,14 @@ public class QuickLoginView extends BaseView {
206 201 successInfo.setType("login");
207 202 successInfo.setUri(fragment.uri);
208 203 successInfo.setClickAd(fragment.clickAd);
  204 + if (!TextUtils.isEmpty(fragment.tagUrl)) {
  205 + successInfo.setTagUrl(fragment.tagUrl);
  206 + }
209 207 successInfo.setTagShare(fragment.tagShare);
210   - successInfo.setTagMsg(fragment.tagMsg);
211   - ARouter.getInstance().build(LoginActivity.LOGIN_SUCCESS_PATH)
212   - .withBoolean("isNewUser", true)
213   - .navigation(getContext());
214   - if (isNewUser) {
215   -// HelperUtil.isNewUser(fragment.getActivity(), successInfo, isHasOtherUserInfo);
216   - } else {
217   -// HelperUtil.isNotNewUser(fragment.getActivity(), successInfo);
  208 + if (!TextUtils.isEmpty(fragment.tagMsg)) {
  209 + successInfo.setClassifyTagMsg(fragment.tagMsg);
218 210 }
219   -// EventBus.getDefault().post(new UserEventMsg(UserEventMsg.LOGIN_SUCCESS, successInfo));
220   -// Intent intent = new Intent(getContext(), MainTestActivity.class);
221   -// intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
222   -// intent.putExtra("type", "login");
223   -// intent.putExtra("uri", fragment.uri);
224   -// intent.putExtra(LoginActivity.TAG_CLICK_AD, fragment.clickAd);
225   -// intent.putExtra("sharetype", fragment.tagShare);
226   -// if (!TextUtils.isEmpty(fragment.tagMsg))
227   -// intent.putExtra("classifyTagMsg", fragment.tagMsg);
228   -// getContext().startActivity(intent);
  211 + UserRouterHelper.showMainView(fragment.getActivity(), successInfo);
229 212 }
230 213  
231 214 public void showProgress() {
... ...
cloud/user/src/main/java/com/cnlive/strike/user/model/LoginSuccessInfo.java
... ... @@ -10,9 +10,27 @@ import java.io.Serializable;
10 10 public class LoginSuccessInfo implements Serializable {
11 11 private String type;
12 12 private Uri uri;
13   - public Boolean clickAd;
14   - public String tagShare;
15   - public String tagMsg;
  13 + private Boolean clickAd;
  14 + private String tagShare;
  15 + private String tagMsg;
  16 + private String classifyTagMsg;
  17 + private String tagUrl;
  18 +
  19 + public String getTagUrl() {
  20 + return tagUrl;
  21 + }
  22 +
  23 + public void setTagUrl(String tagUrl) {
  24 + this.tagUrl = tagUrl;
  25 + }
  26 +
  27 + public String getClassifyTagMsg() {
  28 + return classifyTagMsg;
  29 + }
  30 +
  31 + public void setClassifyTagMsg(String classifyTagMsg) {
  32 + this.classifyTagMsg = classifyTagMsg;
  33 + }
16 34  
17 35 public String getType() {
18 36 return type;
... ...
cloud/user/src/main/java/com/cnlive/strike/user/model/UserConst.java deleted 100644 → 0
1   -package com.cnlive.strike.user.model;
2   -
3   -public class UserConst {
4   - public static final int IS_NEW_USER = 1000;//是新用户
5   - public static final int IS_NOT_NEW_USER = 1001;//不是新用户
6   - public static final int MODIFY_USER_IMAGE = 1002;//修改用户头像
7   - public static final int USER_INVALID = 1003;//用户失效
8   - public static final int MODIFY_USER_NAME = 1004;//修改用户昵称
9   - public static final int COIN_RAIN_ACTION = 1005;//下金币
10   -}
cloud/user/src/main/java/com/cnlive/strike/user/ui/activity/LoginActivity.java
... ... @@ -20,7 +20,6 @@ import com.cnlive.strike.user.ui.fragment.QuickLoginFragment;
20 20 //@Route(path = "/cnmain/LoginActivity")
21 21 @Route(path = LoginActivity.PATH)
22 22 public class LoginActivity extends BaseActivity {
23   -
24 23 public static final String PATH = "/cloud/user/ui/activity/login";
25 24 public static final String LOGIN_SUCCESS_PATH = "/cloud/user/LoginSuccessActivity";
26 25 public static String FROM_TOKEN_ERROR = "from_token_error";
... ...
cloud/user/src/main/java/com/cnlive/strike/user/ui/activity/LoginDialogActivity.java 0 → 100644
  1 +package com.cnlive.strike.user.ui.activity;
  2 +
  3 +
  4 +import android.app.Activity;
  5 +import android.app.ProgressDialog;
  6 +import android.content.Context;
  7 +import android.content.Intent;
  8 +import android.net.Uri;
  9 +import android.os.Bundle;
  10 +import android.text.TextUtils;
  11 +import android.util.Log;
  12 +import android.view.WindowManager;
  13 +
  14 +import androidx.annotation.NonNull;
  15 +
  16 +import com.alibaba.android.arouter.facade.annotation.Route;
  17 +import com.cnlive.core.libs.base.application.AppConfig;
  18 +import com.cnlive.core.libs.base.frame.activity.BaseActivity;
  19 +import com.cnlive.core.libs.base.util.DoublePressed;
  20 +import com.cnlive.core.libs.base.util.ScreenUtil;
  21 +import com.cnlive.strike.user.R;
  22 +import com.cnlive.strike.user.databinding.ActivityLoginDialogBinding;
  23 +import com.cnlive.strike.user.frame.data.QuickLoginData;
  24 +import com.cnlive.strike.user.frame.presenter.LoginDialogPresenter;
  25 +import com.cnlive.strike.user.frame.view.LoginDialogView;
  26 +import com.cnlive.strike.user.router.user.UserAction;
  27 +import com.cnlive.strike.user.sms.SmsVerifyCatcher;
  28 +import com.cnlive.strike.user.ui.adapter.UserListAdapter;
  29 +import static com.cnlive.strike.user.ui.activity.LoginActivity.TAG_CLICK_AD;
  30 +
  31 +/**
  32 + * 作者: 吴奎庆
  33 + * <p>
  34 + * 时间: 2019/11/5
  35 + * <p>
  36 + * 简介:
  37 + */
  38 +@Route(path = "/cnmain/LoginDialogActivity")
  39 +public class LoginDialogActivity extends BaseActivity<LoginDialogView, LoginDialogPresenter> {
  40 + public static String TAG_URL = "tagurl";
  41 + public UserListAdapter adapter;
  42 + public ProgressDialog mProgressDialog = null;
  43 + public boolean isLogin;
  44 + public String countryCode = "86";
  45 + public String tagMsg;
  46 + public boolean fromTokenError;
  47 + public SmsVerifyCatcher smsVerifyCatcher;
  48 + public boolean hasLogin = false;//是否已经登录
  49 + public Uri uri;
  50 + public String tagShare;
  51 + //三方登陆
  52 + //qq的权限
  53 + public final String ACOPE_ALL = "all";
  54 + //三方登陆的信息
  55 + public Boolean clickAd;
  56 + public String tagUrl;
  57 + public ActivityLoginDialogBinding binding;
  58 + public QuickLoginData data;
  59 +
  60 + public static void start(Context context) {
  61 + Intent intent = new Intent(context, LoginDialogActivity.class);
  62 + Activity activity = (Activity) context;
  63 + activity.startActivity(intent);
  64 + activity.overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
  65 + }
  66 +
  67 + @Override
  68 + protected int getBindLayoutId() {
  69 + return R.layout.activity_login_dialog;
  70 + }
  71 +
  72 + @Override
  73 + protected void initBindingData() {
  74 + super.initBindingData();
  75 + binding = (ActivityLoginDialogBinding) getBaseBinding();
  76 + data = new QuickLoginData();
  77 + binding.setData(data);
  78 + }
  79 +
  80 + @Override
  81 + protected void initView() {
  82 + super.initView();
  83 + WindowManager.LayoutParams p = getWindow().getAttributes();
  84 + p.height = WindowManager.LayoutParams.MATCH_PARENT;
  85 + p.width = (ScreenUtil.getScreenWidth(this) - dp2px(88));
  86 + getWindow().setAttributes(p);
  87 +// initThreeLogin();
  88 + uri = UserAction.getUri(this);
  89 + tagUrl = getIntent().getStringExtra(TAG_URL);
  90 + clickAd = getIntent().getBooleanExtra(TAG_CLICK_AD, false);
  91 + adapter = new UserListAdapter(this, 0);
  92 + adapter.setClickListener((name) -> getMvpView().onUploadLoginUser(name));
  93 + adapter.setDeleteListener((name) -> getMvpView().onDeleteLoginUser(name));
  94 + mProgressDialog = new ProgressDialog(this, R.style.AppProgressDialog);
  95 + mProgressDialog.setMessage(getResources().getString(R.string.login_dialog));
  96 + mProgressDialog.setCanceledOnTouchOutside(false);
  97 + mProgressDialog.setOnCancelListener(dialog -> {
  98 + getPresenter().cancelLoad();
  99 + });
  100 +
  101 +
  102 + if (getMvpView() != null)
  103 + getMvpView().setAgreementText();
  104 +
  105 + binding.setClickListener(v -> onClick(v.getId()));
  106 + binding.setAdapter(adapter);
  107 + getPresenter().init(this);
  108 + if (getMvpView() != null) getMvpView().initView();
  109 + }
  110 +
  111 +
  112 +
  113 + @Override
  114 + public void onStart() {
  115 + super.onStart();
  116 + if (smsVerifyCatcher != null) smsVerifyCatcher.onStartCurrent();
  117 + }
  118 +
  119 + @Override
  120 + public void onStop() {
  121 + super.onStop();
  122 + if (smsVerifyCatcher != null) smsVerifyCatcher.onStop();
  123 + }
  124 +
  125 +
  126 + /**
  127 + * 点击事件
  128 + *
  129 + * @param id
  130 + */
  131 + private void onClick(int id) {
  132 + if (id == R.id.login) {
  133 + if (!isLogin) {
  134 + getPresenter().login((LoginDialogActivity) me, data, countryCode);
  135 + hideSoftInput();
  136 + }
  137 + } else if (id == R.id.codeRequest) {
  138 + getPresenter().sendCode(this, data.getPhone(), countryCode);
  139 + hideSoftInput();
  140 + } else if (id == R.id.iv_delete) {
  141 + if (!isLogin) {
  142 + binding.userName.setText("");
  143 + }
  144 + } else if (id == R.id.iv_delete_yzm) {
  145 + if (!isLogin) {
  146 + binding.etSms.setText("");
  147 + }
  148 + } else if (id == R.id.ll_country) {
  149 + if (DoublePressed.onDoublePressed()) return;
  150 + SelectCountryActivity.startSelectCountryActivity(LoginDialogActivity.this, 1010, countryCode);
  151 + }
  152 +// else if (id == R.id.entrance) {
  153 +// if (getMvpView() != null) getMvpView().startWeb();
  154 +// }
  155 + else if (id == R.id.iv_qq) {
  156 + if (DoublePressed.onDoublePressed()) return;
  157 + } else if (id == R.id.iv_wb) {
  158 + if (DoublePressed.onDoublePressed()) return;
  159 + } else if (id == R.id.iv_close) {
  160 + finish();
  161 + }
  162 +
  163 + }
  164 +
  165 + @Override
  166 + public void onResume() {
  167 + super.onResume();
  168 + /**
  169 + * 取消加载逻辑会影响微信登录
  170 + * getMvpView().hideProgress();
  171 + * getPresenter().cancelLoad();
  172 + */
  173 +
  174 + if (!TextUtils.isEmpty(AppConfig.getUserPhone())) {
  175 + getMvpView().uploadInputData(AppConfig.getUserPhone(), AppConfig.getCountryCode(), AppConfig.getVerificationCode());
  176 + }
  177 + }
  178 +
  179 + @Override
  180 + public void onPause() {
  181 + super.onPause();
  182 + if (hasLogin) return;
  183 + if (!TextUtils.isEmpty(binding.userName.getText()))
  184 + AppConfig.setUserPhone(binding.userName.getText() + "");
  185 + if (!TextUtils.isEmpty(binding.etSms.getText()))
  186 + AppConfig.setVerificationCode(binding.etSms.getText() + "");
  187 + }
  188 +
  189 + @Override
  190 + public void onDestroy() {
  191 + super.onDestroy();
  192 + if (getMvpView() != null) getMvpView().hideProgress();
  193 + if (getPresenter() != null) getPresenter().destroy();
  194 + }
  195 +
  196 + @Override
  197 + public void onActivityResult(int requestCode, int resultCode, Intent data) {
  198 + super.onActivityResult(requestCode, resultCode, data);
  199 +
  200 + if (requestCode == SelectCountryActivity.ACTIVITY_RESULT_CODE && resultCode == SelectCountryActivity.ACTIVITY_RESULT_CODE) {
  201 + countryCode = data.getStringExtra("countryCode");
  202 + String countryName = data.getStringExtra("country");
  203 + if (!TextUtils.isEmpty(countryCode)) {
  204 + AppConfig.setCountryCode(countryCode);
  205 + binding.tvCountry.setText("+ " + countryCode);
  206 + }
  207 + if (!TextUtils.isEmpty(countryName)) {
  208 + AppConfig.setCountryName(countryName);
  209 + binding.tvCountryName.setText(countryName);
  210 + }
  211 + return;
  212 + } else {
  213 + if (requestCode == SelectCountryActivity.ACTIVITY_RESULT_CODE) {
  214 + return;
  215 + }
  216 + }
  217 +
  218 + }
  219 +
  220 + @Override
  221 + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
  222 + super.onRequestPermissionsResult(requestCode, permissions, grantResults);
  223 + if (requestCode == SmsVerifyCatcher.PERMISSION_REQUEST_CODE) {
  224 + if (smsVerifyCatcher != null)
  225 + smsVerifyCatcher.onRequestPermissionsResult(requestCode, permissions, grantResults);
  226 + }
  227 + }
  228 +
  229 + @Override
  230 + public void finish() {
  231 + super.finish();
  232 + overridePendingTransition(R.anim.activity_in, R.anim.fade_out);
  233 + }
  234 +
  235 +}
... ...
cloud/user/src/main/java/com/cnlive/strike/user/ui/fragment/FirstLoginFragment.java
... ... @@ -54,7 +54,7 @@ public class FirstLoginFragment extends BaseFragment&lt;FirstLoginView, FirstLoginP
54 54 @Override
55 55 protected void initFragmentStyle() {
56 56 super.initFragmentStyle();
57   - setStatusBarTextColor(StatusBarConfig.WHITE);
  57 + setStatusBarTextColor(StatusBarConfig.BLACK);
58 58 setStatusBarColor(R.color.color_fff, 0);
59 59 }
60 60  
... ...
cloud/user/src/main/java/com/cnlive/strike/user/ui/fragment/QuickLoginFragment.java
... ... @@ -50,7 +50,8 @@ public class QuickLoginFragment extends BaseFragment&lt;QuickLoginView, QuickLoginP
50 50 public Boolean clickAd;
51 51 public FragmentQuickLoginBinding binding;
52 52 public QuickLoginData data;
53   -
  53 + public String tagUrl;
  54 + public static String TAG_URL = "tagurl";
54 55 @Override
55 56 protected int getBindLayoutId() {
56 57 return R.layout.fragment_quick_login;
... ...
cloud/user/src/main/java/com/cnlive/strike/user/util/UserRouterHelper.java 0 → 100644
  1 +package com.cnlive.strike.user.util;
  2 +
  3 +import android.app.Activity;
  4 +import android.content.Context;
  5 +import android.content.Intent;
  6 +import android.text.TextUtils;
  7 +import android.util.Log;
  8 +
  9 +import com.alibaba.android.arouter.launcher.ARouter;
  10 +import com.cnlive.strike.user.model.LoginSuccessInfo;
  11 +import com.cnlive.strike.user.ui.activity.LoginActivity;
  12 +
  13 +public class UserRouterHelper {
  14 + private static final String activityClassName = "com.cnlive.strike.moduleuser.TestActivity";
  15 + // public static final int IS_NEW_USER = 1000;//是新用户
  16 +// public static final int IS_NOT_NEW_USER = 1001;//不是新用户
  17 + public static final int MODIFY_USER_IMAGE = 1002;//修改用户头像
  18 + public static final int USER_INVALID = 1003;//用户失效
  19 + public static final int MODIFY_USER_NAME = 1004;//修改用户昵称
  20 + public static final int COIN_RAIN_ACTION = 1005;//下金币
  21 + public static final int SHOW_MAIN_VIEW = 1006;//显示主视图
  22 + public static final int SHOW_EDIT_VIEW = 1007;//显示编辑视图
  23 +
  24 + public static void showEditView(Activity context, LoginSuccessInfo successInfo) {
  25 + if (null == context) {
  26 + return;
  27 + }
  28 + ARouter.getInstance().build(LoginActivity.LOGIN_SUCCESS_PATH)
  29 + .withInt("eventType", SHOW_EDIT_VIEW)
  30 + .navigation(context);
  31 + context.finish();
  32 + }
  33 +
  34 + public static void showMainView(Activity context, LoginSuccessInfo successInfo) {
  35 + if (null == context) {
  36 + return;
  37 + }
  38 + ARouter.getInstance().build(LoginActivity.LOGIN_SUCCESS_PATH)
  39 + .withInt("eventType", SHOW_MAIN_VIEW)
  40 + .withSerializable("successInfo", successInfo)
  41 + .navigation(context);
  42 + context.finish();
  43 + }
  44 +
  45 +
  46 + /**
  47 + * 修改用户头像
  48 + *
  49 + * @param context
  50 + * @param faceUrl
  51 + */
  52 + public static void modifyUserImage(Context context, String faceUrl) {
  53 + if (null == context) {
  54 + return;
  55 + }
  56 +// try {
  57 +// Class clz = Class.forName(activityClassName);
  58 +// Intent intent = new Intent(context, clz);
  59 +// intent.putExtra("eventType", MODIFY_USER_IMAGE);
  60 +// context.startActivity(intent);
  61 +// } catch (ClassNotFoundException e) {
  62 +// e.printStackTrace();
  63 +// Log.d("error", e.toString());
  64 +// }
  65 +
  66 + ARouter.getInstance().build(LoginActivity.LOGIN_SUCCESS_PATH)
  67 + .withInt("eventType", MODIFY_USER_IMAGE)
  68 + .withString("faceUrl", faceUrl)
  69 + .navigation(context);
  70 + }
  71 +
  72 + /**
  73 + * 用户失效
  74 + *
  75 + * @param context
  76 + */
  77 + public static void userInvalid(Context context) {
  78 + if (null == context) {
  79 + return;
  80 + }
  81 +// try {
  82 +// Class clz = Class.forName(activityClassName);
  83 +// Intent intent = new Intent(context, clz);
  84 +// intent.putExtra("eventType", USER_INVALID);
  85 +// context.startActivity(intent);
  86 +// } catch (ClassNotFoundException e) {
  87 +// e.printStackTrace();
  88 +// Log.d("error", e.toString());
  89 +// }
  90 + ARouter.getInstance().build(LoginActivity.LOGIN_SUCCESS_PATH)
  91 + .withInt("eventType", USER_INVALID)
  92 + .navigation(context);
  93 + }
  94 +
  95 + /**
  96 + * 修改用户名称
  97 + *
  98 + * @param context
  99 + */
  100 + public static void modifyUserName(Context context, String nickName) {
  101 + if (null == context) {
  102 + return;
  103 + }
  104 +// try {
  105 +// Class clz = Class.forName(activityClassName);
  106 +// Intent intent = new Intent(context, clz);
  107 +// intent.putExtra("eventType", MODIFY_USER_NAME);
  108 +// intent.putExtra("nickName", nickName);
  109 +//
  110 +// context.startActivity(intent);
  111 +// } catch (ClassNotFoundException e) {
  112 +// e.printStackTrace();
  113 +// Log.d("error", e.toString());
  114 +// }
  115 +
  116 + ARouter.getInstance().build(LoginActivity.LOGIN_SUCCESS_PATH)
  117 + .withInt("eventType", MODIFY_USER_NAME)
  118 + .withString("nickName", nickName)
  119 + .navigation(context);
  120 + }
  121 +
  122 +
  123 + /**
  124 + * 下金币
  125 + *
  126 + * @param context
  127 + * @param taskId
  128 + * @param contentId
  129 + * @param addtype
  130 + * @param isDouyin
  131 + */
  132 + public static void goToCoinRainAction(Context context, String taskId, String contentId, String addtype, Boolean isDouyin) {
  133 + if (null == context) {
  134 + return;
  135 + }
  136 + try {
  137 + Class clz = Class.forName(activityClassName);
  138 + Intent intent = new Intent(context, clz);
  139 + intent.putExtra("eventType", COIN_RAIN_ACTION);
  140 + intent.putExtra("taskId", taskId);
  141 + intent.putExtra("contentId", contentId);
  142 + intent.putExtra("addtype", addtype);
  143 + intent.putExtra("isDouyin", isDouyin);
  144 +
  145 + context.startActivity(intent);
  146 + } catch (ClassNotFoundException e) {
  147 + e.printStackTrace();
  148 + Log.d("error", e.toString());
  149 + }
  150 + ARouter.getInstance().build(LoginActivity.LOGIN_SUCCESS_PATH)
  151 + .withInt("eventType", COIN_RAIN_ACTION)
  152 + .navigation(context);
  153 + }
  154 +
  155 +}
... ...
cloud/user/src/main/res/drawable-hdpi/iv_login_dialog_close.png 0 → 100644

529 Bytes

cloud/user/src/main/res/drawable-hdpi/iv_login_dialog_top.webp 0 → 100644
No preview for this file type
cloud/user/src/main/res/drawable-xhdpi/iv_login_dialog_close.png 0 → 100644

529 Bytes

cloud/user/src/main/res/drawable-xhdpi/iv_login_dialog_top.webp 0 → 100644
No preview for this file type
cloud/user/src/main/res/drawable-xxhdpi/iv_login_dialog_close.webp 0 → 100644
No preview for this file type
cloud/user/src/main/res/drawable-xxhdpi/iv_login_dialog_top.webp 0 → 100644
No preview for this file type
cloud/user/src/main/res/layout/activity_login_dialog.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<layout xmlns:tools="http://schemas.android.com/tools">
  3 +
  4 + <data>
  5 +
  6 + <variable
  7 + name="data"
  8 + type="com.cnlive.strike.user.frame.data.QuickLoginData" />
  9 +
  10 + <variable
  11 + name="clickListener"
  12 + type="android.view.View.OnClickListener" />
  13 +
  14 + <variable
  15 + name="adapter"
  16 + type="com.cnlive.strike.user.ui.adapter.UserListAdapter" />
  17 +
  18 + </data>
  19 +
  20 +
  21 + <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  22 + android:layout_width="match_parent"
  23 + android:layout_height="match_parent"
  24 + android:background="@color/transparent"
  25 + android:orientation="vertical">
  26 +
  27 + <androidx.core.widget.NestedScrollView
  28 + android:layout_width="match_parent"
  29 + android:layout_height="wrap_content"
  30 + android:layout_centerInParent="true"
  31 + android:background="@color/transparent">
  32 +
  33 + <LinearLayout
  34 + android:layout_width="match_parent"
  35 + android:layout_height="wrap_content"
  36 + android:background="@color/transparent">
  37 +
  38 + <RelativeLayout
  39 + android:layout_width="match_parent"
  40 + android:layout_height="wrap_content"
  41 + android:layout_gravity="center_vertical"
  42 + android:background="@drawable/iv_login_dialog_top">
  43 +
  44 + <ImageView
  45 + android:id="@+id/iv_close"
  46 + android:layout_width="wrap_content"
  47 + android:layout_height="wrap_content"
  48 + android:layout_alignParentRight="true"
  49 + android:layout_marginTop="11dp"
  50 + android:layout_marginRight="11dp"
  51 + android:onClick="@{clickListener}"
  52 + android:padding="5dp"
  53 + android:src="@drawable/iv_login_dialog_close" />
  54 +
  55 +
  56 + <LinearLayout
  57 + android:layout_width="match_parent"
  58 + android:layout_height="wrap_content"
  59 + android:layout_marginTop="113dp"
  60 + android:orientation="vertical">
  61 +
  62 +
  63 + <RelativeLayout
  64 + android:layout_width="match_parent"
  65 + android:layout_height="wrap_content"
  66 + android:layout_marginLeft="30dp"
  67 +
  68 + android:layout_marginRight="30dp">
  69 +
  70 +
  71 + <TextView
  72 + android:id="@+id/tv_country_name"
  73 + android:layout_width="wrap_content"
  74 + android:layout_height="wrap_content"
  75 + android:layout_centerVertical="true"
  76 + android:text="手机号归属地"
  77 +
  78 + android:textColor="@color/color_333"
  79 + android:textSize="13sp" />
  80 +
  81 + <LinearLayout
  82 + android:id="@+id/ll_country"
  83 + android:layout_width="wrap_content"
  84 + android:layout_height="wrap_content"
  85 + android:layout_alignParentRight="true"
  86 + android:onClick="@{clickListener}"
  87 + android:padding="7dp">
  88 +
  89 + <TextView
  90 + android:id="@+id/tv_country"
  91 + android:layout_width="wrap_content"
  92 + android:layout_height="wrap_content"
  93 + android:textColor="@color/color_3a3a3a"
  94 + android:textSize="14sp" />
  95 +
  96 + <ImageView
  97 + android:layout_width="wrap_content"
  98 + android:layout_height="wrap_content"
  99 + android:layout_gravity="center_vertical"
  100 + android:layout_marginLeft="9dp"
  101 + android:background="@drawable/dl_xl" />
  102 + </LinearLayout>
  103 +
  104 +
  105 + </RelativeLayout>
  106 +
  107 + <View
  108 + android:layout_width="match_parent"
  109 + android:layout_height="1dp"
  110 + android:layout_marginLeft="30dp"
  111 + android:layout_marginRight="30dp"
  112 + android:background="@color/color_e8e8e8" />
  113 +
  114 + <RelativeLayout
  115 + android:id="@+id/layout_phone"
  116 + android:layout_width="match_parent"
  117 + android:layout_height="wrap_content"
  118 + android:layout_marginLeft="30dp"
  119 + android:layout_marginTop="27dp"
  120 + android:layout_marginRight="30dp">
  121 +
  122 +
  123 + <com.cnlive.libs.emoj.widget.SimpleEditText
  124 + android:id="@+id/userName"
  125 + android:layout_width="match_parent"
  126 + android:layout_height="wrap_content"
  127 + android:layout_toLeftOf="@+id/iv_delete"
  128 + android:background="@null"
  129 + android:focusableInTouchMode="true"
  130 + android:hint="手机号"
  131 + android:imeOptions="flagNoFullscreen|flagNoExtractUi"
  132 + android:inputType="number"
  133 + android:maxLength="11"
  134 + android:maxLines="1"
  135 + android:paddingBottom="7dp"
  136 + android:singleLine="true"
  137 + android:text="@={data.phone}"
  138 + android:textColor="@color/color_333"
  139 + android:textColorHint="@color/color_adadad"
  140 + android:textCursorDrawable="@drawable/edit_cursor"
  141 + android:textSize="14sp" />
  142 +
  143 + <ImageView
  144 + android:id="@+id/iv_delete"
  145 + android:layout_width="wrap_content"
  146 + android:layout_height="wrap_content"
  147 + android:layout_alignParentRight="true"
  148 + android:layout_centerVertical="true"
  149 + android:layout_marginRight="@dimen/dp_10"
  150 + android:onClick="@{clickListener}"
  151 + android:src="@drawable/dl_sc"
  152 + android:visibility="invisible" />
  153 +
  154 + </RelativeLayout>
  155 +
  156 + <View
  157 + android:layout_width="match_parent"
  158 + android:layout_height="1dp"
  159 + android:layout_marginLeft="30dp"
  160 + android:layout_marginRight="30dp"
  161 + android:background="@color/color_e8e8e8" />
  162 +
  163 + <RelativeLayout
  164 + android:id="@+id/layout_code"
  165 + android:layout_width="match_parent"
  166 + android:layout_height="wrap_content"
  167 + android:layout_marginLeft="30dp"
  168 + android:layout_marginRight="30dp">
  169 +
  170 +
  171 + <com.cnlive.libs.emoj.widget.SimpleEditText
  172 + android:id="@+id/et_sms"
  173 + android:layout_width="match_parent"
  174 + android:layout_height="wrap_content"
  175 + android:layout_marginTop="26dp"
  176 + android:layout_toLeftOf="@+id/iv_delete_yzm"
  177 + android:background="@null"
  178 + android:focusableInTouchMode="true"
  179 + android:gravity="bottom"
  180 + android:hint="验证码"
  181 + android:imeOptions="flagNoFullscreen|flagNoExtractUi"
  182 + android:inputType="number"
  183 + android:maxLength="6"
  184 + android:maxLines="1"
  185 + android:paddingBottom="10dp"
  186 + android:singleLine="true"
  187 + android:text="@={data.code}"
  188 + android:textColor="@color/color_333"
  189 + android:textColorHint="@color/color_adadad"
  190 + android:textCursorDrawable="@drawable/edit_cursor"
  191 + android:textSize="15sp" />
  192 +
  193 + <ImageView
  194 + android:id="@+id/iv_delete_yzm"
  195 + android:layout_width="wrap_content"
  196 + android:layout_height="wrap_content"
  197 + android:layout_centerVertical="true"
  198 +
  199 + android:layout_marginRight="10dp"
  200 + android:layout_toLeftOf="@+id/codeRequest"
  201 + android:onClick="@{clickListener}"
  202 + android:src="@drawable/dl_sc"
  203 + android:visibility="invisible" />
  204 +
  205 + <TextView
  206 + android:id="@+id/codeRequest"
  207 + android:layout_width="wrap_content"
  208 + android:layout_height="22dp"
  209 + android:layout_alignParentEnd="true"
  210 + android:layout_alignParentRight="true"
  211 + android:layout_centerVertical="true"
  212 + android:layout_marginTop="16dp"
  213 + android:layout_marginBottom="10dp"
  214 + android:background="@drawable/shape_login_yzm"
  215 + android:enabled="@{data.sendEnabled}"
  216 + android:gravity="center"
  217 + android:maxLines="1"
  218 + android:onClick="@{clickListener}"
  219 + android:text="@={data.sendBtnText}"
  220 + android:textColor="@color/white"
  221 + android:textSize="10sp"
  222 + tools:text="获取验证码" />
  223 +
  224 + </RelativeLayout>
  225 +
  226 + <View
  227 + android:layout_width="match_parent"
  228 + android:layout_height="1dp"
  229 + android:layout_marginLeft="30dp"
  230 + android:layout_marginRight="30dp"
  231 + android:background="@color/color_e8e8e8" />
  232 +
  233 + <Button
  234 + android:id="@+id/login"
  235 + android:layout_width="180dp"
  236 + android:layout_height="30dp"
  237 + android:layout_centerHorizontal="true"
  238 + android:layout_gravity="center"
  239 + android:layout_marginTop="25dp"
  240 + android:background="@drawable/view_button_bg"
  241 + android:onClick="@{clickListener}"
  242 + android:text="登录"
  243 + android:textColor="@color/white"
  244 + android:textSize="14sp" />
  245 +
  246 + <RelativeLayout
  247 + android:layout_width="match_parent"
  248 + android:layout_height="wrap_content"
  249 + android:layout_gravity="center_horizontal"
  250 + android:layout_marginLeft="29dp"
  251 + android:layout_marginTop="32dp"
  252 + android:layout_marginRight="29dp"
  253 + android:orientation="horizontal">
  254 +
  255 + <View
  256 + android:layout_width="match_parent"
  257 + android:layout_height="1dp"
  258 + android:layout_centerVertical="true"
  259 + android:layout_gravity="center_vertical"
  260 + android:layout_toLeftOf="@+id/tv"
  261 + android:background="#ffcccccc" />
  262 +
  263 + <TextView
  264 + android:id="@+id/tv"
  265 + android:layout_width="wrap_content"
  266 + android:layout_height="wrap_content"
  267 + android:layout_centerInParent="true"
  268 + android:layout_centerVertical="true"
  269 + android:layout_gravity="center_horizontal"
  270 + android:layout_marginLeft="10dp"
  271 + android:layout_marginRight="10dp"
  272 + android:text="第三方账号登录"
  273 + android:textColor="#ff999999"
  274 + android:textSize="13sp" />
  275 +
  276 + <View
  277 + android:layout_width="match_parent"
  278 + android:layout_height="1dp"
  279 + android:layout_centerVertical="true"
  280 + android:layout_gravity="center_vertical"
  281 + android:layout_toRightOf="@+id/tv"
  282 + android:background="#ffcccccc" />
  283 + </RelativeLayout>
  284 +
  285 + <RelativeLayout
  286 + android:layout_width="match_parent"
  287 + android:layout_height="match_parent"
  288 + android:layout_marginLeft="29dp"
  289 + android:layout_marginTop="11dp"
  290 + android:layout_marginRight="29dp"
  291 + android:orientation="horizontal">
  292 +
  293 + <ImageView
  294 + android:id="@+id/iv_qq"
  295 + android:layout_width="31dp"
  296 + android:layout_height="31dp"
  297 + android:onClick="@{clickListener}"
  298 + android:src="@drawable/qq" />
  299 +
  300 + <ImageView
  301 + android:id="@+id/iv_wc"
  302 + android:layout_width="31dp"
  303 + android:layout_height="31dp"
  304 + android:layout_centerInParent="true"
  305 + android:layout_marginLeft="40dp"
  306 + android:layout_marginRight="40dp"
  307 + android:onClick="@{clickListener}"
  308 + android:src="@drawable/wechat" />
  309 +
  310 + <ImageView
  311 + android:id="@+id/iv_wb"
  312 + android:layout_width="31dp"
  313 + android:layout_height="31dp"
  314 + android:layout_alignParentRight="true"
  315 + android:onClick="@{clickListener}"
  316 + android:src="@drawable/weibo" />
  317 +
  318 + </RelativeLayout>
  319 +
  320 + <TextView
  321 + android:id="@+id/tv_agreement"
  322 + android:layout_width="wrap_content"
  323 + android:layout_height="wrap_content"
  324 + android:layout_gravity="center"
  325 + android:layout_margin="11dp"
  326 + android:layout_marginBottom="17.5dp"
  327 + android:gravity="center"
  328 + android:textColor="#c9cacb"
  329 + android:textSize="10sp" />
  330 +
  331 + </LinearLayout>
  332 +
  333 +
  334 + </RelativeLayout>
  335 + </LinearLayout>
  336 + </androidx.core.widget.NestedScrollView>
  337 + </RelativeLayout>
  338 +
  339 +</layout>
... ...
cloud/user/src/main/res/layout/fragment_quick_login.xml
... ... @@ -242,9 +242,69 @@
242 242 android:textColor="@color/white"
243 243 android:textSize="14sp" />
244 244  
  245 + <LinearLayout
  246 + android:layout_width="wrap_content"
  247 + android:layout_height="wrap_content"
  248 + android:layout_gravity="center_horizontal"
  249 + android:layout_marginTop="79dp"
  250 + android:orientation="horizontal">
  251 +
  252 + <View
  253 + android:layout_width="60dp"
  254 + android:layout_height="1dp"
  255 + android:layout_gravity="center_vertical"
  256 + android:background="#ffcccccc" />
  257 +
  258 + <TextView
  259 + android:layout_width="wrap_content"
  260 + android:layout_height="wrap_content"
  261 + android:layout_gravity="center_horizontal"
  262 + android:layout_marginLeft="10dp"
  263 + android:layout_marginRight="10dp"
  264 + android:text="第三方账号登录"
  265 + android:textColor="#ff999999"
  266 + android:textSize="13sp" />
  267 +
  268 + <View
  269 + android:layout_width="60dp"
  270 + android:layout_height="1dp"
  271 + android:layout_gravity="center_vertical"
  272 + android:background="#ffcccccc" />
  273 +
  274 + </LinearLayout>
245 275  
  276 + <LinearLayout
  277 + android:layout_width="wrap_content"
  278 + android:layout_height="wrap_content"
  279 + android:layout_gravity="center_horizontal"
  280 + android:layout_marginTop="19.5dp"
  281 + android:orientation="horizontal">
  282 +
  283 + <ImageView
  284 + android:id="@+id/iv_qq"
  285 + android:layout_width="50dp"
  286 + android:layout_height="50dp"
  287 + android:layout_weight="1"
  288 + android:onClick="@{clickListener}"
  289 + android:src="@drawable/qq" />
246 290  
  291 + <ImageView
  292 + android:id="@+id/iv_wc"
  293 + android:layout_width="50dp"
  294 + android:layout_height="50dp"
  295 + android:layout_marginLeft="40dp"
  296 + android:layout_marginRight="40dp"
  297 + android:onClick="@{clickListener}"
  298 + android:src="@drawable/wechat" />
  299 +
  300 + <ImageView
  301 + android:id="@+id/iv_wb"
  302 + android:layout_width="50dp"
  303 + android:layout_height="50dp"
  304 + android:onClick="@{clickListener}"
  305 + android:src="@drawable/weibo" />
247 306  
  307 + </LinearLayout>
248 308  
249 309 </LinearLayout>
250 310  
... ...
cloud/user/src/main/res/values/style.xml
... ... @@ -16,4 +16,15 @@
16 16 <item name="android:textSize">14sp</item>
17 17 <item name="android:textColor">@color/grayText</item>
18 18 </style>
  19 +
  20 + <style name="ProcessHtmlDialogActivityTheme" parent="Theme.AppCompat.Dialog">
  21 + <item name="android:windowFrame">@android:color/transparent</item><!--边框-->
  22 + <item name="android:windowIsFloating">true</item><!--是否浮现在activity之上-->
  23 + <item name="android:windowIsTranslucent">true</item><!--半透明-->
  24 + <item name="android:windowBackground">@android:color/transparent</item><!--背景透明-->
  25 + <item name="windowNoTitle">true</item>
  26 + <item name="windowActionBar">true</item>
  27 + <item name="android:windowActionBar">true</item>
  28 + <item name="android:windowCloseOnTouchOutside">false</item>
  29 + </style>
19 30 </resources>
... ...
core/base/src/main/res/values/colors.xml
... ... @@ -62,5 +62,7 @@
62 62 <!-- -->
63 63 <color name="my_dialog_line">#80EEEEEE</color>
64 64 <color name="my_dialog_btn_text_color">#23D41E</color>
  65 + <!---->
  66 + <color name="color_232326">#232326</color>
65 67  
66 68 </resources>
67 69 \ No newline at end of file
... ...
core/base/src/main/res/values/style.xml
1 1 <?xml version="1.0" encoding="utf-8"?>
2 2 <resources>
  3 + <!-- 登陆页面等待框的style -->
  4 + <style name="AppProgressDialog" parent="Theme.AppCompat.Dialog.Alert">
  5 + <!--文字大小-->
  6 + <item name="android:textSize">16sp</item>
  7 + <!-- 这里是修改顶部标题背景颜色,具体颜色自己定,可以是图片 -->
  8 + <item name="android:topDark">@android:color/white</item>
  9 + <!--修改底部背景颜色-->
  10 + <item name="android:bottomDark">@android:color/white</item>
  11 + <!-- 这里是修改内容区域背景颜色 -->
  12 + <item name="android:centerDark">@android:color/white</item>
  13 + <!--//窗口半透明-->
  14 + <item name="android:windowIsTranslucent">true</item>
  15 + <item name="android:textColor">@color/color_232326</item>
  16 + <!--设置progressbar的颜色-->
  17 + <item name="android:indeterminateTint">#008577</item>
  18 + <item name="android:indeterminateTintMode">src_atop</item>
  19 + </style>
3 20  
4 21 <style name="SwipeBackLayout">
5 22 <item name="shadow_left">@drawable/shadow_left</item>
... ...