Unexpected-Keyboard/srcs/juloo.keyboard2/ClipboardHistoryCheckBox.java
Jules Aguillon bf3b9c374e
Clipboard pane (#681)
This adds the clipboard pane, which allows to save an arbitrary number of
clipboards and to paste them later. The key can be disabled in settings.

Checking the "Recently copied text" checkbox will cause the keyboard to keep a
temporary history of copied text. This history can only contain 3 elements
which expire after 5 minutes.
If this is unchecked, no history is collected.

History entries can be pinned into the persisted list of pins.
2024-07-06 22:16:37 +02:00

23 lines
559 B
Java

package juloo.keyboard2;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.CheckBox;
import android.widget.CompoundButton;
final class ClipboardHistoryCheckBox extends CheckBox
implements CompoundButton.OnCheckedChangeListener
{
public ClipboardHistoryCheckBox(Context ctx, AttributeSet attrs)
{
super(ctx, attrs);
setOnCheckedChangeListener(this);
}
@Override
public void onCheckedChanged(CompoundButton _v, boolean isChecked)
{
ClipboardHistoryService.set_history_enabled(isChecked);
}
}