閱讀370 返回首頁    go 阿裏雲 go 技術社區[雲棲]


鎵嬫満鍗+07-璁劇疆鍚戝-鍗氬-浜戞爾紺懼尯-闃塊噷浜?

浠婂ぉ锛屾垜浠鍋氱殑灝辨槸緇欐垜浠殑鎵嬫満闃茬洍榪欎釜鍔熻兘娣誨姞涓€涓緗悜瀵肩殑鍔熻兘鍟︼紝鎸囧鐢ㄦ埛榪涜涓€浜涜緗紝搴熻瘽涓嶅璿達紝鐩存帴涓婂浘锛岀湅鐪嬫垜浠鍋氱殑鏁堟灉

聽 聽聽


UI涓嶆槸寰堝ソ鐪嬶紝鍚勪綅鍙互鑷繁淇敼涓€涓嬪搱

濂藉暒锛屾垜浠粖澶╀富瑕佹槸鎶婅繖涓や釜鐣岄潰鍐欏嚭鏉ワ紝榪樻湁鎶婁竴浜溳€昏緫浠g爜鍐欎竴涓?/span>

鍏跺疄榪欎富瑕佸氨鏄袱涓獂ml鏂囦歡鍟?/span>

setup_guide1.xml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:andro
  3. 聽 聽 android:layout_width="match_parent"
  4. 聽 聽 android:layout_height="match_parent"
  5. 聽 聽 android:background="@drawable/title_background"
  6. 聽 聽 android:orientation="vertical" >
  7. 聽 聽聽
  8. 聽 聽 <TextView聽
  9. 聽 聽聽 聽聽聽
  10. 聽 聽聽 聽聽聽android:text="@string/guide1"/>
  11. 聽 聽聽
  12. 聽 聽 <TextView聽
  13. 聽 聽聽 聽聽聽/>
  14. 聽 聽聽
  15. 聽 聽 <TextView聽
  16. 聽 聽聽 聽聽聽
  17. 聽 聽聽 聽聽聽android:text="@string/guide1_content"/>
  18. 聽 聽聽
  19. 聽 聽 <TextView聽
  20. 聽 聽聽 聽聽聽
  21. 聽 聽聽 聽聽聽android:text="@string/guide1_item1"/>
  22. 聽 聽聽
  23. 聽 聽 <TextView聽
  24. 聽 聽聽 聽聽聽
  25. 聽 聽聽 聽聽聽android:text="@string/guide1_item2"/>
  26. 聽 聽聽
  27. 聽 聽 <TextView聽
  28. 聽 聽聽 聽聽聽
  29. 聽 聽聽 聽聽聽android:text="@string/guide1_item3"/>
  30. 聽 聽聽
  31. 聽 聽 <TextView聽
  32. 聽 聽聽 聽聽聽
  33. 聽 聽聽 聽聽聽android:text="@string/guide1_item4"/>
  34. 聽 聽聽
  35. 聽 聽 <LinearLayout聽
  36. 聽 聽聽 聽聽聽android:layout_width="match_parent"
  37. 聽 聽聽 聽聽聽android:layout_height="wrap_content"
  38. 聽 聽聽 聽聽聽android:layout_marginTop="8dip"
  39. 聽 聽聽 聽聽聽android:gravity="center_horizontal"
  40. 聽 聽聽 聽聽聽android:orientation="horizontal">
  41. 聽 聽聽 聽聽聽
  42. 聽 聽聽 聽聽聽<ImageView聽
  43. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  44. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  45. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_online"
  46. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  47. 聽 聽聽 聽聽聽
  48. 聽 聽聽 聽聽聽<ImageView聽
  49. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  50. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  51. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_invisible"
  52. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  53. 聽 聽聽 聽聽聽
  54. 聽 聽聽 聽聽聽<ImageView聽
  55. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  56. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  57. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_invisible"
  58. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  59. 聽 聽聽 聽聽聽
  60. 聽 聽聽 聽聽聽<ImageView聽
  61. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  62. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  63. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_invisible"
  64. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  65. 聽 聽聽 聽聽聽
  66. 聽 聽 </LinearLayout>
  67. 聽 聽聽
  68. 聽 聽 <RelativeLayout聽
  69. 聽 聽聽 聽聽聽android:layout_width="match_parent"
  70. 聽 聽聽 聽聽聽android:layout_height="match_parent"
  71. 聽 聽聽 聽聽聽android:gravity="center_horizontal|center_vertical">
  72. 聽 聽聽 聽聽聽
  73. 聽 聽聽 聽聽聽<LinearLayout聽
  74. 聽 聽聽 聽聽 聽聽 聽android:layout_width="match_parent"
  75. 聽 聽 聽 聽聽 聽聽 聽聽 聽android:layout_height="match_parent"
  76. 聽 聽 聽 聽聽 聽聽 聽聽 聽android:gravity="center_horizontal|center_vertical">
  77. 聽 聽 聽 聽聽 聽聽 聽聽 聽
  78. 聽 聽 聽 聽聽 聽聽 聽聽 聽<ImageView聽
  79. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:layout_width="150dip"
  80. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:layout_height="150dip"
  81. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:src="@drawable/widget01"
  82. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:contentDescription="@string/hello_world"/>
  83. 聽 聽聽 聽聽聽
  84. 聽 聽聽 聽聽聽</LinearLayout>
  85. 聽 聽聽 聽聽聽
  86. 聽 聽聽 聽聽聽<Button聽
  87. 聽 聽聽 聽聽 聽聽 聽android:
  88. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  89. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  90. 聽 聽聽 聽聽 聽聽 聽android:text="@string/next"
  91. 聽 聽聽 聽聽 聽聽 聽android:drawableRight="@drawable/next"
  92. 聽 聽聽 聽聽 聽聽 聽android:layout_alignParentBottom="true"
  93. 聽 聽聽 聽聽 聽聽 聽android:layout_alignParentRight="true"/>
  94. 聽 聽聽 聽聽聽
  95. 聽 聽 </RelativeLayout>
  96. 聽 聽聽 聽聽聽
  97. </LinearLayout>
澶嶅埗浠g爜
setup_guide2.xml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:andro
  3. 聽 聽 android:layout_width="match_parent"
  4. 聽 聽 android:layout_height="match_parent"
  5. 聽 聽 android:background="@drawable/title_background"
  6. 聽 聽 android:orientation="vertical" >
  7. 聽 聽聽
  8. 聽 聽 <TextView聽
  9. 聽 聽聽 聽聽聽
  10. 聽 聽聽 聽聽聽android:text="@string/guide2"/>
  11. 聽 聽聽
  12. 聽 聽 <TextView聽
  13. 聽 聽聽 聽聽聽/>
  14. 聽 聽聽
  15. 聽 聽 <TextView聽
  16. 聽 聽聽 聽聽聽
  17. 聽 聽聽 聽聽聽android:text="@string/guide2_content"/>
  18. 聽 聽聽
  19. 聽 聽 <LinearLayout聽
  20. 聽 聽聽 聽聽聽android:layout_width="match_parent"
  21. 聽 聽聽 聽聽聽android:layout_height="wrap_content"
  22. 聽 聽聽 聽聽聽android:orientation="horizontal">
  23. 聽 聽聽 聽聽聽
  24. 聽 聽聽 聽聽聽<Button聽
  25. 聽 聽聽 聽聽 聽聽 聽android:
  26. 聽 聽聽 聽聽 聽聽 聽android:layout_width="240dip"
  27. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  28. 聽 聽聽 聽聽 聽聽 聽android:layout_marginTop="8dip"
  29. 聽 聽聽 聽聽 聽聽 聽android:text="@string/guide2_item1"/>
  30. 聽 聽聽 聽聽聽
  31. 聽 聽聽 聽聽聽<CheckBox聽
  32. 聽 聽聽 聽聽 聽聽 聽android:
  33. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  34. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  35. 聽 聽聽 聽聽 聽聽 聽android:text="@string/guide2_item2"/>
  36. 聽 聽聽 聽聽聽
  37. 聽 聽 </LinearLayout>
  38. 聽 聽聽
  39. 聽 聽 <LinearLayout聽
  40. 聽 聽聽 聽聽聽android:layout_width="match_parent"
  41. 聽 聽聽 聽聽聽android:layout_height="wrap_content"
  42. 聽 聽聽 聽聽聽android:layout_marginTop="20dip"
  43. 聽 聽聽 聽聽聽android:gravity="center_horizontal"
  44. 聽 聽聽 聽聽聽android:orientation="horizontal">
  45. 聽 聽聽 聽聽聽
  46. 聽 聽聽 聽聽聽<ImageView聽
  47. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  48. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  49. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_invisible"
  50. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  51. 聽 聽聽 聽聽聽
  52. 聽 聽聽 聽聽聽<ImageView聽
  53. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  54. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  55. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_online"
  56. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  57. 聽 聽聽 聽聽聽
  58. 聽 聽聽 聽聽聽<ImageView聽
  59. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  60. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  61. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_invisible"
  62. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  63. 聽 聽聽 聽聽聽
  64. 聽 聽聽 聽聽聽<ImageView聽
  65. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  66. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  67. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_invisible"
  68. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  69. 聽 聽聽 聽聽聽
  70. 聽 聽 </LinearLayout>
  71. 聽 聽聽
  72. 聽 聽 <RelativeLayout聽
  73. 聽 聽聽 聽聽聽android:layout_width="match_parent"
  74. 聽 聽聽 聽聽聽android:layout_height="match_parent"
  75. 聽 聽聽 聽聽聽android:gravity="center_horizontal|center_vertical">
  76. 聽 聽聽 聽聽聽
  77. 聽 聽聽 聽聽聽<LinearLayout聽
  78. 聽 聽聽 聽聽 聽聽 聽android:layout_width="match_parent"
  79. 聽 聽 聽 聽聽 聽聽 聽聽 聽android:layout_height="match_parent"
  80. 聽 聽 聽 聽聽 聽聽 聽聽 聽android:gravity="center_horizontal|center_vertical">
  81. 聽 聽 聽 聽聽 聽聽 聽聽 聽
  82. 聽 聽 聽 聽聽 聽聽 聽聽 聽<ImageView聽
  83. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:layout_width="150dip"
  84. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:layout_height="150dip"
  85. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:src="@drawable/guide2"
  86. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:contentDescription="@string/hello_world"/>
  87. 聽 聽聽 聽聽聽
  88. 聽 聽聽 聽聽聽</LinearLayout>
  89. 聽 聽聽 聽聽聽
  90. 聽 聽聽 聽聽聽<Button聽
  91. 聽 聽聽 聽聽 聽聽 聽android:
  92. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  93. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  94. 聽 聽聽 聽聽 聽聽 聽android:text="@string/perviout"
  95. 聽 聽聽 聽聽 聽聽 聽android:drawableRight="@drawable/previous"
  96. 聽 聽聽 聽聽 聽聽 聽android:layout_alignParentBottom="true"
  97. 聽 聽聽 聽聽 聽聽 聽android:layout_alignParentLeft="true"/>
  98. 聽 聽聽 聽聽聽
  99. 聽 聽聽 聽聽聽<Button聽
  100. 聽 聽聽 聽聽 聽聽 聽android:
  101. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  102. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  103. 聽 聽聽 聽聽 聽聽 聽android:text="@string/next"
  104. 聽 聽聽 聽聽 聽聽 聽android:drawableRight="@drawable/next"
  105. 聽 聽聽 聽聽 聽聽 聽android:layout_alignParentBottom="true"
  106. 聽 聽聽 聽聽 聽聽 聽android:layout_alignParentRight="true"/>
  107. 聽 聽聽 聽聽聽
  108. 聽 聽 </RelativeLayout>
  109. 聽 聽聽 聽聽聽
  110. </LinearLayout>
澶嶅埗浠g爜
setup_guide3.xml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:andro
  3. 聽 聽 android:layout_width="match_parent"
  4. 聽 聽 android:layout_height="match_parent"
  5. 聽 聽 android:background="@drawable/title_background"
  6. 聽 聽 android:orientation="vertical" >
  7. 聽 聽聽
  8. 聽 聽 <TextView聽
  9. 聽 聽聽 聽聽聽
  10. 聽 聽聽 聽聽聽android:text="@string/guide1"/>
  11. 聽 聽聽
  12. 聽 聽 <TextView聽
  13. 聽 聽聽 聽聽聽/>
  14. 聽 聽聽
  15. 聽 聽 <TextView聽
  16. 聽 聽聽 聽聽聽
  17. 聽 聽聽 聽聽聽android:text="@string/guide1_content"/>
  18. 聽 聽聽
  19. 聽 聽 <TextView聽
  20. 聽 聽聽 聽聽聽
  21. 聽 聽聽 聽聽聽android:text="@string/guide1_item1"/>
  22. 聽 聽聽
  23. 聽 聽 <TextView聽
  24. 聽 聽聽 聽聽聽
  25. 聽 聽聽 聽聽聽android:text="@string/guide1_item2"/>
  26. 聽 聽聽
  27. 聽 聽 <TextView聽
  28. 聽 聽聽 聽聽聽
  29. 聽 聽聽 聽聽聽android:text="@string/guide1_item3"/>
  30. 聽 聽聽
  31. 聽 聽 <TextView聽
  32. 聽 聽聽 聽聽聽
  33. 聽 聽聽 聽聽聽android:text="@string/guide1_item4"/>
  34. 聽 聽聽
  35. 聽 聽 <LinearLayout聽
  36. 聽 聽聽 聽聽聽android:layout_width="match_parent"
  37. 聽 聽聽 聽聽聽android:layout_height="wrap_content"
  38. 聽 聽聽 聽聽聽android:layout_marginTop="8dip"
  39. 聽 聽聽 聽聽聽android:gravity="center_horizontal"
  40. 聽 聽聽 聽聽聽android:orientation="horizontal">
  41. 聽 聽聽 聽聽聽
  42. 聽 聽聽 聽聽聽<ImageView聽
  43. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  44. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  45. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_online"
  46. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  47. 聽 聽聽 聽聽聽
  48. 聽 聽聽 聽聽聽<ImageView聽
  49. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  50. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  51. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_invisible"
  52. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  53. 聽 聽聽 聽聽聽
  54. 聽 聽聽 聽聽聽<ImageView聽
  55. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  56. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  57. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_invisible"
  58. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  59. 聽 聽聽 聽聽聽
  60. 聽 聽聽 聽聽聽<ImageView聽
  61. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  62. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  63. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_invisible"
  64. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  65. 聽 聽聽 聽聽聽
  66. 聽 聽 </LinearLayout>
  67. 聽 聽聽
  68. 聽 聽 <RelativeLayout聽
  69. 聽 聽聽 聽聽聽android:layout_width="match_parent"
  70. 聽 聽聽 聽聽聽android:layout_height="match_parent"
  71. 聽 聽聽 聽聽聽android:gravity="center_horizontal|center_vertical">
  72. 聽 聽聽 聽聽聽
  73. 聽 聽聽 聽聽聽<LinearLayout聽
  74. 聽 聽聽 聽聽 聽聽 聽android:layout_width="match_parent"
  75. 聽 聽 聽 聽聽 聽聽 聽聽 聽android:layout_height="match_parent"
  76. 聽 聽 聽 聽聽 聽聽 聽聽 聽android:gravity="center_horizontal|center_vertical">
  77. 聽 聽 聽 聽聽 聽聽 聽聽 聽
  78. 聽 聽 聽 聽聽 聽聽 聽聽 聽<ImageView聽
  79. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:layout_width="150dip"
  80. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:layout_height="150dip"
  81. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:src="@drawable/widget01"
  82. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:contentDescription="@string/hello_world"/>
  83. 聽 聽聽 聽聽聽
  84. 聽 聽聽 聽聽聽</LinearLayout>
  85. 聽 聽聽 聽聽聽
  86. 聽 聽聽 聽聽聽<Button聽
  87. 聽 聽聽 聽聽 聽聽 聽android:
  88. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  89. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  90. 聽 聽聽 聽聽 聽聽 聽android:text="@string/next"
  91. 聽 聽聽 聽聽 聽聽 聽android:drawableRight="@drawable/next"
  92. 聽 聽聽 聽聽 聽聽 聽android:layout_alignParentBottom="true"
  93. 聽 聽聽 聽聽 聽聽 聽android:layout_alignParentRight="true"/>
  94. 聽 聽聽 聽聽聽
  95. 聽 聽 </RelativeLayout>
  96. 聽 聽聽 聽聽聽
  97. </LinearLayout>
澶嶅埗浠g爜
setup_guide4.xml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:andro
  3. 聽 聽 android:layout_width="match_parent"
  4. 聽 聽 android:layout_height="match_parent"
  5. 聽 聽 android:background="@drawable/title_background"
  6. 聽 聽 android:orientation="vertical" >
  7. 聽 聽聽
  8. 聽 聽 <TextView聽
  9. 聽 聽聽 聽聽聽
  10. 聽 聽聽 聽聽聽android:text="@string/guide4"/>
  11. 聽 聽聽
  12. 聽 聽 <TextView聽
  13. 聽 聽聽 聽聽聽/>
  14. 聽 聽聽
  15. 聽 聽 <TextView聽
  16. 聽 聽聽 聽聽聽
  17. 聽 聽聽 聽聽聽android:text="@string/guide4_content"/>
  18. 聽 聽聽
  19. 聽 聽 <CheckBox聽
  20. 聽 聽聽 聽聽聽android:
  21. 聽 聽聽 聽聽聽android:layout_width="wrap_content"
  22. 聽 聽聽 聽聽聽android:layout_height="wrap_content"
  23. 聽 聽聽 聽聽聽android:textColor="@android:color/white"
  24. 聽 聽聽 聽聽聽android:text="@string/guide4_item1"/>
  25. 聽 聽聽
  26. 聽 聽 <LinearLayout聽
  27. 聽 聽聽 聽聽聽android:layout_width="match_parent"
  28. 聽 聽聽 聽聽聽android:layout_height="wrap_content"
  29. 聽 聽聽 聽聽聽android:layout_marginTop="8dip"
  30. 聽 聽聽 聽聽聽android:gravity="center_horizontal"
  31. 聽 聽聽 聽聽聽android:orientation="horizontal">
  32. 聽 聽聽 聽聽聽
  33. 聽 聽聽 聽聽聽<ImageView聽
  34. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  35. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  36. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_invisible"
  37. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  38. 聽 聽聽 聽聽聽
  39. 聽 聽聽 聽聽聽<ImageView聽
  40. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  41. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  42. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_invisible"
  43. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  44. 聽 聽聽 聽聽聽
  45. 聽 聽聽 聽聽聽<ImageView聽
  46. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  47. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  48. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_invisible"
  49. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  50. 聽 聽聽 聽聽聽
  51. 聽 聽聽 聽聽聽<ImageView聽
  52. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  53. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  54. 聽 聽聽 聽聽 聽聽 聽android:src="@android:drawable/presence_online"
  55. 聽 聽聽 聽聽 聽聽 聽android:contentDescription="@string/hello_world"/>
  56. 聽 聽聽 聽聽聽
  57. 聽 聽 </LinearLayout>
  58. 聽 聽聽
  59. 聽 聽 <RelativeLayout聽
  60. 聽 聽聽 聽聽聽android:layout_width="match_parent"
  61. 聽 聽聽 聽聽聽android:layout_height="match_parent"
  62. 聽 聽聽 聽聽聽android:gravity="center_horizontal|center_vertical">
  63. 聽 聽聽 聽聽聽
  64. 聽 聽聽 聽聽聽<LinearLayout聽
  65. 聽 聽聽 聽聽 聽聽 聽android:layout_width="match_parent"
  66. 聽 聽 聽 聽聽 聽聽 聽聽 聽android:layout_height="match_parent"
  67. 聽 聽 聽 聽聽 聽聽 聽聽 聽android:gravity="center_horizontal|center_vertical">
  68. 聽 聽 聽 聽聽 聽聽 聽聽 聽
  69. 聽 聽 聽 聽聽 聽聽 聽聽 聽<ImageView聽
  70. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:layout_width="150dip"
  71. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:layout_height="150dip"
  72. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:src="@drawable/guide4"
  73. 聽 聽 聽 聽聽 聽聽 聽聽 聽聽 聽 android:contentDescription="@string/hello_world"/>
  74. 聽 聽聽 聽聽聽
  75. 聽 聽聽 聽聽聽</LinearLayout>
  76. 聽 聽聽 聽聽聽
  77. 聽 聽聽 聽聽聽<Button聽
  78. 聽 聽聽 聽聽 聽聽 聽android:
  79. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  80. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  81. 聽 聽聽 聽聽 聽聽 聽android:text="@string/perviout"
  82. 聽 聽聽 聽聽 聽聽 聽android:drawableRight="@drawable/previous"
  83. 聽 聽聽 聽聽 聽聽 聽android:layout_alignParentBottom="true"
  84. 聽 聽聽 聽聽 聽聽 聽android:layout_alignParentLeft="true"/>
  85. 聽 聽聽 聽聽聽
  86. 聽 聽聽 聽聽聽<Button聽
  87. 聽 聽聽 聽聽 聽聽 聽android:layout_width="wrap_content"
  88. 聽 聽聽 聽聽 聽聽 聽android:layout_height="wrap_content"
  89. 聽 聽聽 聽聽 聽聽 聽android:text="@string/finish"
  90. 聽 聽聽 聽聽 聽聽 聽android:drawableRight="@drawable/next"
  91. 聽 聽聽 聽聽 聽聽 聽android:layout_alignParentBottom="true"
  92. 聽 聽聽 聽聽 聽聽 聽android:layout_alignParentRight="true"/>
  93. 聽 聽聽 聽聽聽
  94. 聽 聽 </RelativeLayout>
  95. 聽 聽聽 聽聽聽
  96. </LinearLayout>
澶嶅埗浠g爜
涓婇潰鍥涗釜xml鏂囦歡锛屽氨鏄垜浠鍋氱殑鍚戝鐨勭晫闈㈠暒锛屽叾涓兘鐢ㄥ埌浜嗘牱寮忕殑瀹氫箟锛屽悇浣嶅鏋滄湁浠€涔堜笉鏄庣櫧鐨勶紝鍙互鍥炲ご鍐嶇湅涓€涓嬫垜浠箣鍓嶅啓鐨勶紝姣曠珶鏄竴姝ユ帴涓€姝ョ殑锛岃偗瀹氳鍏堟妸鍓嶉潰鐨勫紕娓呮鐨勶紝鍥犱負鍚庨潰榪樹細鐢ㄥ埌閭d簺鐭ヨ瘑鐐圭殑銆傛垜浠粖澶╀富瑕佹槸鎶婂墠涓や釜欏甸潰鐨勯€昏緫鍔犱笂锛屽悗闈袱涓〉闈㈢殑閫昏緫鍦ㄦ槑澶╁啀鍔狅紝鍥犱負絎笁涓〉闈紝瑕佹秹鍙婂埌璿誨彇鐢ㄦ埛鐨勮仈緋諱漢榪欎竴闈炲父甯哥敤鐨勬搷浣滐紝鎵€浠ュ崟鐙潵璁蹭竴涓嬫垜浠殑璁劇疆鍚戝鏄湪鐢ㄦ埛絎竴嬈℃墦寮€鎴戜滑鐨勬墜鏈洪槻鐩楄繖涓姛鑳芥椂鎵嶅惎鍔ㄧ殑锛屾墍浠ユ垜浠繕瑕佸湪鎵嬫満闃茬洍榪欎釜鍔熻兘鐨勭晫闈㈤噷闈㈠姞涓€浜溳€昏緫锛屽ソ锛屽簾璿濅笉澶氳锛? 鐩存帴涓婁唬鐮乧om.xiaobin.security.ui.LostProtectedActivity
  1. package com.xiaobin.security.ui;

  2. import android.app.Activity;
  3. import android.app.Dialog;
  4. import android.content.Context;
  5. import android.content.Intent;
  6. import android.content.SharedPreferences;
  7. import android.content.SharedPreferences.Editor;
  8. import android.os.Bundle;
  9. import android.view.View;
  10. import android.view.View.OnClickListener;
  11. import android.widget.Button;
  12. import android.widget.EditText;
  13. import android.widget.Toast;

  14. import com.xiaobin.security.R;
  15. import com.xiaobin.security.utils.MD5Encoder;

  16. public class LostProtectedActivity extends Activity implements OnClickListener
  17. {
  18. 聽 聽 聽 聽 private SharedPreferences sp;
  19. 聽 聽 聽 聽 private Dialog dialog;
  20. 聽 聽 聽 聽 private EditText password;
  21. 聽 聽 聽 聽 private EditText confirmPassword;
  22. 聽 聽 聽 聽聽
  23. 聽 聽 聽 聽 @Override
  24. 聽 聽 聽 聽 protected void onCreate(Bundle savedInstanceState)
  25. 聽 聽 聽 聽 {
  26. 聽 聽 聽 聽 聽 聽 聽 聽 super.onCreate(savedInstanceState);
  27. 聽 聽 聽 聽 聽 聽 聽 聽聽
  28. 聽 聽 聽 聽 聽 聽 聽 聽 sp = getSharedPreferences("cofig", Context.MODE_PRIVATE);
  29. 聽 聽 聽 聽 聽 聽 聽 聽聽
  30. 聽 聽 聽 聽 聽 聽 聽 聽 if(isSetPassword())
  31. 聽 聽 聽 聽 聽 聽 聽 聽 {
  32. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 showLoginDialog();
  33. 聽 聽 聽 聽 聽 聽 聽 聽 }
  34. 聽 聽 聽 聽 聽 聽 聽 聽 else
  35. 聽 聽 聽 聽 聽 聽 聽 聽 {
  36. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 showFirstDialog();
  37. 聽 聽 聽 聽 聽 聽 聽 聽 }
  38. 聽 聽 聽 聽 }
  39. 聽 聽 聽 聽聽
  40. 聽 聽 聽 聽 private void showLoginDialog()
  41. 聽 聽 聽 聽 {
  42. 聽 聽 聽 聽 聽 聽 聽 聽 dialog = new Dialog(this, R.style.MyDialog);
  43. 聽 聽 聽 聽 聽 聽 聽 聽 View view = View.inflate(this, R.layout.login_dialog, null);
  44. 聽 聽 聽 聽 聽 聽 聽 聽 password = (EditText) view.findViewById(R.id.et_protected_password);
  45. 聽 聽 聽 聽 聽 聽 聽 聽 Button yes = (Button) view.findViewById(R.id.bt_protected_login_yes);
  46. 聽 聽 聽 聽 聽 聽 聽 聽 Button cancel = (Button) view.findViewById(R.id.bt_protected_login_no);
  47. 聽 聽 聽 聽 聽 聽 聽 聽 yes.setOnClickListener(this);
  48. 聽 聽 聽 聽 聽 聽 聽 聽 cancel.setOnClickListener(this);
  49. 聽 聽 聽 聽 聽 聽 聽 聽 dialog.setContentView(view);
  50. 聽 聽 聽 聽 聽 聽 聽 聽 dialog.setCancelable(false);
  51. 聽 聽 聽 聽 聽 聽 聽 聽 dialog.show();
  52. 聽 聽 聽 聽 }

  53. 聽 聽 聽 聽 private void showFirstDialog()
  54. 聽 聽 聽 聽 {
  55. 聽 聽 聽 聽 聽 聽 聽 聽 dialog = new Dialog(this, R.style.MyDialog);
  56. 聽 聽 聽 聽 聽 聽 聽 聽 //dialog.setContentView(R.layout.first_dialog);
  57. 聽 聽 聽 聽 聽 聽 聽 聽 View view = View.inflate(this, R.layout.first_dialog, null);//榪欑濉厖甯冨矓鐨勬柟寮忔瘮杈冩柟渚匡紝宄敤鎷垮埌涓€涓狶ayoutInflate瀵矽薄
  58. 聽 聽 聽 聽 聽 聽 聽 聽 password = (EditText) view.findViewById(R.id.et_protected_first_password);
  59. 聽 聽 聽 聽 聽 聽 聽 聽 confirmPassword = (EditText) view.findViewById(R.id.et_protected_confirm_password);
  60. 聽 聽 聽 聽 聽 聽 聽 聽 Button yes = (Button) view.findViewById(R.id.bt_protected_first_yes);
  61. 聽 聽 聽 聽 聽 聽 聽 聽 Button cancel = (Button) view.findViewById(R.id.bt_protected_first_no);
  62. 聽 聽 聽 聽 聽 聽 聽 聽 yes.setOnClickListener(this);
  63. 聽 聽 聽 聽 聽 聽 聽 聽 cancel.setOnClickListener(this);
  64. 聽 聽 聽 聽 聽 聽 聽 聽 dialog.setContentView(view);
  65. 聽 聽 聽 聽 聽 聽 聽 聽 dialog.setCancelable(false);
  66. 聽 聽 聽 聽 聽 聽 聽 聽 dialog.show();
  67. 聽 聽 聽 聽 }

  68. 聽 聽 聽 聽 private boolean isSetPassword()
  69. 聽 聽 聽 聽 {
  70. 聽 聽 聽 聽 聽 聽 聽 聽 String pwd = sp.getString("password", "");
  71. 聽 聽 聽 聽 聽 聽 聽 聽 if(pwd.equals("") || pwd == null)
  72. 聽 聽 聽 聽 聽 聽 聽 聽 {
  73. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 return false;
  74. 聽 聽 聽 聽 聽 聽 聽 聽 }
  75. 聽 聽 聽 聽 聽 聽 聽 聽 return true;
  76. 聽 聽 聽 聽 }
  77. 聽 聽 聽 聽聽
  78. 聽 聽 聽 聽 private boolean isSetupGuide()
  79. 聽 聽 聽 聽 {
  80. 聽 聽 聽 聽 聽 聽 聽 聽 return sp.getBoolean("setupGuide", false);
  81. 聽 聽 聽 聽 }

  82. 聽 聽 聽 聽 @Override
  83. 聽 聽 聽 聽 public void onClick(View v)
  84. 聽 聽 聽 聽 {
  85. 聽 聽 聽 聽 聽 聽 聽 聽 switch(v.getId())
  86. 聽 聽 聽 聽 聽 聽 聽 聽 {
  87. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 case R.id.bt_protected_first_yes :聽
  88. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 String fp = password.getText().toString().trim();
  89. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 String cp = confirmPassword.getText().toString().trim();
  90. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 if(fp.equals("") || cp.equals(""))
  91. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 {
  92. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Toast.makeText(this, "瀵嗙爜涓嶈兘涓虹┖", Toast.LENGTH_SHORT).show();
  93. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 return;
  94. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
  95. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 else聽
  96. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 {
  97. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 if(fp.equals(cp))
  98. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 {
  99. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Editor editor = sp.edit();
  100. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 editor.putString("password", MD5Encoder.encode(fp));
  101. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 editor.commit();
  102. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 dialog.dismiss();
  103. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽聽
  104. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 if(!isSetupGuide())
  105. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 {
  106. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 finish();
  107. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Intent intent = new Intent(this, SetupGuide1Activity.class);
  108. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 startActivity(intent);
  109. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
  110. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
  111. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 else
  112. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 {
  113. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Toast.makeText(this, "涓ゆ瀵嗙爜涓嶇溮鍚?, Toast.LENGTH_SHORT).show();
  114. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 return;
  115. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
  116. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
  117. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 dialog.dismiss();
  118. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 break;
  119. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽聽
  120. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 case R.id.bt_protected_first_no :聽
  121. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 dialog.dismiss();
  122. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 finish();
  123. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 break;
  124. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽聽
  125. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 case R.id.bt_protected_login_yes :聽
  126. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 String pwd = password.getText().toString().toString();
  127. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 if(pwd.equals(""))
  128. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 {
  129. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Toast.makeText(this, "璿瘋緭鍏ュ瘑鐮?, Toast.LENGTH_SHORT).show();
  130. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
  131. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 else
  132. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 {
  133. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 String str = sp.getString("password", "");
  134. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 if(MD5Encoder.encode(pwd).equals(str))
  135. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 {
  136. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 if(!isSetupGuide())
  137. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 {
  138. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 finish();
  139. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Intent intent = new Intent(this, SetupGuide1Activity.class);
  140. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 startActivity(intent);
  141. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
  142. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 dialog.dismiss();
  143. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
  144. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 else
  145. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 {
  146. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Toast.makeText(this, "瀵嗙爜閿欒", Toast.LENGTH_SHORT).show();
  147. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
  148. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
  149. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 break;
  150. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽聽
  151. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 case R.id.bt_protected_login_no :聽
  152. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 dialog.dismiss();
  153. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 finish();
  154. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 break;
  155. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽聽
  156. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 default :聽
  157. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 break;
  158. 聽 聽 聽 聽 聽 聽 聽 聽 }
  159. 聽 聽 聽 聽 }

  160. }
澶嶅埗浠g爜
com.xiaobin.security.ui.SetupGuide1
  1. package com.xiaobin.security.ui;

  2. import android.app.Activity;
  3. import android.content.Intent;
  4. import android.os.Bundle;
  5. import android.view.View;
  6. import android.view.View.OnClickListener;
  7. import android.widget.Button;

  8. import com.xiaobin.security.R;

  9. public class SetupGuide1Activity extends Activity implements OnClickListener
  10. {
  11. 聽 聽 聽 聽 private Button next;
  12. 聽 聽 聽 聽聽
  13. 聽 聽 聽 聽 @Override
  14. 聽 聽 聽 聽 protected void onCreate(Bundle savedInstanceState)
  15. 聽 聽 聽 聽 {
  16. 聽 聽 聽 聽 聽 聽 聽 聽 super.onCreate(savedInstanceState);
  17. 聽 聽 聽 聽 聽 聽 聽 聽 setContentView(R.layout.setup_guide1);
  18. 聽 聽 聽 聽 聽 聽 聽 聽聽
  19. 聽 聽 聽 聽 聽 聽 聽 聽 next = (Button) findViewById(R.id.bt_guide_next);
  20. 聽 聽 聽 聽 聽 聽 聽 聽 next.setOnClickListener(this);
  21. 聽 聽 聽 聽 }

  22. 聽 聽 聽 聽 @Override
  23. 聽 聽 聽 聽 public void onClick(View v)
  24. 聽 聽 聽 聽 {
  25. 聽 聽 聽 聽 聽 聽 聽 聽 switch(v.getId())
  26. 聽 聽 聽 聽 聽 聽 聽 聽 {
  27. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 case R.id.bt_guide_next :聽
  28. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Intent intent = new Intent(this, SetupGuide2Activity.class);
  29. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 finish();
  30. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 startActivity(intent);
  31. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 //榪欎釜鏄畾涔塧ctivity鍒囨崲鏃剁殑鍔ㄧ敾鏁堟灉鐨?br>
  32. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 overridePendingTransition(R.anim.alpha_in, R.anim.alpha_out);
  33. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 break;
  34. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽聽
  35. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 default :聽
  36. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 break;
  37. 聽 聽 聽 聽 聽 聽 聽 聽 }
  38. 聽 聽 聽 聽 }

  39. }
澶嶅埗浠g爜
澶у鍙互鐪嬪埌锛屾垜浠湪涓婇潰鍒囨崲activity鏃訛紝鍔犱簡涓€浜涙晥鏋滐紝鍏跺疄灝辨槸閫氳繃overridePendingTransition榪欎釜鏂規硶鏉ュ疄鐜扮殑锛屾墍浠ュぇ瀹朵互鍚庢兂璁╄嚜宸辯殑activity涔嬮棿鍒囨崲锛屽涓€浜涘姩鎬佺殑鏁堟灉锛屽氨鍙互鐢ㄨ繖涓柟娉曞暒銆備笂闈㈠彧鏄垜鑷繁瀹氫箟鐨勪竴涓畝鍗曠殑鍔ㄧ敾鏂囦歡锛岃瀹氫箟涓€涓姩鐢繪枃浠朵篃寰堢畝鍗曪紝鍙鍦╮es涓嬮潰鏂板緩涓€涓猘nim鐩綍锛岀劧鍚庡湪閲岄潰鏂板緩涓€浜涘姩鐢葷殑xml灝辮鍟︿笅闈㈡槸鎴戜滑涓婇潰鐨勯偅涓や釜xml鍔ㄧ敾alpha_in.xml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <alpha xmlns:andro
  3. 聽 聽 android:fromAlpha="0.0"
  4. 聽 聽 android:toAlpha="1.0"
  5. 聽 聽 android:duration="300" >
  6. 聽 聽聽

  7. </alpha>
澶嶅埗浠g爜
alpha_out.xml鏈変竴涓湴鏂矽娉ㄦ剰鐨勶紝鎴戜滑鏂板緩鍔ㄧ敾鐨剎ml鏃訛紝涓€瀹氳鎶婇偅涓懡鍚嶇┖闂?a target="_blank" href="https://schemas.android.com/apk/res/android" >https://schemas.android.com/apk/res/android鎸囧畾濂斤紝涓嶇劧灝變笉琛岀殑 濂藉暒锛岀幇鍦ㄦ垜浠妸絎簩涓猤uide鐨勯€昏緫浠g爜涔熷啓涓€涓媍om.xiaobin.security.ui.SetupGuide2
  1. package com.xiaobin.security.ui;

  2. import android.app.Activity;
  3. import android.content.Context;
  4. import android.content.Intent;
  5. import android.content.SharedPreferences;
  6. import android.content.SharedPreferences.Editor;
  7. import android.os.Bundle;
  8. import android.telephony.TelephonyManager;
  9. import android.view.View;
  10. import android.view.View.OnClickListener;
  11. import android.widget.Button;
  12. import android.widget.CheckBox;
  13. import android.widget.CompoundButton;
  14. import android.widget.CompoundButton.OnCheckedChangeListener;

  15. import com.xiaobin.security.R;

  16. public class SetupGuide2Activity extends Activity implements OnClickListener
  17. {
  18. 聽 聽 聽 聽 private Button bt_bind;
  19. 聽 聽 聽 聽 private Button bt_next;
  20. 聽 聽 聽 聽 private Button bt_perviout;
  21. 聽 聽 聽 聽 private CheckBox cb_bind;
  22. 聽 聽 聽 聽 private SharedPreferences sp;
  23. 聽 聽 聽 聽聽
  24. 聽 聽 聽 聽 @Override
  25. 聽 聽 聽 聽 protected void onCreate(Bundle savedInstanceState)
  26. 聽 聽 聽 聽 {
  27. 聽 聽 聽 聽 聽 聽 聽 聽 super.onCreate(savedInstanceState);
  28. 聽 聽 聽 聽 聽 聽 聽 聽 setContentView(R.layout.setup_guide2);
  29. 聽 聽 聽 聽 聽 聽 聽 聽聽
  30. 聽 聽 聽 聽 聽 聽 聽 聽 sp = getSharedPreferences("config", Context.MODE_PRIVATE);
  31. 聽 聽 聽 聽 聽 聽 聽 聽聽
  32. 聽 聽 聽 聽 聽 聽 聽 聽 bt_bind = (Button) findViewById(R.id.bt_guide_bind);
  33. 聽 聽 聽 聽 聽 聽 聽 聽 bt_next = (Button) findViewById(R.id.bt_guide_next);
  34. 聽 聽 聽 聽 聽 聽 聽 聽 bt_perviout = (Button) findViewById(R.id.bt_guide_pervious);
  35. 聽 聽 聽 聽 聽 聽 聽 聽 bt_bind.setOnClickListener(this);
  36. 聽 聽 聽 聽 聽 聽 聽 聽 bt_next.setOnClickListener(this);
  37. 聽 聽 聽 聽 聽 聽 聽 聽 bt_perviout.setOnClickListener(this);
  38. 聽 聽 聽 聽 聽 聽 聽 聽聽
  39. 聽 聽 聽 聽 聽 聽 聽 聽 cb_bind = (CheckBox) findViewById(R.id.cb_guide_check);
  40. 聽 聽 聽 聽 聽 聽 聽 聽 //鍒濆鍖朇heckBox鐘舵€?br>
  41. 聽 聽 聽 聽 聽 聽 聽 聽 String sim = sp.getString("simSerial", null);
  42. 聽 聽 聽 聽 聽 聽 聽 聽 if(sim != null)
  43. 聽 聽 聽 聽 聽 聽 聽 聽 {
  44. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 cb_bind.setText("宸茬粡緇戝畾");
  45. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 cb_bind.setChecked(true);
  46. 聽 聽 聽 聽 聽 聽 聽 聽 }
  47. 聽 聽 聽 聽 聽 聽 聽 聽 else
  48. 聽 聽 聽 聽 聽 聽 聽 聽 {
  49. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 cb_bind.setText("娌℃湁緇戝畾");
  50. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 cb_bind.setChecked(false);
  51. 聽 聽 聽 聽 聽 聽 聽 聽 }
  52. 聽 聽 聽 聽 聽 聽 聽 聽 cb_bind.setOnCheckedChangeListener(new OnCheckedChangeListener()
  53. 聽 聽 聽 聽 聽 聽 聽 聽 {
  54. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 @Override
  55. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
  56. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 {
  57. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 //閭d釜瑙i櫎緇戝畾鐨勬垜榪樻病鍋氱殑鍛紝鍚勪綅鍙互鑷繁鍘誨畬鎴愶紝灝辨槸鎶婇偅涓猄haredPreferences閲岄潰鐨勫€艱緗竴涓嬪氨琛屽暒
  58. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 if(isChecked)
  59. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 {
  60. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 cb_bind.setText("宸茬粡緇戝畾");
  61. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 setSimInfo();
  62. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
  63. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 else
  64. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 {
  65. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 cb_bind.setText("娌℃湁緇戝畾");
  66. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
  67. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 }
  68. 聽 聽 聽 聽 聽 聽 聽 聽 });
  69. 聽 聽 聽 聽 }

  70. 聽 聽 聽 聽 @Override
  71. 聽 聽 聽 聽 public void onClick(View v)
  72. 聽 聽 聽 聽 {
  73. 聽 聽 聽 聽 聽 聽 聽 聽 switch(v.getId())
  74. 聽 聽 聽 聽 聽 聽 聽 聽 {
  75. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 case R.id.bt_guide_bind :聽
  76. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 setSimInfo();
  77. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 cb_bind.setText("宸茬粡緇戝畾");
  78. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 cb_bind.setChecked(true);
  79. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 break;
  80. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽聽
  81. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 case R.id.bt_guide_next :聽
  82. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Intent intent = new Intent(this, SetupGuide3Activity.class);
  83. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 finish();
  84. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 startActivity(intent);
  85. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 //榪欎釜鏄畾涔塧ctivity鍒囨崲鏃剁殑鍔ㄧ敾鏁堟灉鐨?br>
  86. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 overridePendingTransition(R.anim.alpha_in, R.anim.alpha_out);
  87. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 break;
  88. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 case R.id.bt_guide_pervious :聽
  89. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽聽
  90. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Intent i = new Intent(this, SetupGuide1Activity.class);
  91. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 finish();
  92. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 startActivity(i);
  93. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 //榪欎釜鏄畾涔塧ctivity鍒囨崲鏃剁殑鍔ㄧ敾鏁堟灉鐨?br>
  94. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 overridePendingTransition(R.anim.alpha_in, R.anim.alpha_out);
  95. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 break;
  96. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽聽
  97. 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 default :聽
  98. 聽 聽 聽 聽 聽

    最後更新:2017-04-03 14:54:25

      上一篇:go 手機衛士08-獲取手機聯係人
      下一篇:go 手機衛士07-設置向導