Commit 9b399eed authored by 赵鹏翔's avatar 赵鹏翔

设置界面添加弹出日志组件逻辑

parent 69cb9121
......@@ -3,18 +3,26 @@ package com.miya.fastcashier.ui
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.Gravity
import androidx.fragment.app.FragmentManager
import com.miya.fastcashier.BaseApplication
import com.miya.fastcashier.R
import com.miya.fastcashier.databinding.ActivitySettingBinding
import com.miya.fastcashier.ui.dialog.AuthorizePasswordInputDialog
import com.miya.fastcashier.ui.dialog.CommonDialog
import com.miya.fastcashier.utils.click
import com.miya.fastcashier.utils.clickWithTrigger
import es.dmoral.toasty.Toasty
class SettingActivity : BaseActivity() {
private lateinit var viewBinding: ActivitySettingBinding
private var alertDialog: CommonDialog? = null
private var countClick = 0
private var lastClickTime: Long = 0
companion object {
@JvmStatic
fun start(context: Context) {
......@@ -35,6 +43,58 @@ class SettingActivity : BaseActivity() {
viewBinding.llBack.clickWithTrigger { finish() }
viewBinding.vLoginOut.clickWithTrigger { loginOut() }
viewBinding.vUpdatePassword.clickWithTrigger { ResetAuthorizePasswordActivity.start(this) }
viewBinding.vFunction.click { checkBeforeEnterFunction() }
}
private fun checkBeforeEnterFunction() {
var currentTime = System.currentTimeMillis()
if (currentTime - lastClickTime > 1000 && lastClickTime != 0L){
countClick = 0
}
countClick++
lastClickTime = currentTime
// HideClickUtil.getInstance().countClick()
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe { integer ->
// if (integer === HideClickUtil.CLICK_TWO) {
// //进入隐藏操作,弹出身份验证对话框
// if (verifyDialog != null) {
// verifyDialog.show()
// }
// } else if (integer > HideClickUtil.CLICK_ONE && integer < HideClickUtil.CLICK_TWO) {
// //吐司提示
//
// }
// }
if (countClick < 5) {
if (countClick >= 2 && countClick < 5) {
Toasty.info(
applicationContext,
getString(R.string.toast_click_again, 5 - countClick)
).show()
}
return
}
showAuthorizedDialog()
}
private fun showAuthorizedDialog() {
val FRAGMENT_TAG = "Authorize_Password"
val fm: FragmentManager = getSupportFragmentManager()
val oldFrag = fm.findFragmentByTag(FRAGMENT_TAG)
if (oldFrag != null) {
fm.beginTransaction().remove(oldFrag).commitAllowingStateLoss()
}
// AuthorizePasswordInputDialog.newInstance().show(fm, FRAGMENT_TAG,object :AuthorizePasswordInputDialog.OnAuthorizedFinishListener{
// override fun onAuthorizedFinished(isSucceed: Boolean) {
// if (isSucceed){
// FunctionCenterActivity.start(this@SettingActivity)
// }
// }
//
// })
}
private fun loginOut() {
......
......@@ -120,4 +120,12 @@
android:drawableRight="@mipmap/app_icon_arrow_right_grey"
android:text="@string/app_login_out"/>
<View
android:id="@+id/v_function"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="@color/color_F8F8F8"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -31,5 +31,21 @@
<string name="app_setting_confirm_password">确认密码</string>
<string name="app_confirm_update">确认修改</string>
<string name="app_confirm">确认</string>
<string name="app_unkown">未知</string>
<string name="toast_click_again">再点击%1$d次进入身份验证</string>
<!--日志上传字段-->
<string name="lfile_Cancel">取消全选</string>
<string name="lfile_ChooseTip">请选择文件夹</string>
<string name="lfile_FileSize">文件大小:</string>
<string name="lfile_LItem"></string>
<string name="lfile_NotFoundBooks">请选择需要上传的日志</string>
<string name="lfile_NotFoundPath">SD 存储卡状态不可用</string>
<string name="lfile_OK">确定</string>
<string name="lfile_OutSize">已经达到最大选择数量</string>
<string name="lfile_SelectAll">全选</string>
<string name="lfile_Selected">上传</string>
<string name="lfile_UpOneLevel">上一级</string>
<string name="please_wait">请稍候...</string>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment