Minitwitter Remember password function implementation
First of all, before entering this main content to say, the implementation of this function is on the basis of the Twitter landing interface operation, but this time the main task is to remember the function of the password implementation, so the landing interface is not detailed introduction.
For the results of this experiment;
1, Interface Introduction
Layout Construction: The layout is divided into three parts
(1) Background: Use linearlayout layout;
(2) Light blue section: Use relativelayout layout;
Note: Use the fillet setting corners and fill color to set solid;
(3) Input box and button: Use TextView, EditText, button;
The aivity_main.xml code is as follows:
1<TextView2Android:id= "@+id/login_user_input"3Android:layout_width= "Wrap_content"4android:layout_height= "Wrap_content"5Android:layout_alignparenttop= "true"6android:layout_margintop= "5DP"7android:text= "@string/login_label_username"8style= "@style/normaltext"/>9 Ten<style name= "Normaltext" parent= "@android: Style/textappearance" > One<item name= "Android:textcolor" > #444 </item> A<item name= "Android:textsize" >14sp</item> -</style> -<EditText theAndroid:id= "@+id/username_edit" -Android:layout_width= "Fill_parent" -android:layout_height= "Wrap_content" -android:hint= "@string/login_username_hint" +android:layout_below= "@id/login_user_input" -Android:singleline= "true" +android:inputtype= "Text"/> A<TextView atAndroid:id= "@+id/login_password_input" -Android:layout_width= "Wrap_content" -android:layout_height= "Wrap_content" -android:layout_below= "@id/username_edit" -android:layout_margintop= "3DP" -android:text= "@string/login_label_password" instyle= "@style/normaltext"/> -<EditText toAndroid:id= "@+id/password_edit" +Android:layout_width= "Fill_parent" -android:layout_height= "Wrap_content" theandroid:layout_below= "@id/login_password_input" *Android:password= "true" $Android:singleline= "true"Panax NotoginsengAndroid:inputtype= "Textpassword" -/> the<Button +Android:id= "@+id/signin_button" AAndroid:layout_width= "Wrap_content" theandroid:layout_height= "Wrap_content" +android:layout_below= "@id/password_edit" -android:layout_alignright= "@id/password_edit" $android:text= "@string/login_label_signin" $android:background= "@drawable/blue_button" -/>
Activity_main.xml
2, remember the password function implementation
Reminder: The implementation of this feature mainly uses sharedpreferences to store passwords
The code is as follows:
Android minitwitter Remember password feature