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
acc63fce
Commit
acc63fce
authored
Dec 23, 2020
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:验证码部分UI
parent
178b2434
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
797 additions
and
60 deletions
+797
-60
RegisterAndLoginActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
+1
-1
PinField.kt
m-user/src/main/java/com/yidianling/user/widget/PinField/PinField.kt
+374
-0
SquarePinField.kt
m-user/src/main/java/com/yidianling/user/widget/PinField/SquarePinField.kt
+110
-0
user_ic_invisibility_new.webp
m-user/src/main/res/drawable-xhdpi/user_ic_invisibility_new.webp
+0
-0
user_ic_visibility_new.webp
m-user/src/main/res/drawable-xhdpi/user_ic_visibility_new.webp
+0
-0
user_login_protocol_selected_new.webp
m-user/src/main/res/drawable-xhdpi/user_login_protocol_selected_new.webp
+0
-0
user_login_protocol_unselected_new.webp
m-user/src/main/res/drawable-xhdpi/user_login_protocol_unselected_new.webp
+0
-0
login_password_able_bg_24dp.xml
m-user/src/main/res/drawable/login_password_able_bg_24dp.xml
+11
-0
login_password_unable_bg_24dp.xml
m-user/src/main/res/drawable/login_password_unable_bg_24dp.xml
+11
-0
user_activity_input_password_new.xml
m-user/src/main/res/layout/user_activity_input_password_new.xml
+104
-0
user_activity_register_and_login_bottom.xml
m-user/src/main/res/layout/user_activity_register_and_login_bottom.xml
+89
-0
user_activity_register_and_login_new.xml
m-user/src/main/res/layout/user_activity_register_and_login_new.xml
+3
-59
user_activity_verfication_code_new.xml
m-user/src/main/res/layout/user_activity_verfication_code_new.xml
+68
-0
arrays.xml
m-user/src/main/res/values/arrays.xml
+23
-0
colors.xml
m-user/src/main/res/values/colors.xml
+3
-0
No files found.
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
View file @
acc63fce
...
...
@@ -64,7 +64,7 @@ import kotlinx.android.synthetic.main.user_activity_register_and_login.*
* @Company 壹点灵
* @date 2018/11/28
*/
@Route
(
path
=
"/user/login"
)
@Route
(
path
=
"/user/login
1
"
)
class
RegisterAndLoginActivity
:
BaseMvpActivity
<
ILoginContract
.
View
,
ILoginContract
.
Presenter
>(),
ILoginContract
.
View
{
...
...
m-user/src/main/java/com/yidianling/user/widget/PinField/PinField.kt
0 → 100644
View file @
acc63fce
package
com.yidianling.user.widget.PinField
import
`in`.srain.cube.util.LocalDisplay.dp2px
import
android.content.Context
import
android.graphics.Canvas
import
android.graphics.Color
import
android.graphics.Paint
import
android.support.v4.content.ContextCompat
import
android.support.v7.widget.AppCompatEditText
import
android.text.InputFilter
import
android.text.method.PasswordTransformationMethod
import
android.text.method.TransformationMethod
import
android.util.AttributeSet
import
android.view.inputmethod.EditorInfo
import
android.view.inputmethod.InputMethodManager
import
com.yidianling.user.R
/**
* Created by poovam-5255 on 3/3/2018.
* View where all the magic happens
*/
open
class
PinField
:
AppCompatEditText
{
private
val
defaultWidth
=
dp2px
(
60f
)
companion
object
{
const
val
DEFAULT_DISTANCE_IN_BETWEEN
=
-
1f
}
protected
var
distanceInBetween
:
Float
=
DEFAULT_DISTANCE_IN_BETWEEN
set
(
value
)
{
field
=
value
requestLayout
()
invalidate
()
}
var
numberOfFields
=
4
set
(
value
)
{
field
=
value
limitCharsToNoOfFields
()
invalidate
()
}
protected
var
singleFieldWidth
=
0
var
lineThickness
=
dp2px
(
1.0f
)
set
(
value
)
{
field
=
value
fieldPaint
.
strokeWidth
=
field
.
toFloat
()
highlightPaint
.
strokeWidth
=
highLightThickness
.
toFloat
()
invalidate
()
}
var
fieldColor
=
ContextCompat
.
getColor
(
context
,
R
.
color
.
user_inactivePinFieldColor
)
set
(
value
)
{
field
=
value
fieldPaint
.
color
=
field
invalidate
()
}
var
highlightPaintColor
=
ContextCompat
.
getColor
(
context
,
R
.
color
.
user_pinFieldLibraryAccent
)
set
(
value
)
{
field
=
value
highlightPaint
.
color
=
field
invalidate
()
}
var
isCursorEnabled
=
false
set
(
value
)
{
field
=
value
invalidate
()
}
protected
var
fieldPaint
=
Paint
()
protected
var
textPaint
=
Paint
()
protected
var
hintPaint
=
Paint
()
protected
var
highlightPaint
=
Paint
()
protected
var
yPadding
=
dp2px
(
10f
)
protected
var
highlightSingleFieldType
=
HighlightType
.
ALL_FIELDS
private
var
lastCursorChangeState
:
Long
=
-
1
private
var
cursorCurrentVisible
=
true
private
val
cursorTimeout
=
500L
var
isCustomBackground
=
false
set
(
value
)
{
if
(!
value
)
{
setBackgroundResource
(
R
.
color
.
user_pinFieldLibraryTransparent
)
}
field
=
value
}
var
highLightThickness
=
lineThickness
get
()
{
return
(
lineThickness
+
lineThickness
*
0.7f
).
toInt
()
}
var
onTextCompleteListener
:
OnTextCompleteListener
?
=
null
var
fieldBgColor
=
ContextCompat
.
getColor
(
context
,
R
.
color
.
user_pinFieldLibraryAccent
)
set
(
value
)
{
field
=
value
fieldBgPaint
.
color
=
fieldBgColor
invalidate
()
}
var
fieldBgPaint
=
Paint
()
init
{
limitCharsToNoOfFields
()
setWillNotDraw
(
false
)
maxLines
=
1
setSingleLine
(
true
)
fieldPaint
.
color
=
fieldColor
fieldPaint
.
isAntiAlias
=
true
fieldPaint
.
style
=
Paint
.
Style
.
STROKE
fieldPaint
.
strokeWidth
=
lineThickness
.
toFloat
()
textPaint
.
color
=
currentTextColor
textPaint
.
isAntiAlias
=
true
textPaint
.
textSize
=
textSize
textPaint
.
textAlign
=
Paint
.
Align
.
CENTER
textPaint
.
style
=
Paint
.
Style
.
FILL
hintPaint
.
color
=
hintTextColors
.
defaultColor
hintPaint
.
isAntiAlias
=
true
hintPaint
.
textSize
=
textSize
hintPaint
.
textAlign
=
Paint
.
Align
.
CENTER
hintPaint
.
style
=
Paint
.
Style
.
FILL
highlightPaint
=
Paint
(
fieldPaint
)
highlightPaint
.
color
=
highlightPaintColor
highlightPaint
.
strokeWidth
=
highLightThickness
.
toFloat
()
fieldBgColor
=
Color
.
TRANSPARENT
fieldBgPaint
.
style
=
Paint
.
Style
.
FILL
}
constructor
(
context
:
Context
)
:
super
(
context
)
constructor
(
context
:
Context
,
attr
:
AttributeSet
)
:
super
(
context
,
attr
)
{
initParams
(
attr
)
}
constructor
(
context
:
Context
,
attr
:
AttributeSet
,
defStyle
:
Int
)
:
super
(
context
,
attr
,
defStyle
)
{
initParams
(
attr
)
}
private
fun
initParams
(
attr
:
AttributeSet
)
{
val
a
=
context
.
theme
.
obtainStyledAttributes
(
attr
,
R
.
styleable
.
User_PinField
,
0
,
0
)
try
{
numberOfFields
=
a
.
getInt
(
R
.
styleable
.
User_PinField_User_noOfFields
,
numberOfFields
)
lineThickness
=
a
.
getDimension
(
R
.
styleable
.
User_PinField_User_lineThickness
,
lineThickness
.
toFloat
()).
toInt
()
distanceInBetween
=
a
.
getDimension
(
R
.
styleable
.
User_PinField_User_distanceInBetween
,
DEFAULT_DISTANCE_IN_BETWEEN
)
fieldColor
=
a
.
getColor
(
R
.
styleable
.
User_PinField_User_fieldColor
,
fieldColor
)
highlightPaintColor
=
a
.
getColor
(
R
.
styleable
.
User_PinField_User_highlightColor
,
highlightPaintColor
)
isCustomBackground
=
a
.
getBoolean
(
R
.
styleable
.
User_PinField_User_isCustomBackground
,
false
)
isCursorEnabled
=
a
.
getBoolean
(
R
.
styleable
.
User_PinField_User_isCursorEnabled
,
false
)
highlightSingleFieldType
=
if
(
a
.
getBoolean
(
R
.
styleable
.
User_PinField_User_highlightEnabled
,
true
)
)
HighlightType
.
ALL_FIELDS
else
HighlightType
.
NO_FIELDS
highlightSingleFieldType
=
if
(
a
.
getBoolean
(
R
.
styleable
.
User_PinField_User_highlightSingleFieldMode
,
false
)
)
HighlightType
.
CURRENT_FIELD
else
HighlightType
.
ALL_FIELDS
highlightSingleFieldType
=
HighlightType
.
getEnum
(
a
.
getInt
(
R
.
styleable
.
User_PinField_User_highlightType
,
highlightSingleFieldType
.
code
)
)
fieldBgColor
=
a
.
getColor
(
R
.
styleable
.
User_PinField_User_fieldBgColor
,
fieldBgColor
)
textPaint
.
typeface
=
typeface
}
finally
{
a
.
recycle
()
}
}
override
fun
onMeasure
(
widthMeasureSpec
:
Int
,
heightMeasureSpec
:
Int
)
{
val
width
=
getViewWidth
(
defaultWidth
*
numberOfFields
,
widthMeasureSpec
)
singleFieldWidth
=
width
/
numberOfFields
setMeasuredDimension
(
width
,
getViewHeight
(
singleFieldWidth
,
heightMeasureSpec
))
}
protected
open
fun
getViewWidth
(
desiredWidth
:
Int
,
widthMeasureSpec
:
Int
):
Int
{
val
widthMode
=
MeasureSpec
.
getMode
(
widthMeasureSpec
)
val
widthSize
=
MeasureSpec
.
getSize
(
widthMeasureSpec
)
//Measure Width
return
when
(
widthMode
)
{
MeasureSpec
.
EXACTLY
->
widthSize
MeasureSpec
.
AT_MOST
->
Math
.
min
(
desiredWidth
,
widthSize
)
MeasureSpec
.
UNSPECIFIED
->
desiredWidth
else
->
desiredWidth
}
}
protected
open
fun
getViewHeight
(
desiredHeight
:
Int
,
heightMeasureSpec
:
Int
):
Int
{
val
heightMode
=
MeasureSpec
.
getMode
(
heightMeasureSpec
)
val
heightSize
=
MeasureSpec
.
getSize
(
heightMeasureSpec
)
//Measure Height
return
when
(
heightMode
)
{
MeasureSpec
.
EXACTLY
->
heightSize
MeasureSpec
.
AT_MOST
->
Math
.
min
(
desiredHeight
,
heightSize
)
MeasureSpec
.
UNSPECIFIED
->
desiredHeight
else
->
desiredHeight
}
}
override
fun
onSelectionChanged
(
selStart
:
Int
,
selEnd
:
Int
)
{
this
.
setSelection
(
this
.
text
!!
.
length
)
}
final
override
fun
setWillNotDraw
(
willNotDraw
:
Boolean
)
{
super
.
setWillNotDraw
(
willNotDraw
)
}
override
fun
onCheckIsTextEditor
():
Boolean
{
return
true
}
protected
open
fun
getDefaultDistanceInBetween
():
Float
{
return
(
singleFieldWidth
/
(
numberOfFields
-
1
)).
toFloat
()
}
private
fun
limitCharsToNoOfFields
()
{
val
filterArray
=
arrayOfNulls
<
InputFilter
>(
1
)
filterArray
[
0
]
=
InputFilter
.
LengthFilter
(
numberOfFields
)
filters
=
filterArray
}
override
fun
onTextChanged
(
text
:
CharSequence
?,
start
:
Int
,
lengthBefore
:
Int
,
lengthAfter
:
Int
)
{
super
.
onTextChanged
(
text
,
start
,
lengthBefore
,
lengthAfter
)
if
(
text
!=
null
&&
text
.
length
==
numberOfFields
)
{
val
shouldCloseKeyboard
=
onTextCompleteListener
?.
onTextComplete
(
text
.
toString
())
?:
false
if
(
shouldCloseKeyboard
)
{
val
imm
=
context
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
imm
.
hideSoftInputFromWindow
(
windowToken
,
0
)
}
}
}
protected
fun
shouldDrawHint
():
Boolean
{
return
(
text
!!
.
isEmpty
()
||
text
!!
.
isBlank
())
&&
!
isFocused
&&
(
hint
!=
null
&&
hint
.
isNotBlank
()
&&
hint
.
isNotEmpty
())
}
protected
fun
drawCursor
(
canvas
:
Canvas
?,
x
:
Float
,
y1
:
Float
,
y2
:
Float
,
paint
:
Paint
)
{
if
(
System
.
currentTimeMillis
()
-
lastCursorChangeState
>
500
)
{
cursorCurrentVisible
=
!
cursorCurrentVisible
lastCursorChangeState
=
System
.
currentTimeMillis
()
}
if
(
cursorCurrentVisible
)
{
canvas
?.
drawLine
(
x
,
y1
,
x
,
y2
,
paint
)
}
postInvalidateDelayed
(
cursorTimeout
)
}
final
override
fun
setBackgroundResource
(
resId
:
Int
)
{
super
.
setBackgroundResource
(
resId
)
}
protected
fun
highlightNextField
():
Boolean
{
return
highlightSingleFieldType
==
HighlightType
.
CURRENT_FIELD
}
protected
fun
highlightCompletedFields
():
Boolean
{
return
highlightSingleFieldType
==
HighlightType
.
COMPLETED_FIELDS
}
protected
fun
highlightAllFields
():
Boolean
{
return
highlightSingleFieldType
==
HighlightType
.
ALL_FIELDS
}
protected
fun
highlightNoFields
():
Boolean
{
return
highlightSingleFieldType
==
HighlightType
.
NO_FIELDS
}
protected
fun
highlightLogic
(
currentPosition
:
Int
,
textLength
:
Int
?,
onHighlight
:
()
->
Unit
)
{
if
(
hasFocus
()
&&
!
highlightNoFields
())
{
when
{
highlightNextField
()
&&
currentPosition
==
textLength
?:
0
->
{
onHighlight
.
invoke
()
}
highlightCompletedFields
()
&&
currentPosition
<
textLength
?:
0
->
{
onHighlight
.
invoke
()
}
}
}
}
//There is a issue where android transformation method is not set to password so as a work around
//the transformation method used is hardcoded
//the check condition used in isPassword() is taken from TextView.java constructor
protected
fun
getCharAt
(
i
:
Int
):
Char
?
{
return
getPinFieldTransformation
().
getTransformation
(
text
,
this
)
?.
getOrNull
(
i
)
?:
text
?.
getOrNull
(
i
)
}
private
fun
getPinFieldTransformation
():
TransformationMethod
{
if
(
isPassword
())
{
return
PasswordTransformationMethod
.
getInstance
()
}
return
transformationMethod
}
private
fun
isPassword
():
Boolean
{
val
variation
=
inputType
and
(
EditorInfo
.
TYPE_MASK_CLASS
or
EditorInfo
.
TYPE_MASK_VARIATION
)
val
passwordInputType
=
(
variation
==
EditorInfo
.
TYPE_CLASS_TEXT
or
EditorInfo
.
TYPE_TEXT_VARIATION_PASSWORD
)
val
webPasswordInputType
=
(
variation
==
EditorInfo
.
TYPE_CLASS_TEXT
or
EditorInfo
.
TYPE_TEXT_VARIATION_WEB_PASSWORD
)
val
numberPasswordInputType
=
(
variation
==
EditorInfo
.
TYPE_CLASS_NUMBER
or
EditorInfo
.
TYPE_NUMBER_VARIATION_PASSWORD
)
return
passwordInputType
||
webPasswordInputType
||
numberPasswordInputType
}
interface
OnTextCompleteListener
{
/**
* @return return true if keyboard should be closed after text is entered
*/
fun
onTextComplete
(
enteredText
:
String
):
Boolean
}
}
enum
class
HighlightType
(
val
code
:
Int
)
{
ALL_FIELDS
(
0
),
CURRENT_FIELD
(
1
),
COMPLETED_FIELDS
(
2
),
NO_FIELDS
(
3
);
companion
object
{
fun
getEnum
(
code
:
Int
):
HighlightType
{
for
(
type
in
HighlightType
.
values
())
{
if
(
type
.
code
==
code
)
{
return
type
}
}
return
ALL_FIELDS
}
}
}
\ No newline at end of file
m-user/src/main/java/com/yidianling/user/widget/PinField/SquarePinField.kt
0 → 100644
View file @
acc63fce
package
com.yidianling.user.widget.PinField
/**
* @author huozhiliang
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2020/12/23
*/
import
`in`.srain.cube.util.LocalDisplay.dp2px
import
android.content.Context
import
android.graphics.Canvas
import
android.graphics.Paint
import
android.os.Build
import
android.util.AttributeSet
import
com.yidianling.user.R
/**
* Created by poovam-5255 on 5/23/2018.
*
* Pin field represented with squares
*/
class
SquarePinField
:
PinField
{
private
var
cornerRadius
=
0f
set
(
value
)
{
field
=
value
invalidate
()
}
private
val
cursorPadding
=
dp2px
(
5f
)
constructor
(
context
:
Context
):
super
(
context
)
constructor
(
context
:
Context
,
attr
:
AttributeSet
)
:
super
(
context
,
attr
){
initParams
(
attr
)
}
constructor
(
context
:
Context
,
attr
:
AttributeSet
,
defStyle
:
Int
)
:
super
(
context
,
attr
,
defStyle
){
initParams
(
attr
)
}
private
fun
initParams
(
attr
:
AttributeSet
){
val
a
=
context
.
theme
.
obtainStyledAttributes
(
attr
,
R
.
styleable
.
user_SquarePinField
,
0
,
0
)
try
{
cornerRadius
=
a
.
getDimension
(
R
.
styleable
.
user_SquarePinField_user_cornerRadius
,
cornerRadius
)
}
finally
{
a
.
recycle
()
}
}
override
fun
onDraw
(
canvas
:
Canvas
?)
{
for
(
i
in
0
until
numberOfFields
){
val
x1
=
(
i
*
singleFieldWidth
)
val
padding
=
(
if
(
distanceInBetween
!=
DEFAULT_DISTANCE_IN_BETWEEN
)
distanceInBetween
else
getDefaultDistanceInBetween
())/
2
val
paddedX1
=
(
x1
+
padding
)
val
paddedX2
=
((
x1
+
singleFieldWidth
)-
padding
)
val
squareHeight
=
paddedX2
-
paddedX1
val
paddedY1
=
(
height
/
2
)-(
squareHeight
/
2
)
val
paddedY2
=
(
height
/
2
)+(
squareHeight
/
2
)
val
textX
=
((
paddedX2
-
paddedX1
)/
2
)+
paddedX1
val
textY
=
((
paddedY2
-
paddedY1
)/
2
+
paddedY1
)+
lineThickness
+(
textPaint
.
textSize
/
4
)
val
character
:
Char
?
=
getCharAt
(
i
)
drawRect
(
canvas
,
paddedX1
,
paddedY1
,
paddedX2
,
paddedY2
,
fieldBgPaint
)
if
(
highlightAllFields
()
&&
hasFocus
()){
drawRect
(
canvas
,
paddedX1
,
paddedY1
,
paddedX2
,
paddedY2
,
highlightPaint
)
}
else
{
drawRect
(
canvas
,
paddedX1
,
paddedY1
,
paddedX2
,
paddedY2
,
fieldPaint
)
}
if
(
character
!=
null
)
{
canvas
?.
drawText
(
character
.
toString
(),
textX
,
textY
,
textPaint
)
}
if
(
shouldDrawHint
()){
val
hintChar
=
hint
.
getOrNull
(
i
)
if
(
hintChar
!=
null
){
canvas
?.
drawText
(
hintChar
.
toString
(),
textX
,
textY
,
hintPaint
)
}
}
if
(
hasFocus
()
&&
i
==
text
?.
length
?:
0
){
if
(
isCursorEnabled
){
val
cursorPadding
=
cursorPadding
+
highLightThickness
val
cursorY1
=
paddedY1
+
cursorPadding
val
cursorY2
=
paddedY2
-
cursorPadding
drawCursor
(
canvas
,
textX
,
cursorY1
,
cursorY2
,
highlightPaint
)
}
}
highlightLogic
(
i
,
text
?.
length
){
drawRect
(
canvas
,
paddedX1
,
paddedY1
,
paddedX2
,
paddedY2
,
highlightPaint
)
}
}
}
private
fun
drawRect
(
canvas
:
Canvas
?,
paddedX1
:
Float
,
paddedY1
:
Float
,
paddedX2
:
Float
,
paddedY2
:
Float
,
paint
:
Paint
){
if
(
cornerRadius
>
0
&&
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
){
canvas
?.
drawRoundRect
(
paddedX1
,
paddedY1
,
paddedX2
,
paddedY2
,
cornerRadius
,
cornerRadius
,
paint
)
}
else
{
canvas
?.
drawRect
(
paddedX1
,
paddedY1
,
paddedX2
,
paddedY2
,
paint
)
}
}
}
\ No newline at end of file
m-user/src/main/res/drawable-xhdpi/user_ic_invisibility_new.webp
0 → 100644
View file @
acc63fce
File added
m-user/src/main/res/drawable-xhdpi/user_ic_visibility_new.webp
0 → 100644
View file @
acc63fce
File added
m-user/src/main/res/drawable-xhdpi/user_login_protocol_selected_new.webp
0 → 100644
View file @
acc63fce
File added
m-user/src/main/res/drawable-xhdpi/user_login_protocol_unselected_new.webp
0 → 100644
View file @
acc63fce
File added
m-user/src/main/res/drawable/login_password_able_bg_24dp.xml
0 → 100644
View file @
acc63fce
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<gradient
android:startColor=
"#1da1f2"
android:endColor=
"#1da1f2"
android:angle=
"90"
/>
<corners
android:radius=
"@dimen/platform_dp_24"
/>
</shape>
\ No newline at end of file
m-user/src/main/res/drawable/login_password_unable_bg_24dp.xml
0 → 100644
View file @
acc63fce
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<gradient
android:startColor=
"#a5dafa"
android:endColor=
"#a5dafa"
android:angle=
"90"
/>
<corners
android:radius=
"@dimen/platform_dp_24"
/>
</shape>
\ No newline at end of file
m-user/src/main/res/layout/user_activity_input_password_new.xml
0 → 100644
View file @
acc63fce
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<ImageView
android:id=
"@+id/img_reg_back"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/platform_dp_16"
android:layout_marginTop=
"@dimen/platform_dp_20"
android:src=
"@drawable/user_ic_back_black"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_login_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_40"
android:text=
"密码登录"
android:textColor=
"@color/pay_color_242424"
android:textSize=
"22sp"
app:layout_constraintLeft_toRightOf=
"@id/img_reg_back"
app:layout_constraintTop_toBottomOf=
"@id/img_reg_back"
/>
<EditText
android:id=
"@+id/et_input_password"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
app:layout_constraintTop_toBottomOf=
"@id/tv_login_title"
android:layout_marginTop=
"100dp"
app:layout_constraintLeft_toLeftOf=
"@id/tv_login_title"
android:layout_weight=
"1"
android:background=
"@null"
android:digits=
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
android:hint=
"输入密码"
android:lines=
"1"
android:maxLines=
"16"
android:textColorHint=
"@color/platform_color_BFBFBF"
android:textSize=
"20sp"
/>
<View
android:id=
"@+id/view_lin"
android:layout_width=
"0dp"
android:layout_height=
"1dp"
android:layout_marginTop=
"@dimen/platform_dp_10"
android:layout_marginEnd=
"@dimen/platform_dp_40"
android:background=
"@color/platform_color_EBEBEB"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"@id/tv_login_title"
app:layout_constraintTop_toBottomOf=
"@id/et_input_password"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/user_ic_invisibility_new"
app:layout_constraintTop_toTopOf=
"@id/et_input_password"
app:layout_constraintBottom_toBottomOf=
"@id/et_input_password"
app:layout_constraintEnd_toEndOf=
"@id/view_lin"
android:id=
"@+id/iv_visibility"
>
</ImageView>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"验证码登录"
android:textColor=
"@color/platform_color_666666"
android:textSize=
"13sp"
app:layout_constraintTop_toBottomOf=
"@id/view_lin"
app:layout_constraintStart_toStartOf=
"@id/view_lin"
android:layout_marginTop=
"@dimen/platform_dp_15"
android:id=
"@+id/tv_msm_login"
>
</TextView>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"忘记密码?"
app:layout_constraintEnd_toEndOf=
"@id/view_lin"
app:layout_constraintTop_toTopOf=
"@id/tv_msm_login"
app:layout_constraintBottom_toBottomOf=
"@id/tv_msm_login"
android:id=
"@+id/tv_forget"
>
</TextView>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:textColor=
"@color/white"
android:text=
"登录"
android:textSize=
"15sp"
android:id=
"@+id/login_password"
android:background=
"@drawable/login_password_unable_bg_24dp"
android:paddingTop=
"@dimen/platform_dp_14"
android:paddingBottom=
"@dimen/platform_dp_14"
app:layout_constraintTop_toBottomOf=
"@id/tv_msm_login"
app:layout_constraintStart_toStartOf=
"@id/tv_msm_login"
app:layout_constraintEnd_toEndOf=
"@id/tv_forget"
android:layout_marginTop=
"@dimen/platform_dp_40"
/>
<include
layout=
"@layout/user_activity_register_and_login_bottom"
/>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
m-user/src/main/res/layout/user_activity_register_and_login_bottom.xml
0 → 100644
View file @
acc63fce
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:android=
"http://schemas.android.com/apk/res/android"
tools:showIn=
"@layout/user_activity_register_and_login_new"
>
<LinearLayout
android:id=
"@+id/other_login_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"187dp"
android:gravity=
"center"
android:orientation=
"horizontal"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
>
<View
android:layout_width=
"@dimen/platform_dp_60"
android:layout_height=
"@dimen/platform_dp_1"
android:background=
"@color/platform_color_EBEBEB"
>
</View>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/platform_dp_16"
android:layout_marginRight=
"@dimen/platform_dp_16"
android:text=
"第三方登录"
android:textColor=
"@color/platform_color_BFBFBF"
android:textSize=
"13sp"
/>
<View
android:layout_width=
"@dimen/platform_dp_60"
android:layout_height=
"@dimen/platform_dp_1"
android:background=
"@color/platform_color_EBEBEB"
>
</View>
</LinearLayout>
<LinearLayout
android:id=
"@+id/other_login_ll"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_20"
android:orientation=
"horizontal"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/other_login_style"
>
<ImageView
android:id=
"@+id/login_wechat"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/platform_dp_35"
android:src=
"@drawable/user_login_wechat_new"
/>
<ImageView
android:id=
"@+id/login_qq"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/user_login_qq_new"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_30"
android:gravity=
"center"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/other_login_ll"
>
<ImageView
android:id=
"@+id/iv_select_protocol"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/user_login_protocol_unselected_new"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/platform_dp_4"
android:textSize=
"12sp"
android:text=
"同意壹点灵用户注册协议"
/>
</LinearLayout>
</merge>
\ No newline at end of file
m-user/src/main/res/layout/user_activity_register_and_login_new.xml
View file @
acc63fce
...
...
@@ -24,7 +24,7 @@
android:textColor=
"@color/pay_color_242424"
android:textSize=
"22sp"
app:layout_constraintLeft_toRightOf=
"@id/img_reg_back"
app:layout_constraintTop_to
Top
Of=
"@id/img_reg_back"
/>
app:layout_constraintTop_to
Bottom
Of=
"@id/img_reg_back"
/>
<TextView
android:id=
"@+id/country_code"
...
...
@@ -70,63 +70,6 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/country_code"
/>
<LinearLayout
android:id=
"@+id/other_login_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"187dp"
android:gravity=
"center"
android:orientation=
"horizontal"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
>
<View
android:layout_width=
"@dimen/platform_dp_60"
android:layout_height=
"@dimen/platform_dp_1"
android:background=
"@color/platform_color_EBEBEB"
>
</View>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/platform_dp_16"
android:layout_marginRight=
"@dimen/platform_dp_16"
android:text=
"第三方登录"
android:textColor=
"@color/platform_color_BFBFBF"
android:textSize=
"13sp"
/>
<View
android:layout_width=
"@dimen/platform_dp_60"
android:layout_height=
"@dimen/platform_dp_1"
android:background=
"@color/platform_color_EBEBEB"
>
</View>
</LinearLayout>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_20"
android:orientation=
"horizontal"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/other_login_style"
>
<ImageView
android:id=
"@+id/login_wechat"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/platform_dp_35"
android:src=
"@drawable/user_login_wechat_new"
/>
<ImageView
android:id=
"@+id/login_qq"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/user_login_qq_new"
/>
</LinearLayout>
<include
layout=
"@layout/user_activity_register_and_login_bottom"
/>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
m-user/src/main/res/layout/user_activity_verfication_code_new.xml
0 → 100644
View file @
acc63fce
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
>
<ImageView
android:id=
"@+id/img_reg_back"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/platform_dp_16"
android:layout_marginTop=
"@dimen/platform_dp_20"
android:src=
"@drawable/user_ic_back_black"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_login_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_40"
android:text=
"输入短信验证码"
android:textColor=
"@color/pay_color_242424"
android:textSize=
"22sp"
app:layout_constraintLeft_toRightOf=
"@id/img_reg_back"
app:layout_constraintTop_toBottomOf=
"@id/img_reg_back"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"已发送至+86 137 7759 3333"
app:layout_constraintTop_toBottomOf=
"@id/tv_login_title"
android:layout_marginTop=
"@dimen/platform_dp_5"
app:layout_constraintStart_toStartOf=
"@id/tv_login_title"
android:id=
"@+id/tv_phone"
>
</TextView>
<TextView
android:id=
"@+id/tv_countdown_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/pay_color_999999"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_phone"
app:layout_constraintBottom_toBottomOf=
"@id/tv_phone"
android:layout_marginEnd=
"@dimen/platform_dp_40"
android:textSize=
"13sp"
tools:text=
"发送验证码"
tools:visibility=
"visible"
/>
<com.yidianling.user.widget.PinField.SquarePinField
android:id=
"@+id/verify_code"
android:cursorVisible=
"true"
app:highlightType=
"currentField"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toBottomOf=
"@id/tv_phone"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
android:layout_marginStart=
"@dimen/platform_dp_40"
android:layout_marginEnd=
"@dimen/platform_dp_40"
android:layout_marginTop=
"67dp"
app:cornerRadius=
"8dp"
app:noOfFields=
"4"
android:inputType=
"number"
>
</com.yidianling.user.widget.PinField.SquarePinField>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
m-user/src/main/res/values/arrays.xml
View file @
acc63fce
...
...
@@ -3,4 +3,26 @@
<integer-array
name=
"user_colors"
>
<item>
@color/platform_main_theme
</item>
</integer-array>
<declare-styleable
name=
"User_PinField"
>
<attr
name=
"User_noOfFields"
format=
"integer"
/>
<attr
name=
"User_distanceInBetween"
format=
"dimension"
/>
<attr
name=
"User_lineThickness"
format=
"dimension"
/>
<attr
name=
"User_fieldColor"
format=
"color"
/>
<attr
name=
"User_highlightColor"
format=
"color"
/>
<attr
name=
"User_highlightEnabled"
format=
"boolean"
/>
<attr
name=
"User_isCustomBackground"
format=
"boolean"
/>
<attr
name=
"User_isCursorEnabled"
format=
"boolean"
/>
<!--Single Field Mode is deprecated use highlight type to define how to highlight the fields-->
<attr
name=
"User_highlightSingleFieldMode"
format=
"boolean"
/>
<attr
name=
"User_highlightType"
format=
"enum"
>
<enum
name=
"allFields"
value=
"0"
/>
<enum
name=
"currentField"
value=
"1"
/>
<enum
name=
"completedFields"
value=
"2"
/>
<enum
name=
"noFields"
value=
"3"
/>
</attr>
<attr
name=
"User_fieldBgColor"
format=
"color"
/>
</declare-styleable>
<declare-styleable
name=
"user_SquarePinField"
>
<attr
name=
"user_cornerRadius"
format=
"dimension"
/>
</declare-styleable>
</resources>
\ No newline at end of file
m-user/src/main/res/values/colors.xml
View file @
acc63fce
...
...
@@ -22,4 +22,7 @@
<!--动态-->
<!--动态顶部title背景变色-->
<color
name=
"user_with_status_fail"
>
#fcff6600
</color>
<color
name=
"user_pinFieldLibraryAccent"
>
#1da1f2
</color>
<color
name=
"user_inactivePinFieldColor"
>
#ebebeb
</color>
<color
name=
"user_pinFieldLibraryTransparent"
>
#00000000
</color>
</resources>
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