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
649c539a
Commit
649c539a
authored
May 10, 2022
by
赵鹏翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
授权码检验,跳转功能界面
parent
9b399eed
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
11 deletions
+25
-11
SettingActivity.kt
app/src/main/java/com/miya/fastcashier/ui/SettingActivity.kt
+7
-7
AuthorizePasswordInputDialog.kt
...iya/fastcashier/ui/dialog/AuthorizePasswordInputDialog.kt
+18
-4
No files found.
app/src/main/java/com/miya/fastcashier/ui/SettingActivity.kt
View file @
649c539a
...
...
@@ -87,14 +87,14 @@ class SettingActivity : BaseActivity() {
if
(
oldFrag
!=
null
)
{
fm
.
beginTransaction
().
remove
(
oldFrag
).
commitAllowingStateLoss
()
}
//
AuthorizePasswordInputDialog.newInstance().show(fm, FRAGMENT_TAG,object :AuthorizePasswordInputDialog.OnAuthorizedFinishListener{
//
override fun onAuthorizedFinished(isSucceed: Boolean) {
//
if (isSucceed){
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/java/com/miya/fastcashier/ui/dialog/AuthorizePasswordInputDialog.kt
View file @
649c539a
...
...
@@ -8,9 +8,8 @@ import android.text.TextWatcher
import
android.view.*
import
android.widget.EditText
import
androidx.appcompat.app.AppCompatActivity
import
androidx.core.widget.doAfterTextChanged
import
androidx.fragment.app.DialogFragment
import
com.blankj.utilcode.util.ScreenUtils
import
androidx.fragment.app.FragmentManager
import
com.miya.fastcashier.databinding.DialogAuthorizePasswordInputBinding
import
com.miya.fastcashier.ui.BaseActivity
import
com.miya.fastcashier.ui.RefundActivity
...
...
@@ -18,9 +17,10 @@ import com.miya.fastcashier.utils.CenterToasty
import
com.miya.fastcashier.utils.dp2px
import
com.miya.fastcashier.utils.manage.AccountPasswordManageKit
class
AuthorizePasswordInputDialog
()
:
DialogFragment
(),
View
.
OnClickListener
{
class
AuthorizePasswordInputDialog
:
DialogFragment
(),
View
.
OnClickListener
{
private
lateinit
var
viewBinding
:
DialogAuthorizePasswordInputBinding
private
var
callback
:
OnAuthorizedFinishListener
?
=
null
companion
object
{
...
...
@@ -84,7 +84,7 @@ class AuthorizePasswordInputDialog() : DialogFragment(), View.OnClickListener {
val
accountPassword
=
AccountPasswordManageKit
.
get
().
accountPassword
if
(
TextUtils
.
isEmpty
(
accountPassword
))
{
AccountPasswordManageKit
.
get
().
loadAccountPassword
(
context
as
AppCompatActivity
,
object
:
AccountPasswordManageKit
.
AccountPasswordManageCallback
{
object
:
AccountPasswordManageKit
.
AccountPasswordManageCallback
{
override
fun
onPasswordGet
(
password
:
String
?)
{
password
?.
let
{
checkPasswordAndDoNext
(
it
,
inputPassword
)
}
}
...
...
@@ -98,6 +98,11 @@ class AuthorizePasswordInputDialog() : DialogFragment(), View.OnClickListener {
if
(!
accountPassword
.
equals
(
password
))
{
viewBinding
.
tvError
.
visibility
=
View
.
VISIBLE
}
else
{
if
(
null
!=
callback
){
callback
!!
.
onAuthorizedFinished
(
true
)
dismissAllowingStateLoss
()
return
}
RefundActivity
.
start
(
context
as
BaseActivity
)
dismissAllowingStateLoss
()
}
...
...
@@ -123,4 +128,13 @@ class AuthorizePasswordInputDialog() : DialogFragment(), View.OnClickListener {
override
fun
onTextChanged
(
s
:
CharSequence
,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{}
})
}
fun
show
(
manager
:
FragmentManager
,
tag
:
String
?,
callback
:
OnAuthorizedFinishListener
)
{
this
.
callback
=
callback
super
.
show
(
manager
,
tag
)
}
interface
OnAuthorizedFinishListener
{
fun
onAuthorizedFinished
(
isSucceed
:
Boolean
)
}
}
\ 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