mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-02-09 22:30:20 +01:00
Persist state of clipboard history checkbox
This commit is contained in:
parent
91751afec8
commit
dc922b0258
@ -11,6 +11,7 @@ final class ClipboardHistoryCheckBox extends CheckBox
|
||||
public ClipboardHistoryCheckBox(Context ctx, AttributeSet attrs)
|
||||
{
|
||||
super(ctx, attrs);
|
||||
setChecked(Config.globalConfig().clipboard_history_enabled);
|
||||
setOnCheckedChangeListener(this);
|
||||
}
|
||||
|
||||
|
@ -30,11 +30,9 @@ public final class ClipboardHistoryService
|
||||
|
||||
public static void set_history_enabled(boolean e)
|
||||
{
|
||||
Config.globalConfig().set_clipboard_history_enabled(e);
|
||||
if (_service == null)
|
||||
return;
|
||||
Config.globalPrefs().edit()
|
||||
.putBoolean("clipboard_history_enabled", e)
|
||||
.commit();
|
||||
if (e)
|
||||
_service.add_current_clip();
|
||||
else
|
||||
|
@ -207,6 +207,12 @@ public final class Config
|
||||
e.apply();
|
||||
}
|
||||
|
||||
public void set_clipboard_history_enabled(boolean e)
|
||||
{
|
||||
clipboard_history_enabled = e;
|
||||
_prefs.edit().putBoolean("clipboard_history_enabled", e).commit();
|
||||
}
|
||||
|
||||
KeyValue action_key()
|
||||
{
|
||||
// Update the name to avoid caching in KeyModifier
|
||||
|
Loading…
Reference in New Issue
Block a user