添加注册源

This commit is contained in:
cyh 2025-02-18 15:27:57 +08:00
parent 5200ed6fd3
commit 73b14fc0af
7 changed files with 342 additions and 254 deletions

View File

@ -2,6 +2,7 @@ package com.yingmao.clash.act
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.text.Spannable import android.text.Spannable
import android.text.SpannableStringBuilder import android.text.SpannableStringBuilder
@ -25,6 +26,8 @@ import com.yingmao.clash.app.MainApplication
import com.yingmao.clash.base.BaseActivity import com.yingmao.clash.base.BaseActivity
import com.yingmao.clash.conf.BZYConstants import com.yingmao.clash.conf.BZYConstants
import com.yingmao.clash.entity.CheckLoginRsp import com.yingmao.clash.entity.CheckLoginRsp
import com.yingmao.clash.listener.AsyncBodyCallback
import com.yingmao.clash.listener.AsyncCallback
import com.yingmao.clash.net.http.HttpReqType import com.yingmao.clash.net.http.HttpReqType
import com.yingmao.clash.net.http.HttpStatus import com.yingmao.clash.net.http.HttpStatus
import com.yingmao.clash.util.AESUtil import com.yingmao.clash.util.AESUtil
@ -47,6 +50,7 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
private lateinit var loginUserName: String private lateinit var loginUserName: String
private var username_encrypt = "" private var username_encrypt = ""
private var password_encrypt = "" private var password_encrypt = ""
private var registerHost = ""
companion object { companion object {
private const val LOGIN_TO_REGISTER_REQUEST_CODE = 1 private const val LOGIN_TO_REGISTER_REQUEST_CODE = 1
@ -157,7 +161,10 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
if (::rxDialogShapeLoading.isInitialized && rxDialogShapeLoading.isShowing) { if (::rxDialogShapeLoading.isInitialized && rxDialogShapeLoading.isShowing) {
rxDialogShapeLoading.cancel() rxDialogShapeLoading.cancel()
} }
Log.e("LoginActivity", resources.getString(R.string.LoginException)+"${httpStatus.msg}") Log.e(
"LoginActivity",
resources.getString(R.string.LoginException) + "${httpStatus.msg}"
)
// Logger.i("检查登录异常${httpStatus.msg}") // Logger.i("检查登录异常${httpStatus.msg}")
RxToast.error(resources.getString(R.string.LoginException)) RxToast.error(resources.getString(R.string.LoginException))
} }
@ -248,8 +255,9 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
private fun initUserAgreementView(textView: TextView) { private fun initUserAgreementView(textView: TextView) {
val config = resources.configuration val config = resources.configuration
val language = config.locale.language val language = config.locale.language
if(language.equals("en")){ if (language.equals("en")) {
val spannableStringBuilder = SpannableStringBuilder(resources.getString(R.string.AgreeAgreement)) val spannableStringBuilder =
SpannableStringBuilder(resources.getString(R.string.AgreeAgreement))
val clickableSpan: MyClickableSpan = object : MyClickableSpan() { val clickableSpan: MyClickableSpan = object : MyClickableSpan() {
override fun onClick(view: View) { override fun onClick(view: View) {
val backgroundColorSpan = BackgroundColorSpan(Color.parseColor("#00000000")) val backgroundColorSpan = BackgroundColorSpan(Color.parseColor("#00000000"))
@ -281,7 +289,10 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
) )
textView.text = spannableStringBuilder textView.text = spannableStringBuilder
val intent = Intent(this@LoginActivity, AgreementAndPrivacyActivity::class.java) val intent = Intent(this@LoginActivity, AgreementAndPrivacyActivity::class.java)
intent.putExtra(BZYConstants.EXTRA_KEY_AGREEMENT, BZYConstants.EXTRA_USER_AGREEMENT) intent.putExtra(
BZYConstants.EXTRA_KEY_AGREEMENT,
BZYConstants.EXTRA_USER_AGREEMENT
)
startActivity(intent) startActivity(intent)
} }
} }
@ -293,8 +304,9 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
) )
textView.text = spannableStringBuilder textView.text = spannableStringBuilder
textView.movementMethod = LinkMovementMethod.getInstance() textView.movementMethod = LinkMovementMethod.getInstance()
}else{ } else {
val spannableStringBuilder = SpannableStringBuilder(resources.getString(R.string.AgreeAgreement)) val spannableStringBuilder =
SpannableStringBuilder(resources.getString(R.string.AgreeAgreement))
val clickableSpan: MyClickableSpan = object : MyClickableSpan() { val clickableSpan: MyClickableSpan = object : MyClickableSpan() {
override fun onClick(view: View) { override fun onClick(view: View) {
val backgroundColorSpan = BackgroundColorSpan(Color.parseColor("#00000000")) val backgroundColorSpan = BackgroundColorSpan(Color.parseColor("#00000000"))
@ -326,7 +338,10 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
) )
textView.text = spannableStringBuilder textView.text = spannableStringBuilder
val intent = Intent(this@LoginActivity, AgreementAndPrivacyActivity::class.java) val intent = Intent(this@LoginActivity, AgreementAndPrivacyActivity::class.java)
intent.putExtra(BZYConstants.EXTRA_KEY_AGREEMENT, BZYConstants.EXTRA_USER_AGREEMENT) intent.putExtra(
BZYConstants.EXTRA_KEY_AGREEMENT,
BZYConstants.EXTRA_USER_AGREEMENT
)
startActivity(intent) startActivity(intent)
} }
} }
@ -382,7 +397,7 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
.removeValueForKey(BZYConstants.MMKV_KEY_REMEMBER_PASSWORD) .removeValueForKey(BZYConstants.MMKV_KEY_REMEMBER_PASSWORD)
MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_REMEMBER_IS_CHECKED, false) MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_REMEMBER_IS_CHECKED, false)
} }
if(TextUtils.isEmpty(username)){ if (TextUtils.isEmpty(username)) {
return return
} }
username_encrypt = AESUtil.byteArrayToHexStr( username_encrypt = AESUtil.byteArrayToHexStr(
@ -400,8 +415,44 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
} }
R.id.tv_register -> { R.id.tv_register -> {
val intent = Intent(applicationContext, RegisterActivity::class.java) // val intent = Intent(applicationContext, RegisterActivity::class.java)
startActivityForResult(intent, LOGIN_TO_REGISTER_REQUEST_CODE) // startActivityForResult(intent, LOGIN_TO_REGISTER_REQUEST_CODE)
//
if (TextUtils.isEmpty(registerHost)) {
var mmkvHost = MMKV.defaultMMKV()
.decodeString(BZYConstants.MMKV_KEY_REGISTER_HOST, "")
// com.cncat.vpn.common.log.Log.d("mmkvHost==>${mmkvHost}")
loginViewMode.getRegisterHost(object : AsyncBodyCallback {
override suspend fun suc(str: String) {
// com.cncat.vpn.common.log.Log.d("str==>${str}")
if (str != mmkvHost) {
MMKV.defaultMMKV()
.encode(BZYConstants.MMKV_KEY_REGISTER_HOST, str)
}
// mmkvHost = str
registerHost = str
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(str)))
}
override fun err() {
if (TextUtils.isEmpty(mmkvHost)) {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse(mmkvHost)
)
)
}
}
})
} else {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(registerHost)))
}
} }
R.id.tv_forget_pwd -> { R.id.tv_forget_pwd -> {

View File

@ -29,7 +29,8 @@ class BZYConstants {
//备用地址 //备用地址
const val MMKV_KEY_ROUTER_HOST ="router_host" const val MMKV_KEY_ROUTER_HOST ="router_host"
const val MMKV_KEY_Airport_Base64 ="airport_base64" const val MMKV_KEY_Airport_Base64 ="airport_base64"
//注册地址
const val MMKV_KEY_REGISTER_HOST ="register_host"
const val REQUEST_CODE_PAY_WEB_Stripe = 1001 const val REQUEST_CODE_PAY_WEB_Stripe = 1001
const val REQUEST_CODE_PAY_WEB_BiLai = 1002 const val REQUEST_CODE_PAY_WEB_BiLai = 1002

View File

@ -93,7 +93,7 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
backIv: ImageView, backIv: ImageView,
moreTv: TextView, moreTv: TextView,
titleTv: TextView, titleTv: TextView,
container: FrameLayout container: FrameLayout,
) { ) {
titleBarRl.visibility = View.VISIBLE titleBarRl.visibility = View.VISIBLE
backIv.visibility = View.INVISIBLE backIv.visibility = View.INVISIBLE
@ -215,7 +215,7 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
when (v?.id) { when (v?.id) {
R.id.rl_check_node -> { R.id.rl_check_node -> {
if (checkExpire()) { if (checkExpire()) {
if(isAdded){ if (isAdded) {
RxToast.info(requireActivity().resources.getString(R.string.AccountExpired)) RxToast.info(requireActivity().resources.getString(R.string.AccountExpired))
} }
return return
@ -233,7 +233,7 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
if (clashRunning) { if (clashRunning) {
val rxDialogSureCancel = RxDialogSureCancel(activity) val rxDialogSureCancel = RxDialogSureCancel(activity)
if(isAdded){ if (isAdded) {
rxDialogSureCancel.setContent(requireActivity().resources.getString(R.string.StopAccelerating)) rxDialogSureCancel.setContent(requireActivity().resources.getString(R.string.StopAccelerating))
} }
rxDialogSureCancel.setCancelListener { rxDialogSureCancel.setCancelListener {
@ -270,7 +270,7 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
private fun startClash() { private fun startClash() {
if (checkExpire()) { if (checkExpire()) {
if(isAdded){ if (isAdded) {
RxToast.info(resources.getString(R.string.AccountExpired)) RxToast.info(resources.getString(R.string.AccountExpired))
} }
@ -297,9 +297,9 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
newUuid = profile.uuid.toString(); newUuid = profile.uuid.toString();
isSubed = true isSubed = true
}?:run { } ?: run {
//为空的情况下选择第一个 //为空的情况下选择第一个
pm.queryAll().forEach { profile-> pm.queryAll().forEach { profile ->
pm.setActive(profile) pm.setActive(profile)
newUuid = profile.uuid.toString(); newUuid = profile.uuid.toString();
@ -369,7 +369,7 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
// currentNode // currentNode
// ) // )
// setNodeNameAndImg(currentNode!!.name) // setNodeNameAndImg(currentNode!!.name)
if(isAdded){ if (isAdded) {
RxToast.success(resources.getString(R.string.AccelerateSuccess)) RxToast.success(resources.getString(R.string.AccelerateSuccess))
} }
checkGlo() checkGlo()
@ -389,7 +389,7 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
com.cncat.vpn.common.log.Log.d("ACTION_CLASH_REQUEST_STOP") com.cncat.vpn.common.log.Log.d("ACTION_CLASH_REQUEST_STOP")
if (::rxDialogShapeLoading.isInitialized) { if (::rxDialogShapeLoading.isInitialized) {
if (!rxDialogShapeLoading.isShowing) { if (!rxDialogShapeLoading.isShowing) {
if(isAdded){ if (isAdded) {
rxDialogShapeLoading.setMessage(resources.getString(R.string.Disconnecting)) rxDialogShapeLoading.setMessage(resources.getString(R.string.Disconnecting))
} }
rxDialogShapeLoading.show() rxDialogShapeLoading.show()
@ -410,7 +410,6 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
private fun getNodesStatus() { private fun getNodesStatus() {
} }
@ -429,10 +428,9 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
// ) // )
// setNodeNameAndImg(currentNode!!.name) // setNodeNameAndImg(currentNode!!.name)
if (isShowToast) { if (isShowToast) {
if(isAdded){ if (isAdded) {
RxToast.success(resources.getString(R.string.AccelerateSuccess)) RxToast.success(resources.getString(R.string.AccelerateSuccess))
} }
} }
// File("${Core.deviceStorage.noBackupFilesDir}/${BaseService.CONFIG_FILE}").delete() // File("${Core.deviceStorage.noBackupFilesDir}/${BaseService.CONFIG_FILE}").delete()
} }
@ -450,7 +448,7 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
Clash_Starting -> { Clash_Starting -> {
if (::rxDialogShapeLoading.isInitialized) { if (::rxDialogShapeLoading.isInitialized) {
if (!rxDialogShapeLoading.isShowing) { if (!rxDialogShapeLoading.isShowing) {
if(isAdded){ if (isAdded) {
rxDialogShapeLoading.setMessage(resources.getString(R.string.ConnectingInProgress)) rxDialogShapeLoading.setMessage(resources.getString(R.string.ConnectingInProgress))
} }
rxDialogShapeLoading.show() rxDialogShapeLoading.show()
@ -516,24 +514,24 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
// var isExpire = false // var isExpire = false
var endTimeInfo = "--" var endTimeInfo = "--"
if (isExpire) { if (isExpire) {
if(isAdded){ if (isAdded) {
endTimeInfo =resources.getString(R.string.AccountExpired) endTimeInfo = resources.getString(R.string.AccountExpired)
} }
} else { } else {
val validPeriod = MMKV.defaultMMKV().decodeLong(BZYConstants.MMKV_KEY_VPN_VALID_PERIOD) val validPeriod = MMKV.defaultMMKV().decodeLong(BZYConstants.MMKV_KEY_VPN_VALID_PERIOD)
val decodeString = MMKV.defaultMMKV().decodeString(BZYConstants.languageInfo, "") val decodeString = MMKV.defaultMMKV().decodeString(BZYConstants.languageInfo, "")
if(decodeString.isNullOrEmpty()){ if (decodeString.isNullOrEmpty()) {
//获取当前系统语言 //获取当前系统语言
val config = resources.configuration val config = resources.configuration
val language = config.locale.language val language = config.locale.language
if (language.equals("en")) { if (language.equals("en")) {
val dateFormat = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { val dateFormat = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val localEN = Locale.ENGLISH val localEN = Locale.ENGLISH
SimpleDateFormat("MM/dd/yyyy HH:mm",localEN) SimpleDateFormat("MM/dd/yyyy HH:mm", localEN)
} else { } else {
val localEN = Locale.ENGLISH val localEN = Locale.ENGLISH
SimpleDateFormat("MM/dd/yyyy HH:mm",localEN) SimpleDateFormat("MM/dd/yyyy HH:mm", localEN)
} }
endTimeInfo = dateFormat.format(validPeriod) endTimeInfo = dateFormat.format(validPeriod)
} else { } else {
@ -547,17 +545,17 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
endTimeInfo = dateFormat.format(validPeriod) endTimeInfo = dateFormat.format(validPeriod)
} }
}else{ } else {
if(decodeString == "English"){ if (decodeString == "English") {
val dateFormat = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { val dateFormat = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val locale = Locale.ENGLISH val locale = Locale.ENGLISH
SimpleDateFormat("MM/dd/yyyy HH:mm",locale) SimpleDateFormat("MM/dd/yyyy HH:mm", locale)
} else { } else {
val locale = Locale.ENGLISH val locale = Locale.ENGLISH
SimpleDateFormat("MM/dd/yyyy HH:mm",locale) SimpleDateFormat("MM/dd/yyyy HH:mm", locale)
} }
endTimeInfo = dateFormat.format(validPeriod) endTimeInfo = dateFormat.format(validPeriod)
}else{ } else {
val dateFormat = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { val dateFormat = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
SimpleDateFormat("yyyy年MM月dd日 HH:mm") SimpleDateFormat("yyyy年MM月dd日 HH:mm")
} else { } else {
@ -650,32 +648,35 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
} }
private fun goRechargeWeb() { private fun goRechargeWeb() {
if (activity!=null) { if (activity != null) {
var mact = activity as NewMainActivity var mact = activity as NewMainActivity
mact.goRechargeWeb() mact.goRechargeWeb()
} }
} }
private fun goNewRecharge() { private fun goNewRecharge() {
if (activity!=null) { if (activity != null) {
var mact = activity as NewMainActivity var mact = activity as NewMainActivity
mact.goBackupRechargeWeb() mact.goBackupRechargeWeb()
} }
} }
private fun updateUserInfo() { private fun updateUserInfo() {
if (activity!=null) { if (activity != null) {
var mact = activity as NewMainActivity var mact = activity as NewMainActivity
mact.goCheckLogin() mact.goCheckLogin()
} }
} }
private fun start_u_timer() { private fun start_u_timer() {
if (activity!=null) { if (activity != null) {
var mact = activity as NewMainActivity var mact = activity as NewMainActivity
mact.startUploadTimer() mact.startUploadTimer()
} }
} }
private fun stop_u_timer() { private fun stop_u_timer() {
if (activity!=null) { if (activity != null) {
var mact = activity as NewMainActivity var mact = activity as NewMainActivity
mact.stopUploadTimer() mact.stopUploadTimer()
} }
@ -731,13 +732,13 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
private fun setProxyModeView(isGlobal: Boolean) { private fun setProxyModeView(isGlobal: Boolean) {
if (isGlobal) { if (isGlobal) {
iv_proxy_mode.setImageResource(R.drawable.ic_s_global) iv_proxy_mode.setImageResource(R.drawable.ic_s_global)
if(isAdded){ if (isAdded) {
tv_proxy_model.text = resources.getString(R.string.GlobalMode) tv_proxy_model.text = resources.getString(R.string.GlobalMode)
} }
} else { } else {
iv_proxy_mode.setImageResource(R.drawable.smart) iv_proxy_mode.setImageResource(R.drawable.smart)
if(isAdded){ if (isAdded) {
tv_proxy_model.text =resources.getString(R.string.IntelligentMode) tv_proxy_model.text = resources.getString(R.string.IntelligentMode)
} }
} }

View File

@ -0,0 +1,7 @@
package com.yingmao.clash.listener
public interface AsyncBodyCallback {
suspend fun suc(str:String)
fun err()
}

View File

@ -166,6 +166,10 @@ interface HttpApi {
@GET("/hosttaizi.txt") @GET("/hosttaizi.txt")
suspend fun getHostTZ(): String suspend fun getHostTZ(): String
@GET("/ymregister.txt")
suspend fun getRegister(): String
// @Headers( // @Headers(
// "User-Agent: Octopus_Android" // "User-Agent: Octopus_Android"
// ) // )

View File

@ -7,8 +7,11 @@ import com.tencent.mmkv.MMKV
import com.yingmao.clash.app.MainApplication import com.yingmao.clash.app.MainApplication
import com.yingmao.clash.base.PublicViewMode import com.yingmao.clash.base.PublicViewMode
import com.cncat.vpn.common.log.Log import com.cncat.vpn.common.log.Log
import com.yingmao.clash.BuildConfig
import com.yingmao.clash.conf.BZYConstants import com.yingmao.clash.conf.BZYConstants
import com.yingmao.clash.entity.CheckLoginRsp import com.yingmao.clash.entity.CheckLoginRsp
import com.yingmao.clash.listener.AsyncBodyCallback
import com.yingmao.clash.listener.AsyncCallback
import com.yingmao.clash.net.http.HttpApi import com.yingmao.clash.net.http.HttpApi
import com.yingmao.clash.net.http.HttpReqType import com.yingmao.clash.net.http.HttpReqType
import com.yingmao.clash.net.http.HttpStatus import com.yingmao.clash.net.http.HttpStatus
@ -89,4 +92,28 @@ class LoginAtyVM : PublicViewMode() {
) )
} }
} }
fun getRegisterHost(callback: AsyncBodyCallback) {
val rt =
NetService.instances.createFreeBaseUrl("https://yingmao.oss-cn-hongkong.aliyuncs.com/")
doAsyncNoNeedReturn(HttpReqType.GET_HOST) {
try { //TODO bug 会引起崩溃
var host = rt.getRegister()
// Log.e("data", "2:$host")
// if (!TextUtils.isEmpty(host)) {
//
// MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_REGISTER_HOST, host)
// }
// Log.e("data", "22:$host")
callback.suc(host)
} catch (e: Exception) {
e.printStackTrace()
callback.err()
}
}
}
} }

View File

@ -55,8 +55,8 @@
android:background="@drawable/login_et_bg_selector" android:background="@drawable/login_et_bg_selector"
android:inputType="textPersonName" android:inputType="textPersonName"
android:maxLines="1" android:maxLines="1"
android:textSize="@dimen/layout_login_et_textsize"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/layout_login_et_textsize"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/iv_icon" app:layout_constraintStart_toStartOf="@+id/iv_icon"
@ -93,8 +93,8 @@
android:background="@drawable/login_et_bg_selector" android:background="@drawable/login_et_bg_selector"
android:inputType="textPassword" android:inputType="textPassword"
android:maxLines="1" android:maxLines="1"
android:textSize="@dimen/layout_login_et_textsize"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/layout_login_et_textsize"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/iv_icon" app:layout_constraintStart_toStartOf="@+id/iv_icon"
@ -106,8 +106,8 @@
android:layout_width="@dimen/layout_login_cb_width" android:layout_width="@dimen/layout_login_cb_width"
android:layout_height="@dimen/layout_login_cb_height" android:layout_height="@dimen/layout_login_cb_height"
android:layout_marginEnd="@dimen/layout_login_cb_end_margin" android:layout_marginEnd="@dimen/layout_login_cb_end_margin"
android:drawableBottom="@drawable/hide_pwd_cb_selector"
android:button="@null" android:button="@null"
android:drawableBottom="@drawable/hide_pwd_cb_selector"
android:gravity="center" android:gravity="center"
android:paddingBottom="@dimen/layout_login_cb_bottom_padding" android:paddingBottom="@dimen/layout_login_cb_bottom_padding"
app:layout_constraintBottom_toBottomOf="@+id/et_password" app:layout_constraintBottom_toBottomOf="@+id/et_password"
@ -126,48 +126,48 @@
app:layout_constraintTop_toBottomOf="@+id/et_password" /> app:layout_constraintTop_toBottomOf="@+id/et_password" />
<CheckBox <CheckBox
android:checked="true"
android:id="@+id/cb_remember_password" android:id="@+id/cb_remember_password"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="20dp" android:layout_height="20dp"
android:button="@null"
android:checked="true"
android:drawablePadding="7dp"
android:gravity="center"
android:text="@string/remember_password" android:text="@string/remember_password"
android:textColor="@color/white_70" android:textColor="@color/white_70"
android:textSize="12sp" android:textSize="12sp"
android:drawablePadding="7dp" app:drawableLeftCompat="@drawable/checked_selector"
android:gravity="center"
android:button="@null"
app:layout_constraintStart_toStartOf="@+id/tv_password_error" app:layout_constraintStart_toStartOf="@+id/tv_password_error"
app:layout_constraintTop_toBottomOf="@+id/tv_password_error" app:layout_constraintTop_toBottomOf="@+id/tv_password_error" />
app:drawableLeftCompat="@drawable/checked_selector" />
<LinearLayout <LinearLayout
android:id="@+id/ll_user_agreement" android:id="@+id/ll_user_agreement"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="20dp" android:layout_height="20dp"
app:layout_constraintStart_toStartOf="@+id/cb_remember_password" android:layout_marginTop="15dp"
app:layout_constraintTop_toBottomOf="@+id/cb_remember_password"
android:orientation="horizontal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_marginTop="15dp"> android:orientation="horizontal"
app:layout_constraintStart_toStartOf="@+id/cb_remember_password"
app:layout_constraintTop_toBottomOf="@+id/cb_remember_password">
<CheckBox <CheckBox
android:checked="true"
android:id="@+id/cb_user_agreement" android:id="@+id/cb_user_agreement"
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center"
android:button="@null" android:button="@null"
android:checked="true"
android:gravity="center"
app:drawableLeftCompat="@drawable/checked_selector" /> app:drawableLeftCompat="@drawable/checked_selector" />
<TextView <TextView
android:id="@+id/tv_user_agreement" android:id="@+id/tv_user_agreement"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="12sp" android:layout_marginStart="7dp"
android:gravity="center_vertical"
android:maxLines="2" android:maxLines="2"
android:textColor="@color/white_70" android:textColor="@color/white_70"
android:gravity="center_vertical" android:textSize="12sp" />
android:layout_marginStart="7dp" />
</LinearLayout> </LinearLayout>
@ -176,8 +176,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/layout_login_tv_login_start_margin" android:layout_marginStart="@dimen/layout_login_tv_login_start_margin"
android:layout_marginEnd="@dimen/layout_login_tv_login_end_margin"
android:layout_marginTop="30dp" android:layout_marginTop="30dp"
android:layout_marginEnd="@dimen/layout_login_tv_login_end_margin"
android:background="@drawable/login_btn_bg_selector" android:background="@drawable/login_btn_bg_selector"
android:gravity="center" android:gravity="center"
android:paddingTop="@dimen/layout_login_tv_login_top_padding" android:paddingTop="@dimen/layout_login_tv_login_top_padding"
@ -186,72 +186,69 @@
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/layout_login_tv_login_textsize" android:textSize="@dimen/layout_login_tv_login_textsize"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@+id/ll_user_agreement" app:layout_constraintTop_toBottomOf="@+id/ll_user_agreement" />
/>
<TextView <TextView
app:layout_constraintEnd_toEndOf="parent"
android:id="@+id/tv_tip_default_psw" android:id="@+id/tv_tip_default_psw"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:layout_marginTop="@dimen/dp_10"
app:layout_constraintTop_toBottomOf="@id/tv_login"
app:layout_constraintStart_toStartOf="parent"
android:textSize="12sp"
android:textColor="@color/white"
android:maxLines="2"
android:ellipsize="end"
android:text="@string/loginTips"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="30dp"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/loginTips"
android:textColor="@color/white"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_login" />
<TextView <TextView
android:visibility="gone"
android:id="@+id/tv_hongmeng_tip" android:id="@+id/tv_hongmeng_tip"
android:layout_marginTop="5dp"
android:layout_marginLeft="53dp"
app:layout_constraintTop_toBottomOf="@id/tv_tip_default_psw"
android:textSize="12sp"
android:maxLines="10"
android:textColor="@color/white"
android:text="@string/LoginTips2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:paddingRight="20dp"
android:paddingLeft="20dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="53dp"
android:layout_marginTop="5dp"
android:maxLines="10"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="@string/LoginTips2"
android:textColor="@color/white"
android:textSize="12sp"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/tv_tip_default_psw"
tools:ignore="MissingConstraints" /> tools:ignore="MissingConstraints" />
<TextView <TextView
android:visibility="gone"
android:id="@+id/tv_register" android:id="@+id/tv_register"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_10"
android:layout_marginStart="@dimen/layout_login_tv_register_start_margin" android:layout_marginStart="@dimen/layout_login_tv_register_start_margin"
android:layout_marginTop="@dimen/layout_login_tv_register_top_margin" android:layout_marginTop="35dp"
android:layout_marginBottom="@dimen/dp_10"
android:text="@string/register" android:text="@string/register"
android:textColor="@drawable/loginlayout_register_text_color_selector" android:textColor="@drawable/loginlayout_register_text_color_selector"
android:textSize="@dimen/layout_login_tv_register_textsize" android:textSize="@dimen/layout_login_tv_register_textsize"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_login" /> app:layout_constraintTop_toBottomOf="@+id/tv_hongmeng_tip" />
<TextView <TextView
android:id="@+id/tv_forget_pwd" android:id="@+id/tv_forget_pwd"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_10"
android:layout_marginTop="35dp" android:layout_marginTop="35dp"
android:layout_marginEnd="@dimen/layout_login_forget_tv_end_margin" android:layout_marginEnd="@dimen/layout_login_forget_tv_end_margin"
android:layout_marginBottom="@dimen/dp_10"
android:text="@string/forget_pwd" android:text="@string/forget_pwd"
android:textColor="@drawable/loginlayout_forget_text_color_selector" android:textColor="@drawable/loginlayout_forget_text_color_selector"
android:textSize="@dimen/layout_login_forget_tv_textsize" android:textSize="@dimen/layout_login_forget_tv_textsize"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
android:visibility="visible"
app:layout_constraintTop_toBottomOf="@+id/tv_hongmeng_tip" /> app:layout_constraintTop_toBottomOf="@+id/tv_hongmeng_tip" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>