Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
69cc81ab
Commit
69cc81ab
authored
Jun 16, 2021
by
shiyuelong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人认证人脸识别去验证按钮点击事件优化
parent
b63a9a4f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
57 deletions
+68
-57
LifeAccountFaceAuthView.kt
...henghuoquan/newscontent/widget/LifeAccountFaceAuthView.kt
+55
-50
view_life_account_face_auth.xml
...ntent/src/main/res/layout/view_life_account_face_auth.xml
+13
-7
No files found.
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/widget/LifeAccountFaceAuthView.kt
View file @
69cc81ab
...
...
@@ -4,6 +4,8 @@ import android.content.Context
import
android.graphics.Color
import
android.util.AttributeSet
import
android.view.View
import
com.yidian.common.extensions.hide
import
com.yidian.common.extensions.show
import
com.yidian.nightmode.widget.YdConstraintLayout
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.databinding.ViewLifeAccountFaceAuthBinding
...
...
@@ -28,7 +30,7 @@ class LifeAccountFaceAuthView @JvmOverloads constructor(
private
var
callback
:
OnLifeAccountFaceAuthCallback
?
=
null
init
{
viewBinding
.
i
vFaceAuthStart
.
setOnClickListener
(
this
)
viewBinding
.
t
vFaceAuthStart
.
setOnClickListener
(
this
)
}
/**
...
...
@@ -37,10 +39,11 @@ class LifeAccountFaceAuthView @JvmOverloads constructor(
*/
fun
showFaceAuthResult
(
result
:
Boolean
)
{
if
(
result
)
{
viewBinding
.
tvFaceAuthResult
.
show
()
viewBinding
.
tvFaceAuthResult
.
text
=
resources
.
getText
(
R
.
string
.
face_auth_success
)
viewBinding
.
tvFaceAuthResult
.
setTextColor
(
Color
.
parseColor
(
"#FF6BB81F"
))
viewBinding
.
ivFaceAuthStart
.
visibility
=
View
.
GONE
viewBinding
.
tvFaceAuthErrorTips
.
visibility
=
View
.
GONE
viewBinding
.
tvFaceAuthStart
.
hide
()
viewBinding
.
tvFaceAuthErrorTips
.
hide
()
}
else
{
viewBinding
.
tvFaceAuthResult
.
text
=
resources
.
getText
(
R
.
string
.
face_auth_fail
)
viewBinding
.
tvFaceAuthResult
.
setTextColor
(
Color
.
parseColor
(
"#FFFF3A3A"
))
...
...
@@ -53,14 +56,16 @@ class LifeAccountFaceAuthView @JvmOverloads constructor(
* 人脸验证结果成功UI
*/
fun
showFaceAuthSuccess
()
{
viewBinding
.
tvFaceAuthResult
.
show
()
viewBinding
.
tvFaceAuthResult
.
text
=
resources
.
getText
(
R
.
string
.
face_auth_success
)
viewBinding
.
tvFaceAuthResult
.
setTextColor
(
Color
.
parseColor
(
"#FF6BB81F"
))
viewBinding
.
ivFaceAuthStart
.
visibility
=
View
.
GONE
viewBinding
.
tvFaceAuthErrorTips
.
visibility
=
View
.
GONE
viewBinding
.
tvFaceAuthStart
.
hide
()
viewBinding
.
tvFaceAuthErrorTips
.
hide
()
}
override
fun
onClick
(
v
:
View
?)
{
if
(
v
?.
id
==
R
.
id
.
iv_face_auth_start
)
{
// 去验证
if
(
v
?.
id
==
R
.
id
.
tv_face_auth_start
)
{
callback
?.
onStartFaceAuth
()
}
}
...
...
Components/newscontent/src/main/res/layout/view_life_account_face_auth.xml
View file @
69cc81ab
...
...
@@ -23,17 +23,23 @@
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"2dp"
android:includeFontPadding=
"false"
android:text=
"@string/
start_face_auth
"
android:text=
"@string/
face_auth_fail
"
android:textColor=
"#FF1852F1"
android:textSize=
"15sp"
app:layout_constraintEnd_toStartOf=
"@id/iv_face_auth_start"
android:visibility=
"gone"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<com.yidian.nightmode.widget.YdImageView
android:id=
"@+id/iv_face_auth_start"
android:layout_width=
"23dp"
android:layout_height=
"23dp"
android:src=
"@mipmap/icon_next"
<com.yidian.nightmode.widget.YdTextView
android:id=
"@+id/tv_face_auth_start"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"@dimen/dp2"
android:drawableEnd=
"@mipmap/icon_next"
android:text=
"去验证"
android:textColor=
"#FF1852F1"
android:textSize=
"15sp"
android:visibility=
"visible"
app:layout_constraintBottom_toBottomOf=
"@id/tv_face_auth"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_face_auth"
/>
...
...
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