Android imitation Alipay WeChat payment password interface pop-up package dialog
1、 Functional effect
2、 Implementation process
1. First write the XML file: dialog_ keyboard.xml
matters needing attention
(1) , the password part uses six textviews in a linear layout and sets Android: inputtype = "numberpassword". The outer frame uses a shape with stroke attribute,
(2) , the numbers 1-9 are recycleview. There are 1DP black lines at the bottom and right of each item, which are filled to form a split line.
(3) , the recycleview should set the property Android: overscrollmode = "never", otherwise there will be a shadow when sliding the keyboard
(4) , three textviews in the linear layout for the three buttons at the bottom
2. Java code keyboarddialog.java
matters needing attention
(1) , encapsulated into dialog. This code should be window.requestfeature (window. Feature_no_title) before setcontentview
(2) , set the style in the construction method (detailed later)
(3) , the adapter is encapsulated and native
(4) , the storage and deletion of passwords are operation strings
(5) , the version of butterknife used is: compile 'com. Jakewarton: butterknife: 7.0.1'
(6) , set attributes. Width = screenutils. Getscreenwidth (context); The packaging method is used to obtain the width of the screen and achieve the same effect
3. Set pop-up style
(1) , set the style r.style.keyboard in the construction method_ dialog
Style code is
(2) , set the bullet frame animation style in the oncreate method
Style code is
3、 Call
The call is very simple, one line can be used, and the data needs to be added on its own
The following topics about Android on this site are recommended for your reference:
Android verification code function http://www.jb51.net/Special/899.htm
Android recyclerview Usage Summary http://www.jb51.net/Special/855.htm
Android listview common features http://www.jb51.net/Special/850.htm
Detailed usage of Android control ImageView http://www.jb51.net/Special/726.htm
Android SDK basic tutorial http://www.jb51.net/Special/637.htm
Summary of cache knowledge in Android Development http://www.jb51.net/Special/622.htm
The above is a small package for you to introduce the Android imitation Alipay WeChat payment password interface pop-up dialog package, I hope to help everyone, if you have any questions, please leave a message to me, Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!