Methods Summary |
---|
public static com.android.inputmethod.pinyin.Settings | getInstance(android.content.SharedPreferences pref)
if (mInstance == null) {
mInstance = new Settings(pref);
}
assert (pref == mSharedPref);
mRefCount++;
return mInstance;
|
public static boolean | getKeySound()
return mKeySound;
|
public static boolean | getPrediction()
return mPrediction;
|
public static boolean | getVibrate()
return mVibrate;
|
private void | initConfs()
mKeySound = mSharedPref.getBoolean(ANDPY_CONFS_KEYSOUND_KEY, true);
mVibrate = mSharedPref.getBoolean(ANDPY_CONFS_VIBRATE_KEY, false);
mPrediction = mSharedPref.getBoolean(ANDPY_CONFS_PREDICTION_KEY, true);
|
public static void | releaseInstance()
mRefCount--;
if (mRefCount == 0) {
mInstance = null;
}
|
public static void | setKeySound(boolean v)
if (mKeySound == v) return;
mKeySound = v;
|
public static void | setPrediction(boolean v)
if (mPrediction == v) return;
mPrediction = v;
|
public static void | setVibrate(boolean v)
if (mVibrate == v) return;
mVibrate = v;
|
public static void | writeBack()
Editor editor = mSharedPref.edit();
editor.putBoolean(ANDPY_CONFS_VIBRATE_KEY, mVibrate);
editor.putBoolean(ANDPY_CONFS_KEYSOUND_KEY, mKeySound);
editor.putBoolean(ANDPY_CONFS_PREDICTION_KEY, mPrediction);
editor.commit();
|