一键登录勾选框处理

This commit is contained in:
yitao_hello
2021-12-16 12:01:51 +08:00
committed by zu
parent 10766d0593
commit bdc90d0a0e
15 changed files with 27 additions and 16 deletions

View File

@@ -251,9 +251,9 @@ dependencies {
// 易盾一键登录
implementation(name: 'quicklogin_libary-external-release', ext: 'aar')
implementation(name: 'CMCCSSOSDK-WY', ext: 'aar')
implementation(name: 'Ui-factory_oauth_mobile_3.8.3.1', ext: 'aar')
implementation(name: 'CTAccount_sdk_api_v3.7.0_all', ext: 'aar')
implementation(name: 'CMCCSSOSDK-wy-release', ext: 'aar')
implementation(name: 'Ui-factory_oauth_mobile_3.9.1.7_external', ext: 'aar')
implementation(name: 'CTAccount_sdk_api_v3.8.3_all', ext: 'aar')
implementation 'com.github.fodroid:XRadioGroup:v1.5'
implementation files('libs/msa_mdid_1.0.13.aar')

Binary file not shown.

Binary file not shown.

View File

@@ -65,7 +65,7 @@ public class TitleBar extends ViewGroup implements View.OnClickListener {
setBackgroundColor(mBackgroundColor);
}
private int mBackgroundColor = getResources().getColor(R.color.translucent);
private int mBackgroundColor = getResources().getColor(R.color.transparent);
public TitleBar(Context context) {
super(context);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

View File

@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="45"
android:endColor="@color/translucent"
android:endColor="@color/transparent"
android:startColor="@color/bg_secondary_2a2a39"
android:type="linear"
android:useLevel="true" />

View File

@@ -7,7 +7,7 @@ import androidx.core.content.ContextCompat;
import com.netease.nis.quicklogin.helper.UnifyUiConfig;
import com.yizhuan.erban.R;
import com.yizhuan.xchat_android_core.UriProvider;
import com.yizhuan.xchat_android_core.PreferencesUtils;
/**
* Created by hzhuqi on 2019/12/31
@@ -27,6 +27,7 @@ public class QuickLoginUiConfig {
int X_OFFSET = 0;
int BOTTOM_OFFSET = 0;
final boolean privacyState = PreferencesUtils.readPrivacyState();
UnifyUiConfig uiConfig = new UnifyUiConfig.Builder()
// 状态栏
.setStatusBarDarkColor(false)
@@ -80,20 +81,23 @@ public class QuickLoginUiConfig {
*/
// .setPrivacyXOffset(43)
.setPrivacyState(false)
.setPrivacyState(privacyState)
.setPrivacySize(12)
// .setPrivacyTopYOffset(510)
.setPrivacyBottomYOffset(20)
.setPrivacyXOffset(20)
.setPrivacyMarginRight(20)
.setCheckedImageName("quick_pass_checked")
.setUnCheckedImageName("quick_pass_uncheck")
// 协议详情页导航栏
.setProtocolPageNavTitle("服务条款")
.setProtocolPageNavBackIcon("quick_pass_back")
.setProtocolPageNavColor(Color.WHITE)
// .setBackgroundImage("bg1")
// 自定义控件
// .addCustomView(otherLoginRel, "relative", UnifyUiConfig.POSITION_IN_BODY, null)
.setClickEventListener((viewType, code) -> {
if (viewType == 2) {
PreferencesUtils.savePrivacyState(code == 1);
}
})
.build(context);
return uiConfig;
}

View File

@@ -177,7 +177,6 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
login.onePass(new QuickLoginTokenListener() {
@Override
public void onGetTokenSuccess(String s, String s1) {
getDialogManager().showProgressDialog(QuickPassLoginAct.this);
setClickEnable(false);
AuthModel.get().quickPassLogin(s, s1, "", "")
.compose(bindToLifecycle())
@@ -192,15 +191,13 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
@Override
public void onSuccess(String s) {
setClickEnable(false);
getDialogManager().dismissDialog();
finish();
login.quitActivity();
StatisticManager.Instance().onEvent(
StatisticsProtocol.Event.EVENT_ONE_CLICK_LOGIN_SUCCEED, "一键登录成功");
}
@Override
public void onError(Throwable e) {
getDialogManager().dismissDialog();
dealWithLoginError(e);
setClickEnable(true);
StatisticManager.Instance().onEvent(

View File

@@ -27,6 +27,7 @@ public class PreferencesUtils {
private static final String KEY_ACCOUNT_INFO = "AccountInfo";
private static final String KEY_NOTI_TOGGLE = "NotiToggle";
private static final String KEY_NOTI_CONFIG = "StatusBarNotificationConfig";
private static final String KEY_AGREE_PRIVACY = "key_agree_privacy";
public static void saveTicketInfo(TicketInfo ticketInfo) {
@@ -77,6 +78,7 @@ public class PreferencesUtils {
public static void setFristSendGold(boolean isOpen) {
SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).putBoolean(KEY_FRIST_SEED_GOLD, isOpen);
}
public static boolean readFristQQ() {
return SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).getBoolean(KEY_FRIST_QQ, true);
}
@@ -84,6 +86,7 @@ public class PreferencesUtils {
public static void setFristQQ(boolean isOpen) {
SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).putBoolean(KEY_FRIST_QQ, isOpen);
}
public static boolean readFristUser() {
return SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).getBoolean(KEY_FRIST_USER, true);
}
@@ -93,7 +96,6 @@ public class PreferencesUtils {
}
public static void saveStatusBarNotificationConfig(StatusBarNotificationConfig notificationConfig) {
ObjectPref.instance(BasicConfig.INSTANCE.getAppContext()).put(KEY_NOTI_CONFIG, notificationConfig);
}
@@ -109,4 +111,12 @@ public class PreferencesUtils {
saveTicketInfo(new TicketInfo());
saveLoginInfo(new LoginInfo("", ""));
}
public static void savePrivacyState(boolean privacy) {
ObjectPref.instance(BasicConfig.INSTANCE.getAppContext()).put(KEY_AGREE_PRIVACY, privacy);
}
public static boolean readPrivacyState() {
return (boolean) ObjectPref.instance(BasicConfig.INSTANCE.getAppContext()).get(KEY_AGREE_PRIVACY, false);
}
}