Commit 2b292d02 by 霍志良

feat:修改自定义验证码UIwidget

parent 533f8c46
......@@ -24,6 +24,11 @@
android:name=".ui.GetIdentifyingCodeActivity"
android:theme="@style/platform_NoTitleTheme"
android:screenOrientation="portrait" />
<activity android:name=".ui.login.testLoginActivity"
android:theme="@style/platform_NoTitleTheme"
android:screenOrientation="portrait"
>
</activity>
<activity
android:name=".ui.FillInfoActivity"
android:theme="@style/platform_NoTitleTheme"
......
......@@ -175,9 +175,9 @@ class testLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginContract.Pr
)
) {
runOnUiThread {
et_phone_number.setPhoneText(mAutCheckResult!!.simPhoneNumber)
et_phone_number.setSelection(et_phone_number.text.length)
iv_del.visibility = View.VISIBLE
// et_phone_number.setPhoneText(mAutCheckResult!!.simPhoneNumber)
// et_phone_number.setSelection(et_phone_number.text.length)
// iv_del.visibility = View.VISIBLE
}
}
}
......@@ -305,7 +305,7 @@ class testLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginContract.Pr
val privacyOnOffType = PlatformRamImpl.getInstance().getGlobalInfo()?.info?.protocol_android ?: 2
val channel = WalleChannelReader.getChannel(applicationContext)
if (channel=="huawei"){
/* if (channel=="huawei"){
iv_select_protocol.setImageResource(R.drawable.user_login_protocol_unselected)
}else if (privacyOnOffType == 2 && (channel=="vivo")){
iv_select_protocol.setImageResource(R.drawable.user_login_protocol_unselected)
......@@ -322,51 +322,8 @@ class testLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginContract.Pr
iv_select_protocol.setImageResource(R.drawable.user_login_protocol_unselected)
}
}
}
//微信登录
iv_weixin.setOnClickListener {
mPresenter.loginByThird(this, SHARE_MEDIA.WEIXIN)
}
//QQ 登录
iv_qq.setOnClickListener {
}*/
val config = UMShareConfig()
config.isNeedAuthOnGetUserInfo(true)
UMShareAPI.get(this).setShareConfig(config)
mPresenter.loginByThird(this, SHARE_MEDIA.QQ)
}
ll_country.setOnClickListener {
val intent = Intent(this, CountryListActivity::class.java)
intent.putExtra("userCountryCode", countryCode)
startActivityForResult(intent, REQUEST_CODE_COUNTRY)
overridePendingTransition(R.anim.platform_slide_in_from_bottom, R.anim.user_slide_null)
}
//下一步
iv_next.setOnClickListener {
if (iv_select_protocol.visibility == View.VISIBLE && !isAgreeProtocol) {
ToastUtil.toastShort("请您先同意壹点灵《用户使用协议》、《隐私保护政策》,才能登录使用")
return@setOnClickListener
}
if (checkPhone()) {
mPresenter.checkPhoneStatus(userPhoneNumber!!, countryCode!!, isUmengLoginState)
}
}
//手机号输入框
et_phone_number.setListener {
if (TextUtils.isEmpty(it)) {
setHint()
iv_del.visibility = View.INVISIBLE
iv_del.isEnabled = false
} else {
iv_del.visibility = View.VISIBLE
iv_del.isEnabled = true
}
}
//删除按钮
iv_del.setOnClickListener {
et_phone_number.setText("")
}
}
/**
......
......@@ -19,6 +19,10 @@ import com.yidianling.user.R
* Created by poovam-5255 on 5/23/2018.
*
* Pin field represented with squares
*
* 光标距离上下的距离目前手动改cursorY1和cursorY2后期可以改成自定义
* 需要延迟大概300ms弹出键盘才能主动获取焦点
*
*/
class SquarePinField : PinField{
......@@ -89,7 +93,11 @@ class SquarePinField : PinField{
val cursorPadding = cursorPadding + highLightThickness
val cursorY1 = paddedY1 + cursorPadding
val cursorY2 = paddedY2 - cursorPadding
drawCursor(canvas,textX,cursorY1,cursorY2,highlightPaint)
/*
* 绘制光标cursorY1是光标上方,cursorY2是光标下方
*
* */
drawCursor(canvas,textX,cursorY1+20f,cursorY2-20f,highlightPaint)
}
}
highlightLogic(i, text?.length){
......
......@@ -52,6 +52,7 @@
app:User_highlightType="currentField"
app:User_isCursorEnabled="true"
android:layout_width="0dp"
android:textSize="20sp"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tv_phone"
app:layout_constraintStart_toStartOf="parent"
......@@ -62,6 +63,7 @@
app:user_cornerRadius="8dp"
app:User_noOfFields="4"
android:inputType="number"
android:focusable="true"
>
</com.yidianling.user.widget.PinField.SquarePinField>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment