Forgotten

This commit is contained in:
hyb1996
2017-02-20 23:37:47 +08:00
parent 40d6285bed
commit 676ca14aca
17 changed files with 375 additions and 35 deletions

View File

@@ -11,6 +11,7 @@ public class Pref {
private static final SharedPreferences DISPOSABLE_BOOLEAN = App.getApp().getSharedPreferences("DISPOSABLE_BOOLEAN", Context.MODE_PRIVATE);
public static final String SAMPLE_SCRIPTS_COPIED = "SAMPLE_SCRIPTS_COPIED";
private static final String KEY_MAX_TEXT_LENGTH_FOR_CODE_COMPLETION = "KEY_MAX_TEXT_LENGTH_FOR_CODE_COMPLETION";
public static SharedPreferences def() {
return PreferenceManager.getDefaultSharedPreferences(App.getApp());
@@ -43,4 +44,12 @@ public class Pref {
private static String getString(int id) {
return App.getApp().getString(id);
}
public static int MaxTextLengthForCodeCompletion() {
try {
return Integer.parseInt(def().getString(App.getApp().getString(R.string.key_max_length_for_code_completion), "2000"));
} catch (NumberFormatException e) {
return 2000;
}
}
}