private MyInputPwdUtil myInputPwdUtil;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myInputPwdUtil = new MyInputPwdUtil(this);
myInputPwdUtil.getMyInputDialogBuilder().setAnimStyle(R.style.dialog_anim);
//可以定制自己进入退出动画,不设置没有动画
myInputPwdUtil.setListener(new InputPwdView.InputPwdListener() {
@Override
public void hide() {
myInputPwdUtil.hide();
}
@Override
public void forgetPwd() {
Toast.makeText(MainActivity.this, "忘记密码", Toast.LENGTH_SHORT).show();
}
@Override
public void finishPwd(String pwd) {
Toast.makeText(MainActivity.this, pwd, Toast.LENGTH_SHORT).show();
}
});
}
public void show(View view){
myInputPwdUtil.show();
}
int height = getHeight();
int width = getWidth();
//画边框
RectF rect = new RectF(0, 0, width, height);
borderPaint.setColor(borderColor);
canvas.drawRoundRect(rect, borderRadius, borderRadius, borderPaint);
//画内容区域
RectF rectContent = new RectF(rect.left + defaultContentMargin, rect.top + defaultContentMargin, rect.right - defaultContentMargin, rect.bottom - defaultContentMargin);
borderPaint.setColor(getResources().getColor(R.color.myInputPwdBase_gray));
canvas.drawRoundRect(rectContent, borderRadius, borderRadius, borderPaint);
//画分割线:分割线数量比密码数少1
borderPaint.setColor(borderColor);
borderPaint.setStrokeWidth(defaultSplitLineWidth);
for (int i = 1; i < passwordLength; i++) {
float x = width * i / passwordLength;
canvas.drawLine(x, 0, x, height, borderPaint);
}
//画密码内容
float px, py = height / 2;
float halfWidth = width / passwordLength / 2;
for (int i = 0; i < textLength; i++) {
px = width * i / passwordLength + halfWidth;
canvas.drawCircle(px, py, passwordWidth, passwordPaint);
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有