From bf3b9c374e1e68b1244da392666b571ab37e51fb Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 6 Jul 2024 22:16:37 +0200 Subject: 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. --- assets/special_font.ttf | Bin 10328 -> 10504 bytes check_layout.output | 5 +- check_layout.py | 3 +- res/drawable/ic_clipboard_paste.xml | 1 + res/drawable/ic_clipboard_save.xml | 1 + res/drawable/ic_delete.xml | 1 + res/layout/clipboard_history_entry.xml | 8 + res/layout/clipboard_pane.xml | 12 ++ res/layout/clipboard_pin_entry.xml | 8 + res/values-cs/strings.xml | 5 + res/values-de/strings.xml | 5 + res/values-es/strings.xml | 5 + res/values-fa/strings.xml | 5 + res/values-fr/strings.xml | 5 + res/values-it/strings.xml | 5 + res/values-ko/strings.xml | 5 + res/values-lv/strings.xml | 5 + res/values-pl/strings.xml | 5 + res/values-pt/strings.xml | 5 + res/values-ro/strings.xml | 5 + res/values-ru/strings.xml | 5 + res/values-tr/strings.xml | 5 + res/values-uk/strings.xml | 5 + res/values-vi/strings.xml | 5 + res/values-zh-rCN/strings.xml | 5 + res/values/strings.xml | 5 + res/values/styles.xml | 34 ++++ res/values/themes.xml | 10 +- res/values/values.xml | 1 + res/xml/bottom_row.xml | 2 +- res/xml/clipboard_bottom_row.xml | 10 ++ srcs/juloo.keyboard2/ClipboardHistoryCheckBox.java | 22 +++ srcs/juloo.keyboard2/ClipboardHistoryService.java | 180 +++++++++++++++++++++ srcs/juloo.keyboard2/ClipboardHistoryView.java | 125 ++++++++++++++ srcs/juloo.keyboard2/ClipboardPinView.java | 139 ++++++++++++++++ srcs/juloo.keyboard2/Config.java | 2 + srcs/juloo.keyboard2/KeyEventHandler.java | 10 +- srcs/juloo.keyboard2/KeyValue.java | 4 + srcs/juloo.keyboard2/Keyboard2.java | 10 ++ srcs/juloo.keyboard2/NonScrollListView.java | 38 +++++ .../juloo.keyboard2/prefs/ExtraKeysPreference.java | 3 + srcs/special_font/17.svg | 2 + srcs/special_font/35.svg | 2 +- 43 files changed, 711 insertions(+), 7 deletions(-) create mode 100644 res/drawable/ic_clipboard_paste.xml create mode 100644 res/drawable/ic_clipboard_save.xml create mode 100644 res/drawable/ic_delete.xml create mode 100644 res/layout/clipboard_history_entry.xml create mode 100644 res/layout/clipboard_pane.xml create mode 100644 res/layout/clipboard_pin_entry.xml create mode 100644 res/xml/clipboard_bottom_row.xml create mode 100644 srcs/juloo.keyboard2/ClipboardHistoryCheckBox.java create mode 100644 srcs/juloo.keyboard2/ClipboardHistoryService.java create mode 100644 srcs/juloo.keyboard2/ClipboardHistoryView.java create mode 100644 srcs/juloo.keyboard2/ClipboardPinView.java create mode 100644 srcs/juloo.keyboard2/NonScrollListView.java create mode 100644 srcs/special_font/17.svg diff --git a/assets/special_font.ttf b/assets/special_font.ttf index 5b9aa57..eb07561 100644 Binary files a/assets/special_font.ttf and b/assets/special_font.ttf differ diff --git a/check_layout.output b/check_layout.output index 683db03..d6aa54a 100644 --- a/check_layout.output +++ b/check_layout.output @@ -63,7 +63,7 @@ Layout includes some ASCII punctuation but not all, missing: (, ), <, >, [, ], { 0 warnings # latn_bone Layout includes some ASCII punctuation but not all, missing: $ -Layout redefines the bottom row but some important keys are missing, missing: cursor_left, cursor_right, loc compose, loc end, loc home, loc page_down, loc page_up, loc switch_greekmath, loc voice_typing, switch_backward +Layout redefines the bottom row but some important keys are missing, missing: cursor_left, cursor_right, loc compose, loc end, loc home, loc page_down, loc page_up, loc switch_clipboard, loc switch_greekmath, loc voice_typing, switch_backward 2 warnings # latn_colemak Some keys contain whitespaces, unexpected: ́ @@ -71,7 +71,8 @@ Some keys contain whitespaces, unexpected: ́ # latn_dvorak 0 warnings # latn_neo2 -0 warnings +Layout redefines the bottom row but some important keys are missing, missing: loc switch_clipboard +1 warnings # latn_qwerty_br 0 warnings # latn_qwerty_cz diff --git a/check_layout.py b/check_layout.py index dee9b9b..47a17b6 100644 --- a/check_layout.py +++ b/check_layout.py @@ -6,7 +6,8 @@ warning_count = 0 KNOWN_NOT_LAYOUT = set([ "number_row", "numpad", "pin", "bottom_row", "settings", "method", - "greekmath", "numeric", "emoji_bottom_row" ]) + "greekmath", "numeric", "emoji_bottom_row", + "clipboard_bottom_row" ]) def warn(msg): global warning_count diff --git a/res/drawable/ic_clipboard_paste.xml b/res/drawable/ic_clipboard_paste.xml new file mode 100644 index 0000000..1507f27 --- /dev/null +++ b/res/drawable/ic_clipboard_paste.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/res/drawable/ic_clipboard_save.xml b/res/drawable/ic_clipboard_save.xml new file mode 100644 index 0000000..53abcf2 --- /dev/null +++ b/res/drawable/ic_clipboard_save.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/res/drawable/ic_delete.xml b/res/drawable/ic_delete.xml new file mode 100644 index 0000000..5b69d0b --- /dev/null +++ b/res/drawable/ic_delete.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/res/layout/clipboard_history_entry.xml b/res/layout/clipboard_history_entry.xml new file mode 100644 index 0000000..9d34a9e --- /dev/null +++ b/res/layout/clipboard_history_entry.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/res/layout/clipboard_pane.xml b/res/layout/clipboard_pane.xml new file mode 100644 index 0000000..84dc6c9 --- /dev/null +++ b/res/layout/clipboard_pane.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/res/layout/clipboard_pin_entry.xml b/res/layout/clipboard_pin_entry.xml new file mode 100644 index 0000000..9cd8b2d --- /dev/null +++ b/res/layout/clipboard_pin_entry.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index 0e645a7..4e7c785 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -116,4 +116,9 @@ Tato aplikace neobsahuje žádné reklamy, nevyužívá připojení k síti a je Page Down Home End + + + + + diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 8a63e4c..890d8af 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -116,4 +116,9 @@ Diese App enthält keine Werbung, benötigt keinen Netzwerkzugriff und ist quell Bild ab Pos1 Ende + + + + + diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index 9f3322d..dc8578f 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -116,4 +116,9 @@ La misma no contiene ningún anuncio/publicidad, no realiza peticiones de red y Re Pág Inicio Fin + + + + + diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml index f76e689..46e9310 100644 --- a/res/values-fa/strings.xml +++ b/res/values-fa/strings.xml @@ -116,4 +116,9 @@ This application contains no ads, doesn't make any network requests and is Open + + + + + diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index ba7d21a..93d7ff0 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -116,4 +116,9 @@ Cette application ne contient pas de publicité, n'accède pas au réseau et est Page suivante Début Fin + + + + + diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index f4da65d..0d58124 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -116,4 +116,9 @@ This application contains no ads, doesn't make any network requests and is Open + + + + + diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index 20844c2..c2036f2 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -116,4 +116,9 @@ This application contains no ads, doesn't make any network requests and is Open + + + + + diff --git a/res/values-lv/strings.xml b/res/values-lv/strings.xml index 7ae25b3..db6eded 100644 --- a/res/values-lv/strings.xml +++ b/res/values-lv/strings.xml @@ -118,4 +118,9 @@ Tagad lieliski piemērota izmantošanai ikdienā. Lejupšķirt Sākums Beigas + + + + + diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index 4531c8f..dff1b05 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -116,4 +116,9 @@ Aplikacja nie zawiera reklam, nie żąda dostępu do internetu, a jej kod źród Page Down Home End + + + + + diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml index 1d98260..651eb0b 100644 --- a/res/values-pt/strings.xml +++ b/res/values-pt/strings.xml @@ -116,4 +116,9 @@ Este aplicativo não contém anúncios, não faz nenhuma solicitação de rede e Page Down Home End + + + + + diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml index b68f15e..13086c5 100644 --- a/res/values-ro/strings.xml +++ b/res/values-ro/strings.xml @@ -116,4 +116,9 @@ Această aplicație nu conține publicitate, nu folosește rețeaua deloc și e + + + + + diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 47e925c..982dcb3 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -116,4 +116,9 @@ Страница вниз Home End + + + + + diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml index 4a77bbc..ce8c205 100644 --- a/res/values-tr/strings.xml +++ b/res/values-tr/strings.xml @@ -116,4 +116,9 @@ Bu uygulama açık kaynaklıdır. Reklam içermez ve internete bağlanmaz."Aşağı BAŞ(Sol yön tuşu) SON(Sağ yön tuşu) + + + + + diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml index 268dc8b..0f7e81f 100644 --- a/res/values-uk/strings.xml +++ b/res/values-uk/strings.xml @@ -116,4 +116,9 @@ Page Down Home End + + + + + diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml index 8ea468d..a97068a 100644 --- a/res/values-vi/strings.xml +++ b/res/values-vi/strings.xml @@ -116,4 +116,9 @@ Bây giờ đã hoàn hảo cho việc sử dụng hàng ngày. + + + + + diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 89b6c28..8809ff2 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -116,4 +116,9 @@ 下一页 Home End + + + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index 224aca5..75df689 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -116,4 +116,9 @@ This application contains no ads, doesn't make any network requests and is Open Page Down Home End + Clipboard manager + Recently copied text + Pinned + Remove this clipboard? + Yes diff --git a/res/values/styles.xml b/res/values/styles.xml index 07ed490..8705d98 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -1,5 +1,6 @@ + + + + + + +