Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
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
杨凯
YDL-Component-Medical
Commits
5cd173af
Commit
5cd173af
authored
Feb 07, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat : 身份证输入最后文字动态效果完成
parent
5a297706
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
MedicalAddNewArchivesActivity.kt
m-im/src/main/java/com/yidianling/medical/archives/MedicalAddNewArchivesActivity.kt
+59
-0
No files found.
m-im/src/main/java/com/yidianling/medical/archives/MedicalAddNewArchivesActivity.kt
View file @
5cd173af
...
...
@@ -3,6 +3,14 @@ package com.yidianling.medical.archives
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Intent
import
android.os.Handler
import
android.os.Looper
import
android.os.Message
import
android.text.Editable
import
android.text.SpannableString
import
android.text.Spanned
import
android.text.TextWatcher
import
android.text.style.AbsoluteSizeSpan
import
android.view.*
import
com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.utils.StatusBarUtils
...
...
@@ -14,6 +22,7 @@ import com.yidianling.uikit.custom.http.ServiceImpl
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
kotlinx.android.synthetic.main.medical_add_new_archives_activity.*
import
kotlin.concurrent.thread
/**
...
...
@@ -25,6 +34,9 @@ class MedicalAddNewArchivesActivity : BaseActivity() {
companion
object
{
var
mMarried
=
-
1
var
mRelation
=
-
1
//之前输入内容长度
var
oldLength
=
0
;
private
val
AUTOSIZE
=
1027
;
@JvmStatic
fun
start
(
context
:
Context
)
{
...
...
@@ -32,6 +44,23 @@ class MedicalAddNewArchivesActivity : BaseActivity() {
context
.
startActivity
(
starter
)
}
}
private
val
mHandler
:
Handler
=
object
:
Handler
(
Looper
.
getMainLooper
()){
override
fun
handleMessage
(
msg
:
Message
?)
{
super
.
handleMessage
(
msg
)
if
(
msg
?.
what
==
AUTOSIZE
){
val
msp
=
SpannableString
(
et_idcard
.
text
.
toString
())
msp
.
setSpan
(
AbsoluteSizeSpan
(
16
,
true
),
0
,
et_idcard
.
text
.
length
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
et_idcard
.
setText
(
msp
)
et_idcard
.
setSelection
(
et_idcard
.
text
.
length
)
}
}
}
override
fun
layoutResId
():
Int
{
return
R
.
layout
.
medical_add_new_archives_activity
...
...
@@ -108,6 +137,36 @@ class MedicalAddNewArchivesActivity : BaseActivity() {
EditTextUtils
.
disableCopyAndPaste
(
et_name
)
et_idcard
.
addTextChangedListener
(
object
:
TextWatcher
{
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{
}
override
fun
onTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{
}
override
fun
afterTextChanged
(
s
:
Editable
?)
{
var
sLength
=
s
.
toString
().
length
;
if
(
sLength
!=
oldLength
){
val
msp
=
SpannableString
(
s
.
toString
())
msp
.
setSpan
(
AbsoluteSizeSpan
(
18
,
true
),
Math
.
max
(
s
.
toString
().
length
-
1
,
0
),
s
.
toString
().
length
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
oldLength
=
sLength
;
et_idcard
.
setText
(
msp
)
et_idcard
.
setSelection
(
sLength
)
var
message
=
Message
()
message
.
what
=
AUTOSIZE
;
mHandler
.
sendMessageDelayed
(
message
,
1000
)
}
}
})
iv_back
.
setOnClickListener
{
finish
()
}
showDialogTip
()
...
...
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