diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ec12e090a..2672e123e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -962,11 +962,6 @@ android:configChanges="screenSize|orientation|keyboardHidden|mcc|mnc|locale|touchscreen|screenLayout|keyboard|navigation|fontScale|uiMode|smallestScreenSize|layoutDirection" android:exported="false" android:screenOrientation="portrait" /> - mMainTabLayout.setMsgNum(unreadCount); } - @Subscribe(threadMode = ThreadMode.MAIN) - public void NeedVerifyBoundAuthCode(NeedVerifyBoundAuthCodeEvent event) { - AuthModel.get() - .isBoundPhoneAuthCode() - .compose(bindUntilEvent(ActivityEvent.DESTROY)) - .subscribe(new BeanObserver() { - @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(); diff --git a/app/src/main/java/com/yizhuan/habu/ui/login/LoginBoundAuthCodeActivity.kt b/app/src/main/java/com/yizhuan/habu/ui/login/LoginBoundAuthCodeActivity.kt deleted file mode 100644 index 54a9b6cdf..000000000 --- a/app/src/main/java/com/yizhuan/habu/ui/login/LoginBoundAuthCodeActivity.kt +++ /dev/null @@ -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(), - 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() { - 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) - } - -} \ No newline at end of file diff --git a/app/src/main/res/layout/activity_login_bound_auth_code.xml b/app/src/main/res/layout/activity_login_bound_auth_code.xml deleted file mode 100644 index 8ae5bcd97..000000000 --- a/app/src/main/res/layout/activity_login_bound_auth_code.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - -