仿iPhone密碼鎖效果
作者:網(wǎng)絡(luò)整理
一款仿iPhone的密碼鎖,帶有動(dòng)畫效果。
源碼簡(jiǎn)介
一款仿iPhone的密碼鎖,帶有動(dòng)畫效果。
源碼運(yùn)行截圖
源碼片段
- public class DBSharedPreferences {
- private Context context;
- public static final String _NAME = "DIARY_DB";
- public static final String _USERD = "_USERD";
- public DBSharedPreferences(Context context) {
- this.context = context;
- }
- // ///////////////////////////////////////////String///////////////////////////////////////////////////
- public void putString(String key, String value) {
- SharedPreferences sp = context.getSharedPreferences(_NAME, 1);
- Editor editor = sp.edit();
- editor.putString(key, value);
- editor.commit();
- }
- public String getString(String key) {
- SharedPreferences sp = context.getSharedPreferences(_NAME, 1);
- return sp.getString(key, "nothing");
- }
- // ///////////////////////////////////////////Integer///////////////////////////////////////////////////
- public void putInteger(String key, int value) {
- SharedPreferences sp = context.getSharedPreferences(_NAME, 1);
- Editor editor = sp.edit();
- editor.putInt(key, value);
- editor.commit();
- }
- public Integer getInteger(String key) {
- SharedPreferences sp = context.getSharedPreferences(_NAME, 1);
- return sp.getInt(key, -1);
- }
- // ///////////////////////////////////////////Boolean///////////////////////////////////////////////////
- public void putBoolean(String key, boolean value) {
- SharedPreferences sp = context.getSharedPreferences(_NAME, 1);
- Editor editor = sp.edit();
- editor.putBoolean(key, value);
- editor.commit();
- }
- public boolean getBoolean(String key) {
- SharedPreferences sp = context.getSharedPreferences(_NAME, 1);
- return sp.getBoolean(key, false);
- }
- // ///////////////////////////////////////////Long///////////////////////////////////////////////////
- public void putLong(String key, long value) {
- SharedPreferences sp = context.getSharedPreferences(_NAME, 1);
- Editor editor = sp.edit();
- editor.putLong(key, value);
- editor.commit();
- }
- public long getLong(String key) {
- SharedPreferences sp = context.getSharedPreferences(_NAME, 1);
- return sp.getLong(key, -1);
- }
- // ///////////////////////////////////////////Float///////////////////////////////////////////////////
- public void putFloat(String key, float value) {
- SharedPreferences sp = context.getSharedPreferences(_NAME, 1);
- Editor editor = sp.edit();
- editor.putFloat(key, value);
- editor.commit();
- }
- public float getFloat(String key) {
- SharedPreferences sp = context.getSharedPreferences(_NAME, 1);
- return sp.getFloat(key, 0.0F);
- }
- }
源碼下載:http://down.51cto.com/data/1980604
責(zé)任編輯:chenqingxiang
來源:
網(wǎng)絡(luò)整理