操作密码弹窗修改
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
android:name=".personal.RetrievePasswordActivity"
|
android:name=".personal.RetrievePasswordActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".personal.LoginPasswordActivity"
|
android:name=".personal.ChangePasswordActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".personal.PasswordManagementActivity"
|
android:name=".personal.PasswordManagementActivity"
|
||||||
@@ -80,8 +80,8 @@
|
|||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".liveVideo.AlarmLogActivity"
|
android:name=".liveVideo.AlarmLogActivity"
|
||||||
android:exported="false"
|
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".liveVideo.SettingsActivity"
|
android:name=".liveVideo.SettingsActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import kotlinx.coroutines.Dispatchers
|
|||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
//添加关联用户
|
//添加关联用户-删除和解除关联
|
||||||
class AddLinkedUserActivity : AppCompatActivity() {
|
class AddLinkedUserActivity : AppCompatActivity() {
|
||||||
private lateinit var binding: AddLinkedUserActivityBinding
|
private lateinit var binding: AddLinkedUserActivityBinding
|
||||||
private val selectedPhoneSet = mutableSetOf<String>()
|
private val selectedPhoneSet = mutableSetOf<String>()
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ class AutoModeActivity : AppCompatActivity() {
|
|||||||
Toast.makeText(this@AutoModeActivity, "修改成功", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this@AutoModeActivity, "修改成功", Toast.LENGTH_SHORT).show()
|
||||||
DeviceUpdateEvent.notifyDeviceUpdated(deviceId)
|
DeviceUpdateEvent.notifyDeviceUpdated(deviceId)
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(this@AutoModeActivity, response.msg, Toast.LENGTH_SHORT).show()
|
Toast.makeText(this@AutoModeActivity, "修改失败", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ import com.example.defenseapplication.adapter.LinkedUserAdapter
|
|||||||
import com.example.defenseapplication.bean.DeleteDeviceUserRequest
|
import com.example.defenseapplication.bean.DeleteDeviceUserRequest
|
||||||
import com.example.defenseapplication.bean.DeviceUserBean
|
import com.example.defenseapplication.bean.DeviceUserBean
|
||||||
import com.example.defenseapplication.bean.FamilyMembersBean
|
import com.example.defenseapplication.bean.FamilyMembersBean
|
||||||
|
import com.example.defenseapplication.bean.VerifyOptionPasswordRequest
|
||||||
import com.example.defenseapplication.databinding.LinkedUserActivityBinding
|
import com.example.defenseapplication.databinding.LinkedUserActivityBinding
|
||||||
|
import com.example.defenseapplication.personal.PasswordInputDialog
|
||||||
import com.example.defenseapplication.utils.DeviceIdEvent
|
import com.example.defenseapplication.utils.DeviceIdEvent
|
||||||
import com.example.defenseapplication.utils.DeviceUserUpdateEvent
|
import com.example.defenseapplication.utils.DeviceUserUpdateEvent
|
||||||
import com.example.defenseapplication.utils.RetrofitNetwork
|
import com.example.defenseapplication.utils.RetrofitNetwork
|
||||||
@@ -25,6 +27,7 @@ import com.example.defenseapplication.view.CustomDialogFragmentText
|
|||||||
import com.gyf.immersionbar.ImmersionBar
|
import com.gyf.immersionbar.ImmersionBar
|
||||||
import com.yanzhenjie.recyclerview.SwipeMenuItem
|
import com.yanzhenjie.recyclerview.SwipeMenuItem
|
||||||
import com.yanzhenjie.recyclerview.SwipeRecyclerView
|
import com.yanzhenjie.recyclerview.SwipeRecyclerView
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
@@ -36,6 +39,8 @@ class LinkedUserActivity : AppCompatActivity() {
|
|||||||
private val fullUserList = mutableListOf<LinkedUser>()
|
private val fullUserList = mutableListOf<LinkedUser>()
|
||||||
private val userList = mutableListOf<LinkedUser>()
|
private val userList = mutableListOf<LinkedUser>()
|
||||||
private var mode: Int = MODE_SETTINGS
|
private var mode: Int = MODE_SETTINGS
|
||||||
|
private var isPasswordVerified: Boolean = false
|
||||||
|
private lateinit var passwordDialog: PasswordInputDialog
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val EXTRA_MODE = "extra_mode"
|
const val EXTRA_MODE = "extra_mode"
|
||||||
@@ -71,6 +76,9 @@ class LinkedUserActivity : AppCompatActivity() {
|
|||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
DeviceUserUpdateEvent.removeListener(deviceUserUpdateListener)
|
DeviceUserUpdateEvent.removeListener(deviceUserUpdateListener)
|
||||||
|
if (::passwordDialog.isInitialized) {
|
||||||
|
passwordDialog.dismiss()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initView() {
|
private fun initView() {
|
||||||
@@ -135,11 +143,55 @@ class LinkedUserActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
dialog.setShowInput(false)
|
dialog.setShowInput(false)
|
||||||
dialog.setOnConfirmListener {
|
dialog.setOnConfirmListener {
|
||||||
|
if (!isPasswordVerified) {
|
||||||
|
showPasswordDialog {
|
||||||
|
isPasswordVerified = true
|
||||||
deleteDeviceUser(user, position)
|
deleteDeviceUser(user, position)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
deleteDeviceUser(user, position)
|
||||||
|
}
|
||||||
|
}
|
||||||
dialog.show(supportFragmentManager, "DeleteDialog")
|
dialog.show(supportFragmentManager, "DeleteDialog")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showPasswordDialog(onVerified: () -> Unit) {
|
||||||
|
passwordDialog = PasswordInputDialog(this).apply {
|
||||||
|
setOnConfirmListener { inputPassword ->
|
||||||
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
|
try {
|
||||||
|
val response = RetrofitNetwork.getNetworkService()
|
||||||
|
.verifyOptionPassword(VerifyOptionPasswordRequest(inputPassword))
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
if (response.code == 200) {
|
||||||
|
dismiss()
|
||||||
|
onVerified()
|
||||||
|
} else {
|
||||||
|
Toast.makeText(
|
||||||
|
this@LinkedUserActivity,
|
||||||
|
response.msg ?: getString(R.string.password_error),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
showError(getString(R.string.password_error))
|
||||||
|
clearPassword()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
Toast.makeText(this@LinkedUserActivity, "网络请求失败", Toast.LENGTH_SHORT).show()
|
||||||
|
showError(getString(R.string.password_error))
|
||||||
|
clearPassword()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setOnDismissListener {
|
||||||
|
// Dialog dismissed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
passwordDialog.show()
|
||||||
|
}
|
||||||
|
|
||||||
private fun deleteDeviceUser(user: LinkedUser, position: Int) {
|
private fun deleteDeviceUser(user: LinkedUser, position: Int) {
|
||||||
val deviceId = DeviceIdEvent.getDeviceId()
|
val deviceId = DeviceIdEvent.getDeviceId()
|
||||||
if (deviceId.isNullOrEmpty() || user.userId.isEmpty()) {
|
if (deviceId.isNullOrEmpty() || user.userId.isEmpty()) {
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ import android.widget.Toast
|
|||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import com.example.defenseapplication.R
|
import com.example.defenseapplication.R
|
||||||
import com.example.defenseapplication.base.BaseActivity
|
import com.example.defenseapplication.base.BaseActivity
|
||||||
import com.example.defenseapplication.bean.DeviceUserBean
|
|
||||||
import com.example.defenseapplication.databinding.SettingsActivityBinding
|
import com.example.defenseapplication.databinding.SettingsActivityBinding
|
||||||
import com.example.defenseapplication.utils.DeviceIdEvent
|
import com.example.defenseapplication.utils.DeviceIdEvent
|
||||||
import com.example.defenseapplication.utils.LanguageUtil
|
|
||||||
import com.example.defenseapplication.utils.RetrofitNetwork
|
import com.example.defenseapplication.utils.RetrofitNetwork
|
||||||
import com.example.defenseapplication.view.CustomDialogFragmentText
|
import com.example.defenseapplication.view.CustomDialogFragmentText
|
||||||
import com.example.defenseapplication.view.RecognitionModeDialog
|
import com.example.defenseapplication.view.RecognitionModeDialog
|
||||||
|
import com.example.defenseapplication.bean.VerifyOptionPasswordRequest
|
||||||
|
import com.example.defenseapplication.personal.PasswordInputDialog
|
||||||
import com.gyf.immersionbar.ImmersionBar
|
import com.gyf.immersionbar.ImmersionBar
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
@@ -23,8 +23,10 @@ import kotlinx.coroutines.withContext
|
|||||||
class SettingsActivity : BaseActivity() {
|
class SettingsActivity : BaseActivity() {
|
||||||
|
|
||||||
private lateinit var binding: SettingsActivityBinding
|
private lateinit var binding: SettingsActivityBinding
|
||||||
|
private lateinit var passwordDialog: PasswordInputDialog
|
||||||
private var alertAudio: String? = null
|
private var alertAudio: String? = null
|
||||||
private var audioContent: String? = null
|
private var audioContent: String? = null
|
||||||
|
private var isPasswordVerified = false
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
@@ -50,11 +52,22 @@ class SettingsActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.itemRecognitionMode.setOnClickListener {
|
binding.itemRecognitionMode.setOnClickListener {
|
||||||
|
if (isPasswordVerified) {
|
||||||
val dialog = RecognitionModeDialog(this)
|
val dialog = RecognitionModeDialog(this)
|
||||||
dialog.setOnConfirmListener { mode ->
|
dialog.setOnConfirmListener { mode ->
|
||||||
updateRecognitionMode(mode)
|
updateRecognitionMode(mode)
|
||||||
}
|
}
|
||||||
dialog.show()
|
dialog.show()
|
||||||
|
} else {
|
||||||
|
showPasswordDialog {
|
||||||
|
isPasswordVerified = true
|
||||||
|
val dialog = RecognitionModeDialog(this)
|
||||||
|
dialog.setOnConfirmListener { mode ->
|
||||||
|
updateRecognitionMode(mode)
|
||||||
|
}
|
||||||
|
dialog.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.itemDeviceName.setOnClickListener {
|
binding.itemDeviceName.setOnClickListener {
|
||||||
@@ -80,48 +93,26 @@ class SettingsActivity : BaseActivity() {
|
|||||||
dialog.show(supportFragmentManager, "CustomDialogFragment")
|
dialog.show(supportFragmentManager, "CustomDialogFragment")
|
||||||
}
|
}
|
||||||
binding.itemWaterGunSetting.setOnClickListener {
|
binding.itemWaterGunSetting.setOnClickListener {
|
||||||
val intent = Intent(this, WaterGunSettingsActivity::class.java)
|
if (isPasswordVerified) {
|
||||||
// 传递水枪设置参数
|
navigateToWaterGunSettings()
|
||||||
val deviceId = DeviceIdEvent.getDeviceId()
|
|
||||||
if (!deviceId.isNullOrEmpty()) {
|
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
|
||||||
try {
|
|
||||||
val response = RetrofitNetwork.getNetworkService().getDeviceInfo(deviceId)
|
|
||||||
withContext(Dispatchers.Main) {
|
|
||||||
if (response.code == 200 && response.data != null) {
|
|
||||||
val device = response.data
|
|
||||||
intent.putExtra("strikeRange", device.strikeRange ?: "7")
|
|
||||||
intent.putExtra("strikeInterval", device.strikeInterval ?: "3")
|
|
||||||
intent.putExtra("container", device.container ?: "容器4")
|
|
||||||
startActivity(intent)
|
|
||||||
} else {
|
} else {
|
||||||
// 如果获取失败,使用默认值
|
showPasswordDialog {
|
||||||
intent.putExtra("strikeRange", "7")
|
isPasswordVerified = true
|
||||||
intent.putExtra("strikeInterval", "3")
|
navigateToWaterGunSettings()
|
||||||
intent.putExtra("container", "容器4")
|
|
||||||
startActivity(intent)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
|
||||||
e.printStackTrace()
|
|
||||||
withContext(Dispatchers.Main) {
|
|
||||||
intent.putExtra("strikeRange", "7")
|
|
||||||
intent.putExtra("strikeInterval", "3")
|
|
||||||
intent.putExtra("container", "容器4")
|
|
||||||
startActivity(intent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
intent.putExtra("strikeRange", "7")
|
|
||||||
intent.putExtra("strikeInterval", "3")
|
|
||||||
intent.putExtra("container", "容器4")
|
|
||||||
startActivity(intent)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
binding.itemAutoMode.setOnClickListener {
|
binding.itemAutoMode.setOnClickListener {
|
||||||
|
if (isPasswordVerified) {
|
||||||
val intent = Intent(this, AutoModeActivity::class.java)
|
val intent = Intent(this, AutoModeActivity::class.java)
|
||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
|
} else {
|
||||||
|
showPasswordDialog {
|
||||||
|
isPasswordVerified = true
|
||||||
|
val intent = Intent(this, AutoModeActivity::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
binding.itemDeviceInfo.setOnClickListener {
|
binding.itemDeviceInfo.setOnClickListener {
|
||||||
val intent = Intent(this, DeviceInfoActivity::class.java)
|
val intent = Intent(this, DeviceInfoActivity::class.java)
|
||||||
@@ -337,4 +328,87 @@ class SettingsActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showPasswordDialog(onVerified: () -> Unit) {
|
||||||
|
passwordDialog = PasswordInputDialog(this).apply {
|
||||||
|
setOnConfirmListener { inputPassword ->
|
||||||
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
|
try {
|
||||||
|
val response = RetrofitNetwork.getNetworkService()
|
||||||
|
.verifyOptionPassword(VerifyOptionPasswordRequest(inputPassword))
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
if (response.code == 200) {
|
||||||
|
dismiss()
|
||||||
|
onVerified()
|
||||||
|
} else {
|
||||||
|
Toast.makeText(
|
||||||
|
this@SettingsActivity,
|
||||||
|
response.msg ?: getString(R.string.password_error),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
showError(getString(R.string.password_error))
|
||||||
|
clearPassword()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
Toast.makeText(this@SettingsActivity, "网络请求失败", Toast.LENGTH_SHORT).show()
|
||||||
|
showError(getString(R.string.password_error))
|
||||||
|
clearPassword()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setOnDismissListener {
|
||||||
|
// Dialog dismissed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
passwordDialog.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun navigateToWaterGunSettings() {
|
||||||
|
val intent = Intent(this, WaterGunSettingsActivity::class.java)
|
||||||
|
val deviceId = DeviceIdEvent.getDeviceId()
|
||||||
|
if (!deviceId.isNullOrEmpty()) {
|
||||||
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
|
try {
|
||||||
|
val response = RetrofitNetwork.getNetworkService().getDeviceInfo(deviceId)
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
if (response.code == 200 && response.data != null) {
|
||||||
|
val device = response.data
|
||||||
|
intent.putExtra("strikeRange", device.strikeRange ?: "7")
|
||||||
|
intent.putExtra("strikeInterval", device.strikeInterval ?: "3")
|
||||||
|
intent.putExtra("container", device.container ?: "容器4")
|
||||||
|
startActivity(intent)
|
||||||
|
} else {
|
||||||
|
intent.putExtra("strikeRange", "7")
|
||||||
|
intent.putExtra("strikeInterval", "3")
|
||||||
|
intent.putExtra("container", "容器4")
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
intent.putExtra("strikeRange", "7")
|
||||||
|
intent.putExtra("strikeInterval", "3")
|
||||||
|
intent.putExtra("container", "容器4")
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
intent.putExtra("strikeRange", "7")
|
||||||
|
intent.putExtra("strikeInterval", "3")
|
||||||
|
intent.putExtra("container", "容器4")
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
if (::passwordDialog.isInitialized) {
|
||||||
|
passwordDialog.dismiss()
|
||||||
|
}
|
||||||
|
super.onDestroy()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import androidx.lifecycle.lifecycleScope
|
|||||||
import com.example.defenseapplication.R
|
import com.example.defenseapplication.R
|
||||||
import com.example.defenseapplication.bean.DeleteDeviceUserRequest
|
import com.example.defenseapplication.bean.DeleteDeviceUserRequest
|
||||||
import com.example.defenseapplication.bean.ObtainInviterInformationRequest
|
import com.example.defenseapplication.bean.ObtainInviterInformationRequest
|
||||||
|
import com.example.defenseapplication.bean.VerifyOptionPasswordRequest
|
||||||
|
import com.example.defenseapplication.personal.PasswordInputDialog
|
||||||
import com.example.defenseapplication.utils.DeviceIdEvent
|
import com.example.defenseapplication.utils.DeviceIdEvent
|
||||||
import com.example.defenseapplication.utils.DeviceUserUpdateEvent
|
import com.example.defenseapplication.utils.DeviceUserUpdateEvent
|
||||||
import com.example.defenseapplication.databinding.UserDetailsActivityBinding
|
import com.example.defenseapplication.databinding.UserDetailsActivityBinding
|
||||||
@@ -23,6 +25,8 @@ class UserDetailsActivity : AppCompatActivity() {
|
|||||||
private lateinit var binding: UserDetailsActivityBinding
|
private lateinit var binding: UserDetailsActivityBinding
|
||||||
|
|
||||||
private var userId: String = ""
|
private var userId: String = ""
|
||||||
|
private var isPasswordVerified: Boolean = false
|
||||||
|
private lateinit var passwordDialog: PasswordInputDialog
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
@@ -82,12 +86,11 @@ class UserDetailsActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.swUserStatus.setOnCheckedChangeListener { _, isChecked ->
|
binding.swUserStatus.setOnCheckedChangeListener { _, isChecked ->
|
||||||
when (isChecked) {
|
if (!isPasswordVerified) {
|
||||||
true -> {
|
binding.swUserStatus.isChecked = !isChecked
|
||||||
// 打开开关业务逻辑
|
showPasswordDialog {
|
||||||
}
|
isPasswordVerified = true
|
||||||
false -> {
|
binding.swUserStatus.isChecked = isChecked
|
||||||
// 关闭开关业务逻辑
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,6 +100,41 @@ class UserDetailsActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showPasswordDialog(onVerified: () -> Unit) {
|
||||||
|
passwordDialog = PasswordInputDialog(this).apply {
|
||||||
|
setOnConfirmListener { inputPassword ->
|
||||||
|
lifecycleScope.launch {
|
||||||
|
try {
|
||||||
|
val response = RetrofitNetwork.getNetworkService()
|
||||||
|
.verifyOptionPassword(VerifyOptionPasswordRequest(inputPassword))
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
if (response.code == 200) {
|
||||||
|
dismiss()
|
||||||
|
onVerified()
|
||||||
|
} else {
|
||||||
|
Toast.makeText(
|
||||||
|
this@UserDetailsActivity,
|
||||||
|
response.msg ?: getString(R.string.password_error),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
showError(getString(R.string.password_error))
|
||||||
|
clearPassword()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
Toast.makeText(this@UserDetailsActivity, "网络请求失败", Toast.LENGTH_SHORT).show()
|
||||||
|
showError(getString(R.string.password_error))
|
||||||
|
clearPassword()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setOnDismissListener {}
|
||||||
|
}
|
||||||
|
passwordDialog.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun showDeleteDialog() {
|
private fun showDeleteDialog() {
|
||||||
val dialog = CustomDialogFragmentText()
|
val dialog = CustomDialogFragmentText()
|
||||||
@@ -106,7 +144,14 @@ class UserDetailsActivity : AppCompatActivity() {
|
|||||||
dialog.setPositiveText(getString(R.string.confirm))
|
dialog.setPositiveText(getString(R.string.confirm))
|
||||||
dialog.setNegativeText(getString(R.string.cancel))
|
dialog.setNegativeText(getString(R.string.cancel))
|
||||||
dialog.setOnConfirmListener {
|
dialog.setOnConfirmListener {
|
||||||
|
if (isPasswordVerified) {
|
||||||
deleteDeviceUser()
|
deleteDeviceUser()
|
||||||
|
} else {
|
||||||
|
showPasswordDialog {
|
||||||
|
isPasswordVerified = true
|
||||||
|
deleteDeviceUser()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dialog.show(supportFragmentManager, "DeleteUserDialog")
|
dialog.show(supportFragmentManager, "DeleteUserDialog")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.example.defenseapplication.personal
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.widget.Toast
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import com.example.defenseapplication.R
|
||||||
|
import com.example.defenseapplication.bean.UpdatePassword
|
||||||
|
import com.example.defenseapplication.databinding.ChangePasswordActivityBinding
|
||||||
|
import com.example.defenseapplication.utils.RetrofitNetwork
|
||||||
|
import com.gyf.immersionbar.ImmersionBar
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
|
|
||||||
|
//登录密码修改
|
||||||
|
class ChangePasswordActivity : AppCompatActivity() {
|
||||||
|
private lateinit var binding: ChangePasswordActivityBinding
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
binding = ChangePasswordActivityBinding.inflate(layoutInflater)
|
||||||
|
setContentView(binding.root)
|
||||||
|
|
||||||
|
ImmersionBar.with(this)
|
||||||
|
.statusBarDarkFont(true)
|
||||||
|
.titleBar(binding.topBar)
|
||||||
|
.init()
|
||||||
|
|
||||||
|
binding.ivBack.setOnClickListener {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.btnConfirm.setOnClickListener {
|
||||||
|
val oldPassword = binding.etOldPassword.text.toString().trim()
|
||||||
|
val newPassword = binding.etNewPassword.text.toString().trim()
|
||||||
|
val confirmPassword = binding.etConfirmPassword.text.toString().trim()
|
||||||
|
|
||||||
|
if (oldPassword.isEmpty()) {
|
||||||
|
Toast.makeText(this, getString(R.string.enter_old_password), Toast.LENGTH_SHORT).show()
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newPassword.isEmpty()) {
|
||||||
|
Toast.makeText(this, getString(R.string.enter_new_password), Toast.LENGTH_SHORT).show()
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newPassword != confirmPassword) {
|
||||||
|
Toast.makeText(this, getString(R.string.password_not_match), Toast.LENGTH_SHORT).show()
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
|
|
||||||
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
|
try {
|
||||||
|
val result = RetrofitNetwork.getNetworkService().updatePassword(UpdatePassword(oldPassword, newPassword))
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
if (result.code == 200) {
|
||||||
|
Toast.makeText(this@ChangePasswordActivity, getString(R.string.password_reset_success), Toast.LENGTH_SHORT).show()
|
||||||
|
finish()
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this@ChangePasswordActivity, result.msg ?: getString(R.string.password_reset_failed), Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
Toast.makeText(this@ChangePasswordActivity, getString(R.string.network_error), Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,24 +1,20 @@
|
|||||||
package com.example.defenseapplication.personal
|
package com.example.defenseapplication.personal
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.widget.Toast
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import bean.LoginRequest
|
import androidx.core.view.ViewCompat
|
||||||
|
import androidx.core.view.WindowInsetsCompat
|
||||||
import com.example.defenseapplication.R
|
import com.example.defenseapplication.R
|
||||||
import com.example.defenseapplication.bean.UpdatePassword
|
|
||||||
import com.example.defenseapplication.bean.UserInfoBean
|
|
||||||
import com.example.defenseapplication.databinding.LoginPasswordActivityBinding
|
import com.example.defenseapplication.databinding.LoginPasswordActivityBinding
|
||||||
import com.example.defenseapplication.utils.RetrofitNetwork
|
import com.example.defenseapplication.databinding.PasswordManagementActivityBinding
|
||||||
import com.gyf.immersionbar.ImmersionBar
|
import com.gyf.immersionbar.ImmersionBar
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import kotlinx.coroutines.withContext
|
|
||||||
|
|
||||||
//登录密码修改
|
//登录密码
|
||||||
class LoginPasswordActivity : AppCompatActivity() {
|
class LoginPasswordActivity : AppCompatActivity() {
|
||||||
private lateinit var binding: LoginPasswordActivityBinding
|
|
||||||
|
|
||||||
|
private lateinit var binding: LoginPasswordActivityBinding
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = LoginPasswordActivityBinding.inflate(layoutInflater)
|
binding = LoginPasswordActivityBinding.inflate(layoutInflater)
|
||||||
@@ -33,44 +29,13 @@ class LoginPasswordActivity : AppCompatActivity() {
|
|||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.btnConfirm.setOnClickListener {
|
binding.changePassword.setOnClickListener {
|
||||||
val oldPassword = binding.etOldPassword.text.toString().trim()
|
startActivity(Intent(this, ChangePasswordActivity::class.java))
|
||||||
val newPassword = binding.etNewPassword.text.toString().trim()
|
}
|
||||||
val confirmPassword = binding.etConfirmPassword.text.toString().trim()
|
binding.retrievePassword.setOnClickListener {
|
||||||
|
startActivity(Intent(this, RetrievePasswordActivity::class.java))
|
||||||
if (oldPassword.isEmpty()) {
|
|
||||||
Toast.makeText(this, getString(R.string.enter_old_password), Toast.LENGTH_SHORT).show()
|
|
||||||
return@setOnClickListener
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newPassword.isEmpty()) {
|
|
||||||
Toast.makeText(this, getString(R.string.enter_new_password), Toast.LENGTH_SHORT).show()
|
|
||||||
return@setOnClickListener
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newPassword != confirmPassword) {
|
|
||||||
Toast.makeText(this, getString(R.string.password_not_match), Toast.LENGTH_SHORT).show()
|
|
||||||
return@setOnClickListener
|
|
||||||
}
|
|
||||||
|
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
|
||||||
try {
|
|
||||||
val result = RetrofitNetwork.getNetworkService().updatePassword(UpdatePassword(oldPassword, newPassword))
|
|
||||||
withContext(Dispatchers.Main) {
|
|
||||||
if (result.code == 200) {
|
|
||||||
Toast.makeText(this@LoginPasswordActivity, getString(R.string.password_reset_success), Toast.LENGTH_SHORT).show()
|
|
||||||
finish()
|
|
||||||
} else {
|
|
||||||
Toast.makeText(this@LoginPasswordActivity, result.msg ?: getString(R.string.password_reset_failed), Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e: Exception) {
|
|
||||||
withContext(Dispatchers.Main) {
|
|
||||||
Toast.makeText(this@LoginPasswordActivity, getString(R.string.network_error), Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,11 +34,7 @@ class PasswordManagementActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.loginPassword.setOnClickListener {
|
binding.loginPassword.setOnClickListener {
|
||||||
startActivity(Intent(this, LoginPasswordActivity::class.java))
|
startActivity(Intent(this, ChangePasswordActivity::class.java))
|
||||||
}
|
|
||||||
|
|
||||||
binding.retrievePassword.setOnClickListener {
|
|
||||||
startActivity(Intent(this, RetrievePasswordActivity::class.java))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.operationPassword.setOnClickListener {
|
binding.operationPassword.setOnClickListener {
|
||||||
|
|||||||
112
app/src/main/res/layout/change_password_activity.xml
Normal file
112
app/src/main/res/layout/change_password_activity.xml
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
<?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:id="@+id/main"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/message_bg"
|
||||||
|
tools:context=".personal.ChangePasswordActivity">
|
||||||
|
|
||||||
|
<!-- 标题栏 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/topBar"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingHorizontal="16dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivBack"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:src="@drawable/back" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/login_password"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="16dp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 旧密码输入框 -->
|
||||||
|
<EditText
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:id="@+id/etOldPassword"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
android:background="@drawable/textinput_white_bg"
|
||||||
|
android:hint="@string/enter_old_password"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:paddingHorizontal="16dp"
|
||||||
|
android:paddingVertical="16dp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="@color/gray"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/topBar" />
|
||||||
|
|
||||||
|
<!-- 新密码输入框 -->
|
||||||
|
<EditText
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:id="@+id/etNewPassword"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:background="@drawable/textinput_white_bg"
|
||||||
|
android:hint="@string/enter_new_password"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:paddingHorizontal="16dp"
|
||||||
|
android:paddingVertical="16dp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="@color/gray"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/etOldPassword" />
|
||||||
|
|
||||||
|
<!-- 再次输入新密码输入框 -->
|
||||||
|
<EditText
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:id="@+id/etConfirmPassword"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:background="@drawable/textinput_white_bg"
|
||||||
|
android:hint="@string/enter_password_again"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:paddingHorizontal="16dp"
|
||||||
|
android:paddingVertical="16dp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="@color/gray"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/etNewPassword" />
|
||||||
|
|
||||||
|
<!-- 确定重设密码按钮 -->
|
||||||
|
<android.widget.Button
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:id="@+id/btnConfirm"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
android:background="@drawable/rounded_blue_bg"
|
||||||
|
android:text="@string/confirm_reset_password"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/etConfirmPassword" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -1,23 +1,20 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/main"
|
android:id="@+id/main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/message_bg"
|
android:orientation="vertical"
|
||||||
tools:context=".personal.LoginPasswordActivity">
|
tools:context=".personal.LoginPasswordActivity">
|
||||||
|
|
||||||
<!-- 标题栏 -->
|
<!-- 标题栏 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/topBar"
|
android:id="@+id/topBar"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:paddingHorizontal="16dp"
|
android:paddingHorizontal="16dp">
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ivBack"
|
android:id="@+id/ivBack"
|
||||||
@@ -30,83 +27,55 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/login_password"
|
android:text="@string/password_management"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="16dp"
|
android:textSize="16dp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
<!-- 旧密码输入框 -->
|
android:id="@+id/change_password"
|
||||||
<EditText
|
android:layout_width="match_parent"
|
||||||
android:layout_margin="16dp"
|
android:layout_height="60dp"
|
||||||
android:id="@+id/etOldPassword"
|
android:background="@color/white"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="16dp">
|
||||||
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="32dp"
|
android:text="@string/change_password"
|
||||||
android:background="@drawable/textinput_white_bg"
|
|
||||||
android:hint="@string/enter_old_password"
|
|
||||||
android:inputType="textPassword"
|
|
||||||
android:paddingHorizontal="16dp"
|
|
||||||
android:paddingVertical="16dp"
|
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textColorHint="@color/gray"
|
android:textSize="16dp" />
|
||||||
android:textSize="16sp"
|
<ImageView
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:layout_width="24dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="24dp"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/topBar" />
|
android:layout_marginStart="12dp"
|
||||||
|
android:src="@drawable/right_back" />
|
||||||
|
|
||||||
<!-- 新密码输入框 -->
|
</LinearLayout>
|
||||||
<EditText
|
<LinearLayout
|
||||||
android:layout_margin="16dp"
|
android:id="@+id/retrieve_password"
|
||||||
android:id="@+id/etNewPassword"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="16dp">
|
||||||
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:text="@string/retrieve_password"
|
||||||
android:background="@drawable/textinput_white_bg"
|
|
||||||
android:hint="@string/enter_new_password"
|
|
||||||
android:inputType="textPassword"
|
|
||||||
android:paddingHorizontal="16dp"
|
|
||||||
android:paddingVertical="16dp"
|
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textColorHint="@color/gray"
|
android:textSize="16dp" />
|
||||||
android:textSize="16sp"
|
<ImageView
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:layout_width="24dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="24dp"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/etOldPassword" />
|
android:layout_marginStart="12dp"
|
||||||
|
android:src="@drawable/right_back" />
|
||||||
|
|
||||||
<!-- 再次输入新密码输入框 -->
|
</LinearLayout>
|
||||||
<EditText
|
|
||||||
android:layout_margin="16dp"
|
|
||||||
android:id="@+id/etConfirmPassword"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:background="@drawable/textinput_white_bg"
|
|
||||||
android:hint="@string/enter_password_again"
|
|
||||||
android:inputType="textPassword"
|
|
||||||
android:paddingHorizontal="16dp"
|
|
||||||
android:paddingVertical="16dp"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textColorHint="@color/gray"
|
|
||||||
android:textSize="16sp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/etNewPassword" />
|
|
||||||
|
|
||||||
<!-- 确定重设密码按钮 -->
|
|
||||||
<android.widget.Button
|
|
||||||
android:layout_margin="16dp"
|
|
||||||
android:id="@+id/btnConfirm"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:layout_marginTop="32dp"
|
|
||||||
android:background="@drawable/rounded_blue_bg"
|
|
||||||
android:text="@string/confirm_reset_password"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="16sp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/etConfirmPassword" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</LinearLayout>
|
||||||
@@ -55,28 +55,7 @@
|
|||||||
android:src="@drawable/right_back" />
|
android:src="@drawable/right_back" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/retrieve_password"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:background="@color/white"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingHorizontal="16dp">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/retrieve_password"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="16dp" />
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp"
|
|
||||||
android:layout_marginStart="12dp"
|
|
||||||
android:src="@drawable/right_back" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/operation_password"
|
android:id="@+id/operation_password"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
Reference in New Issue
Block a user