안 드 로 이 드 알 리 페 이 비밀번호 입력 효과 패키지
1.어떻게 사용 하면 자신의 입장 을 설정 하고 애니메이션 을 종료 할 수 있 습 니 다.설정 하지 않 으 면 애니메이션 효과 가 없고 자신 이 포장 한 후에 도 매우 유용 하 다 고 생각 합 니 다.
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();
}
2.입력 상자 의 주요 코드 는 사각형 과 중간의 원형 을 그 리 는 것 입 니 다.
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);
}
3.library 의 module 로 서 사용 하 는 속성 을 정의 할 때 특히 구분 하고 특정한 시작 을 설정 하면 자신의 프로젝트 를 도입 한 후에 충돌 을 피 할 수 있 습 니 다.bug 가 있 으 면 지적 해 주 셔 서 감사합니다.
소스 코드
이상 이 바로 본 고의 모든 내용 입 니 다.여러분 의 학습 에 도움 이 되 고 저 희 를 많이 응원 해 주 셨 으 면 좋 겠 습 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Bitrise에서 배포 어플리케이션 설정 테스트하기이 글은 Bitrise 광고 달력의 23일째 글입니다. 자체 또는 당사 등에서 Bitrise 구축 서비스를 사용합니다. 그나저나 며칠 전 Bitrise User Group Meetup #3에서 아래 슬라이드를 발표했...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.