Imitation iPhone password lock effect

Imitation iPhone password lock effect

Source code introduction

An iPhone-like password lock with animation effects.
Source code running screenshot

Source code snippet

  1. public   class DBSharedPreferences {
  2.       
  3. private Context context;
  4. public   static   final String _NAME = "DIARY_DB" ;
  5. public   static   final String _USERD = "_USERD" ;
  6.   
  7. public DBSharedPreferences(Context context) {
  8. this .context = context;
  9. }
  10.   
  11. // /////////////////////////////////////////////String///////////////////////////////////////////////////////  
  12. public   void putString(String key, String value) {
  13. SharedPreferences sp = context.getSharedPreferences(_NAME, 1 );
  14. Editor editor = sp.edit();
  15. editor.putString(key, value);
  16. editor.commit();
  17. }
  18.   
  19. public String getString(String key) {
  20. SharedPreferences sp = context.getSharedPreferences(_NAME, 1 );
  21. return sp.getString(key, "nothing" );
  22. }
  23.   
  24. // /////////////////////////////////////////////Integer////////////////////////////////////////////////////////  
  25. public   void putInteger(String key, int value) {
  26. SharedPreferences sp = context.getSharedPreferences(_NAME, 1 );
  27. Editor editor = sp.edit();
  28. editor.putInt(key, value);
  29. editor.commit();
  30. }
  31.   
  32. public Integer getInteger(String key) {
  33. SharedPreferences sp = context.getSharedPreferences(_NAME, 1 );
  34. return sp.getInt(key, - 1 );
  35. }
  36.   
  37. // /////////////////////////////////////////////Boolean///////////////////////////////////////////////////////  
  38. public   void putBoolean(String key, boolean value) {
  39. SharedPreferences sp = context.getSharedPreferences(_NAME, 1 );
  40. Editor editor = sp.edit();
  41. editor.putBoolean(key, value);
  42. editor.commit();
  43. }
  44.   
  45. public   boolean getBoolean(String key) {
  46. SharedPreferences sp = context.getSharedPreferences(_NAME, 1 );
  47. return sp.getBoolean(key, false );
  48. }
  49.   
  50. // /////////////////////////////////////////////Long///////////////////////////////////////////////////////  
  51. public   void putLong(String key, long value) {
  52. SharedPreferences sp = context.getSharedPreferences(_NAME, 1 );
  53. Editor editor = sp.edit();
  54. editor.putLong(key, value);
  55. editor.commit();
  56. }
  57.   
  58. public   long getLong(String key) {
  59. SharedPreferences sp = context.getSharedPreferences(_NAME, 1 );
  60. return sp.getLong(key, - 1 );
  61. }
  62.   
  63. // /////////////////////////////////////////////Float////////////////////////////////////////////////////////  
  64. public   void putFloat(String key, float value) {
  65. SharedPreferences sp = context.getSharedPreferences(_NAME, 1 );
  66. Editor editor = sp.edit();
  67. editor.putFloat(key, value);
  68. editor.commit();
  69. }
  70.   
  71. public   float getFloat(String key) {
  72. SharedPreferences sp = context.getSharedPreferences(_NAME, 1 );
  73. return sp.getFloat(key, 0 .0F);
  74. }
  75. }

Source code download: http://download..com/data/1980604

<<:  Don't step on the white block game source code

>>:  "One Piece: Journey" lead programmer Dan Bei Leng: We want to become the team of the game king

Recommend

Operational framework construction: Make 1 traffic flow more valuable than 4

Because I am good at building frameworks, my arti...

Review of the private domain traffic case of maternal and infant community!

As a private domain operator, many people are cur...

Can wool coats be washed in a washing machine? How to wash them correctly?

When winter comes, I become lazy and just want to...

Imitation mall app

Source code introduction: 1. It has the function ...

Top 10 features of Office 2016 for Mac to prepare for back to school

As teachers, students and parents prepare for sum...

Re-experience the most popular mobile phone ten years ago

In 2004, Motorola Mobility brought us the Razr V3,...

How to achieve growth at low prices? Let you know Xiaomi's business model

How to achieve growth at low prices? How to make ...

Xiaomi Air Purifier 2 unboxing photos: 699 yuan, smaller in size

When you are all paying attention to the Redmi No...

Why does bottled water expire but well/tap water doesn't?

In our impression, water has always existed on th...

TCL faces huge transformation pressure, with many executives leaving

TCL Group, which has just released its semi-annua...

Anniversary event planning

The growth of a person needs the blessing of birt...