Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MiYaFastCashier
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangjiantao
MiYaFastCashier
Commits
9b399eed
Commit
9b399eed
authored
May 10, 2022
by
赵鹏翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设置界面添加弹出日志组件逻辑
parent
69cb9121
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
0 deletions
+84
-0
SettingActivity.kt
app/src/main/java/com/miya/fastcashier/ui/SettingActivity.kt
+60
-0
activity_setting.xml
app/src/main/res/layout/activity_setting.xml
+8
-0
strings.xml
app/src/main/res/values/strings.xml
+16
-0
No files found.
app/src/main/java/com/miya/fastcashier/ui/SettingActivity.kt
View file @
9b399eed
...
...
@@ -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
()
{
...
...
app/src/main/res/layout/activity_setting.xml
View file @
9b399eed
...
...
@@ -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
app/src/main/res/values/strings.xml
View file @
9b399eed
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment