From 58cb6ca232ba89a45d2712088f81e0355e1de771 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 14 Jan 2024 00:50:33 +0100 Subject: [PATCH] Clipboard history pane Work in progress: It's not yet possible to paste from the pane. The pane can be switched to and from and displays the strings recently added to the clipboard. ClipboardHistoryService listens for change to the system clipboard and keep the history in memory. This data is not persisted to the storage. The maximum size limits the amount of user data stored in memory but also gives a sense to the user that the history is not persisted and can be forgotten as soon as the app stops. --- check_layout.py | 3 +- res/layout/clipboard_pane.xml | 6 ++ res/layout/clipboard_pane_entry.xml | 4 + res/values-cs/strings.xml | 1 + res/values-de/strings.xml | 1 + res/values-es/strings.xml | 1 + res/values-fa/strings.xml | 1 + res/values-fr/strings.xml | 1 + res/values-it/strings.xml | 1 + res/values-ko/strings.xml | 1 + res/values-lv/strings.xml | 1 + res/values-pl/strings.xml | 1 + res/values-pt/strings.xml | 1 + res/values-ro/strings.xml | 1 + res/values-ru/strings.xml | 1 + res/values-tr/strings.xml | 1 + res/values-uk/strings.xml | 1 + res/values-vi/strings.xml | 1 + res/values-zh-rCN/strings.xml | 1 + res/values/strings.xml | 1 + res/values/styles.xml | 17 ++++ res/values/themes.xml | 10 ++- res/values/values.xml | 1 + res/xml/clipboard_bottom_row.xml | 9 ++ .../ClipboardHistoryService.java | 85 +++++++++++++++++++ .../juloo.keyboard2/ClipboardHistoryView.java | 78 +++++++++++++++++ srcs/juloo.keyboard2/KeyValue.java | 4 + srcs/juloo.keyboard2/Keyboard2.java | 10 +++ .../prefs/ExtraKeysPreference.java | 1 + 29 files changed, 243 insertions(+), 2 deletions(-) create mode 100644 res/layout/clipboard_pane.xml create mode 100644 res/layout/clipboard_pane_entry.xml create mode 100644 res/xml/clipboard_bottom_row.xml create mode 100644 srcs/juloo.keyboard2/ClipboardHistoryService.java create mode 100644 srcs/juloo.keyboard2/ClipboardHistoryView.java 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/layout/clipboard_pane.xml b/res/layout/clipboard_pane.xml new file mode 100644 index 0000000..41be436 --- /dev/null +++ b/res/layout/clipboard_pane.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/res/layout/clipboard_pane_entry.xml b/res/layout/clipboard_pane_entry.xml new file mode 100644 index 0000000..9d767c3 --- /dev/null +++ b/res/layout/clipboard_pane_entry.xml @@ -0,0 +1,4 @@ + + + + diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index 8474f7f..ceff4fe 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -115,4 +115,5 @@ 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 513d982..7b8295c 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -115,4 +115,5 @@ 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 66ca26a..303bcfd 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -115,4 +115,5 @@ 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 f8132ce..a5e6862 100644 --- a/res/values-fa/strings.xml +++ b/res/values-fa/strings.xml @@ -115,4 +115,5 @@ 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 5530a8b..104ebde 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -115,4 +115,5 @@ 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 84c5706..18b0815 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -115,4 +115,5 @@ 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 f0c1996..9513322 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -115,4 +115,5 @@ 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 c4c39b3..5926476 100644 --- a/res/values-lv/strings.xml +++ b/res/values-lv/strings.xml @@ -117,4 +117,5 @@ 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 fdd4635..3ea9435 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -115,4 +115,5 @@ 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 4eac2a7..fedc8b3 100644 --- a/res/values-pt/strings.xml +++ b/res/values-pt/strings.xml @@ -115,4 +115,5 @@ 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 cf54f43..f1c944e 100644 --- a/res/values-ro/strings.xml +++ b/res/values-ro/strings.xml @@ -115,4 +115,5 @@ 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 2d77de6..dff0a35 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -115,4 +115,5 @@ Страница вниз Home End + diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml index 9f017ca..a7ee01e 100644 --- a/res/values-tr/strings.xml +++ b/res/values-tr/strings.xml @@ -115,4 +115,5 @@ 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 ff0f12a..2abacc0 100644 --- a/res/values-uk/strings.xml +++ b/res/values-uk/strings.xml @@ -115,4 +115,5 @@ Page Down Home End + diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml index a8bea74..fedfd3d 100644 --- a/res/values-vi/strings.xml +++ b/res/values-vi/strings.xml @@ -115,4 +115,5 @@ 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 20eba97..8de622f 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -115,4 +115,5 @@ 下一页 Home End + diff --git a/res/values/strings.xml b/res/values/strings.xml index 9050ce8..253321d 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -115,4 +115,5 @@ This application contains no ads, doesn't make any network requests and is Open Page Down Home End + Recently copied text diff --git a/res/values/styles.xml b/res/values/styles.xml index 07ed490..d57322c 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -1,5 +1,6 @@ + + + + +