feat:删除绑定授权码相关业务代码
This commit is contained in:
@@ -958,11 +958,6 @@
|
||||
android:configChanges="screenSize|orientation|keyboardHidden|mcc|mnc|locale|touchscreen|screenLayout|keyboard|navigation|fontScale|uiMode|smallestScreenSize|layoutDirection"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".ui.login.LoginBoundAuthCodeActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden|mcc|mnc|locale|touchscreen|screenLayout|keyboard|navigation|fontScale|uiMode|smallestScreenSize|layoutDirection"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".ui.setting.ShieldManageActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden|mcc|mnc|locale|touchscreen|screenLayout|keyboard|navigation|fontScale|uiMode|smallestScreenSize|layoutDirection"
|
||||
|
@@ -68,7 +68,6 @@ import com.yizhuan.habu.ui.im.ImInitHelper;
|
||||
import com.yizhuan.habu.ui.im.avtivity.NimP2PMessageActivity;
|
||||
import com.yizhuan.habu.ui.login.BindPhoneActivity;
|
||||
import com.yizhuan.habu.ui.login.LoginActivity;
|
||||
import com.yizhuan.habu.ui.login.LoginBoundAuthCodeActivity;
|
||||
import com.yizhuan.habu.ui.login.fragment.AddUserInfoFragment;
|
||||
import com.yizhuan.habu.ui.patriarch.help.LimitEnterRoomHelper;
|
||||
import com.yizhuan.habu.ui.patriarch.help.PmDialogShowMrg;
|
||||
@@ -111,11 +110,9 @@ import com.yizhuan.xchat_android_core.user.event.LoadLoginUserInfoEvent;
|
||||
import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent;
|
||||
import com.yizhuan.xchat_android_core.user.event.NeedBindPhoneEvent;
|
||||
import com.yizhuan.xchat_android_core.user.event.NeedCompleteInfoEvent;
|
||||
import com.yizhuan.xchat_android_core.user.event.NeedVerifyBoundAuthCodeEvent;
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.SharedPreferenceUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.threadmgr.ThreadPoolManager;
|
||||
import com.yizhuan.xchat_android_library.utils.JavaUtil;
|
||||
@@ -560,29 +557,6 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
mMainTabLayout.setMsgNum(unreadCount);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void NeedVerifyBoundAuthCode(NeedVerifyBoundAuthCodeEvent event) {
|
||||
AuthModel.get()
|
||||
.isBoundPhoneAuthCode()
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe(new BeanObserver<Boolean>() {
|
||||
@Override
|
||||
public void onErrorMsg(String error) {
|
||||
com.yizhuan.xchat_android_core.utils.Logger.info("isBoundAuthCode", error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(Boolean flag) {
|
||||
if (!flag) {
|
||||
LoginBoundAuthCodeActivity.start(MainActivity.this);
|
||||
} else {
|
||||
//首次注册需要完善昵称和头像
|
||||
UIHelper.showAddInfoAct(MainActivity.this);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onNeedCompleteInfo(NeedCompleteInfoEvent event) {
|
||||
getDialogManager().dismissDialog();
|
||||
|
@@ -1,111 +0,0 @@
|
||||
package com.yizhuan.habu.ui.login
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.KeyEvent
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.widget.EditText
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent
|
||||
import com.yizhuan.habu.R
|
||||
import com.yizhuan.habu.base.BaseViewBindingActivity
|
||||
import com.yizhuan.habu.databinding.ActivityLoginBoundAuthCodeBinding
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.user.event.NeedCompleteInfoEvent
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
/**
|
||||
* 绑定授权码
|
||||
*/
|
||||
class LoginBoundAuthCodeActivity : BaseViewBindingActivity<ActivityLoginBoundAuthCodeBinding>(),
|
||||
View.OnClickListener {
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, LoginBoundAuthCodeActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
binding.btnNext.setOnClickListener(this)
|
||||
binding.etAccount.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
val enabled = binding.etAccount.text.toString().trim { it <= ' ' }.isNotEmpty()
|
||||
binding.btnNext.isEnabled = enabled
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
override fun onClick(view: View?) {
|
||||
when (view?.id) {
|
||||
R.id.btnNext -> {
|
||||
if (TextUtils.isEmptyText(binding.etAccount.text.toString())) {
|
||||
toast(getString(R.string.bound_auth_code_is_empty))
|
||||
return
|
||||
}
|
||||
AuthModel.get()
|
||||
.boundAuthCode(binding.etAccount.text.toString())
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe(object : BeanObserver<String?>() {
|
||||
override fun onErrorMsg(error: String) {
|
||||
toast(error)
|
||||
}
|
||||
|
||||
override fun onSuccess(s: String) {
|
||||
//首次注册需要完善昵称和头像
|
||||
EventBus.getDefault().post(NeedCompleteInfoEvent())
|
||||
finish()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||
val view = currentFocus
|
||||
var isPressEdit = false
|
||||
if (view is EditText) {
|
||||
if (event.rawX >= view.getX() && event.rawX <= view.getX() + view.getWidth() && event.rawY >= view.getY() && event.rawY <= view.getY() + view.getHeight()) {
|
||||
isPressEdit = true
|
||||
}
|
||||
}
|
||||
if (!isPressEdit) {
|
||||
hideIME()
|
||||
}
|
||||
return super.onTouchEvent(event)
|
||||
}
|
||||
|
||||
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
moveTaskToBack(true)
|
||||
return true
|
||||
}
|
||||
return super.onKeyDown(keyCode, event)
|
||||
}
|
||||
|
||||
override fun needSteepStateBar() = true
|
||||
|
||||
override fun setStatusBar() {
|
||||
super.setStatusBar()
|
||||
StatusBarUtil.transparencyBar(this)
|
||||
StatusBarUtil.StatusBarLightMode(this)
|
||||
}
|
||||
|
||||
}
|
@@ -1,90 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@color/color_white"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<View
|
||||
android:id="@+id/view_bg_top"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_login_new"
|
||||
app:layout_constraintDimensionRatio="750:666"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_slogan"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:layout_marginBottom="@dimen/dp_24"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:text="@string/text_login_auth_code"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/view_bg_bottom"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/view_bg_bottom"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/shape_white_top_25dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="-120dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/view_bg_top"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="68dp"
|
||||
android:layout_marginStart="34dp"
|
||||
android:layout_marginEnd="34dp"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@drawable/shape_login_btn_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etAccount"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@null"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="@dimen/dp_24"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
android:inputType="text"
|
||||
android:hint="@string/Please_enter_the_authorization_code"
|
||||
android:textColorHint="@color/color_B3B3C3"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/dp_14"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnNext"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="@dimen/dp_36"
|
||||
android:layout_marginTop="48dp"
|
||||
android:layout_marginEnd="@dimen/dp_36"
|
||||
android:background="@drawable/bg_common_enabled"
|
||||
android:enabled="false"
|
||||
android:gravity="center"
|
||||
android:text="@string/finish"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -37,7 +37,6 @@ import com.yizhuan.xchat_android_core.user.event.CurrentUserInfoCompleteFailEven
|
||||
import com.yizhuan.xchat_android_core.user.event.LoadLoginUserInfoEvent;
|
||||
import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent;
|
||||
import com.yizhuan.xchat_android_core.user.event.NeedCompleteInfoEvent;
|
||||
import com.yizhuan.xchat_android_core.user.event.NeedVerifyBoundAuthCodeEvent;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
@@ -153,11 +152,7 @@ public final class UserModel extends BaseModel implements IUserModel {
|
||||
UserInfo userInfo = userResult.getData();
|
||||
//用户信息不全的情况下,currentUserInfo并不会被保存,这里单独保存下预填写的邀请码...
|
||||
preFillInviteCode = userInfo.getPrefillInviteCode();
|
||||
boolean isBoundAuthPhone = DemoCache.readBoundAuthCode();
|
||||
if (isBoundAuthPhone && (TextUtils.isEmpty(userInfo.getNick()) || TextUtils.isEmpty(userInfo.getAvatar()))) {
|
||||
EventBus.getDefault().post(new NeedVerifyBoundAuthCodeEvent());
|
||||
return Single.error(new Throwable("need verify bound auth code"));
|
||||
} else if (TextUtils.isEmpty(userInfo.getNick()) || TextUtils.isEmpty(userInfo.getAvatar())) {
|
||||
if (TextUtils.isEmpty(userInfo.getNick()) || TextUtils.isEmpty(userInfo.getAvatar())) {
|
||||
//首次注册需要完善昵称和头像
|
||||
EventBus.getDefault().post(new NeedCompleteInfoEvent());
|
||||
return Single.error(new Throwable("need nick and avatar"));
|
||||
|
@@ -1,8 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.user.event;
|
||||
|
||||
/**
|
||||
* create by lvzebiao on 2018/8/31
|
||||
*/
|
||||
public class NeedVerifyBoundAuthCodeEvent {
|
||||
|
||||
}
|
Reference in New Issue
Block a user