mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-02-18 18:40:56 +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)
|
public ClipboardHistoryCheckBox(Context ctx, AttributeSet attrs)
|
||||||
{
|
{
|
||||||
super(ctx, attrs);
|
super(ctx, attrs);
|
||||||
|
setChecked(Config.globalConfig().clipboard_history_enabled);
|
||||||
setOnCheckedChangeListener(this);
|
setOnCheckedChangeListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,11 +30,9 @@ public final class ClipboardHistoryService
|
|||||||
|
|
||||||
public static void set_history_enabled(boolean e)
|
public static void set_history_enabled(boolean e)
|
||||||
{
|
{
|
||||||
|
Config.globalConfig().set_clipboard_history_enabled(e);
|
||||||
if (_service == null)
|
if (_service == null)
|
||||||
return;
|
return;
|
||||||
Config.globalPrefs().edit()
|
|
||||||
.putBoolean("clipboard_history_enabled", e)
|
|
||||||
.commit();
|
|
||||||
if (e)
|
if (e)
|
||||||
_service.add_current_clip();
|
_service.add_current_clip();
|
||||||
else
|
else
|
||||||
|
@ -207,6 +207,12 @@ public final class Config
|
|||||||
e.apply();
|
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()
|
KeyValue action_key()
|
||||||
{
|
{
|
||||||
// Update the name to avoid caching in KeyModifier
|
// Update the name to avoid caching in KeyModifier
|
||||||
|
Loading…
Reference in New Issue
Block a user