diff --git a/app/src/main/assets/language_key_texts/af.txt b/app/src/main/assets/language_key_texts/af.txt index cf64da7e2..de2685f2d 100644 --- a/app/src/main/assets/language_key_texts/af.txt +++ b/app/src/main/assets/language_key_texts/af.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á â ä à æ ã å ā e é è ê ë ę ė ē i í ì ï î į ī ij diff --git a/app/src/main/assets/language_key_texts/all_popup_keys.txt b/app/src/main/assets/language_key_texts/all_popup_keys.txt index e4014ce0c..a66fe37fd 100644 --- a/app/src/main/assets/language_key_texts/all_popup_keys.txt +++ b/app/src/main/assets/language_key_texts/all_popup_keys.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á â ä à ã æ å ā ą ª ă ả ạ ằ ắ ẳ ẵ ặ ầ ấ ẩ ẫ ậ e é è ê ë ē ė ę ě ə ẻ ẽ ẹ ề ế ể ễ ệ ĕ i í ì ï î ī į ı ij ĩ ỉ ị ĭ diff --git a/app/src/main/assets/language_key_texts/ar.txt b/app/src/main/assets/language_key_texts/ar.txt index 0d3027e69..884976182 100644 --- a/app/src/main/assets/language_key_texts/ar.txt +++ b/app/src/main/assets/language_key_texts/ar.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ق ڨ ف ڤ ڢ ڥ ه ﻫ|ه‍ diff --git a/app/src/main/assets/language_key_texts/az.txt b/app/src/main/assets/language_key_texts/az.txt index d8f9fb694..6a3e684dd 100644 --- a/app/src/main/assets/language_key_texts/az.txt +++ b/app/src/main/assets/language_key_texts/az.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a â ä á e ə é i ı î ï ì í į ī diff --git a/app/src/main/assets/language_key_texts/be.txt b/app/src/main/assets/language_key_texts/be.txt index e65d9d22e..7c8edcf87 100644 --- a/app/src/main/assets/language_key_texts/be.txt +++ b/app/src/main/assets/language_key_texts/be.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] е ё ь ъ ' ’ ‚ ‘ diff --git a/app/src/main/assets/language_key_texts/bg.txt b/app/src/main/assets/language_key_texts/bg.txt index 50dc012e4..a0d8740f6 100644 --- a/app/src/main/assets/language_key_texts/bg.txt +++ b/app/src/main/assets/language_key_texts/bg.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] и ѝ [labels] diff --git a/app/src/main/assets/language_key_texts/bn-BD.txt b/app/src/main/assets/language_key_texts/bn-BD.txt index 4c747d74d..99a6e968d 100644 --- a/app/src/main/assets/language_key_texts/bn-BD.txt +++ b/app/src/main/assets/language_key_texts/bn-BD.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ঙ ং % য য় % ড ঢ % diff --git a/app/src/main/assets/language_key_texts/bn-IN.txt b/app/src/main/assets/language_key_texts/bn-IN.txt index 4e0049a74..77fdac212 100644 --- a/app/src/main/assets/language_key_texts/bn-IN.txt +++ b/app/src/main/assets/language_key_texts/bn-IN.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ব ভ % গ ঘ % দ ধ % diff --git a/app/src/main/assets/language_key_texts/ca.txt b/app/src/main/assets/language_key_texts/ca.txt index 93e0cc53e..ded408ce1 100644 --- a/app/src/main/assets/language_key_texts/ca.txt +++ b/app/src/main/assets/language_key_texts/ca.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a à á ä â ã å ą æ ā ª e è é ë ê ę ė ē i í ï ì î į ī diff --git a/app/src/main/assets/language_key_texts/cs.txt b/app/src/main/assets/language_key_texts/cs.txt index 706b2e464..d0198e28e 100644 --- a/app/src/main/assets/language_key_texts/cs.txt +++ b/app/src/main/assets/language_key_texts/cs.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á à â ä æ ã å ā e é ě è ê ë ę ė ē i í î ï ì į ī diff --git a/app/src/main/assets/language_key_texts/da.txt b/app/src/main/assets/language_key_texts/da.txt index 1348dc530..7ddca44d4 100644 --- a/app/src/main/assets/language_key_texts/da.txt +++ b/app/src/main/assets/language_key_texts/da.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a å æ á ä à â ã ā e é ë i í ï diff --git a/app/src/main/assets/language_key_texts/de-CH.txt b/app/src/main/assets/language_key_texts/de-CH.txt index ada864fdd..cc8bd0df0 100644 --- a/app/src/main/assets/language_key_texts/de-CH.txt +++ b/app/src/main/assets/language_key_texts/de-CH.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a ä â à á æ ã å ā e é è ê ë ė o ö ô ò ó õ œ ø ō diff --git a/app/src/main/assets/language_key_texts/de-DE.txt b/app/src/main/assets/language_key_texts/de-DE.txt index 6d8651004..a3465bb1a 100644 --- a/app/src/main/assets/language_key_texts/de-DE.txt +++ b/app/src/main/assets/language_key_texts/de-DE.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a ä â à á æ ã å ā e é è ê ë ė o ö ô ò ó õ œ ø ō diff --git a/app/src/main/assets/language_key_texts/de.txt b/app/src/main/assets/language_key_texts/de.txt index 576ac4be0..144743d16 100644 --- a/app/src/main/assets/language_key_texts/de.txt +++ b/app/src/main/assets/language_key_texts/de.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a ä % â à á æ ã å ā e é è ê ë ė o ö % ô ò ó õ œ ø ō diff --git a/app/src/main/assets/language_key_texts/el.txt b/app/src/main/assets/language_key_texts/el.txt index eebabdbca..4db3f77dd 100644 --- a/app/src/main/assets/language_key_texts/el.txt +++ b/app/src/main/assets/language_key_texts/el.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ε έ % υ ύ % ϋ ΰ ι ί % ϊ ΐ diff --git a/app/src/main/assets/language_key_texts/en.txt b/app/src/main/assets/language_key_texts/en.txt index 6ca4fc9e6..a091434a5 100644 --- a/app/src/main/assets/language_key_texts/en.txt +++ b/app/src/main/assets/language_key_texts/en.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a à á â ä æ ã å ā e é è ê ë ē i í î ï ī ì diff --git a/app/src/main/assets/language_key_texts/eo.txt b/app/src/main/assets/language_key_texts/eo.txt index 510f9757e..6437f715b 100644 --- a/app/src/main/assets/language_key_texts/eo.txt +++ b/app/src/main/assets/language_key_texts/eo.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á à â ä æ ã å ā ă ą ª e é ě è ê ë ę ė ē i í î ï ĩ ì į ī ı ij diff --git a/app/src/main/assets/language_key_texts/es.txt b/app/src/main/assets/language_key_texts/es.txt index d39b9e040..22682a493 100644 --- a/app/src/main/assets/language_key_texts/es.txt +++ b/app/src/main/assets/language_key_texts/es.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á à ä â ã å ą æ ā ª e é è ë ê ę ė ē i í ï ì î į ī diff --git a/app/src/main/assets/language_key_texts/et.txt b/app/src/main/assets/language_key_texts/et.txt index e9cce1675..67d8fbfd2 100644 --- a/app/src/main/assets/language_key_texts/et.txt +++ b/app/src/main/assets/language_key_texts/et.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a ä ā à á â ã å æ ą e ē è ė é ê ë ę ě i ī ì į í î ï ı diff --git a/app/src/main/assets/language_key_texts/eu.txt b/app/src/main/assets/language_key_texts/eu.txt index edae54fc0..5cd8baba5 100644 --- a/app/src/main/assets/language_key_texts/eu.txt +++ b/app/src/main/assets/language_key_texts/eu.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á à ä â ã å ą æ ā ª e é è ë ê ę ė ē i í ï ì î į ī diff --git a/app/src/main/assets/language_key_texts/fa.txt b/app/src/main/assets/language_key_texts/fa.txt index 3b774eaff..1fce5e719 100644 --- a/app/src/main/assets/language_key_texts/fa.txt +++ b/app/src/main/assets/language_key_texts/fa.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ه ﻫ|ه‍ هٔ ة ی ئ ي ﯨ|ى ا !fixedColumnOrder!5 ٱ ء آ أ إ diff --git a/app/src/main/assets/language_key_texts/fi.txt b/app/src/main/assets/language_key_texts/fi.txt index 21c2c508b..0049508b9 100644 --- a/app/src/main/assets/language_key_texts/fi.txt +++ b/app/src/main/assets/language_key_texts/fi.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a ä å æ à á â ã ā o ö ø ô ò ó õ œ ō u ü diff --git a/app/src/main/assets/language_key_texts/fr.txt b/app/src/main/assets/language_key_texts/fr.txt index ecb09856b..1bc0a4b75 100644 --- a/app/src/main/assets/language_key_texts/fr.txt +++ b/app/src/main/assets/language_key_texts/fr.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a à â % æ á ä ã å ā ª e é è ê ë % ę ė ē i î % ï ì í į ī diff --git a/app/src/main/assets/language_key_texts/gl.txt b/app/src/main/assets/language_key_texts/gl.txt index edae54fc0..5cd8baba5 100644 --- a/app/src/main/assets/language_key_texts/gl.txt +++ b/app/src/main/assets/language_key_texts/gl.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á à ä â ã å ą æ ā ª e é è ë ê ę ė ē i í ï ì î į ī diff --git a/app/src/main/assets/language_key_texts/hi-Latn.txt b/app/src/main/assets/language_key_texts/hi-Latn.txt index 6ca4fc9e6..a091434a5 100644 --- a/app/src/main/assets/language_key_texts/hi-Latn.txt +++ b/app/src/main/assets/language_key_texts/hi-Latn.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a à á â ä æ ã å ā e é è ê ë ē i í î ï ī ì diff --git a/app/src/main/assets/language_key_texts/hi.txt b/app/src/main/assets/language_key_texts/hi.txt index bae65ee5e..4514c00a5 100644 --- a/app/src/main/assets/language_key_texts/hi.txt +++ b/app/src/main/assets/language_key_texts/hi.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] औ ऒं ऐ ऐं आ आं आँ diff --git a/app/src/main/assets/language_key_texts/hr.txt b/app/src/main/assets/language_key_texts/hr.txt index 979381342..641abe7e9 100644 --- a/app/src/main/assets/language_key_texts/hr.txt +++ b/app/src/main/assets/language_key_texts/hr.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] s š ś ß n ñ ń z ž ź ż diff --git a/app/src/main/assets/language_key_texts/hu.txt b/app/src/main/assets/language_key_texts/hu.txt index 8f23d7081..f973343ab 100644 --- a/app/src/main/assets/language_key_texts/hu.txt +++ b/app/src/main/assets/language_key_texts/hu.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á e é i í diff --git a/app/src/main/assets/language_key_texts/hy.txt b/app/src/main/assets/language_key_texts/hy.txt index 0fe2ec70f..4808e31b5 100644 --- a/app/src/main/assets/language_key_texts/hy.txt +++ b/app/src/main/assets/language_key_texts/hy.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] punctuation !autoColumnOrder!8 \, ՞ ՜ ․ … ' = / ՝ ՛ ֊ » « ― ) ( ? ՞ ¿ ! ՜ ¡ diff --git a/app/src/main/assets/language_key_texts/is.txt b/app/src/main/assets/language_key_texts/is.txt index 574bb90dd..c54669d7d 100644 --- a/app/src/main/assets/language_key_texts/is.txt +++ b/app/src/main/assets/language_key_texts/is.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á ä æ å à â ã ā e é ë è ê ę ė ē i í ï î ì į ī diff --git a/app/src/main/assets/language_key_texts/it.txt b/app/src/main/assets/language_key_texts/it.txt index 5a74e23c9..e6773c542 100644 --- a/app/src/main/assets/language_key_texts/it.txt +++ b/app/src/main/assets/language_key_texts/it.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a à á â ä æ ã å ā ª e è é ê ë ę ė ē ə i ì í î ï į ī diff --git a/app/src/main/assets/language_key_texts/iw.txt b/app/src/main/assets/language_key_texts/iw.txt index 3fe1c4a5e..70f5f0a2b 100644 --- a/app/src/main/assets/language_key_texts/iw.txt +++ b/app/src/main/assets/language_key_texts/iw.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] + ﬩ ג ג׳ י ײַ diff --git a/app/src/main/assets/language_key_texts/ka.txt b/app/src/main/assets/language_key_texts/ka.txt index d8ff40221..5503b53fa 100644 --- a/app/src/main/assets/language_key_texts/ka.txt +++ b/app/src/main/assets/language_key_texts/ka.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ე ჱ ყ ჸ ი ჲ diff --git a/app/src/main/assets/language_key_texts/kab.txt b/app/src/main/assets/language_key_texts/kab.txt index b8c1c20cb..47a02ff2a 100644 --- a/app/src/main/assets/language_key_texts/kab.txt +++ b/app/src/main/assets/language_key_texts/kab.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a ɛ z ẓ r ṛ diff --git a/app/src/main/assets/language_key_texts/kk.txt b/app/src/main/assets/language_key_texts/kk.txt index b9b810f1c..3a002d98e 100644 --- a/app/src/main/assets/language_key_texts/kk.txt +++ b/app/src/main/assets/language_key_texts/kk.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] у ү ұ к қ е ё diff --git a/app/src/main/assets/language_key_texts/km.txt b/app/src/main/assets/language_key_texts/km.txt index 16b35de8e..6ebd1f31c 100644 --- a/app/src/main/assets/language_key_texts/km.txt +++ b/app/src/main/assets/language_key_texts/km.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ! !icon/zwj_key|‍ ៗ !icon/zwnj_key|‌ " ៑ diff --git a/app/src/main/assets/language_key_texts/kn.txt b/app/src/main/assets/language_key_texts/kn.txt index c96285159..3d684d256 100644 --- a/app/src/main/assets/language_key_texts/kn.txt +++ b/app/src/main/assets/language_key_texts/kn.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ೌ ಔ ೧ % ೈ ಐ ೨ % ಾ ಆ ೩ % diff --git a/app/src/main/assets/language_key_texts/ky.txt b/app/src/main/assets/language_key_texts/ky.txt index 94acce8a4..a16a4c612 100644 --- a/app/src/main/assets/language_key_texts/ky.txt +++ b/app/src/main/assets/language_key_texts/ky.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] у ү е ё н ң diff --git a/app/src/main/assets/language_key_texts/lt.txt b/app/src/main/assets/language_key_texts/lt.txt index bdafec288..22499999f 100644 --- a/app/src/main/assets/language_key_texts/lt.txt +++ b/app/src/main/assets/language_key_texts/lt.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a ą ä ā à á â ã å æ e ė ę ē è é ê ë ě i į ī ì í î ï ı diff --git a/app/src/main/assets/language_key_texts/lv.txt b/app/src/main/assets/language_key_texts/lv.txt index b47fa84d9..fe390ce0b 100644 --- a/app/src/main/assets/language_key_texts/lv.txt +++ b/app/src/main/assets/language_key_texts/lv.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a ā à á â ã ä å æ ą e ē ė è é ê ë ę ě i ī į ì í î ï ı diff --git a/app/src/main/assets/language_key_texts/mk.txt b/app/src/main/assets/language_key_texts/mk.txt index 3de0c28d0..ef3457646 100644 --- a/app/src/main/assets/language_key_texts/mk.txt +++ b/app/src/main/assets/language_key_texts/mk.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] е ѐ и ѝ ' ’ ‚ ‘ diff --git a/app/src/main/assets/language_key_texts/ml.txt b/app/src/main/assets/language_key_texts/ml.txt index fbd4762d1..7782adc75 100644 --- a/app/src/main/assets/language_key_texts/ml.txt +++ b/app/src/main/assets/language_key_texts/ml.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ് അ % ാ ആ % ി ഇ % diff --git a/app/src/main/assets/language_key_texts/mn.txt b/app/src/main/assets/language_key_texts/mn.txt index 5f9b51b46..90ef4f9ca 100644 --- a/app/src/main/assets/language_key_texts/mn.txt +++ b/app/src/main/assets/language_key_texts/mn.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ш щ ё е ь ъ diff --git a/app/src/main/assets/language_key_texts/more_popup_keys.txt b/app/src/main/assets/language_key_texts/more_popup_keys.txt index 948da4f4d..c48b21ad4 100644 --- a/app/src/main/assets/language_key_texts/more_popup_keys.txt +++ b/app/src/main/assets/language_key_texts/more_popup_keys.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á â ä à ã æ å ā ą ª ă e é è ê ë ē ė ę ě ə i í ì ï î ī į ı ij ĩ diff --git a/app/src/main/assets/language_key_texts/mr.txt b/app/src/main/assets/language_key_texts/mr.txt index 29b9995c7..b8455c566 100644 --- a/app/src/main/assets/language_key_texts/mr.txt +++ b/app/src/main/assets/language_key_texts/mr.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ौ औ % ै ऐ % ा आ % diff --git a/app/src/main/assets/language_key_texts/my.txt b/app/src/main/assets/language_key_texts/my.txt index cd50e0c82..f670e805b 100644 --- a/app/src/main/assets/language_key_texts/my.txt +++ b/app/src/main/assets/language_key_texts/my.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] punctuation !autoColumnOrder!9 ၊ . ? ! # ) ( / ; ... ' @ : - " + \% & [labels] diff --git a/app/src/main/assets/language_key_texts/nb.txt b/app/src/main/assets/language_key_texts/nb.txt index d9dfedd7b..d22acc5d5 100644 --- a/app/src/main/assets/language_key_texts/nb.txt +++ b/app/src/main/assets/language_key_texts/nb.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a å æ ä à á â ã ā e é è ê ë ę ė ē o ø ö ô ò ó õ œ ō diff --git a/app/src/main/assets/language_key_texts/ne.txt b/app/src/main/assets/language_key_texts/ne.txt index 6c6f09ce7..e89e7d14f 100644 --- a/app/src/main/assets/language_key_texts/ne.txt +++ b/app/src/main/assets/language_key_texts/ne.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ट ़ ् ऽ punctuation !autoColumnOrder!9 . \, ? ! # ) ( / ; ' @ : - " + \% & diff --git a/app/src/main/assets/language_key_texts/nl.txt b/app/src/main/assets/language_key_texts/nl.txt index 932c4f8a6..ccaa502e3 100644 --- a/app/src/main/assets/language_key_texts/nl.txt +++ b/app/src/main/assets/language_key_texts/nl.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á ä â à æ ã å ā e é ë ê è ę ė ē i í ï ì î į ī ij diff --git a/app/src/main/assets/language_key_texts/pl.txt b/app/src/main/assets/language_key_texts/pl.txt index 295737a08..e96d1acdb 100644 --- a/app/src/main/assets/language_key_texts/pl.txt +++ b/app/src/main/assets/language_key_texts/pl.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a ą á à â ä æ ã å ā e ę è é ê ë ė ē o ó ö ô ò õ œ ø ō diff --git a/app/src/main/assets/language_key_texts/pt.txt b/app/src/main/assets/language_key_texts/pt.txt index 4e584c0ab..7d0247ed6 100644 --- a/app/src/main/assets/language_key_texts/pt.txt +++ b/app/src/main/assets/language_key_texts/pt.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á ã à â ä å æ ª e é ê è ę ė ē ë i í î ì ï į ī diff --git a/app/src/main/assets/language_key_texts/rm.txt b/app/src/main/assets/language_key_texts/rm.txt index a8822b619..864fab38c 100644 --- a/app/src/main/assets/language_key_texts/rm.txt +++ b/app/src/main/assets/language_key_texts/rm.txt @@ -1,2 +1,2 @@ -[morekeys] +[popup_keys] o ò ó ö ô õ œ ø diff --git a/app/src/main/assets/language_key_texts/ro.txt b/app/src/main/assets/language_key_texts/ro.txt index 726599387..3d0ed9711 100644 --- a/app/src/main/assets/language_key_texts/ro.txt +++ b/app/src/main/assets/language_key_texts/ro.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a ă â ã à á ä æ å ā i î ï ì í į ī s ș ß ś š diff --git a/app/src/main/assets/language_key_texts/ru.txt b/app/src/main/assets/language_key_texts/ru.txt index e65d9d22e..7c8edcf87 100644 --- a/app/src/main/assets/language_key_texts/ru.txt +++ b/app/src/main/assets/language_key_texts/ru.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] е ё ь ъ ' ’ ‚ ‘ diff --git a/app/src/main/assets/language_key_texts/si.txt b/app/src/main/assets/language_key_texts/si.txt index 5967763f9..a9f3d3609 100644 --- a/app/src/main/assets/language_key_texts/si.txt +++ b/app/src/main/assets/language_key_texts/si.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ඥ ෴ ද ඳ ඤ ෴ diff --git a/app/src/main/assets/language_key_texts/sk.txt b/app/src/main/assets/language_key_texts/sk.txt index 049cd8c3b..48518a179 100644 --- a/app/src/main/assets/language_key_texts/sk.txt +++ b/app/src/main/assets/language_key_texts/sk.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á ä ā à â ã å æ ą e é ě ē ė è ê ë ę i í ī į ì î ï ı diff --git a/app/src/main/assets/language_key_texts/sl.txt b/app/src/main/assets/language_key_texts/sl.txt index 8d910e67f..435b57239 100644 --- a/app/src/main/assets/language_key_texts/sl.txt +++ b/app/src/main/assets/language_key_texts/sl.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] s š c č ć d đ diff --git a/app/src/main/assets/language_key_texts/sr-Latn.txt b/app/src/main/assets/language_key_texts/sr-Latn.txt index f5bb2c127..dfbcac470 100644 --- a/app/src/main/assets/language_key_texts/sr-Latn.txt +++ b/app/src/main/assets/language_key_texts/sr-Latn.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] e è i ì s š % diff --git a/app/src/main/assets/language_key_texts/sr.txt b/app/src/main/assets/language_key_texts/sr.txt index 4e6d0fd5e..89e06672f 100644 --- a/app/src/main/assets/language_key_texts/sr.txt +++ b/app/src/main/assets/language_key_texts/sr.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] е ѐ и ѝ ' ’ ‚ ‘ › ‹ diff --git a/app/src/main/assets/language_key_texts/sv.txt b/app/src/main/assets/language_key_texts/sv.txt index 1312285ef..a1438e1f0 100644 --- a/app/src/main/assets/language_key_texts/sv.txt +++ b/app/src/main/assets/language_key_texts/sv.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a ä å æ á à â ą ã c ç ć č d ð ď diff --git a/app/src/main/assets/language_key_texts/sw.txt b/app/src/main/assets/language_key_texts/sw.txt index 67b54a253..bc7ccd77b 100644 --- a/app/src/main/assets/language_key_texts/sw.txt +++ b/app/src/main/assets/language_key_texts/sw.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a à á â ä æ ã å ā e è é ê ë ē i î ï í ī ì diff --git a/app/src/main/assets/language_key_texts/ta.txt b/app/src/main/assets/language_key_texts/ta.txt index 8e7852d0c..4d692380a 100644 --- a/app/src/main/assets/language_key_texts/ta.txt +++ b/app/src/main/assets/language_key_texts/ta.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ஔ ௌ % ஐ ை % ஆ ா % diff --git a/app/src/main/assets/language_key_texts/te.txt b/app/src/main/assets/language_key_texts/te.txt index 3e5fee828..c86b937c7 100644 --- a/app/src/main/assets/language_key_texts/te.txt +++ b/app/src/main/assets/language_key_texts/te.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] ౌ ఔ % ై ఐ % ా ఆ % diff --git a/app/src/main/assets/language_key_texts/tl.txt b/app/src/main/assets/language_key_texts/tl.txt index edae54fc0..5cd8baba5 100644 --- a/app/src/main/assets/language_key_texts/tl.txt +++ b/app/src/main/assets/language_key_texts/tl.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a á à ä â ã å ą æ ā ª e é è ë ê ę ė ē i í ï ì î į ī diff --git a/app/src/main/assets/language_key_texts/tr.txt b/app/src/main/assets/language_key_texts/tr.txt index 3932090be..8ad9c50a7 100644 --- a/app/src/main/assets/language_key_texts/tr.txt +++ b/app/src/main/assets/language_key_texts/tr.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a â ä á e ə é i ı î ï ì í į ī diff --git a/app/src/main/assets/language_key_texts/uk.txt b/app/src/main/assets/language_key_texts/uk.txt index 9e4831389..c30f828de 100644 --- a/app/src/main/assets/language_key_texts/uk.txt +++ b/app/src/main/assets/language_key_texts/uk.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] г ґ ь ъ і ї diff --git a/app/src/main/assets/language_key_texts/ur.txt b/app/src/main/assets/language_key_texts/ur.txt index 6ea1aa7bc..6a8019d05 100644 --- a/app/src/main/assets/language_key_texts/ur.txt +++ b/app/src/main/assets/language_key_texts/ur.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] و ؤ ر ڑ ت ٹ diff --git a/app/src/main/assets/language_key_texts/uz.txt b/app/src/main/assets/language_key_texts/uz.txt index d8f9fb694..6a3e684dd 100644 --- a/app/src/main/assets/language_key_texts/uz.txt +++ b/app/src/main/assets/language_key_texts/uz.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a â ä á e ə é i ı î ï ì í į ī diff --git a/app/src/main/assets/language_key_texts/vi.txt b/app/src/main/assets/language_key_texts/vi.txt index f8284af59..8f8fb9d7d 100644 --- a/app/src/main/assets/language_key_texts/vi.txt +++ b/app/src/main/assets/language_key_texts/vi.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a à á ả ã ạ ă ằ ắ ẳ ẵ ặ â ầ ấ ẩ ẫ ậ e è é ẻ ẽ ẹ ê ề ế ể ễ ệ i ì í ỉ ĩ ị diff --git a/app/src/main/assets/language_key_texts/zu.txt b/app/src/main/assets/language_key_texts/zu.txt index 6ca4fc9e6..a091434a5 100644 --- a/app/src/main/assets/language_key_texts/zu.txt +++ b/app/src/main/assets/language_key_texts/zu.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a à á â ä æ ã å ā e é è ê ë ē i í î ï ī ì diff --git a/app/src/main/assets/language_key_texts/zz.txt b/app/src/main/assets/language_key_texts/zz.txt index 77703b2d6..c95406a98 100644 --- a/app/src/main/assets/language_key_texts/zz.txt +++ b/app/src/main/assets/language_key_texts/zz.txt @@ -1,4 +1,4 @@ -[morekeys] +[popup_keys] a à á â ã ä å æ ā ă ą ª e è é ê ë ē ĕ ė ę ě i ì í î ï ĩ ī ĭ į ı ij diff --git a/app/src/main/assets/layouts/number.json b/app/src/main/assets/layouts/number.json index 79a48a681..ca36417a2 100644 --- a/app/src/main/assets/layouts/number.json +++ b/app/src/main/assets/layouts/number.json @@ -40,7 +40,7 @@ "date": { "label": "/" }, "time": { "label": ":" }, "datetime": { "label": "/ :|/", "popup": { "relevant": [ - { "label": "!noPanelAutoMoreKey!" }, + { "label": "!noPanelAutoPopupKey!" }, { "label": "," } ] } } }, diff --git a/app/src/main/assets/layouts/phone.json b/app/src/main/assets/layouts/phone.json index 1480f8ac2..a6cccc997 100644 --- a/app/src/main/assets/layouts/phone.json +++ b/app/src/main/assets/layouts/phone.json @@ -19,7 +19,7 @@ ], [ { "label": "*#|!code/key_switch_alpha_symbol", "labelFlags": 524432 }, - { "label": "0 +|0", "type": "numeric", "popup": { "relevant": [ { "label": "!noPanelAutoMoreKey!" }, { "label": "+" } ] } }, + { "label": "0 +|0", "type": "numeric", "popup": { "relevant": [ { "label": "!noPanelAutoPopupKey!" }, { "label": "+" } ] } }, { "label": "." }, { "label": "action" } ] diff --git a/app/src/main/java/com/android/inputmethod/keyboard/ProximityInfo.java b/app/src/main/java/com/android/inputmethod/keyboard/ProximityInfo.java index ff8d730c2..878cd08fe 100644 --- a/app/src/main/java/com/android/inputmethod/keyboard/ProximityInfo.java +++ b/app/src/main/java/com/android/inputmethod/keyboard/ProximityInfo.java @@ -66,7 +66,7 @@ public class ProximityInfo { mSortedKeys = sortedKeys; mGridNeighbors = new List[mGridSize]; if (minWidth == 0 || height == 0) { - // No proximity required. Keyboard might be more keys keyboard. + // No proximity required. Keyboard might be popup keys keyboard. return; } computeNearestNeighbors(); diff --git a/app/src/main/java/helium314/keyboard/accessibility/AccessibilityLongPressTimer.kt b/app/src/main/java/helium314/keyboard/accessibility/AccessibilityLongPressTimer.kt index 73e656e5c..b8ddfb02f 100644 --- a/app/src/main/java/helium314/keyboard/accessibility/AccessibilityLongPressTimer.kt +++ b/app/src/main/java/helium314/keyboard/accessibility/AccessibilityLongPressTimer.kt @@ -12,7 +12,7 @@ import android.os.Message import helium314.keyboard.keyboard.Key import helium314.keyboard.latin.R -// Handling long press timer to show a more keys keyboard. +// Handling long press timer to show a popup keys keyboard. internal class AccessibilityLongPressTimer(private val mCallback: LongPressTimerCallback, context: Context) : Handler() { interface LongPressTimerCallback { diff --git a/app/src/main/java/helium314/keyboard/accessibility/MainKeyboardAccessibilityDelegate.kt b/app/src/main/java/helium314/keyboard/accessibility/MainKeyboardAccessibilityDelegate.kt index 438ab6b70..d81bd4ecf 100644 --- a/app/src/main/java/helium314/keyboard/accessibility/MainKeyboardAccessibilityDelegate.kt +++ b/app/src/main/java/helium314/keyboard/accessibility/MainKeyboardAccessibilityDelegate.kt @@ -221,12 +221,12 @@ class MainKeyboardAccessibilityDelegate( downEvent.recycle() // Invoke {@link PointerTracker#onLongPressed()} as if a long press timeout has passed. tracker.onLongPressed() - // If {@link Key#hasNoPanelAutoMoreKeys()} is true (such as "0 +" key on the phone layout) + // If {@link Key#hasNoPanelAutoPopupKeys()} is true (such as "0 +" key on the phone layout) // or a key invokes IME switcher dialog, we should just ignore the next // {@link #onRegisterHoverKey(Key,MotionEvent)}. It can be determined by whether // {@link PointerTracker} is in operation or not. if (tracker.isInOperation) { - // This long press shows a more keys keyboard and further hover events should be + // This long press shows a popup keys keyboard and further hover events should be // handled. mBoundsToIgnoreHoverEvent.setEmpty() return @@ -234,12 +234,12 @@ class MainKeyboardAccessibilityDelegate( // This long press has handled at {@link MainKeyboardView#onLongPress(PointerTracker)}. // We should ignore further hover events on this key. mBoundsToIgnoreHoverEvent.set(key.hitBox) - if (key.hasNoPanelAutoMoreKey()) { - // This long press has registered a code point without showing a more keys keyboard. + if (key.hasNoPanelAutoPopupKey()) { + // This long press has registered a code point without showing a popup keys keyboard. // We should talk back the code point if possible. - val codePointOfNoPanelAutoMoreKey = key.moreKeys?.get(0)?.mCode ?: return + val codePointOfNoPanelAutoPopupKey = key.popupKeys?.get(0)?.mCode ?: return val text: String = KeyCodeDescriptionMapper.instance.getDescriptionForCodePoint( - mKeyboardView.context, codePointOfNoPanelAutoMoreKey) ?: return + mKeyboardView.context, codePointOfNoPanelAutoPopupKey) ?: return sendWindowStateChanged(text) } } diff --git a/app/src/main/java/helium314/keyboard/accessibility/MoreKeysKeyboardAccessibilityDelegate.kt b/app/src/main/java/helium314/keyboard/accessibility/PopupKeysKeyboardAccessibilityDelegate.kt similarity index 72% rename from app/src/main/java/helium314/keyboard/accessibility/MoreKeysKeyboardAccessibilityDelegate.kt rename to app/src/main/java/helium314/keyboard/accessibility/PopupKeysKeyboardAccessibilityDelegate.kt index 04b684112..a35133395 100644 --- a/app/src/main/java/helium314/keyboard/accessibility/MoreKeysKeyboardAccessibilityDelegate.kt +++ b/app/src/main/java/helium314/keyboard/accessibility/PopupKeysKeyboardAccessibilityDelegate.kt @@ -10,18 +10,18 @@ import android.graphics.Rect import helium314.keyboard.latin.utils.Log import android.view.MotionEvent import helium314.keyboard.keyboard.KeyDetector -import helium314.keyboard.keyboard.MoreKeysKeyboardView +import helium314.keyboard.keyboard.PopupKeysKeyboardView import helium314.keyboard.keyboard.PointerTracker /** - * This class represents a delegate that can be registered in [MoreKeysKeyboardView] to + * This class represents a delegate that can be registered in [PopupKeysKeyboardView] to * enhance accessibility support via composition rather via inheritance. */ -class MoreKeysKeyboardAccessibilityDelegate( - moreKeysKeyboardView: MoreKeysKeyboardView, +class PopupKeysKeyboardAccessibilityDelegate( + popupKeysKeyboardView: PopupKeysKeyboardView, keyDetector: KeyDetector -) : KeyboardAccessibilityDelegate(moreKeysKeyboardView, keyDetector) { - private val mMoreKeysKeyboardValidBounds = Rect() +) : KeyboardAccessibilityDelegate(popupKeysKeyboardView, keyDetector) { + private val mPopupKeysKeyboardValidBounds = Rect() private var mOpenAnnounceResId = 0 private var mCloseAnnounceResId = 0 fun setOpenAnnounce(resId: Int) { @@ -32,11 +32,11 @@ class MoreKeysKeyboardAccessibilityDelegate( mCloseAnnounceResId = resId } - fun onShowMoreKeysKeyboard() { + fun onShowPopupKeysKeyboard() { sendWindowStateChanged(mOpenAnnounceResId) } - fun onDismissMoreKeysKeyboard() { + fun onDismissPopupKeysKeyboard() { sendWindowStateChanged(mCloseAnnounceResId) } @@ -77,27 +77,27 @@ class MoreKeysKeyboardAccessibilityDelegate( val y = event.getY(actionIndex).toInt() val pointerId = event.getPointerId(actionIndex) val eventTime = event.eventTime - // A hover exit event at one pixel width or height area on the edges of more keys keyboard + // A hover exit event at one pixel width or height area on the edges of popup keys keyboard // are treated as closing. - mMoreKeysKeyboardValidBounds[0, 0, mKeyboardView.width] = mKeyboardView.height - mMoreKeysKeyboardValidBounds.inset(CLOSING_INSET_IN_PIXEL, CLOSING_INSET_IN_PIXEL) - if (mMoreKeysKeyboardValidBounds.contains(x, y)) { - // Invoke {@link MoreKeysKeyboardView#onUpEvent(int,int,int,long)} as if this hover + mPopupKeysKeyboardValidBounds[0, 0, mKeyboardView.width] = mKeyboardView.height + mPopupKeysKeyboardValidBounds.inset(CLOSING_INSET_IN_PIXEL, CLOSING_INSET_IN_PIXEL) + if (mPopupKeysKeyboardValidBounds.contains(x, y)) { + // Invoke {@link PopupKeysKeyboardView#onUpEvent(int,int,int,long)} as if this hover // exit event selects a key. mKeyboardView.onUpEvent(x, y, pointerId, eventTime) // TODO: Should fix this reference. This is a hack to clear the state of // {@link PointerTracker}. - PointerTracker.dismissAllMoreKeysPanels() + PointerTracker.dismissAllPopupKeysPanels() return } - // Close the more keys keyboard. + // Close the popup keys keyboard. // TODO: Should fix this reference. This is a hack to clear the state of // {@link PointerTracker}. - PointerTracker.dismissAllMoreKeysPanels() + PointerTracker.dismissAllPopupKeysPanels() } companion object { - private val TAG = MoreKeysKeyboardAccessibilityDelegate::class.java.simpleName + private val TAG = PopupKeysKeyboardAccessibilityDelegate::class.java.simpleName private const val CLOSING_INSET_IN_PIXEL = 1 } } diff --git a/app/src/main/java/helium314/keyboard/keyboard/Key.java b/app/src/main/java/helium314/keyboard/keyboard/Key.java index 3c5e607c6..f24b913ba 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/Key.java +++ b/app/src/main/java/helium314/keyboard/keyboard/Key.java @@ -16,11 +16,11 @@ import helium314.keyboard.keyboard.internal.KeySpecParser; import helium314.keyboard.keyboard.internal.KeyVisualAttributes; import helium314.keyboard.keyboard.internal.KeyboardIconsSet; import helium314.keyboard.keyboard.internal.KeyboardParams; -import helium314.keyboard.keyboard.internal.MoreKeySpec; +import helium314.keyboard.keyboard.internal.PopupKeySpec; import helium314.keyboard.keyboard.internal.keyboard_parser.floris.PopupSet; import helium314.keyboard.latin.common.Constants; import helium314.keyboard.latin.common.StringUtils; -import helium314.keyboard.latin.utils.MoreKeysUtilsKt; +import helium314.keyboard.latin.utils.PopupKeysUtilsKt; import java.util.Arrays; import java.util.Locale; @@ -81,7 +81,7 @@ public class Key implements Comparable { public static final int LABEL_FLAGS_FOLLOW_FUNCTIONAL_TEXT_COLOR = 0x80000; public static final int LABEL_FLAGS_KEEP_BACKGROUND_ASPECT_RATIO = 0x100000; public static final int LABEL_FLAGS_DISABLE_HINT_LABEL = 0x40000000; - public static final int LABEL_FLAGS_DISABLE_ADDITIONAL_MORE_KEYS = 0x80000000; + public static final int LABEL_FLAGS_DISABLE_ADDITIONAL_POPUP_KEYS = 0x80000000; /** Icon to display instead of a label. Icon takes precedence over a label */ private final int mIconId; @@ -108,33 +108,31 @@ public class Key implements Comparable { @NonNull private final Rect mHitBox = new Rect(); - /** More keys. It is guaranteed that this is null or an array of one or more elements */ + /** Popup keys. It is guaranteed that this is null or an array of one or more elements */ @Nullable - private final MoreKeySpec[] mMoreKeys; - /** More keys column number and flags */ - private final int mMoreKeysColumnAndFlags; - private static final int MORE_KEYS_COLUMN_NUMBER_MASK = 0x000000ff; - // If this flag is specified, more keys keyboard should have the specified number of columns. - // Otherwise more keys keyboard should have less than or equal to the specified maximum number + private final PopupKeySpec[] mPopupKeys; + /** Popup keys column number and flags */ + private final int mPopupKeysColumnAndFlags; + private static final int POPUP_KEYS_COLUMN_NUMBER_MASK = 0x000000ff; + // If this flag is specified, popup keys keyboard should have the specified number of columns. + // Otherwise popup keys keyboard should have less than or equal to the specified maximum number // of columns. - private static final int MORE_KEYS_FLAGS_FIXED_COLUMN = 0x00000100; - // If this flag is specified, the order of more keys is determined by the order in the more - // keys' specification. Otherwise the order of more keys is automatically determined. - private static final int MORE_KEYS_FLAGS_FIXED_ORDER = 0x00000200; - private static final int MORE_KEYS_MODE_MAX_COLUMN_WITH_AUTO_ORDER = 0; - private static final int MORE_KEYS_MODE_FIXED_COLUMN_WITH_AUTO_ORDER = - MORE_KEYS_FLAGS_FIXED_COLUMN; - private static final int MORE_KEYS_MODE_FIXED_COLUMN_WITH_FIXED_ORDER = - (MORE_KEYS_FLAGS_FIXED_COLUMN | MORE_KEYS_FLAGS_FIXED_ORDER); - private static final int MORE_KEYS_FLAGS_HAS_LABELS = 0x40000000; - private static final int MORE_KEYS_FLAGS_NEEDS_DIVIDERS = 0x20000000; - private static final int MORE_KEYS_FLAGS_NO_PANEL_AUTO_MORE_KEY = 0x10000000; + private static final int POPUP_KEYS_FLAGS_FIXED_COLUMN = 0x00000100; + // If this flag is specified, the order of popup keys is determined by the order in the popup + // keys' specification. Otherwise the order of popup keys is automatically determined. + private static final int POPUP_KEYS_FLAGS_FIXED_ORDER = 0x00000200; + private static final int POPUP_KEYS_MODE_MAX_COLUMN_WITH_AUTO_ORDER = 0; + private static final int POPUP_KEYS_MODE_FIXED_COLUMN_WITH_AUTO_ORDER = POPUP_KEYS_FLAGS_FIXED_COLUMN; + private static final int POPUP_KEYS_MODE_FIXED_COLUMN_WITH_FIXED_ORDER = (POPUP_KEYS_FLAGS_FIXED_COLUMN | POPUP_KEYS_FLAGS_FIXED_ORDER); + private static final int POPUP_KEYS_FLAGS_HAS_LABELS = 0x40000000; + private static final int POPUP_KEYS_FLAGS_NEEDS_DIVIDERS = 0x20000000; + private static final int POPUP_KEYS_FLAGS_NO_PANEL_AUTO_POPUP_KEY = 0x10000000; // TODO: Rename these specifiers to !autoOrder! and !fixedOrder! respectively. - public static final String MORE_KEYS_AUTO_COLUMN_ORDER = "!autoColumnOrder!"; - public static final String MORE_KEYS_FIXED_COLUMN_ORDER = "!fixedColumnOrder!"; - public static final String MORE_KEYS_HAS_LABELS = "!hasLabels!"; - private static final String MORE_KEYS_NEEDS_DIVIDERS = "!needsDividers!"; - private static final String MORE_KEYS_NO_PANEL_AUTO_MORE_KEY = "!noPanelAutoMoreKey!"; + public static final String POPUP_KEYS_AUTO_COLUMN_ORDER = "!autoColumnOrder!"; + public static final String POPUP_KEYS_FIXED_COLUMN_ORDER = "!fixedColumnOrder!"; + public static final String POPUP_KEYS_HAS_LABELS = "!hasLabels!"; + private static final String POPUP_KEYS_NEEDS_DIVIDERS = "!needsDividers!"; + private static final String POPUP_KEYS_NO_PANEL_AUTO_POPUP_KEY = "!noPanelAutoPopupKey!"; /** Background type that represents different key background visual than normal one. */ private final int mBackgroundType; @@ -197,7 +195,7 @@ public class Key implements Comparable { private boolean mEnabled = true; /** - * Constructor for a key on MoreKeyKeyboard and on MoreSuggestions. + * Constructor for a key on PopupKeyKeyboard and on MoreSuggestions. */ public Key(@Nullable final String label, final int iconId, final int code, @Nullable final String outputText, @Nullable final String hintLabel, @@ -212,8 +210,8 @@ public class Key implements Comparable { mBackgroundType = backgroundType; // TODO: Pass keyActionFlags as an argument. mActionFlags = ACTION_FLAGS_NO_KEY_PREVIEW; - mMoreKeys = null; - mMoreKeysColumnAndFlags = 0; + mPopupKeys = null; + mPopupKeysColumnAndFlags = 0; mLabel = label; mOptionalAttributes = OptionalAttributes.newInstance(outputText, CODE_UNSPECIFIED, ICON_UNDEFINED, 0 /* visualInsetsLeft */, 0 /* visualInsetsRight */); @@ -233,11 +231,11 @@ public class Key implements Comparable { * Copy constructor for DynamicGridKeyboard.GridKey. * * @param key the original key. - * @param moreKeys the more keys that should be assigned to this key. + * @param popupKeys the popup keys that should be assigned to this key. * @param labelHint the label hint that should be assigned to this key. * @param backgroundType the background type that should be assigned to this key. */ - protected Key(@NonNull final Key key, @Nullable final MoreKeySpec[] moreKeys, + protected Key(@NonNull final Key key, @Nullable final PopupKeySpec[] popupKeys, @Nullable final String labelHint, final int backgroundType) { // Final attributes. mCode = key.mCode; @@ -252,8 +250,8 @@ public class Key implements Comparable { mX = key.mX; mY = key.mY; mHitBox.set(key.mHitBox); - mMoreKeys = moreKeys; - mMoreKeysColumnAndFlags = key.mMoreKeysColumnAndFlags; + mPopupKeys = popupKeys; + mPopupKeysColumnAndFlags = key.mPopupKeysColumnAndFlags; mBackgroundType = backgroundType; mActionFlags = key.mActionFlags; mKeyVisualAttributes = key.mKeyVisualAttributes; @@ -265,7 +263,7 @@ public class Key implements Comparable { } /** constructor for creating emoji recent keys when there is no keyboard to take keys from */ - public Key(@NonNull final Key key, @Nullable final MoreKeySpec[] moreKeys, + public Key(@NonNull final Key key, @Nullable final PopupKeySpec[] popupKeys, @Nullable final String labelHint, final int backgroundType, final int code, @Nullable final String outputText) { // Final attributes. mCode = outputText == null ? code : CODE_OUTPUT_TEXT; @@ -280,8 +278,8 @@ public class Key implements Comparable { mX = key.mX; mY = key.mY; mHitBox.set(key.mHitBox); - mMoreKeys = moreKeys; - mMoreKeysColumnAndFlags = key.mMoreKeysColumnAndFlags; + mPopupKeys = popupKeys; + mPopupKeysColumnAndFlags = key.mPopupKeysColumnAndFlags; mBackgroundType = backgroundType; mActionFlags = key.mActionFlags; mKeyVisualAttributes = key.mKeyVisualAttributes; @@ -300,8 +298,8 @@ public class Key implements Comparable { mHintLabel = keyParams.mHintLabel; mLabelFlags = keyParams.mLabelFlags; mIconId = keyParams.mIconId; - mMoreKeys = keyParams.mMoreKeys; - mMoreKeysColumnAndFlags = keyParams.mMoreKeysColumnAndFlags; + mPopupKeys = keyParams.mPopupKeys; + mPopupKeysColumnAndFlags = keyParams.mPopupKeysColumnAndFlags; mBackgroundType = keyParams.mBackgroundType; mActionFlags = keyParams.mActionFlags; mKeyVisualAttributes = keyParams.mKeyVisualAttributes; @@ -328,7 +326,7 @@ public class Key implements Comparable { mHashCode = computeHashCode(this); } - private Key(@NonNull final Key key, @Nullable final MoreKeySpec[] moreKeys) { + private Key(@NonNull final Key key, @Nullable final PopupKeySpec[] popupKeys) { // Final attributes. mCode = key.mCode; mLabel = key.mLabel; @@ -342,10 +340,10 @@ public class Key implements Comparable { mX = key.mX; mY = key.mY; mHitBox.set(key.mHitBox); - mMoreKeys = moreKeys; - mMoreKeysColumnAndFlags = key.mMoreKeysColumnAndFlags; + mPopupKeys = popupKeys; + mPopupKeysColumnAndFlags = key.mPopupKeysColumnAndFlags; mBackgroundType = key.mBackgroundType; - if (moreKeys == null && mCode > Constants.CODE_SPACE && (key.mActionFlags & ACTION_FLAGS_ENABLE_LONG_PRESS) != 0) + if (popupKeys == null && mCode > Constants.CODE_SPACE && (key.mActionFlags & ACTION_FLAGS_ENABLE_LONG_PRESS) != 0) mActionFlags = key.mActionFlags - ACTION_FLAGS_ENABLE_LONG_PRESS; else mActionFlags = key.mActionFlags; @@ -358,12 +356,12 @@ public class Key implements Comparable { } @NonNull - public static Key removeRedundantMoreKeys(@NonNull final Key key, - @NonNull final MoreKeySpec.LettersOnBaseLayout lettersOnBaseLayout) { - final MoreKeySpec[] moreKeys = key.getMoreKeys(); - final MoreKeySpec[] filteredMoreKeys = MoreKeySpec.removeRedundantMoreKeys( - moreKeys, lettersOnBaseLayout); - return (filteredMoreKeys == moreKeys) ? key : new Key(key, filteredMoreKeys); + public static Key removeRedundantPopupKeys(@NonNull final Key key, + @NonNull final PopupKeySpec.LettersOnBaseLayout lettersOnBaseLayout) { + final PopupKeySpec[] popupKeys = key.getPopupKeys(); + final PopupKeySpec[] filteredPopupKeys = PopupKeySpec.removeRedundantPopupKeys( + popupKeys, lettersOnBaseLayout); + return (filteredPopupKeys == popupKeys) ? key : new Key(key, filteredPopupKeys); } private static boolean needsToUpcase(final int labelFlags, final int keyboardElementId) { @@ -386,7 +384,7 @@ public class Key implements Comparable { key.mHintLabel, key.mIconId, key.mBackgroundType, - Arrays.hashCode(key.mMoreKeys), + Arrays.hashCode(key.mPopupKeys), key.getOutputText(), key.mActionFlags, key.mLabelFlags, @@ -398,7 +396,7 @@ public class Key implements Comparable { // key.mVerticalGap, // key.mOptionalAttributes.mVisualInsetLeft, // key.mOptionalAttributes.mVisualInsetRight, - // key.mMaxMoreKeysColumn, + // key.mMaxPopupKeysColumn, }); } @@ -413,7 +411,7 @@ public class Key implements Comparable { && TextUtils.equals(o.mHintLabel, mHintLabel) && o.mIconId == mIconId && o.mBackgroundType == mBackgroundType - && Arrays.equals(o.mMoreKeys, mMoreKeys) + && Arrays.equals(o.mPopupKeys, mPopupKeys) && TextUtils.equals(o.getOutputText(), getOutputText()) && o.mActionFlags == mActionFlags && o.mLabelFlags == mLabelFlags; @@ -486,8 +484,8 @@ public class Key implements Comparable { } @Nullable - public MoreKeySpec[] getMoreKeys() { - return mMoreKeys; + public PopupKeySpec[] getPopupKeys() { + return mPopupKeys; } public void markAsLeftEdge(final KeyboardParams params) { @@ -592,8 +590,8 @@ public class Key implements Comparable { return params.mHintLetterColor; } - public final int selectMoreKeyTextSize(final KeyDrawParams params) { - return hasLabelsInMoreKeys() ? params.mLabelSize : params.mLetterSize; + public final int selectPopupKeyTextSize(final KeyDrawParams params) { + return hasLabelsInPopupKeys() ? params.mLabelSize : params.mLetterSize; } public final String getPreviewLabel() { @@ -666,35 +664,35 @@ public class Key implements Comparable { && !TextUtils.isEmpty(mHintLabel); } - public final int getMoreKeysColumnNumber() { - return mMoreKeysColumnAndFlags & MORE_KEYS_COLUMN_NUMBER_MASK; + public final int getPopupKeysColumnNumber() { + return mPopupKeysColumnAndFlags & POPUP_KEYS_COLUMN_NUMBER_MASK; } - public final boolean isMoreKeysFixedColumn() { - return (mMoreKeysColumnAndFlags & MORE_KEYS_FLAGS_FIXED_COLUMN) != 0; + public final boolean isPopupKeysFixedColumn() { + return (mPopupKeysColumnAndFlags & POPUP_KEYS_FLAGS_FIXED_COLUMN) != 0; } - public final boolean isMoreKeysFixedOrder() { - return (mMoreKeysColumnAndFlags & MORE_KEYS_FLAGS_FIXED_ORDER) != 0; + public final boolean isPopupKeysFixedOrder() { + return (mPopupKeysColumnAndFlags & POPUP_KEYS_FLAGS_FIXED_ORDER) != 0; } - public final boolean hasLabelsInMoreKeys() { - return (mMoreKeysColumnAndFlags & MORE_KEYS_FLAGS_HAS_LABELS) != 0; + public final boolean hasLabelsInPopupKeys() { + return (mPopupKeysColumnAndFlags & POPUP_KEYS_FLAGS_HAS_LABELS) != 0; } - public final int getMoreKeyLabelFlags() { - final int labelSizeFlag = hasLabelsInMoreKeys() + public final int getPopupKeyLabelFlags() { + final int labelSizeFlag = hasLabelsInPopupKeys() ? LABEL_FLAGS_FOLLOW_KEY_LABEL_RATIO : LABEL_FLAGS_FOLLOW_KEY_LETTER_RATIO; return labelSizeFlag | LABEL_FLAGS_AUTO_X_SCALE; } - public final boolean needsDividersInMoreKeys() { - return (mMoreKeysColumnAndFlags & MORE_KEYS_FLAGS_NEEDS_DIVIDERS) != 0; + public final boolean needsDividersInPopupKeys() { + return (mPopupKeysColumnAndFlags & POPUP_KEYS_FLAGS_NEEDS_DIVIDERS) != 0; } - public final boolean hasNoPanelAutoMoreKey() { - return (mMoreKeysColumnAndFlags & MORE_KEYS_FLAGS_NO_PANEL_AUTO_MORE_KEY) != 0; + public final boolean hasNoPanelAutoPopupKey() { + return (mPopupKeysColumnAndFlags & POPUP_KEYS_FLAGS_NO_PANEL_AUTO_POPUP_KEY) != 0; } @Nullable @@ -945,7 +943,7 @@ public class Key implements Comparable { } /** - * This constructor is being used only for divider in more keys keyboard. + * This constructor is being used only for divider in popup keys keyboard. */ protected Spacer(final KeyboardParams params, final int x, final int y, final int width, final int height) { @@ -977,8 +975,8 @@ public class Key implements Comparable { @Nullable public final String mHintLabel; public final int mLabelFlags; public final int mIconId; - @Nullable public MoreKeySpec[] mMoreKeys; - public final int mMoreKeysColumnAndFlags; + @Nullable public PopupKeySpec[] mPopupKeys; + public final int mPopupKeysColumnAndFlags; public int mBackgroundType; public final int mActionFlags; @Nullable public final KeyVisualAttributes mKeyVisualAttributes; @@ -1003,7 +1001,7 @@ public class Key implements Comparable { if (!isSpacer && mRelativeWidth == 0) mRelativeWidth = mKeyboardParams.mDefaultRelativeKeyWidth; if (mRelativeHeight < 0) - // todo (later): deal with it properly when it needs to be adjusted, i.e. when changing moreKeys or moreSuggestions + // todo (later): deal with it properly when it needs to be adjusted, i.e. when changing popupKeys or moreSuggestions throw new IllegalStateException("can't (yet) deal with absolute height"); xPos = newX; yPos = newY; @@ -1023,28 +1021,28 @@ public class Key implements Comparable { } } - private static int getMoreKeysColumnAndFlagsAndSetNullInArray(final KeyboardParams params, final String[] moreKeys) { + private static int getPopupKeysColumnAndFlagsAndSetNullInArray(final KeyboardParams params, final String[] popupKeys) { // Get maximum column order number and set a relevant mode value. - int moreKeysColumnAndFlags = MORE_KEYS_MODE_MAX_COLUMN_WITH_AUTO_ORDER | params.mMaxMoreKeysKeyboardColumn; + int popupKeysColumnAndFlags = POPUP_KEYS_MODE_MAX_COLUMN_WITH_AUTO_ORDER | params.mMaxPopupKeysKeyboardColumn; int value; - if ((value = MoreKeySpec.getIntValue(moreKeys, MORE_KEYS_AUTO_COLUMN_ORDER, -1)) > 0) { + if ((value = PopupKeySpec.getIntValue(popupKeys, POPUP_KEYS_AUTO_COLUMN_ORDER, -1)) > 0) { // Override with fixed column order number and set a relevant mode value. - moreKeysColumnAndFlags = MORE_KEYS_MODE_FIXED_COLUMN_WITH_AUTO_ORDER | (value & MORE_KEYS_COLUMN_NUMBER_MASK); + popupKeysColumnAndFlags = POPUP_KEYS_MODE_FIXED_COLUMN_WITH_AUTO_ORDER | (value & POPUP_KEYS_COLUMN_NUMBER_MASK); } - if ((value = MoreKeySpec.getIntValue(moreKeys, MORE_KEYS_FIXED_COLUMN_ORDER, -1)) > 0) { + if ((value = PopupKeySpec.getIntValue(popupKeys, POPUP_KEYS_FIXED_COLUMN_ORDER, -1)) > 0) { // Override with fixed column order number and set a relevant mode value. - moreKeysColumnAndFlags = MORE_KEYS_MODE_FIXED_COLUMN_WITH_FIXED_ORDER | (value & MORE_KEYS_COLUMN_NUMBER_MASK); + popupKeysColumnAndFlags = POPUP_KEYS_MODE_FIXED_COLUMN_WITH_FIXED_ORDER | (value & POPUP_KEYS_COLUMN_NUMBER_MASK); } - if (MoreKeySpec.getBooleanValue(moreKeys, MORE_KEYS_HAS_LABELS)) { - moreKeysColumnAndFlags |= MORE_KEYS_FLAGS_HAS_LABELS; + if (PopupKeySpec.getBooleanValue(popupKeys, POPUP_KEYS_HAS_LABELS)) { + popupKeysColumnAndFlags |= POPUP_KEYS_FLAGS_HAS_LABELS; } - if (MoreKeySpec.getBooleanValue(moreKeys, MORE_KEYS_NEEDS_DIVIDERS)) { - moreKeysColumnAndFlags |= MORE_KEYS_FLAGS_NEEDS_DIVIDERS; + if (PopupKeySpec.getBooleanValue(popupKeys, POPUP_KEYS_NEEDS_DIVIDERS)) { + popupKeysColumnAndFlags |= POPUP_KEYS_FLAGS_NEEDS_DIVIDERS; } - if (MoreKeySpec.getBooleanValue(moreKeys, MORE_KEYS_NO_PANEL_AUTO_MORE_KEY)) { - moreKeysColumnAndFlags |= MORE_KEYS_FLAGS_NO_PANEL_AUTO_MORE_KEY; + if (PopupKeySpec.getBooleanValue(popupKeys, POPUP_KEYS_NO_PANEL_AUTO_POPUP_KEY)) { + popupKeysColumnAndFlags |= POPUP_KEYS_FLAGS_NO_PANEL_AUTO_POPUP_KEY; } - return moreKeysColumnAndFlags; + return popupKeysColumnAndFlags; } public KeyParams( @@ -1101,18 +1099,18 @@ public class Key implements Comparable { : label; } - // moreKeys - final String[] moreKeys = MoreKeysUtilsKt.createMoreKeysArray(popupSet, mKeyboardParams, label != null ? label : keySpec); - mMoreKeysColumnAndFlags = getMoreKeysColumnAndFlagsAndSetNullInArray(params, moreKeys); - final String[] finalMoreKeys = moreKeys == null ? null : MoreKeySpec.filterOutEmptyString(moreKeys); - if (finalMoreKeys != null) { + // popupKeys + final String[] popupKeys = PopupKeysUtilsKt.createPopupKeysArray(popupSet, mKeyboardParams, label != null ? label : keySpec); + mPopupKeysColumnAndFlags = getPopupKeysColumnAndFlagsAndSetNullInArray(params, popupKeys); + final String[] finalPopupKeys = popupKeys == null ? null : PopupKeySpec.filterOutEmptyString(popupKeys); + if (finalPopupKeys != null) { actionFlags |= ACTION_FLAGS_ENABLE_LONG_PRESS; - mMoreKeys = new MoreKeySpec[finalMoreKeys.length]; - for (int i = 0; i < finalMoreKeys.length; i++) { - mMoreKeys[i] = new MoreKeySpec(finalMoreKeys[i], needsToUpcase, localeForUpcasing); + mPopupKeys = new PopupKeySpec[finalPopupKeys.length]; + for (int i = 0; i < finalPopupKeys.length; i++) { + mPopupKeys[i] = new PopupKeySpec(finalPopupKeys[i], needsToUpcase, localeForUpcasing); } } else { - mMoreKeys = null; + mPopupKeys = null; } // hint label @@ -1120,7 +1118,7 @@ public class Key implements Comparable { mHintLabel = null; } else { // maybe also always null for comma and period keys - final String hintLabel = MoreKeysUtilsKt.getHintLabel(popupSet, params, keySpec); + final String hintLabel = PopupKeysUtilsKt.getHintLabel(popupSet, params, keySpec); mHintLabel = needsToUpcase ? StringUtils.toTitleCaseOfKeyLabel(hintLabel, localeForUpcasing) : hintLabel; @@ -1191,33 +1189,33 @@ public class Key implements Comparable { /** constructor for emoji parser */ public KeyParams(@Nullable final String label, final int code, @Nullable final String hintLabel, - @Nullable final String moreKeySpecs, final int labelFlags, final KeyboardParams params) { + @Nullable final String popupKeySpecs, final int labelFlags, final KeyboardParams params) { mKeyboardParams = params; mHintLabel = hintLabel; mLabelFlags = labelFlags; mBackgroundType = BACKGROUND_TYPE_EMPTY; - if (moreKeySpecs != null) { - String[] moreKeys = MoreKeySpec.splitKeySpecs(moreKeySpecs); - mMoreKeysColumnAndFlags = getMoreKeysColumnAndFlagsAndSetNullInArray(params, moreKeys); + if (popupKeySpecs != null) { + String[] popupKeys = PopupKeySpec.splitKeySpecs(popupKeySpecs); + mPopupKeysColumnAndFlags = getPopupKeysColumnAndFlagsAndSetNullInArray(params, popupKeys); - moreKeys = MoreKeySpec.insertAdditionalMoreKeys(moreKeys, null); + popupKeys = PopupKeySpec.insertAdditionalPopupKeys(popupKeys, null); int actionFlags = 0; - if (moreKeys != null) { + if (popupKeys != null) { actionFlags |= ACTION_FLAGS_ENABLE_LONG_PRESS; - mMoreKeys = new MoreKeySpec[moreKeys.length]; - for (int i = 0; i < moreKeys.length; i++) { - mMoreKeys[i] = new MoreKeySpec(moreKeys[i], false, Locale.getDefault()); + mPopupKeys = new PopupKeySpec[popupKeys.length]; + for (int i = 0; i < popupKeys.length; i++) { + mPopupKeys[i] = new PopupKeySpec(popupKeys[i], false, Locale.getDefault()); } } else { - mMoreKeys = null; + mPopupKeys = null; } mActionFlags = actionFlags; } else { // TODO: Pass keyActionFlags as an argument. mActionFlags = ACTION_FLAGS_NO_KEY_PREVIEW; - mMoreKeys = null; - mMoreKeysColumnAndFlags = 0; + mPopupKeys = null; + mPopupKeysColumnAndFlags = 0; } mLabel = label; @@ -1243,8 +1241,8 @@ public class Key implements Comparable { mIconId = KeyboardIconsSet.ICON_UNDEFINED; mBackgroundType = BACKGROUND_TYPE_NORMAL; mActionFlags = ACTION_FLAGS_NO_KEY_PREVIEW; - mMoreKeys = null; - mMoreKeysColumnAndFlags = 0; + mPopupKeys = null; + mPopupKeysColumnAndFlags = 0; mLabelFlags = LABEL_FLAGS_FONT_NORMAL; mEnabled = true; } @@ -1265,8 +1263,8 @@ public class Key implements Comparable { mIconId = keyParams.mIconId; mFullWidth = keyParams.mFullWidth; mFullHeight = keyParams.mFullHeight; - mMoreKeys = keyParams.mMoreKeys; - mMoreKeysColumnAndFlags = keyParams.mMoreKeysColumnAndFlags; + mPopupKeys = keyParams.mPopupKeys; + mPopupKeysColumnAndFlags = keyParams.mPopupKeysColumnAndFlags; mBackgroundType = keyParams.mBackgroundType; mActionFlags = keyParams.mActionFlags; mKeyVisualAttributes = keyParams.mKeyVisualAttributes; diff --git a/app/src/main/java/helium314/keyboard/keyboard/Keyboard.java b/app/src/main/java/helium314/keyboard/keyboard/Keyboard.java index 5b09a8968..15e11ad5a 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/Keyboard.java +++ b/app/src/main/java/helium314/keyboard/keyboard/Keyboard.java @@ -67,11 +67,11 @@ public class Keyboard { public final int mMostCommonKeyHeight; public final int mMostCommonKeyWidth; - /** More keys keyboard template */ - public final int mMoreKeysTemplate; + /** Popup keys keyboard template */ + public final int mPopupKeysTemplate; - /** Maximum column for more keys keyboard */ - public final int mMaxMoreKeysKeyboardColumn; + /** Maximum column for popup keys keyboard */ + public final int mMaxPopupKeysKeyboardColumn; /** List of keys in this keyboard */ @NonNull @@ -101,8 +101,8 @@ public class Keyboard { mBaseWidth = params.mBaseWidth; mMostCommonKeyHeight = params.mMostCommonKeyHeight; mMostCommonKeyWidth = params.mMostCommonKeyWidth; - mMoreKeysTemplate = params.mMoreKeysTemplate; - mMaxMoreKeysKeyboardColumn = params.mMaxMoreKeysKeyboardColumn; + mPopupKeysTemplate = params.mPopupKeysTemplate; + mMaxPopupKeysKeyboardColumn = params.mMaxPopupKeysKeyboardColumn; mKeyVisualAttributes = params.mKeyVisualAttributes; mTopPadding = params.mTopPadding; mVerticalGap = params.mVerticalGap; @@ -129,8 +129,8 @@ public class Keyboard { mBaseWidth = keyboard.mBaseWidth; mMostCommonKeyHeight = keyboard.mMostCommonKeyHeight; mMostCommonKeyWidth = keyboard.mMostCommonKeyWidth; - mMoreKeysTemplate = keyboard.mMoreKeysTemplate; - mMaxMoreKeysKeyboardColumn = keyboard.mMaxMoreKeysKeyboardColumn; + mPopupKeysTemplate = keyboard.mPopupKeysTemplate; + mMaxPopupKeysKeyboardColumn = keyboard.mMaxPopupKeysKeyboardColumn; mKeyVisualAttributes = keyboard.mKeyVisualAttributes; mTopPadding = keyboard.mTopPadding; mVerticalGap = keyboard.mVerticalGap; diff --git a/app/src/main/java/helium314/keyboard/keyboard/KeyboardSwitcher.java b/app/src/main/java/helium314/keyboard/keyboard/KeyboardSwitcher.java index 4f4d5d79c..8347bd1f0 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/KeyboardSwitcher.java +++ b/app/src/main/java/helium314/keyboard/keyboard/KeyboardSwitcher.java @@ -503,11 +503,11 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { return mClipboardHistoryView != null && mClipboardHistoryView.isShown(); } - public boolean isShowingMoreKeysPanel() { + public boolean isShowingPopupKeysPanel() { if (isShowingEmojiPalettes() || isShowingClipboardHistory()) { return false; } - return mKeyboardView.isShowingMoreKeysPanel(); + return mKeyboardView.isShowingPopupKeysPanel(); } public View getVisibleKeyboardView() { diff --git a/app/src/main/java/helium314/keyboard/keyboard/KeyboardView.java b/app/src/main/java/helium314/keyboard/keyboard/KeyboardView.java index ad2eab7fc..dc5f0b0d2 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/KeyboardView.java +++ b/app/src/main/java/helium314/keyboard/keyboard/KeyboardView.java @@ -37,7 +37,7 @@ import helium314.keyboard.latin.common.Constants; import helium314.keyboard.latin.common.StringUtils; import helium314.keyboard.latin.settings.Settings; import helium314.keyboard.latin.suggestions.MoreSuggestions; -import helium314.keyboard.latin.suggestions.MoreSuggestionsView; +import helium314.keyboard.latin.suggestions.PopupSuggestionsView; import helium314.keyboard.latin.utils.TypefaceUtils; import java.util.HashSet; @@ -134,17 +134,17 @@ public class KeyboardView extends View { final TypedArray keyboardViewAttr = context.obtainStyledAttributes(attrs, R.styleable.KeyboardView, defStyle, R.style.KeyboardView); - if (this instanceof EmojiPageKeyboardView || this instanceof MoreSuggestionsView) + if (this instanceof EmojiPageKeyboardView || this instanceof PopupSuggestionsView) mKeyBackground = mColors.selectAndColorDrawable(keyboardViewAttr, ColorType.BACKGROUND); - else if (this instanceof MoreKeysKeyboardView) - mKeyBackground = mColors.selectAndColorDrawable(keyboardViewAttr, ColorType.MORE_KEYS_BACKGROUND); + else if (this instanceof PopupKeysKeyboardView) + mKeyBackground = mColors.selectAndColorDrawable(keyboardViewAttr, ColorType.POPUP_KEYS_BACKGROUND); else mKeyBackground = mColors.selectAndColorDrawable(keyboardViewAttr, ColorType.KEY_BACKGROUND); mKeyBackground.getPadding(mKeyBackgroundPadding); mFunctionalKeyBackground = mColors.selectAndColorDrawable(keyboardViewAttr, ColorType.FUNCTIONAL_KEY_BACKGROUND); mSpacebarBackground = mColors.selectAndColorDrawable(keyboardViewAttr, ColorType.SPACE_BAR_BACKGROUND); - if (this instanceof MoreKeysKeyboardView) - mActionKeyBackground = mColors.selectAndColorDrawable(keyboardViewAttr, ColorType.ACTION_KEY_MORE_KEYS_BACKGROUND); + if (this instanceof PopupKeysKeyboardView) + mActionKeyBackground = mColors.selectAndColorDrawable(keyboardViewAttr, ColorType.ACTION_KEY_POPUP_KEYS_BACKGROUND); else mActionKeyBackground = mColors.selectAndColorDrawable(keyboardViewAttr, ColorType.ACTION_KEY_BACKGROUND); @@ -201,8 +201,8 @@ public class KeyboardView extends View { public void setKeyboard(@NonNull final Keyboard keyboard) { if (keyboard instanceof MoreSuggestions) { mColors.setBackground(this, ColorType.MORE_SUGGESTIONS_BACKGROUND); - } else if (keyboard instanceof MoreKeysKeyboard) { - mColors.setBackground(this, ColorType.MORE_KEYS_BACKGROUND); + } else if (keyboard instanceof PopupKeysKeyboard) { + mColors.setBackground(this, ColorType.POPUP_KEYS_BACKGROUND); } else { // actual background color/drawable is applied to main_keyboard_frame setBackgroundColor(Color.TRANSPARENT); @@ -530,7 +530,7 @@ public class KeyboardView extends View { drawIcon(canvas, icon, iconX, iconY, iconWidth, iconHeight); } - if (key.hasPopupHint() && key.getMoreKeys() != null) { + if (key.hasPopupHint() && key.getPopupKeys() != null) { drawKeyPopupHint(key, canvas, paint, params); } } @@ -637,7 +637,7 @@ public class KeyboardView extends View { mColors.setColor(icon, ColorType.KEY_ICON); // normal key if not shifted } else if (key.getBackgroundType() != Key.BACKGROUND_TYPE_NORMAL) { mColors.setColor(icon, ColorType.KEY_ICON); - } else if (this instanceof MoreKeysKeyboardView) { + } else if (this instanceof PopupKeysKeyboardView) { // set color filter for long press comma key, should not trigger anywhere else mColors.setColor(icon, ColorType.KEY_ICON); } else if (key.getCode() == Constants.CODE_SPACE || key.getCode() == 0x200C) { diff --git a/app/src/main/java/helium314/keyboard/keyboard/MainKeyboardView.java b/app/src/main/java/helium314/keyboard/keyboard/MainKeyboardView.java index 7d2e27310..6dfb4fedd 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/MainKeyboardView.java +++ b/app/src/main/java/helium314/keyboard/keyboard/MainKeyboardView.java @@ -38,7 +38,7 @@ import helium314.keyboard.keyboard.internal.KeyDrawParams; import helium314.keyboard.keyboard.internal.KeyPreviewChoreographer; import helium314.keyboard.keyboard.internal.KeyPreviewDrawParams; import helium314.keyboard.keyboard.internal.KeyPreviewView; -import helium314.keyboard.keyboard.internal.MoreKeySpec; +import helium314.keyboard.keyboard.internal.PopupKeySpec; import helium314.keyboard.keyboard.internal.NonDistinctMultitouchHelper; import helium314.keyboard.keyboard.internal.SlidingKeyInputDrawingPreview; import helium314.keyboard.keyboard.internal.TimerHandler; @@ -83,10 +83,10 @@ import java.util.WeakHashMap; * @attr ref R.styleable#MainKeyboardView_keyPreviewLayout * @attr ref R.styleable#MainKeyboardView_keyPreviewOffset * @attr ref R.styleable#MainKeyboardView_keyPreviewHeight - * @attr ref R.styleable#MainKeyboardView_moreKeysKeyboardLayout - * @attr ref R.styleable#MainKeyboardView_moreKeysKeyboardForActionLayout + * @attr ref R.styleable#MainKeyboardView_popupKeysKeyboardLayout + * @attr ref R.styleable#MainKeyboardView_popupKeysKeyboardForActionLayout * @attr ref R.styleable#MainKeyboardView_backgroundDimAlpha - * @attr ref R.styleable#MainKeyboardView_showMoreKeysKeyboardAtTouchPoint + * @attr ref R.styleable#MainKeyboardView_showPopupKeysKeyboardAtTouchPoint * @attr ref R.styleable#MainKeyboardView_gestureFloatingPreviewTextLingerTimeout * @attr ref R.styleable#MainKeyboardView_gestureStaticTimeThresholdAfterFastTyping * @attr ref R.styleable#MainKeyboardView_gestureDetectFastMoveSpeedThreshold @@ -101,7 +101,7 @@ import java.util.WeakHashMap; * @attr ref R.styleable#MainKeyboardView_suppressKeyPreviewAfterBatchInputDuration */ public final class MainKeyboardView extends KeyboardView implements DrawingProxy, - MoreKeysPanel.Controller { + PopupKeysPanel.Controller { private static final String TAG = MainKeyboardView.class.getSimpleName(); /** Listener for {@link KeyboardActionListener}. */ @@ -142,13 +142,13 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy // More keys keyboard private final Paint mBackgroundDimAlphaPaint = new Paint(); - private final View mMoreKeysKeyboardContainer; - private final View mMoreKeysKeyboardForActionContainer; - private final WeakHashMap mMoreKeysKeyboardCache = new WeakHashMap<>(); - private final boolean mConfigShowMoreKeysKeyboardAtTouchedPoint; - // More keys panel (used by both more keys keyboard and more suggestions view) - // TODO: Consider extending to support multiple more keys panels - private MoreKeysPanel mMoreKeysPanel; + private final View mPopupKeysKeyboardContainer; + private final View mPopupKeysKeyboardForActionContainer; + private final WeakHashMap mPopupKeysKeyboardCache = new WeakHashMap<>(); + private final boolean mConfigShowPopupKeysKeyboardAtTouchedPoint; + // More keys panel (used by both popup keys keyboard and more suggestions view) + // TODO: Consider extending to support multiple popup keys panels + private PopupKeysPanel mPopupKeysPanel; // Gesture floating preview text // TODO: Make this parameter customizable by user via settings. @@ -220,13 +220,13 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy mKeyPreviewDrawParams = new KeyPreviewDrawParams(mainKeyboardViewAttr); mKeyPreviewChoreographer = new KeyPreviewChoreographer(mKeyPreviewDrawParams); - final int moreKeysKeyboardLayoutId = mainKeyboardViewAttr.getResourceId( - R.styleable.MainKeyboardView_moreKeysKeyboardLayout, 0); - final int moreKeysKeyboardForActionLayoutId = mainKeyboardViewAttr.getResourceId( - R.styleable.MainKeyboardView_moreKeysKeyboardForActionLayout, - moreKeysKeyboardLayoutId); - mConfigShowMoreKeysKeyboardAtTouchedPoint = mainKeyboardViewAttr.getBoolean( - R.styleable.MainKeyboardView_showMoreKeysKeyboardAtTouchedPoint, false); + final int popupKeysKeyboardLayoutId = mainKeyboardViewAttr.getResourceId( + R.styleable.MainKeyboardView_popupKeysKeyboardLayout, 0); + final int popupKeysKeyboardForActionLayoutId = mainKeyboardViewAttr.getResourceId( + R.styleable.MainKeyboardView_popupKeysKeyboardForActionLayout, + popupKeysKeyboardLayoutId); + mConfigShowPopupKeysKeyboardAtTouchedPoint = mainKeyboardViewAttr.getBoolean( + R.styleable.MainKeyboardView_showPopupKeysKeyboardAtTouchedPoint, false); mGestureFloatingPreviewTextLingerTimeout = mainKeyboardViewAttr.getInt( R.styleable.MainKeyboardView_gestureFloatingPreviewTextLingerTimeout, 0); @@ -244,8 +244,8 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy mDrawingPreviewPlacerView = drawingPreviewPlacerView; final LayoutInflater inflater = LayoutInflater.from(getContext()); - mMoreKeysKeyboardContainer = inflater.inflate(moreKeysKeyboardLayoutId, null); - mMoreKeysKeyboardForActionContainer = inflater.inflate(moreKeysKeyboardForActionLayoutId, null); + mPopupKeysKeyboardContainer = inflater.inflate(popupKeysKeyboardLayoutId, null); + mPopupKeysKeyboardForActionContainer = inflater.inflate(popupKeysKeyboardForActionLayoutId, null); mLanguageOnSpacebarFadeoutAnimator = loadObjectAnimator(languageOnSpacebarFadeoutAnimatorResId, this); if (mLanguageOnSpacebarFadeoutAnimator != null) mLanguageOnSpacebarFadeoutAnimator.setIntValues(255, mLanguageOnSpacebarFinalAlpha); @@ -344,7 +344,7 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy mKeyDetector.setKeyboard( keyboard, -getPaddingLeft(), -getPaddingTop() + getVerticalCorrection()); PointerTracker.setKeyDetector(mKeyDetector); - mMoreKeysKeyboardCache.clear(); + mPopupKeysKeyboardCache.clear(); mSpaceKey = keyboard.getKey(Constants.CODE_SPACE); final int keyHeight = keyboard.mMostCommonKeyHeight - keyboard.mVerticalGap; @@ -513,94 +513,94 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy mDrawingPreviewPlacerView.removeAllViews(); } - // Implements {@link DrawingProxy@showMoreKeysKeyboard(Key,PointerTracker)}. + // Implements {@link DrawingProxy@showPopupKeysKeyboard(Key,PointerTracker)}. @Override @Nullable - public MoreKeysPanel showMoreKeysKeyboard(@NonNull final Key key, - @NonNull final PointerTracker tracker) { - final MoreKeySpec[] moreKeys = key.getMoreKeys(); - if (moreKeys == null) { + public PopupKeysPanel showPopupKeysKeyboard(@NonNull final Key key, + @NonNull final PointerTracker tracker) { + final PopupKeySpec[] popupKeys = key.getPopupKeys(); + if (popupKeys == null) { return null; } - Keyboard moreKeysKeyboard = mMoreKeysKeyboardCache.get(key); - if (moreKeysKeyboard == null) { + Keyboard popupKeysKeyboard = mPopupKeysKeyboardCache.get(key); + if (popupKeysKeyboard == null) { // {@link KeyPreviewDrawParams#mPreviewVisibleWidth} should have been set at // {@link KeyPreviewChoreographer#placeKeyPreview(Key,TextView,KeyboardIconsSet,KeyDrawParams,int,int[]}, // though there may be some chances that the value is zero. width == 0 // will cause zero-division error at - // {@link MoreKeysKeyboardParams#setParameters(int,int,int,int,int,int,boolean,int)}. - final boolean isSingleMoreKeyWithPreview = mKeyPreviewDrawParams.isPopupEnabled() - && !key.noKeyPreview() && moreKeys.length == 1 + // {@link PopupKeysKeyboardParams#setParameters(int,int,int,int,int,int,boolean,int)}. + final boolean isSinglePopupKeyWithPreview = mKeyPreviewDrawParams.isPopupEnabled() + && !key.noKeyPreview() && popupKeys.length == 1 && mKeyPreviewDrawParams.getVisibleWidth() > 0; - final MoreKeysKeyboard.Builder builder = new MoreKeysKeyboard.Builder( - getContext(), key, getKeyboard(), isSingleMoreKeyWithPreview, + final PopupKeysKeyboard.Builder builder = new PopupKeysKeyboard.Builder( + getContext(), key, getKeyboard(), isSinglePopupKeyWithPreview, mKeyPreviewDrawParams.getVisibleWidth(), mKeyPreviewDrawParams.getVisibleHeight(), newLabelPaint(key)); - moreKeysKeyboard = builder.build(); - mMoreKeysKeyboardCache.put(key, moreKeysKeyboard); + popupKeysKeyboard = builder.build(); + mPopupKeysKeyboardCache.put(key, popupKeysKeyboard); } - final View container = key.isActionKey() ? mMoreKeysKeyboardForActionContainer - : mMoreKeysKeyboardContainer; - final MoreKeysKeyboardView moreKeysKeyboardView = - container.findViewById(R.id.more_keys_keyboard_view); - moreKeysKeyboardView.setKeyboard(moreKeysKeyboard); + final View container = key.isActionKey() ? mPopupKeysKeyboardForActionContainer + : mPopupKeysKeyboardContainer; + final PopupKeysKeyboardView popupKeysKeyboardView = + container.findViewById(R.id.popup_keys_keyboard_view); + popupKeysKeyboardView.setKeyboard(popupKeysKeyboard); container.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); final int[] lastCoords = CoordinateUtils.newInstance(); tracker.getLastCoordinates(lastCoords); final boolean keyPreviewEnabled = mKeyPreviewDrawParams.isPopupEnabled() && !key.noKeyPreview(); - // The more keys keyboard is usually horizontally aligned with the center of the parent key. - // If showMoreKeysKeyboardAtTouchedPoint is true and the key preview is disabled, the more + // The popup keys keyboard is usually horizontally aligned with the center of the parent key. + // If showPopupKeysKeyboardAtTouchedPoint is true and the key preview is disabled, the more // keys keyboard is placed at the touch point of the parent key. - final int pointX = (mConfigShowMoreKeysKeyboardAtTouchedPoint && !keyPreviewEnabled) + final int pointX = (mConfigShowPopupKeysKeyboardAtTouchedPoint && !keyPreviewEnabled) ? CoordinateUtils.x(lastCoords) : key.getX() + key.getWidth() / 2; - // The more keys keyboard is usually vertically aligned with the top edge of the parent key - // (plus vertical gap). If the key preview is enabled, the more keys keyboard is vertically + // The popup keys keyboard is usually vertically aligned with the top edge of the parent key + // (plus vertical gap). If the key preview is enabled, the popup keys keyboard is vertically // aligned with the bottom edge of the visible part of the key preview. // {@code mPreviewVisibleOffset} has been set appropriately in // {@link KeyboardView#showKeyPreview(PointerTracker)}. final int pointY = key.getY() + mKeyPreviewDrawParams.getVisibleOffset(); - moreKeysKeyboardView.showMoreKeysPanel(this, this, pointX, pointY, mKeyboardActionListener); - return moreKeysKeyboardView; + popupKeysKeyboardView.showPopupKeysPanel(this, this, pointX, pointY, mKeyboardActionListener); + return popupKeysKeyboardView; } public boolean isInDraggingFinger() { - if (isShowingMoreKeysPanel()) { + if (isShowingPopupKeysPanel()) { return true; } return PointerTracker.isAnyInDraggingFinger(); } @Override - public void onShowMoreKeysPanel(final MoreKeysPanel panel) { + public void onShowPopupKeysPanel(final PopupKeysPanel panel) { locatePreviewPlacerView(); - // Dismiss another {@link MoreKeysPanel} that may be being showed. - onDismissMoreKeysPanel(); + // Dismiss another {@link PopupKeysPanel} that may be being showed. + onDismissPopupKeysPanel(); // Dismiss all key previews that may be being showed. PointerTracker.setReleasedKeyGraphicsToAllKeys(); // Dismiss sliding key input preview that may be being showed. mSlidingKeyInputDrawingPreview.dismissSlidingKeyInputPreview(); panel.showInParent(mDrawingPreviewPlacerView); - mMoreKeysPanel = panel; + mPopupKeysPanel = panel; } - public boolean isShowingMoreKeysPanel() { - return mMoreKeysPanel != null && mMoreKeysPanel.isShowingInParent(); + public boolean isShowingPopupKeysPanel() { + return mPopupKeysPanel != null && mPopupKeysPanel.isShowingInParent(); } @Override - public void onCancelMoreKeysPanel() { - PointerTracker.dismissAllMoreKeysPanels(); + public void onCancelPopupKeysPanel() { + PointerTracker.dismissAllPopupKeysPanels(); } @Override - public void onDismissMoreKeysPanel() { - if (isShowingMoreKeysPanel()) { - mMoreKeysPanel.removeFromParent(); - mMoreKeysPanel = null; + public void onDismissPopupKeysPanel() { + if (isShowingPopupKeysPanel()) { + mPopupKeysPanel.removeFromParent(); + mPopupKeysPanel = null; } } @@ -623,7 +623,7 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy } if (mNonDistinctMultitouchHelper != null) { if (event.getPointerCount() > 1 && mTimerHandler.isInKeyRepeat()) { - // Key repeating timer will be canceled if 2 or more keys are in action. + // Key repeating timer will be canceled if 2 or popup keys are in action. mTimerHandler.cancelKeyRepeatTimers(); } // Non distinct multitouch screen support @@ -637,9 +637,9 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy final int index = event.getActionIndex(); final int id = event.getPointerId(index); final PointerTracker tracker = PointerTracker.getPointerTracker(id); - // When a more keys panel is showing, we should ignore other fingers' single touch events - // other than the finger that is showing the more keys panel. - if (isShowingMoreKeysPanel() && !tracker.isShowingMoreKeysPanel() + // When a popup keys panel is showing, we should ignore other fingers' single touch events + // other than the finger that is showing the popup keys panel. + if (isShowingPopupKeysPanel() && !tracker.isShowingPopupKeysPanel() && PointerTracker.getActivePointerTrackerCount() == 1) { return true; } @@ -652,17 +652,17 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy PointerTracker.setReleasedKeyGraphicsToAllKeys(); mGestureFloatingTextDrawingPreview.dismissGestureFloatingPreviewText(); mSlidingKeyInputDrawingPreview.dismissSlidingKeyInputPreview(); - PointerTracker.dismissAllMoreKeysPanels(); + PointerTracker.dismissAllPopupKeysPanels(); PointerTracker.cancelAllPointerTrackers(); } public void closing() { cancelAllOngoingEvents(); - mMoreKeysKeyboardCache.clear(); + mPopupKeysKeyboardCache.clear(); } public void onHideWindow() { - onDismissMoreKeysPanel(); + onDismissPopupKeysPanel(); final MainKeyboardAccessibilityDelegate accessibilityDelegate = mAccessibilityDelegate; if (accessibilityDelegate != null && AccessibilityUtils.Companion.getInstance().isAccessibilityEnabled()) { diff --git a/app/src/main/java/helium314/keyboard/keyboard/PointerTracker.java b/app/src/main/java/helium314/keyboard/keyboard/PointerTracker.java index b9028cdf4..b47295a69 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/PointerTracker.java +++ b/app/src/main/java/helium314/keyboard/keyboard/PointerTracker.java @@ -139,8 +139,8 @@ public final class PointerTracker implements PointerTrackerQueue.Element, // true if this pointer is no longer triggering any action because it has been canceled. private boolean mIsTrackingForActionDisabled; - // the more keys panel currently being shown. equals null if no panel is active. - private MoreKeysPanel mMoreKeysPanel; + // the popup keys panel currently being shown. equals null if no panel is active. + private PopupKeysPanel mPopupKeysPanel; private static final int MULTIPLIER_FOR_LONG_PRESS_TIMEOUT_IN_SLIDING_INPUT = 3; // true if this pointer is in the dragging finger mode. @@ -231,11 +231,11 @@ public final class PointerTracker implements PointerTrackerQueue.Element, } } - public static void dismissAllMoreKeysPanels() { + public static void dismissAllPopupKeysPanels() { final int trackersSize = sTrackers.size(); for (int i = 0; i < trackersSize; ++i) { final PointerTracker tracker = sTrackers.get(i); - tracker.dismissMoreKeysPanel(); + tracker.dismissPopupKeysPanel(); } } @@ -521,7 +521,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element, Log.d(TAG, String.format(Locale.US, "[%d] onStartBatchInput", mPointerId)); } sListener.onStartBatchInput(); - dismissAllMoreKeysPanels(); + dismissAllPopupKeysPanels(); sTimerProxy.cancelLongPressTimersOf(this); } @@ -585,10 +585,10 @@ public final class PointerTracker implements PointerTrackerQueue.Element, final int action = me.getActionMasked(); final long eventTime = me.getEventTime(); if (action == MotionEvent.ACTION_MOVE) { - // When this pointer is the only active pointer and is showing a more keys panel, + // When this pointer is the only active pointer and is showing a popup keys panel, // we should ignore other pointers' motion event. final boolean shouldIgnoreOtherPointers = - isShowingMoreKeysPanel() && getActivePointerTrackerCount() == 1; + isShowingPopupKeysPanel() && getActivePointerTrackerCount() == 1; final int pointerCount = me.getPointerCount(); for (int index = 0; index < pointerCount; index++) { final int id = me.getPointerId(index); @@ -661,14 +661,14 @@ public final class PointerTracker implements PointerTrackerQueue.Element, } } - /* package */ boolean isShowingMoreKeysPanel() { - return (mMoreKeysPanel != null); + /* package */ boolean isShowingPopupKeysPanel() { + return (mPopupKeysPanel != null); } - private void dismissMoreKeysPanel() { - if (isShowingMoreKeysPanel()) { - mMoreKeysPanel.dismissMoreKeysPanel(); - mMoreKeysPanel = null; + private void dismissPopupKeysPanel() { + if (isShowingPopupKeysPanel()) { + mPopupKeysPanel.dismissPopupKeysPanel(); + mPopupKeysPanel = null; } } @@ -677,7 +677,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element, // Key selection by dragging finger is allowed when 1) key selection by dragging finger is // enabled by configuration, 2) this pointer starts dragging from modifier key, or 3) this // pointer's KeyDetector always allows key selection by dragging finger, such as - // {@link MoreKeysKeyboard}. + // {@link PopupKeysKeyboard}. mIsAllowedDraggingFinger = sParams.mKeySelectionByDraggingFinger || (key != null && key.isModifier()) || mKeyDetector.alwaysAllowsKeySelectionByDraggingFinger(); @@ -733,9 +733,9 @@ public final class PointerTracker implements PointerTrackerQueue.Element, } mGestureStrokeDrawingPoints.onMoveEvent( x, y, mBatchInputArbiter.getElapsedTimeSinceFirstDown(eventTime)); - // If the MoreKeysPanel is showing then do not attempt to enter gesture mode. However, + // If the PopupKeysPanel is showing then do not attempt to enter gesture mode. However, // the gestured touch points are still being recorded in case the panel is dismissed. - if (isShowingMoreKeysPanel()) { + if (isShowingPopupKeysPanel()) { return; } if (!sInGesture && key != null && Character.isLetter(key.getCode()) @@ -770,10 +770,10 @@ public final class PointerTracker implements PointerTrackerQueue.Element, } } - if (isShowingMoreKeysPanel()) { - final int translatedX = mMoreKeysPanel.translateX(x); - final int translatedY = mMoreKeysPanel.translateY(y); - mMoreKeysPanel.onMoveEvent(translatedX, translatedY, mPointerId, eventTime); + if (isShowingPopupKeysPanel()) { + final int translatedX = mPopupKeysPanel.translateX(x); + final int translatedY = mPopupKeysPanel.translateY(y); + mPopupKeysPanel.onMoveEvent(translatedX, translatedY, mPointerId, eventTime); onMoveKey(x, y); if (mIsInSlidingKeyInput) { sDrawingProxy.showSlidingKeyInputPreview(this); @@ -1027,13 +1027,13 @@ public final class PointerTracker implements PointerTrackerQueue.Element, sListener.onUpWithDeletePointerActive(); } - if (isShowingMoreKeysPanel()) { + if (isShowingPopupKeysPanel()) { if (!mIsTrackingForActionDisabled) { - final int translatedX = mMoreKeysPanel.translateX(x); - final int translatedY = mMoreKeysPanel.translateY(y); - mMoreKeysPanel.onUpEvent(translatedX, translatedY, mPointerId, eventTime); + final int translatedX = mPopupKeysPanel.translateX(x); + final int translatedY = mPopupKeysPanel.translateY(y); + mPopupKeysPanel.onUpEvent(translatedX, translatedY, mPointerId, eventTime); } - dismissMoreKeysPanel(); + dismissPopupKeysPanel(); if (isInSlidingKeyInput) callListenerOnFinishSlidingInput(); return; @@ -1072,7 +1072,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element, @Override public void cancelTrackingForAction() { - if (isShowingMoreKeysPanel()) { + if (isShowingPopupKeysPanel()) { return; } mIsTrackingForActionDisabled = true; @@ -1084,7 +1084,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element, public void onLongPressed() { sTimerProxy.cancelLongPressTimersOf(this); - if (isShowingMoreKeysPanel()) { + if (isShowingPopupKeysPanel()) { return; } if(mCursorMoved) { @@ -1094,12 +1094,12 @@ public final class PointerTracker implements PointerTrackerQueue.Element, if (key == null) { return; } - if (key.hasNoPanelAutoMoreKey()) { + if (key.hasNoPanelAutoPopupKey()) { cancelKeyTracking(); - final int moreKeyCode = key.getMoreKeys()[0].mCode; - sListener.onPressKey(moreKeyCode, 0, true); - sListener.onCodeInput(moreKeyCode, Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE, false); - sListener.onReleaseKey(moreKeyCode, false); + final int popupKeyCode = key.getPopupKeys()[0].mCode; + sListener.onPressKey(popupKeyCode, 0, true); + sListener.onCodeInput(popupKeyCode, Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE, false); + sListener.onReleaseKey(popupKeyCode, false); return; } final int code = key.getCode(); @@ -1119,14 +1119,14 @@ public final class PointerTracker implements PointerTrackerQueue.Element, } setReleasedKeyGraphics(key, false); - final MoreKeysPanel moreKeysPanel = sDrawingProxy.showMoreKeysKeyboard(key, this); - if (moreKeysPanel == null) { + final PopupKeysPanel popupKeysPanel = sDrawingProxy.showPopupKeysKeyboard(key, this); + if (popupKeysPanel == null) { return; } - final int translatedX = moreKeysPanel.translateX(mLastX); - final int translatedY = moreKeysPanel.translateY(mLastY); - moreKeysPanel.onDownEvent(translatedX, translatedY, mPointerId, SystemClock.uptimeMillis()); - mMoreKeysPanel = moreKeysPanel; + final int translatedX = popupKeysPanel.translateX(mLastX); + final int translatedY = popupKeysPanel.translateY(mLastY); + popupKeysPanel.onDownEvent(translatedX, translatedY, mPointerId, SystemClock.uptimeMillis()); + mPopupKeysPanel = popupKeysPanel; } private void cancelKeyTracking() { @@ -1151,7 +1151,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element, sTimerProxy.cancelKeyTimersOf(this); setReleasedKeyGraphics(mCurrentKey, true); resetKeySelectionByDraggingFinger(); - dismissMoreKeysPanel(); + dismissPopupKeysPanel(); } private boolean isMajorEnoughMoveToBeOnNewKey(final int x, final int y, final long eventTime, @@ -1195,11 +1195,11 @@ public final class PointerTracker implements PointerTrackerQueue.Element, if (key == null) return; if (!key.isLongPressEnabled()) return; // Caveat: Please note that isLongPressEnabled() can be true even if the current key - // doesn't have its more keys. (e.g. spacebar, globe key) If we are in the dragging finger + // doesn't have its popup keys. (e.g. spacebar, globe key) If we are in the dragging finger // mode, we will disable long press timer of such key. - // We always need to start the long press timer if the key has its more keys regardless of + // We always need to start the long press timer if the key has its popup keys regardless of // whether or not we are in the dragging finger mode. - if (mIsInDraggingFinger && key.getMoreKeys() == null) return; + if (mIsInDraggingFinger && key.getPopupKeys() == null) return; final int delay = getLongPressTimeout(key.getCode()); if (delay <= 0) return; diff --git a/app/src/main/java/helium314/keyboard/keyboard/MoreKeysDetector.java b/app/src/main/java/helium314/keyboard/keyboard/PopupKeysDetector.java similarity index 92% rename from app/src/main/java/helium314/keyboard/keyboard/MoreKeysDetector.java rename to app/src/main/java/helium314/keyboard/keyboard/PopupKeysDetector.java index efcda4e14..1294df1c8 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/MoreKeysDetector.java +++ b/app/src/main/java/helium314/keyboard/keyboard/PopupKeysDetector.java @@ -6,11 +6,11 @@ package helium314.keyboard.keyboard; -public final class MoreKeysDetector extends KeyDetector { +public final class PopupKeysDetector extends KeyDetector { private final int mSlideAllowanceSquare; private final int mSlideAllowanceSquareTop; - public MoreKeysDetector(float slideAllowance) { + public PopupKeysDetector(float slideAllowance) { super(); mSlideAllowanceSquare = (int)(slideAllowance * slideAllowance); // Top slide allowance is slightly longer (sqrt(2) times) than other edges. diff --git a/app/src/main/java/helium314/keyboard/keyboard/MoreKeysKeyboard.java b/app/src/main/java/helium314/keyboard/keyboard/PopupKeysKeyboard.java similarity index 74% rename from app/src/main/java/helium314/keyboard/keyboard/MoreKeysKeyboard.java rename to app/src/main/java/helium314/keyboard/keyboard/PopupKeysKeyboard.java index 02fc22f07..5ff793eea 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/MoreKeysKeyboard.java +++ b/app/src/main/java/helium314/keyboard/keyboard/PopupKeysKeyboard.java @@ -13,15 +13,15 @@ import androidx.annotation.NonNull; import helium314.keyboard.keyboard.internal.KeyboardBuilder; import helium314.keyboard.keyboard.internal.KeyboardParams; -import helium314.keyboard.keyboard.internal.MoreKeySpec; +import helium314.keyboard.keyboard.internal.PopupKeySpec; import helium314.keyboard.latin.R; import helium314.keyboard.latin.common.StringUtils; import helium314.keyboard.latin.utils.TypefaceUtils; -public final class MoreKeysKeyboard extends Keyboard { +public final class PopupKeysKeyboard extends Keyboard { private final int mDefaultKeyCoordX; - MoreKeysKeyboard(final MoreKeysKeyboardParams params) { + PopupKeysKeyboard(final PopupKeysKeyboardParams params) { super(params); mDefaultKeyCoordX = params.getDefaultKeyCoordX() + params.mDefaultKeyWidth / 2; } @@ -30,8 +30,8 @@ public final class MoreKeysKeyboard extends Keyboard { return mDefaultKeyCoordX; } - static class MoreKeysKeyboardParams extends KeyboardParams { - public boolean mIsMoreKeysFixedOrder; + static class PopupKeysKeyboardParams extends KeyboardParams { + public boolean mIsPopupKeysFixedOrder; /* package */int mTopRowAdjustment; public int mNumRows; public int mNumColumns; @@ -41,41 +41,41 @@ public final class MoreKeysKeyboard extends Keyboard { public int mDividerWidth; public int mColumnWidth; - public MoreKeysKeyboardParams() { + public PopupKeysKeyboardParams() { super(); } /** - * Set keyboard parameters of more keys keyboard. + * Set keyboard parameters of popup keys keyboard. * - * @param numKeys number of keys in this more keys keyboard. - * @param numColumn number of columns of this more keys keyboard. - * @param keyWidth more keys keyboard key width in pixel, including horizontal gap. - * @param rowHeight more keys keyboard row height in pixel, including vertical gap. + * @param numKeys number of keys in this popup keys keyboard. + * @param numColumn number of columns of this popup keys keyboard. + * @param keyWidth popup keys keyboard key width in pixel, including horizontal gap. + * @param rowHeight popup keys keyboard row height in pixel, including vertical gap. * @param coordXInParent coordinate x of the key preview in parent keyboard. * @param parentKeyboardWidth parent keyboard width in pixel. - * @param isMoreKeysFixedColumn true if more keys keyboard should have - * numColumn columns. Otherwise more keys keyboard should have + * @param isPopupKeysFixedColumn true if popup keys keyboard should have + * numColumn columns. Otherwise popup keys keyboard should have * numColumn columns at most. - * @param isMoreKeysFixedOrder true if the order of more keys is determined by the order in - * the more keys' specification. Otherwise the order of more keys is automatically + * @param isPopupKeysFixedOrder true if the order of popup keys is determined by the order in + * the popup keys' specification. Otherwise the order of popup keys is automatically * determined. * @param dividerWidth width of divider, zero for no dividers. */ public void setParameters(final int numKeys, final int numColumn, final int keyWidth, final int rowHeight, final int coordXInParent, final int parentKeyboardWidth, - final boolean isMoreKeysFixedColumn, final boolean isMoreKeysFixedOrder, + final boolean isPopupKeysFixedColumn, final boolean isPopupKeysFixedOrder, final int dividerWidth) { - mIsMoreKeysFixedOrder = isMoreKeysFixedOrder; + mIsPopupKeysFixedOrder = isPopupKeysFixedOrder; if (parentKeyboardWidth / keyWidth < Math.min(numKeys, numColumn)) { - throw new IllegalArgumentException("Keyboard is too small to hold more keys: " + throw new IllegalArgumentException("Keyboard is too small to hold popup keys: " + parentKeyboardWidth + " " + keyWidth + " " + numKeys + " " + numColumn); } mDefaultKeyWidth = keyWidth; mDefaultRowHeight = rowHeight; mNumRows = (numKeys + numColumn - 1) / numColumn; - final int numColumns = isMoreKeysFixedColumn ? Math.min(numKeys, numColumn) + final int numColumns = isPopupKeysFixedColumn ? Math.min(numKeys, numColumn) : getOptimizedColumns(numKeys, numColumn); mNumColumns = numColumns; final int topKeys = numKeys % numColumns; @@ -97,13 +97,13 @@ public final class MoreKeysKeyboard extends Keyboard { leftKeys = numLeftKeys; rightKeys = numRightKeys; } - // If the left keys fill the left side of the parent key, entire more keys keyboard + // If the left keys fill the left side of the parent key, entire popup keys keyboard // should be shifted to the right unless the parent key is on the left edge. if (maxLeftKeys == leftKeys && leftKeys > 0) { leftKeys--; rightKeys++; } - // If the right keys fill the right side of the parent key, entire more keys + // If the right keys fill the right side of the parent key, entire popup keys // should be shifted to the left unless the parent key is on the right edge. if (maxRightKeys == rightKeys - 1 && rightKeys > 1) { leftKeys++; @@ -113,7 +113,7 @@ public final class MoreKeysKeyboard extends Keyboard { mRightKeys = rightKeys; // Adjustment of the top row. - mTopRowAdjustment = isMoreKeysFixedOrder ? getFixedOrderTopRowAdjustment() + mTopRowAdjustment = isPopupKeysFixedOrder ? getFixedOrderTopRowAdjustment() : getAutoOrderTopRowAdjustment(); mDividerWidth = dividerWidth; mColumnWidth = mDefaultKeyWidth + mDividerWidth; @@ -141,7 +141,7 @@ public final class MoreKeysKeyboard extends Keyboard { // Return key position according to column count (0 is default). /* package */int getColumnPos(final int n) { - return mIsMoreKeysFixedOrder ? getFixedOrderColumnPos(n) : getAutomaticColumnPos(n); + return mIsPopupKeysFixedOrder ? getFixedOrderColumnPos(n) : getAutomaticColumnPos(n); } private int getFixedOrderColumnPos(final int n) { @@ -242,42 +242,42 @@ public final class MoreKeysKeyboard extends Keyboard { } } - public static class Builder extends KeyboardBuilder { + public static class Builder extends KeyboardBuilder { private final Key mParentKey; private static final float LABEL_PADDING_RATIO = 0.2f; private static final float DIVIDER_RATIO = 0.2f; /** - * The builder of MoreKeysKeyboard. - * @param context the context of {@link MoreKeysKeyboardView}. - * @param key the {@link Key} that invokes more keys keyboard. + * The builder of PopupKeysKeyboard. + * @param context the context of {@link PopupKeysKeyboardView}. + * @param key the {@link Key} that invokes popup keys keyboard. * @param keyboard the {@link Keyboard} that contains the parentKey. - * @param isSingleMoreKeyWithPreview true if the key has just a single - * "more key" and its key popup preview is enabled. + * @param isSinglePopupKeyWithPreview true if the key has just a single + * "popup key" and its key popup preview is enabled. * @param keyPreviewVisibleWidth the width of visible part of key popup preview. * @param keyPreviewVisibleHeight the height of visible part of key popup preview - * @param paintToMeasure the {@link Paint} object to measure a "more key" width + * @param paintToMeasure the {@link Paint} object to measure a "popup key" width */ public Builder(final Context context, final Key key, final Keyboard keyboard, - final boolean isSingleMoreKeyWithPreview, final int keyPreviewVisibleWidth, + final boolean isSinglePopupKeyWithPreview, final int keyPreviewVisibleWidth, final int keyPreviewVisibleHeight, final Paint paintToMeasure) { - super(context, new MoreKeysKeyboardParams()); + super(context, new PopupKeysKeyboardParams()); mParams.mId = keyboard.mId; - readAttributes(keyboard.mMoreKeysTemplate); + readAttributes(keyboard.mPopupKeysTemplate); - // TODO: More keys keyboard's vertical gap is currently calculated heuristically. + // TODO: Popup keys keyboard's vertical gap is currently calculated heuristically. // Should revise the algorithm. mParams.mVerticalGap = keyboard.mVerticalGap / 2; - // This {@link MoreKeysKeyboard} is invoked from the key. + // This {@link PopupKeysKeyboard} is invoked from the key. mParentKey = key; final int keyWidth, rowHeight; - if (isSingleMoreKeyWithPreview) { - // Use pre-computed width and height if this more keys keyboard has only one key to - // mitigate visual flicker between key preview and more keys keyboard. + if (isSinglePopupKeyWithPreview) { + // Use pre-computed width and height if this popup keys keyboard has only one key to + // mitigate visual flicker between key preview and popup keys keyboard. // Caveats for the visual assets: To achieve this effect, both the key preview - // backgrounds and the more keys keyboard panel background have the exact same + // backgrounds and the popup keys keyboard panel background have the exact same // left/right/top paddings. The bottom paddings of both backgrounds don't need to // be considered because the vertical positions of both backgrounds were already // adjusted with their bottom paddings deducted. @@ -285,33 +285,33 @@ public final class MoreKeysKeyboard extends Keyboard { rowHeight = keyPreviewVisibleHeight + mParams.mVerticalGap; } else { final float padding = context.getResources().getDimension( - R.dimen.config_more_keys_keyboard_key_horizontal_padding) - + (key.hasLabelsInMoreKeys() + R.dimen.config_popup_keys_keyboard_key_horizontal_padding) + + (key.hasLabelsInPopupKeys() ? mParams.mDefaultKeyWidth * LABEL_PADDING_RATIO : 0.0f); keyWidth = getMaxKeyWidth(key, mParams.mDefaultKeyWidth, padding, paintToMeasure); rowHeight = keyboard.mMostCommonKeyHeight; } final int dividerWidth; - if (key.needsDividersInMoreKeys()) { + if (key.needsDividersInPopupKeys()) { dividerWidth = (int)(keyWidth * DIVIDER_RATIO); } else { dividerWidth = 0; } - final MoreKeySpec[] moreKeys = key.getMoreKeys(); - final int defaultColumns = key.getMoreKeysColumnNumber(); + final PopupKeySpec[] popupKeys = key.getPopupKeys(); + final int defaultColumns = key.getPopupKeysColumnNumber(); final int spaceForKeys = keyboard.mId.mWidth / keyWidth; - final int finalNumColumns = spaceForKeys >= Math.min(moreKeys.length, defaultColumns) + final int finalNumColumns = spaceForKeys >= Math.min(popupKeys.length, defaultColumns) ? defaultColumns : (spaceForKeys > 0 ? spaceForKeys : defaultColumns); // in last case setParameters will throw an exception - mParams.setParameters(moreKeys.length, finalNumColumns, keyWidth, + mParams.setParameters(popupKeys.length, finalNumColumns, keyWidth, rowHeight, key.getX() + key.getWidth() / 2, keyboard.mId.mWidth, - key.isMoreKeysFixedColumn(), key.isMoreKeysFixedOrder(), dividerWidth); + key.isPopupKeysFixedColumn(), key.isPopupKeysFixedOrder(), dividerWidth); } private static int getMaxKeyWidth(final Key parentKey, final int minKeyWidth, final float padding, final Paint paint) { int maxWidth = minKeyWidth; - for (final MoreKeySpec spec : parentKey.getMoreKeys()) { + for (final PopupKeySpec spec : parentKey.getPopupKeys()) { final String label = spec.mLabel; // If the label is single letter, minKeyWidth is enough to hold the label. if (label != null && StringUtils.codePointCount(label) > 1) { @@ -324,16 +324,16 @@ public final class MoreKeysKeyboard extends Keyboard { @Override @NonNull - public MoreKeysKeyboard build() { - final MoreKeysKeyboardParams params = mParams; - final int moreKeyFlags = mParentKey.getMoreKeyLabelFlags(); - final MoreKeySpec[] moreKeys = mParentKey.getMoreKeys(); - for (int n = 0; n < moreKeys.length; n++) { - final MoreKeySpec moreKeySpec = moreKeys[n]; + public PopupKeysKeyboard build() { + final PopupKeysKeyboardParams params = mParams; + final int popupKeyFlags = mParentKey.getPopupKeyLabelFlags(); + final PopupKeySpec[] popupKeys = mParentKey.getPopupKeys(); + for (int n = 0; n < popupKeys.length; n++) { + final PopupKeySpec popupKeySpec = popupKeys[n]; final int row = n / params.mNumColumns; final int x = params.getX(n, row); final int y = params.getY(row); - final Key key = moreKeySpec.buildKey(x, y, moreKeyFlags, params); + final Key key = popupKeySpec.buildKey(x, y, popupKeyFlags, params); params.markAsEdgeKey(key, row); params.onAddKey(key); @@ -343,18 +343,18 @@ public final class MoreKeysKeyboard extends Keyboard { if (params.mDividerWidth > 0 && pos != 0) { final int dividerX = (pos > 0) ? x - params.mDividerWidth : x + params.mDefaultKeyWidth; - final Key divider = new MoreKeyDivider( + final Key divider = new PopupKeyDivider( params, dividerX, y, params.mDividerWidth, params.mDefaultRowHeight); params.onAddKey(divider); } } - return new MoreKeysKeyboard(params); + return new PopupKeysKeyboard(params); } } - // Used as a divider maker. A divider is drawn by {@link MoreKeysKeyboardView}. - public static class MoreKeyDivider extends Key.Spacer { - public MoreKeyDivider(final KeyboardParams params, final int x, final int y, + // Used as a divider maker. A divider is drawn by {@link PopupKeysKeyboardView}. + public static class PopupKeyDivider extends Key.Spacer { + public PopupKeyDivider(final KeyboardParams params, final int x, final int y, final int width, final int height) { super(params, x, y, width, height); } diff --git a/app/src/main/java/helium314/keyboard/keyboard/MoreKeysKeyboardView.java b/app/src/main/java/helium314/keyboard/keyboard/PopupKeysKeyboardView.java similarity index 80% rename from app/src/main/java/helium314/keyboard/keyboard/MoreKeysKeyboardView.java rename to app/src/main/java/helium314/keyboard/keyboard/PopupKeysKeyboardView.java index f341fd4d6..8da446e53 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/MoreKeysKeyboardView.java +++ b/app/src/main/java/helium314/keyboard/keyboard/PopupKeysKeyboardView.java @@ -19,7 +19,7 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import helium314.keyboard.accessibility.AccessibilityUtils; -import helium314.keyboard.accessibility.MoreKeysKeyboardAccessibilityDelegate; +import helium314.keyboard.accessibility.PopupKeysKeyboardAccessibilityDelegate; import helium314.keyboard.keyboard.emoji.OnKeyEventListener; import helium314.keyboard.keyboard.internal.KeyDrawParams; import helium314.keyboard.latin.R; @@ -27,10 +27,10 @@ import helium314.keyboard.latin.common.Constants; import helium314.keyboard.latin.common.CoordinateUtils; /** - * A view that renders a virtual {@link MoreKeysKeyboard}. It handles rendering of keys and + * A view that renders a virtual {@link PopupKeysKeyboard}. It handles rendering of keys and * detecting key presses and touch movements. */ -public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel { +public class PopupKeysKeyboardView extends KeyboardView implements PopupKeysPanel { private final int[] mCoordinates = CoordinateUtils.newInstance(); private final Drawable mDivider; @@ -44,21 +44,21 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel private int mActivePointerId; - protected MoreKeysKeyboardAccessibilityDelegate mAccessibilityDelegate; + protected PopupKeysKeyboardAccessibilityDelegate mAccessibilityDelegate; - public MoreKeysKeyboardView(final Context context, final AttributeSet attrs) { - this(context, attrs, R.attr.moreKeysKeyboardViewStyle); + public PopupKeysKeyboardView(final Context context, final AttributeSet attrs) { + this(context, attrs, R.attr.popupKeysKeyboardViewStyle); } - public MoreKeysKeyboardView(final Context context, final AttributeSet attrs, - final int defStyle) { + public PopupKeysKeyboardView(final Context context, final AttributeSet attrs, + final int defStyle) { super(context, attrs, defStyle); - final TypedArray moreKeysKeyboardViewAttr = context.obtainStyledAttributes(attrs, - R.styleable.MoreKeysKeyboardView, defStyle, R.style.MoreKeysKeyboardView); - mDivider = moreKeysKeyboardViewAttr.getDrawable(R.styleable.MoreKeysKeyboardView_divider); - moreKeysKeyboardViewAttr.recycle(); - mKeyDetector = new MoreKeysDetector(getResources().getDimension( - R.dimen.config_more_keys_keyboard_slide_allowance)); + final TypedArray popupKeysKeyboardViewAttr = context.obtainStyledAttributes(attrs, + R.styleable.PopupKeysKeyboardView, defStyle, R.style.PopupKeysKeyboardView); + mDivider = popupKeysKeyboardViewAttr.getDrawable(R.styleable.PopupKeysKeyboardView_divider); + popupKeysKeyboardViewAttr.recycle(); + mKeyDetector = new PopupKeysDetector(getResources().getDimension( + R.dimen.config_popup_keys_keyboard_slide_allowance)); } @Override @@ -76,7 +76,7 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel @Override protected void onDrawKeyTopVisuals(@NonNull final Key key, @NonNull final Canvas canvas, @NonNull final Paint paint, @NonNull final KeyDrawParams params) { - if (!key.isSpacer() || !(key instanceof MoreKeysKeyboard.MoreKeyDivider) + if (!key.isSpacer() || !(key instanceof PopupKeysKeyboard.PopupKeyDivider) || mDivider == null) { super.onDrawKeyTopVisuals(key, canvas, paint, params); return; @@ -97,10 +97,10 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel keyboard, -getPaddingLeft(), -getPaddingTop() + getVerticalCorrection()); if (AccessibilityUtils.Companion.getInstance().isAccessibilityEnabled()) { if (mAccessibilityDelegate == null) { - mAccessibilityDelegate = new MoreKeysKeyboardAccessibilityDelegate( + mAccessibilityDelegate = new PopupKeysKeyboardAccessibilityDelegate( this, mKeyDetector); - mAccessibilityDelegate.setOpenAnnounce(R.string.spoken_open_more_keys_keyboard); - mAccessibilityDelegate.setCloseAnnounce(R.string.spoken_close_more_keys_keyboard); + mAccessibilityDelegate.setOpenAnnounce(R.string.spoken_open_popup_keys_keyboard); + mAccessibilityDelegate.setCloseAnnounce(R.string.spoken_close_popup_keys_keyboard); } mAccessibilityDelegate.setKeyboard(keyboard); } else { @@ -112,25 +112,25 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel * {@inheritDoc} */ @Override - public void showMoreKeysPanel(final View parentView, final Controller controller, + public void showPopupKeysPanel(final View parentView, final Controller controller, final int pointX, final int pointY, final KeyboardActionListener listener) { mListener = listener; mKeyEventListener = null; - showMoreKeysPanelInternal(parentView, controller, pointX, pointY); + showPopupKeysPanelInternal(parentView, controller, pointX, pointY); } /** * {@inheritDoc} */ @Override - public void showMoreKeysPanel(final View parentView, final Controller controller, + public void showPopupKeysPanel(final View parentView, final Controller controller, final int pointX, final int pointY, final OnKeyEventListener listener) { mListener = null; mKeyEventListener = listener; - showMoreKeysPanelInternal(parentView, controller, pointX, pointY); + showPopupKeysPanelInternal(parentView, controller, pointX, pointY); } - private void showMoreKeysPanelInternal(final View parentView, final Controller controller, + private void showPopupKeysPanelInternal(final View parentView, final Controller controller, final int pointX, final int pointY) { mController = controller; final View container = getContainerView(); @@ -150,11 +150,11 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel mOriginX = x + container.getPaddingLeft(); mOriginY = y + container.getPaddingTop(); - controller.onShowMoreKeysPanel(this); - final MoreKeysKeyboardAccessibilityDelegate accessibilityDelegate = mAccessibilityDelegate; + controller.onShowPopupKeysPanel(this); + final PopupKeysKeyboardAccessibilityDelegate accessibilityDelegate = mAccessibilityDelegate; if (accessibilityDelegate != null && AccessibilityUtils.Companion.getInstance().isAccessibilityEnabled()) { - accessibilityDelegate.onShowMoreKeysKeyboard(); + accessibilityDelegate.onShowPopupKeysKeyboard(); } } @@ -162,7 +162,7 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel * Returns the default x coordinate for showing this panel. */ protected int getDefaultCoordX() { - return ((MoreKeysKeyboard)getKeyboard()).getDefaultCoordX(); + return ((PopupKeysKeyboard)getKeyboard()).getDefaultCoordX(); } @Override @@ -179,8 +179,8 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel final boolean hasOldKey = (mCurrentKey != null); mCurrentKey = detectKey(x, y); if (hasOldKey && mCurrentKey == null) { - // A more keys keyboard is canceled when detecting no key. - mController.onCancelMoreKeysPanel(); + // A popup keys keyboard is canceled when detecting no key. + mController.onCancelPopupKeysPanel(); } } @@ -249,16 +249,16 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel } @Override - public void dismissMoreKeysPanel() { + public void dismissPopupKeysPanel() { if (!isShowingInParent()) { return; } - final MoreKeysKeyboardAccessibilityDelegate accessibilityDelegate = mAccessibilityDelegate; + final PopupKeysKeyboardAccessibilityDelegate accessibilityDelegate = mAccessibilityDelegate; if (accessibilityDelegate != null && AccessibilityUtils.Companion.getInstance().isAccessibilityEnabled()) { - accessibilityDelegate.onDismissMoreKeysKeyboard(); + accessibilityDelegate.onDismissPopupKeysKeyboard(); } - mController.onDismissMoreKeysPanel(); + mController.onDismissPopupKeysPanel(); } @Override @@ -300,7 +300,7 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel */ @Override public boolean onHoverEvent(final MotionEvent event) { - final MoreKeysKeyboardAccessibilityDelegate accessibilityDelegate = mAccessibilityDelegate; + final PopupKeysKeyboardAccessibilityDelegate accessibilityDelegate = mAccessibilityDelegate; if (accessibilityDelegate != null && AccessibilityUtils.Companion.getInstance().isTouchExplorationEnabled()) { return accessibilityDelegate.onHoverEvent(event); diff --git a/app/src/main/java/helium314/keyboard/keyboard/MoreKeysPanel.java b/app/src/main/java/helium314/keyboard/keyboard/PopupKeysPanel.java similarity index 54% rename from app/src/main/java/helium314/keyboard/keyboard/MoreKeysPanel.java rename to app/src/main/java/helium314/keyboard/keyboard/PopupKeysPanel.java index 7afdbf9ad..5a7e60e30 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/MoreKeysPanel.java +++ b/app/src/main/java/helium314/keyboard/keyboard/PopupKeysPanel.java @@ -10,77 +10,77 @@ import android.view.View; import android.view.ViewGroup; import helium314.keyboard.keyboard.emoji.OnKeyEventListener; -public interface MoreKeysPanel { +public interface PopupKeysPanel { interface Controller { /** - * Add the {@link MoreKeysPanel} to the target view. + * Add the {@link PopupKeysPanel} to the target view. * @param panel the panel to be shown. */ - void onShowMoreKeysPanel(final MoreKeysPanel panel); + void onShowPopupKeysPanel(final PopupKeysPanel panel); /** - * Remove the current {@link MoreKeysPanel} from the target view. + * Remove the current {@link PopupKeysPanel} from the target view. */ - void onDismissMoreKeysPanel(); + void onDismissPopupKeysPanel(); /** * Instructs the parent to cancel the panel (e.g., when entering a different input mode). */ - void onCancelMoreKeysPanel(); + void onCancelPopupKeysPanel(); } Controller EMPTY_CONTROLLER = new Controller() { @Override - public void onShowMoreKeysPanel(final MoreKeysPanel panel) {} + public void onShowPopupKeysPanel(final PopupKeysPanel panel) {} @Override - public void onDismissMoreKeysPanel() {} + public void onDismissPopupKeysPanel() {} @Override - public void onCancelMoreKeysPanel() {} + public void onCancelPopupKeysPanel() {} }; /** - * Initializes the layout and event handling of this {@link MoreKeysPanel} and calls the - * controller's onShowMoreKeysPanel to add the panel's container view. + * Initializes the layout and event handling of this {@link PopupKeysPanel} and calls the + * controller's onShowPopupKeysPanel to add the panel's container view. * - * @param parentView the parent view of this {@link MoreKeysPanel} - * @param controller the controller that can dismiss this {@link MoreKeysPanel} - * @param pointX x coordinate of this {@link MoreKeysPanel} - * @param pointY y coordinate of this {@link MoreKeysPanel} + * @param parentView the parent view of this {@link PopupKeysPanel} + * @param controller the controller that can dismiss this {@link PopupKeysPanel} + * @param pointX x coordinate of this {@link PopupKeysPanel} + * @param pointY y coordinate of this {@link PopupKeysPanel} * @param listener the listener that will receive keyboard action from this - * {@link MoreKeysPanel}. + * {@link PopupKeysPanel}. */ - // TODO: Currently the MoreKeysPanel is inside a container view that is added to the parent. - // Consider the simpler approach of placing the MoreKeysPanel itself into the parent view. - void showMoreKeysPanel(View parentView, Controller controller, int pointX, + // TODO: Currently the PopupKeysPanel is inside a container view that is added to the parent. + // Consider the simpler approach of placing the PopupKeysPanel itself into the parent view. + void showPopupKeysPanel(View parentView, Controller controller, int pointX, int pointY, KeyboardActionListener listener); /** * - * Initializes the layout and event handling of this {@link MoreKeysPanel} and calls the - * controller's onShowMoreKeysPanel to add the panel's container view. - * Same as {@link MoreKeysPanel#showMoreKeysPanel(View, Controller, int, int, KeyboardActionListener)}, + * Initializes the layout and event handling of this {@link PopupKeysPanel} and calls the + * controller's onShowPopupKeysPanel to add the panel's container view. + * Same as {@link PopupKeysPanel#showPopupKeysPanel(View, Controller, int, int, KeyboardActionListener)}, * but with a {@link OnKeyEventListener}. * - * @param parentView the parent view of this {@link MoreKeysPanel} - * @param controller the controller that can dismiss this {@link MoreKeysPanel} - * @param pointX x coordinate of this {@link MoreKeysPanel} - * @param pointY y coordinate of this {@link MoreKeysPanel} + * @param parentView the parent view of this {@link PopupKeysPanel} + * @param controller the controller that can dismiss this {@link PopupKeysPanel} + * @param pointX x coordinate of this {@link PopupKeysPanel} + * @param pointY y coordinate of this {@link PopupKeysPanel} * @param listener the listener that will receive keyboard action from this - * {@link MoreKeysPanel}. + * {@link PopupKeysPanel}. */ - // TODO: Currently the MoreKeysPanel is inside a container view that is added to the parent. - // Consider the simpler approach of placing the MoreKeysPanel itself into the parent view. - void showMoreKeysPanel(View parentView, Controller controller, int pointX, + // TODO: Currently the PopupKeysPanel is inside a container view that is added to the parent. + // Consider the simpler approach of placing the PopupKeysPanel itself into the parent view. + void showPopupKeysPanel(View parentView, Controller controller, int pointX, int pointY, OnKeyEventListener listener); /** - * Dismisses the more keys panel and calls the controller's onDismissMoreKeysPanel to remove + * Dismisses the popup keys panel and calls the controller's onDismissPopupKeysPanel to remove * the panel's container view. */ - void dismissMoreKeysPanel(); + void dismissPopupKeysPanel(); /** - * Process a move event on the more keys panel. + * Process a move event on the popup keys panel. * * @param x translated x coordinate of the touch point * @param y translated y coordinate of the touch point @@ -90,7 +90,7 @@ public interface MoreKeysPanel { void onMoveEvent(final int x, final int y, final int pointerId, final long eventTime); /** - * Process a down event on the more keys panel. + * Process a down event on the popup keys panel. * * @param x translated x coordinate of the touch point * @param y translated y coordinate of the touch point @@ -100,7 +100,7 @@ public interface MoreKeysPanel { void onDownEvent(final int x, final int y, final int pointerId, final long eventTime); /** - * Process an up event on the more keys panel. + * Process an up event on the popup keys panel. * * @param x translated x coordinate of the touch point * @param y translated y coordinate of the touch point @@ -111,31 +111,31 @@ public interface MoreKeysPanel { /** * Translate X-coordinate of touch event to the local X-coordinate of this - * {@link MoreKeysPanel}. + * {@link PopupKeysPanel}. * * @param x the global X-coordinate - * @return the local X-coordinate to this {@link MoreKeysPanel} + * @return the local X-coordinate to this {@link PopupKeysPanel} */ int translateX(int x); /** * Translate Y-coordinate of touch event to the local Y-coordinate of this - * {@link MoreKeysPanel}. + * {@link PopupKeysPanel}. * * @param y the global Y-coordinate - * @return the local Y-coordinate to this {@link MoreKeysPanel} + * @return the local Y-coordinate to this {@link PopupKeysPanel} */ int translateY(int y); /** - * Show this {@link MoreKeysPanel} in the parent view. + * Show this {@link PopupKeysPanel} in the parent view. * - * @param parentView the {@link ViewGroup} that hosts this {@link MoreKeysPanel}. + * @param parentView the {@link ViewGroup} that hosts this {@link PopupKeysPanel}. */ void showInParent(ViewGroup parentView); /** - * Remove this {@link MoreKeysPanel} from the parent view. + * Remove this {@link PopupKeysPanel} from the parent view. */ void removeFromParent(); diff --git a/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java b/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java index 1a49759ef..e51168b8f 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java +++ b/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java @@ -17,7 +17,7 @@ import androidx.annotation.Nullable; import helium314.keyboard.keyboard.Key; import helium314.keyboard.keyboard.Keyboard; -import helium314.keyboard.keyboard.internal.MoreKeySpec; +import helium314.keyboard.keyboard.internal.PopupKeySpec; import helium314.keyboard.latin.settings.Settings; import helium314.keyboard.latin.utils.JsonUtils; @@ -151,14 +151,14 @@ final class DynamicGridKeyboard extends Keyboard { } synchronized (mLock) { mCachedGridKeys = null; - // When a key is added to recents keyboard, we don't want to keep its more keys + // When a key is added to recents keyboard, we don't want to keep its popup keys // neither its hint label. Also, we make sure its background type is matching our keyboard - // if key comes from another keyboard (ie. a {@link MoreKeysKeyboard}). - final boolean dropMoreKeys = mIsRecents; - // Check if hint was a more emoji indicator and prevent its copy if more keys aren't copied - final boolean dropHintLabel = dropMoreKeys && EMOJI_HINT_LABEL.equals(usedKey.getHintLabel()); + // if key comes from another keyboard (ie. a {@link PopupKeysKeyboard}). + final boolean dropPopupKeys = mIsRecents; + // Check if hint was a more emoji indicator and prevent its copy if popup keys aren't copied + final boolean dropHintLabel = dropPopupKeys && EMOJI_HINT_LABEL.equals(usedKey.getHintLabel()); final GridKey key = new GridKey(usedKey, - dropMoreKeys ? null : usedKey.getMoreKeys(), + dropPopupKeys ? null : usedKey.getPopupKeys(), dropHintLabel ? null : usedKey.getHintLabel(), mIsRecents ? Key.BACKGROUND_TYPE_EMPTY : usedKey.getBackgroundType()); while (mGridKeys.remove(key)) { @@ -289,9 +289,9 @@ final class DynamicGridKeyboard extends Keyboard { private int mCurrentX; private int mCurrentY; - public GridKey(@NonNull final Key originalKey, @Nullable final MoreKeySpec[] moreKeys, + public GridKey(@NonNull final Key originalKey, @Nullable final PopupKeySpec[] popupKeys, @Nullable final String labelHint, final int backgroundType) { - super(originalKey, moreKeys, labelHint, backgroundType); + super(originalKey, popupKeys, labelHint, backgroundType); } public void updateCoordinates(final int x0, final int y0, final int x1, final int y1) { diff --git a/app/src/main/java/helium314/keyboard/keyboard/emoji/EmojiPageKeyboardView.java b/app/src/main/java/helium314/keyboard/keyboard/emoji/EmojiPageKeyboardView.java index 6721a46a1..6451eef83 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/emoji/EmojiPageKeyboardView.java +++ b/app/src/main/java/helium314/keyboard/keyboard/emoji/EmojiPageKeyboardView.java @@ -32,10 +32,10 @@ import helium314.keyboard.keyboard.Key; import helium314.keyboard.keyboard.KeyDetector; import helium314.keyboard.keyboard.Keyboard; import helium314.keyboard.keyboard.KeyboardView; -import helium314.keyboard.keyboard.MoreKeysKeyboard; -import helium314.keyboard.keyboard.MoreKeysKeyboardView; -import helium314.keyboard.keyboard.MoreKeysPanel; -import helium314.keyboard.keyboard.internal.MoreKeySpec; +import helium314.keyboard.keyboard.PopupKeysKeyboard; +import helium314.keyboard.keyboard.PopupKeysKeyboardView; +import helium314.keyboard.keyboard.PopupKeysPanel; +import helium314.keyboard.keyboard.internal.PopupKeySpec; import helium314.keyboard.latin.R; import helium314.keyboard.latin.common.CoordinateUtils; import helium314.keyboard.latin.settings.Settings; @@ -47,7 +47,7 @@ import java.util.WeakHashMap; * Multi-touch unsupported. No gesture support. */ public final class EmojiPageKeyboardView extends KeyboardView implements - MoreKeysPanel.Controller { + PopupKeysPanel.Controller { private static final String TAG = "EmojiPageKeyboardView"; private static final boolean LOG = false; private static final long KEY_PRESS_DELAY_TIME = 250; // msec @@ -73,13 +73,13 @@ public final class EmojiPageKeyboardView extends KeyboardView implements private final Handler mHandler; // More keys keyboard - private final View mMoreKeysKeyboardContainer; - private final WeakHashMap mMoreKeysKeyboardCache = new WeakHashMap<>(); - private final boolean mConfigShowMoreKeysKeyboardAtTouchedPoint; - private final ViewGroup mMoreKeysPlacerView; - // More keys panel (used by more keys keyboard view) - // TODO: Consider extending to support multiple more keys panels - private MoreKeysPanel mMoreKeysPanel; + private final View mPopupKeysKeyboardContainer; + private final WeakHashMap mPopupKeysKeyboardCache = new WeakHashMap<>(); + private final boolean mConfigShowPopupKeysKeyboardAtTouchedPoint; + private final ViewGroup mPopupKeysPlacerView; + // More keys panel (used by popup keys keyboard view) + // TODO: Consider extending to support multiple popup keys panels + private PopupKeysPanel mPopupKeysPanel; public EmojiPageKeyboardView(final Context context, final AttributeSet attrs) { this(context, attrs, R.attr.keyboardViewStyle); @@ -90,18 +90,18 @@ public final class EmojiPageKeyboardView extends KeyboardView implements super(context, attrs, defStyle); mHandler = new Handler(); - mMoreKeysPlacerView = new FrameLayout(context, attrs); + mPopupKeysPlacerView = new FrameLayout(context, attrs); final TypedArray keyboardViewAttr = context.obtainStyledAttributes(attrs, R.styleable.MainKeyboardView, defStyle, R.style.MainKeyboardView); - final int moreKeysKeyboardLayoutId = keyboardViewAttr.getResourceId( - R.styleable.MainKeyboardView_moreKeysKeyboardLayout, 0); - mConfigShowMoreKeysKeyboardAtTouchedPoint = keyboardViewAttr.getBoolean( - R.styleable.MainKeyboardView_showMoreKeysKeyboardAtTouchedPoint, false); + final int popupKeysKeyboardLayoutId = keyboardViewAttr.getResourceId( + R.styleable.MainKeyboardView_popupKeysKeyboardLayout, 0); + mConfigShowPopupKeysKeyboardAtTouchedPoint = keyboardViewAttr.getBoolean( + R.styleable.MainKeyboardView_showPopupKeysKeyboardAtTouchedPoint, false); keyboardViewAttr.recycle(); final LayoutInflater inflater = LayoutInflater.from(getContext()); - mMoreKeysKeyboardContainer = inflater.inflate(moreKeysKeyboardLayoutId, null); + mPopupKeysKeyboardContainer = inflater.inflate(popupKeysKeyboardLayoutId, null); } @Override @@ -123,10 +123,10 @@ public final class EmojiPageKeyboardView extends KeyboardView implements if (!enabled) return; final Paint layerPaint = new Paint(); layerPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER)); - mMoreKeysPlacerView.setLayerType(LAYER_TYPE_HARDWARE, layerPaint); + mPopupKeysPlacerView.setLayerType(LAYER_TYPE_HARDWARE, layerPaint); } - private void installMoreKeysPlacerView(final boolean uninstall) { + private void installPopupKeysPlacerView(final boolean uninstall) { final View rootView = getRootView(); if (rootView == null) { Log.w(TAG, "Cannot find root view"); @@ -140,9 +140,9 @@ public final class EmojiPageKeyboardView extends KeyboardView implements } if (uninstall) { - windowContentView.removeView(mMoreKeysPlacerView); + windowContentView.removeView(mPopupKeysPlacerView); } else { - windowContentView.addView(mMoreKeysPlacerView); + windowContentView.addView(mPopupKeysPlacerView); } } @@ -157,7 +157,7 @@ public final class EmojiPageKeyboardView extends KeyboardView implements public void setKeyboard(@NonNull final Keyboard keyboard) { super.setKeyboard(keyboard); mKeyDetector.setKeyboard(keyboard, 0 /* correctionX */, 0 /* correctionY */); - mMoreKeysKeyboardCache.clear(); + mPopupKeysKeyboardCache.clear(); if (AccessibilityUtils.Companion.getInstance().isAccessibilityEnabled()) { if (mAccessibilityDelegate == null) { mAccessibilityDelegate = new KeyboardAccessibilityDelegate<>(this, mKeyDetector); @@ -169,68 +169,68 @@ public final class EmojiPageKeyboardView extends KeyboardView implements } @Nullable - public MoreKeysPanel showMoreKeysKeyboard(@NonNull final Key key, final int lastX, final int lastY) { - final MoreKeySpec[] moreKeys = key.getMoreKeys(); - if (moreKeys == null) { + public PopupKeysPanel showPopupKeysKeyboard(@NonNull final Key key, final int lastX, final int lastY) { + final PopupKeySpec[] popupKeys = key.getPopupKeys(); + if (popupKeys == null) { return null; } - Keyboard moreKeysKeyboard = mMoreKeysKeyboardCache.get(key); - if (moreKeysKeyboard == null) { - final MoreKeysKeyboard.Builder builder = new MoreKeysKeyboard.Builder( + Keyboard popupKeysKeyboard = mPopupKeysKeyboardCache.get(key); + if (popupKeysKeyboard == null) { + final PopupKeysKeyboard.Builder builder = new PopupKeysKeyboard.Builder( getContext(), key, getKeyboard(), false, 0, 0, newLabelPaint(key)); - moreKeysKeyboard = builder.build(); - mMoreKeysKeyboardCache.put(key, moreKeysKeyboard); + popupKeysKeyboard = builder.build(); + mPopupKeysKeyboardCache.put(key, popupKeysKeyboard); } - final View container = mMoreKeysKeyboardContainer; - final MoreKeysKeyboardView moreKeysKeyboardView = container.findViewById(R.id.more_keys_keyboard_view); - moreKeysKeyboardView.setKeyboard(moreKeysKeyboard); + final View container = mPopupKeysKeyboardContainer; + final PopupKeysKeyboardView popupKeysKeyboardView = container.findViewById(R.id.popup_keys_keyboard_view); + popupKeysKeyboardView.setKeyboard(popupKeysKeyboard); container.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); final int[] lastCoords = CoordinateUtils.newCoordinateArray(1, lastX, lastY); - // The more keys keyboard is usually horizontally aligned with the center of the parent key. - // If showMoreKeysKeyboardAtTouchedPoint is true and the key preview is disabled, the more + // The popup keys keyboard is usually horizontally aligned with the center of the parent key. + // If showPopupKeysKeyboardAtTouchedPoint is true and the key preview is disabled, the more // keys keyboard is placed at the touch point of the parent key. - final int pointX = mConfigShowMoreKeysKeyboardAtTouchedPoint + final int pointX = mConfigShowPopupKeysKeyboardAtTouchedPoint ? CoordinateUtils.x(lastCoords) : key.getX() + key.getWidth() / 2; final int pointY = key.getY(); - moreKeysKeyboardView.showMoreKeysPanel(this, this, pointX, pointY, mListener); - return moreKeysKeyboardView; + popupKeysKeyboardView.showPopupKeysPanel(this, this, pointX, pointY, mListener); + return popupKeysKeyboardView; } - private void dismissMoreKeysPanel() { - if (isShowingMoreKeysPanel()) { - mMoreKeysPanel.dismissMoreKeysPanel(); + private void dismissPopupKeysPanel() { + if (isShowingPopupKeysPanel()) { + mPopupKeysPanel.dismissPopupKeysPanel(); } } - public boolean isShowingMoreKeysPanel() { - return mMoreKeysPanel != null; + public boolean isShowingPopupKeysPanel() { + return mPopupKeysPanel != null; } @Override - public void onShowMoreKeysPanel(final MoreKeysPanel panel) { + public void onShowPopupKeysPanel(final PopupKeysPanel panel) { // install placer view only when needed instead of when this // view is attached to window - installMoreKeysPlacerView(false /* uninstall */); - panel.showInParent(mMoreKeysPlacerView); - mMoreKeysPanel = panel; + installPopupKeysPlacerView(false /* uninstall */); + panel.showInParent(mPopupKeysPlacerView); + mPopupKeysPanel = panel; } @Override - public void onDismissMoreKeysPanel() { - if (isShowingMoreKeysPanel()) { - mMoreKeysPanel.removeFromParent(); - mMoreKeysPanel = null; - installMoreKeysPlacerView(true /* uninstall */); + public void onDismissPopupKeysPanel() { + if (isShowingPopupKeysPanel()) { + mPopupKeysPanel.removeFromParent(); + mPopupKeysPanel = null; + installPopupKeysPlacerView(true /* uninstall */); } } @Override - public void onCancelMoreKeysPanel() { - if (isShowingMoreKeysPanel()) { - dismissMoreKeysPanel(); + public void onCancelPopupKeysPanel() { + if (isShowingPopupKeysPanel()) { + dismissPopupKeysPanel(); } } @@ -281,7 +281,7 @@ public final class EmojiPageKeyboardView extends KeyboardView implements } private void onLongPressed(final Key key) { - if (isShowingMoreKeysPanel()) { + if (isShowingPopupKeysPanel()) { return; } @@ -292,11 +292,11 @@ public final class EmojiPageKeyboardView extends KeyboardView implements final int x = mLastX; final int y = mLastY; - final MoreKeysPanel moreKeysPanel = showMoreKeysKeyboard(key, x, y); - if (moreKeysPanel != null) { - final int translatedX = moreKeysPanel.translateX(x); - final int translatedY = moreKeysPanel.translateY(y); - moreKeysPanel.onDownEvent(translatedX, translatedY, mPointerId, 0 /* nor used for now */); + final PopupKeysPanel popupKeysPanel = showPopupKeysKeyboard(key, x, y); + if (popupKeysPanel != null) { + final int translatedX = popupKeysPanel.translateX(x); + final int translatedY = popupKeysPanel.translateY(y); + popupKeysPanel.onDownEvent(translatedX, translatedY, mPointerId, 0 /* nor used for now */); // No need of re-allowing parent later as we don't // want any scroll to append during this entire input. disallowParentInterceptTouchEvent(true); @@ -371,13 +371,13 @@ public final class EmojiPageKeyboardView extends KeyboardView implements final Key currentKey = mCurrentKey; releaseCurrentKey(false /* withKeyRegistering */); - final boolean isShowingMoreKeysPanel = isShowingMoreKeysPanel(); - if (isShowingMoreKeysPanel) { + final boolean isShowingPopupKeysPanel = isShowingPopupKeysPanel(); + if (isShowingPopupKeysPanel) { final long eventTime = e.getEventTime(); - final int translatedX = mMoreKeysPanel.translateX(x); - final int translatedY = mMoreKeysPanel.translateY(y); - mMoreKeysPanel.onUpEvent(translatedX, translatedY, mPointerId, eventTime); - dismissMoreKeysPanel(); + final int translatedX = mPopupKeysPanel.translateX(x); + final int translatedY = mPopupKeysPanel.translateY(y); + mPopupKeysPanel.onUpEvent(translatedX, translatedY, mPointerId, eventTime); + dismissPopupKeysPanel(); } else if (key == currentKey && pendingKeyDown != null) { pendingKeyDown.run(); // Trigger key-release event a little later so that a user can see visual feedback. @@ -392,7 +392,7 @@ public final class EmojiPageKeyboardView extends KeyboardView implements public boolean onCancel(final MotionEvent e) { releaseCurrentKey(false); - dismissMoreKeysPanel(); + dismissPopupKeysPanel(); cancelLongPress(); return true; } @@ -401,11 +401,11 @@ public final class EmojiPageKeyboardView extends KeyboardView implements final int x = (int)e.getX(); final int y = (int)e.getY(); final Key key = getKey(x, y); - final boolean isShowingMoreKeysPanel = isShowingMoreKeysPanel(); + final boolean isShowingPopupKeysPanel = isShowingPopupKeysPanel(); // Touched key has changed, release previous key's callbacks and // re-register them for the new key. - if (key != mCurrentKey && !isShowingMoreKeysPanel) { + if (key != mCurrentKey && !isShowingPopupKeysPanel) { releaseCurrentKey(false); mCurrentKey = key; if (key == null) { @@ -417,11 +417,11 @@ public final class EmojiPageKeyboardView extends KeyboardView implements registerLongPress(key); } - if (isShowingMoreKeysPanel) { + if (isShowingPopupKeysPanel) { final long eventTime = e.getEventTime(); - final int translatedX = mMoreKeysPanel.translateX(x); - final int translatedY = mMoreKeysPanel.translateY(y); - mMoreKeysPanel.onMoveEvent(translatedX, translatedY, mPointerId, eventTime); + final int translatedX = mPopupKeysPanel.translateX(x); + final int translatedY = mPopupKeysPanel.translateY(y); + mPopupKeysPanel.onMoveEvent(translatedX, translatedY, mPointerId, eventTime); } mLastX = x; diff --git a/app/src/main/java/helium314/keyboard/keyboard/emoji/OnKeyEventListener.java b/app/src/main/java/helium314/keyboard/keyboard/emoji/OnKeyEventListener.java index d7ff336dc..e9c01fa9a 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/emoji/OnKeyEventListener.java +++ b/app/src/main/java/helium314/keyboard/keyboard/emoji/OnKeyEventListener.java @@ -18,7 +18,7 @@ public interface OnKeyEventListener { /** * Called when a key is released. * This may be called without any prior call to {@link OnKeyEventListener#onPressKey(Key)}, - * for example when a key from a more keys keyboard is selected by releasing touch on it. + * for example when a key from a popup keys keyboard is selected by releasing touch on it. */ void onReleaseKey(Key key); } diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/DrawingProxy.java b/app/src/main/java/helium314/keyboard/keyboard/internal/DrawingProxy.java index 4bd011f10..986bf9197 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/DrawingProxy.java +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/DrawingProxy.java @@ -10,7 +10,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import helium314.keyboard.keyboard.Key; -import helium314.keyboard.keyboard.MoreKeysPanel; +import helium314.keyboard.keyboard.PopupKeysPanel; import helium314.keyboard.keyboard.PointerTracker; public interface DrawingProxy { @@ -29,14 +29,13 @@ public interface DrawingProxy { void onKeyReleased(@NonNull Key key, boolean withAnimation); /** - * Start showing more keys keyboard of a key that is being long pressed. - * @param key the {@link Key} that is being long pressed and showing more keys keyboard. + * Start showing popup keys keyboard of a key that is being long pressed. + * @param key the {@link Key} that is being long pressed and showing popup keys keyboard. * @param tracker the {@link PointerTracker} that detects this long pressing. - * @return {@link MoreKeysPanel} that is being shown. null if there is no need to show more keys - * keyboard. + * @return {@link PopupKeysPanel} that is being shown. null if there is no need to show popup keys keyboard. */ @Nullable - MoreKeysPanel showMoreKeysKeyboard(@NonNull Key key, @NonNull PointerTracker tracker); + PopupKeysPanel showPopupKeysKeyboard(@NonNull Key key, @NonNull PointerTracker tracker); /** * Start a while-typing-animation. diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/KeyPreviewChoreographer.java b/app/src/main/java/helium314/keyboard/keyboard/internal/KeyPreviewChoreographer.java index 23c4b2b19..c2a1f0105 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/KeyPreviewChoreographer.java +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/KeyPreviewChoreographer.java @@ -105,8 +105,8 @@ public final class KeyPreviewChoreographer { } else { keyPreviewPosition = KeyPreviewView.POSITION_MIDDLE; } - final boolean hasMoreKeys = (key.getMoreKeys() != null); - keyPreviewView.setPreviewBackground(hasMoreKeys, keyPreviewPosition); + final boolean hasPopupKeys = (key.getPopupKeys() != null); + keyPreviewView.setPreviewBackground(hasPopupKeys, keyPreviewPosition); final Colors colors = Settings.getInstance().getCurrent().mColors; colors.setBackground(keyPreviewView, ColorType.KEY_PREVIEW); diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/KeyPreviewDrawParams.java b/app/src/main/java/helium314/keyboard/keyboard/internal/KeyPreviewDrawParams.java index 7acc9eaa8..132e47ffa 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/KeyPreviewDrawParams.java +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/KeyPreviewDrawParams.java @@ -33,13 +33,13 @@ public final class KeyPreviewDrawParams { // | key| // +-------+ // The background of a {@link TextView} being used for a key preview may have invisible - // paddings. To align the more keys keyboard panel's visible part with the visible part of + // paddings. To align the popup keys keyboard panel's visible part with the visible part of // the background, we need to record the width and height of key preview that don't include // invisible paddings. private int mVisibleWidth; private int mVisibleHeight; // The key preview may have an arbitrary offset and its background that may have a bottom - // padding. To align the more keys keyboard and the key preview we also need to record the + // padding. To align the popup keys keyboard and the key preview we also need to record the // offset between the top edge of parent key and the bottom of the visible part of key // preview background. private int mVisibleOffset; diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/KeyPreviewView.java b/app/src/main/java/helium314/keyboard/keyboard/internal/KeyPreviewView.java index 0fd89375e..7c735810e 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/KeyPreviewView.java +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/KeyPreviewView.java @@ -110,26 +110,26 @@ public class KeyPreviewView extends AppCompatTextView { private static final int[][][] KEY_PREVIEW_BACKGROUND_STATE_TABLE = { { // POSITION_MIDDLE {}, - { R.attr.state_has_morekeys } + { R.attr.state_has_popup_keys} }, { // POSITION_LEFT { R.attr.state_left_edge }, - { R.attr.state_left_edge, R.attr.state_has_morekeys } + { R.attr.state_left_edge, R.attr.state_has_popup_keys} }, { // POSITION_RIGHT { R.attr.state_right_edge }, - { R.attr.state_right_edge, R.attr.state_has_morekeys } + { R.attr.state_right_edge, R.attr.state_has_popup_keys} } }; private static final int STATE_NORMAL = 0; - private static final int STATE_HAS_MOREKEYS = 1; + private static final int STATE_HAS_POPUPKEYS = 1; - public void setPreviewBackground(final boolean hasMoreKeys, final int position) { + public void setPreviewBackground(final boolean hasPopupKeys, final int position) { final Drawable background = getBackground(); if (background == null) { return; } - final int hasMoreKeysState = hasMoreKeys ? STATE_HAS_MOREKEYS : STATE_NORMAL; - background.setState(KEY_PREVIEW_BACKGROUND_STATE_TABLE[position][hasMoreKeysState]); + final int hasPopupKeysState = hasPopupKeys ? STATE_HAS_POPUPKEYS : STATE_NORMAL; + background.setState(KEY_PREVIEW_BACKGROUND_STATE_TABLE[position][hasPopupKeysState]); } } diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/KeySpecParser.java b/app/src/main/java/helium314/keyboard/keyboard/internal/KeySpecParser.java index 1af6c0abf..062be8c1d 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/KeySpecParser.java +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/KeySpecParser.java @@ -30,7 +30,7 @@ import androidx.annotation.Nullable; * - Code point presented by hexadecimal string prefixed with "0x" * - Code reference represented by (!code/code_name), see {@link KeyboardCodesSet}. * Special character, comma ',' backslash '\', and bar '|' can be escaped by '\' character. - * Note that the '\' is also parsed by XML parser and {@link MoreKeySpec#splitKeySpecs(String)} + * Note that the '\' is also parsed by XML parser and {@link PopupKeySpec#splitKeySpecs(String)} * as well. */ // TODO: Rename to KeySpec and make this class to the key specification object. diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/KeyboardBuilder.kt b/app/src/main/java/helium314/keyboard/keyboard/internal/KeyboardBuilder.kt index 230492341..6f44b7677 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/KeyboardBuilder.kt +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/KeyboardBuilder.kt @@ -42,23 +42,23 @@ open class KeyboardBuilder(protected val mContext: Context, mParams.GRID_HEIGHT = res.getInteger(R.integer.config_keyboard_grid_height) } - fun setAllowRedundantMoreKeys(enabled: Boolean) { - mParams.mAllowRedundantMoreKeys = enabled + fun setAllowRedundantPopupKeys(enabled: Boolean) { + mParams.mAllowRedundantPopupKeys = enabled } fun load(id: KeyboardId): KeyboardBuilder { mParams.mId = id if (id.isEmojiKeyboard) { - setAllowRedundantMoreKeys(true) + setAllowRedundantPopupKeys(true) readAttributes(R.xml.kbd_emoji) keysInRows = EmojiParser(mParams, mContext).parse() } else { try { val sv = Settings.getInstance().current - addLocaleKeyTextsToParams(mContext, mParams, sv.mShowMoreMoreKeys) - mParams.mMoreKeyTypes.addAll(sv.mMoreKeyTypes) - // add label source only if moreKey type enabled - sv.mMoreKeyLabelSources.forEach { if (it in sv.mMoreKeyTypes) mParams.mMoreKeyLabelSources.add(it) } + addLocaleKeyTextsToParams(mContext, mParams, sv.mShowMorePopupKeys) + mParams.mPopupKeyTypes.addAll(sv.mPopupKeyTypes) + // add label source only if popup key type enabled + sv.mPopupKeyLabelSources.forEach { if (it in sv.mPopupKeyTypes) mParams.mPopupKeyLabelSources.add(it) } keysInRows = KeyboardParser.parseLayout(mParams, mContext) determineAbsoluteValues() } catch (e: Exception) { @@ -259,7 +259,7 @@ open class KeyboardBuilder(protected val mContext: Context, } private fun endKeyboard() { - mParams.removeRedundantMoreKeys() + mParams.removeRedundantPopupKeys() // {@link #parseGridRows(XmlPullParser,boolean)} may populate keyboard rows higher than // previously expected. // todo (low priority): mCurrentY may end up too high with the new parser and 4 row keyboards in landscape mode diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/KeyboardParams.java b/app/src/main/java/helium314/keyboard/keyboard/internal/KeyboardParams.java index edf4734b6..a1011ad04 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/KeyboardParams.java +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/KeyboardParams.java @@ -64,8 +64,8 @@ public class KeyboardParams { public int mHorizontalGap; public int mVerticalGap; - public int mMoreKeysTemplate; - public int mMaxMoreKeysKeyboardColumn; + public int mPopupKeysTemplate; + public int mMaxPopupKeysKeyboardColumn; public int GRID_WIDTH; public int GRID_HEIGHT; @@ -81,12 +81,12 @@ public class KeyboardParams { public final KeyboardIconsSet mIconsSet = new KeyboardIconsSet(); @NonNull // todo: not good, this only works because params are currently always created for the active subtype public final List mSecondaryLocales = Settings.getInstance().getCurrent().mSecondaryLocales; - public final ArrayList mMoreKeyTypes = new ArrayList<>(); - public final ArrayList mMoreKeyLabelSources = new ArrayList<>(); + public final ArrayList mPopupKeyTypes = new ArrayList<>(); + public final ArrayList mPopupKeyLabelSources = new ArrayList<>(); @NonNull private final UniqueKeysCache mUniqueKeysCache; - public boolean mAllowRedundantMoreKeys; + public boolean mAllowRedundantPopupKeys; @NonNull public LocaleKeyTexts mLocaleKeyTexts; @@ -142,19 +142,19 @@ public class KeyboardParams { } } - public void removeRedundantMoreKeys() { - if (mAllowRedundantMoreKeys) { + public void removeRedundantPopupKeys() { + if (mAllowRedundantPopupKeys) { return; } - final MoreKeySpec.LettersOnBaseLayout lettersOnBaseLayout = - new MoreKeySpec.LettersOnBaseLayout(); + final PopupKeySpec.LettersOnBaseLayout lettersOnBaseLayout = + new PopupKeySpec.LettersOnBaseLayout(); for (final Key key : mSortedKeys) { lettersOnBaseLayout.addLetter(key); } final ArrayList allKeys = new ArrayList<>(mSortedKeys); mSortedKeys.clear(); for (final Key key : allKeys) { - final Key filteredKey = Key.removeRedundantMoreKeys(key, lettersOnBaseLayout); + final Key filteredKey = Key.removeRedundantPopupKeys(key, lettersOnBaseLayout); mSortedKeys.add(mUniqueKeysCache.getUniqueKey(filteredKey)); } } @@ -199,7 +199,7 @@ public class KeyboardParams { // when attr is null, default attributes will be loaded // these are good for basic keyboards already, but have wrong/unsuitable sizes e.g. for emojis, - // moreKeys and moreSuggestions + // popupKeys and moreSuggestions public void readAttributes(final Context context, @Nullable final AttributeSet attr) { final TypedArray keyboardAttr = context.obtainStyledAttributes( attr, R.styleable.Keyboard, R.attr.keyboardStyle, R.style.Keyboard); @@ -260,8 +260,8 @@ public class KeyboardParams { mKeyVisualAttributes = KeyVisualAttributes.newInstance(keyAttr); - mMoreKeysTemplate = keyboardAttr.getResourceId(R.styleable.Keyboard_moreKeysTemplate, 0); - mMaxMoreKeysKeyboardColumn = keyAttr.getInt(R.styleable.Keyboard_Key_maxMoreKeysColumn, 5); + mPopupKeysTemplate = keyboardAttr.getResourceId(R.styleable.Keyboard_popupKeysTemplate, 0); + mMaxPopupKeysKeyboardColumn = keyAttr.getInt(R.styleable.Keyboard_Key_maxPopupKeysColumn, 5); mThemeId = keyboardAttr.getInt(R.styleable.Keyboard_themeId, 0); mIconsSet.loadIcons(keyboardAttr); diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/KeyboardState.java b/app/src/main/java/helium314/keyboard/keyboard/internal/KeyboardState.java index fa306dde3..4f2fc295b 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/KeyboardState.java +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/KeyboardState.java @@ -627,7 +627,7 @@ public final class KeyboardState { } } } else { - // In symbol mode, just toggle symbol and symbol more keyboard. + // In symbol mode, just toggle symbol and symbol popup keyboard. toggleShiftInSymbols(); mSwitchState = SWITCH_STATE_MOMENTARY_SYMBOL_AND_MORE; mShiftKeyState.onPress(); diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/MoreCodesArrayParser.java b/app/src/main/java/helium314/keyboard/keyboard/internal/MoreCodesArrayParser.java index 526bd4d74..1b3bf7953 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/MoreCodesArrayParser.java +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/MoreCodesArrayParser.java @@ -17,7 +17,7 @@ import helium314.keyboard.latin.common.StringUtils; * The string parser of moreCodesArray specification for . The attribute moreCodesArray is an * array of string. * The more codes array specification is semicolon separated "codes array specification" each of which represents one - * "more key". + * "popup key". * Each element of the array defines a sequence of key labels specified as hexadecimal strings * representing code points separated by a vertical bar. * diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/MoreKeySpec.java b/app/src/main/java/helium314/keyboard/keyboard/internal/PopupKeySpec.java similarity index 69% rename from app/src/main/java/helium314/keyboard/keyboard/internal/MoreKeySpec.java rename to app/src/main/java/helium314/keyboard/keyboard/internal/PopupKeySpec.java index 06df6b872..3b58ac0b5 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/MoreKeySpec.java +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/PopupKeySpec.java @@ -22,18 +22,18 @@ import java.util.HashSet; import java.util.Locale; /** - * The more key specification object. The more keys are an array of {@link MoreKeySpec}. - * - * The more keys specification is comma separated "key specification" each of which represents one - * "more key". + * The popup key specification object. The popup keys are an array of {@link PopupKeySpec}. + *

+ * The popup keys specification is comma separated "key specification" each of which represents one + * "popup key". * The key specification might have label or string resource reference in it. These references are * expanded before parsing comma. * Special character, comma ',' backslash '\' can be escaped by '\' character. - * Note that the '\' is also parsed by XML parser and {@link MoreKeySpec#splitKeySpecs(String)} + * Note that the '\' is also parsed by XML parser and {@link PopupKeySpec#splitKeySpecs(String)} * as well. */ // TODO: Should extend the key specification object. -public final class MoreKeySpec { +public final class PopupKeySpec { public final int mCode; @Nullable public final String mLabel; @@ -41,14 +41,14 @@ public final class MoreKeySpec { public final String mOutputText; public final int mIconId; - public MoreKeySpec(@NonNull final String moreKeySpec, boolean needsToUpperCase, - @NonNull final Locale locale) { - if (moreKeySpec.isEmpty()) { - throw new KeySpecParser.KeySpecParserError("Empty more key spec"); + public PopupKeySpec(@NonNull final String popupKeySpec, boolean needsToUpperCase, + @NonNull final Locale locale) { + if (popupKeySpec.isEmpty()) { + throw new KeySpecParser.KeySpecParserError("Empty popup key spec"); } - final String label = KeySpecParser.getLabel(moreKeySpec); + final String label = KeySpecParser.getLabel(popupKeySpec); mLabel = needsToUpperCase ? StringUtils.toTitleCaseOfKeyLabel(label, locale) : label; - final int codeInSpec = KeySpecParser.getCode(moreKeySpec); + final int codeInSpec = KeySpecParser.getCode(popupKeySpec); final int code = needsToUpperCase ? StringUtils.toTitleCaseOfKeyCode(codeInSpec, locale) : codeInSpec; if (code == Constants.CODE_UNSPECIFIED) { @@ -58,11 +58,11 @@ public final class MoreKeySpec { mOutputText = mLabel; } else { mCode = code; - final String outputText = KeySpecParser.getOutputText(moreKeySpec); + final String outputText = KeySpecParser.getOutputText(popupKeySpec); mOutputText = needsToUpperCase ? StringUtils.toTitleCaseOfKeyLabel(outputText, locale) : outputText; } - mIconId = KeySpecParser.getIconId(moreKeySpec); + mIconId = KeySpecParser.getIconId(popupKeySpec); } @NonNull @@ -89,8 +89,8 @@ public final class MoreKeySpec { if (this == o) { return true; } - if (o instanceof MoreKeySpec) { - final MoreKeySpec other = (MoreKeySpec)o; + if (o instanceof PopupKeySpec) { + final PopupKeySpec other = (PopupKeySpec)o; return mCode == other.mCode && mIconId == other.mIconId && TextUtils.equals(mLabel, other.mLabel) @@ -124,40 +124,40 @@ public final class MoreKeySpec { } } - public boolean contains(@NonNull final MoreKeySpec moreKey) { - final int code = moreKey.mCode; + public boolean contains(@NonNull final PopupKeySpec popupKey) { + final int code = popupKey.mCode; if (mCodes.indexOfKey(code) >= 0) { return true; - } else return code == Constants.CODE_OUTPUT_TEXT && mTexts.contains(moreKey.mOutputText); + } else return code == Constants.CODE_OUTPUT_TEXT && mTexts.contains(popupKey.mOutputText); } } @Nullable - public static MoreKeySpec[] removeRedundantMoreKeys(@Nullable final MoreKeySpec[] moreKeys, + public static PopupKeySpec[] removeRedundantPopupKeys(@Nullable final PopupKeySpec[] popupKeys, @NonNull final LettersOnBaseLayout lettersOnBaseLayout) { - if (moreKeys == null) { + if (popupKeys == null) { return null; } - final ArrayList filteredMoreKeys = new ArrayList<>(); - for (final MoreKeySpec moreKey : moreKeys) { - if (!lettersOnBaseLayout.contains(moreKey)) { - filteredMoreKeys.add(moreKey); + final ArrayList filteredPopupKeys = new ArrayList<>(); + for (final PopupKeySpec popupKey : popupKeys) { + if (!lettersOnBaseLayout.contains(popupKey)) { + filteredPopupKeys.add(popupKey); } } - final int size = filteredMoreKeys.size(); - if (size == moreKeys.length) { - return moreKeys; + final int size = filteredPopupKeys.size(); + if (size == popupKeys.length) { + return popupKeys; } if (size == 0) { return null; } - return filteredMoreKeys.toArray(new MoreKeySpec[size]); + return filteredPopupKeys.toArray(new PopupKeySpec[size]); } // Constants for parsing. private static final char COMMA = Constants.CODE_COMMA; private static final char BACKSLASH = Constants.CODE_BACKSLASH; - private static final String ADDITIONAL_MORE_KEY_MARKER = + private static final String ADDITIONAL_POPUP_KEY_MARKER = StringUtils.newSingleCodePointString(Constants.CODE_PERCENT); /** @@ -239,55 +239,55 @@ public final class MoreKeySpec { return out.toArray(new String[0]); } - public static String[] insertAdditionalMoreKeys(@Nullable final String[] moreKeySpecs, - @Nullable final String[] additionalMoreKeySpecs) { - final String[] moreKeys = filterOutEmptyString(moreKeySpecs); - final String[] additionalMoreKeys = filterOutEmptyString(additionalMoreKeySpecs); - final int moreKeysCount = moreKeys.length; - final int additionalCount = additionalMoreKeys.length; + public static String[] insertAdditionalPopupKeys(@Nullable final String[] popupKeySpecs, + @Nullable final String[] additionalPopupKeySpecs) { + final String[] popupKeys = filterOutEmptyString(popupKeySpecs); + final String[] additionalPopupKeys = filterOutEmptyString(additionalPopupKeySpecs); + final int popupKeysCount = popupKeys.length; + final int additionalCount = additionalPopupKeys.length; ArrayList out = null; int additionalIndex = 0; - for (int moreKeyIndex = 0; moreKeyIndex < moreKeysCount; moreKeyIndex++) { - final String moreKeySpec = moreKeys[moreKeyIndex]; - if (moreKeySpec.equals(ADDITIONAL_MORE_KEY_MARKER)) { + for (int popupKeyIndex = 0; popupKeyIndex < popupKeysCount; popupKeyIndex++) { + final String popupKeySpec = popupKeys[popupKeyIndex]; + if (popupKeySpec.equals(ADDITIONAL_POPUP_KEY_MARKER)) { if (additionalIndex < additionalCount) { - // Replace '%' marker with additional more key specification. - final String additionalMoreKey = additionalMoreKeys[additionalIndex]; + // Replace '%' marker with additional popup key specification. + final String additionalPopupKey = additionalPopupKeys[additionalIndex]; if (out != null) { - out.add(additionalMoreKey); + out.add(additionalPopupKey); } else { - moreKeys[moreKeyIndex] = additionalMoreKey; + popupKeys[popupKeyIndex] = additionalPopupKey; } additionalIndex++; } else { // Filter out excessive '%' marker. if (out == null) { - out = CollectionUtils.arrayAsList(moreKeys, 0, moreKeyIndex); + out = CollectionUtils.arrayAsList(popupKeys, 0, popupKeyIndex); } } } else { if (out != null) { - out.add(moreKeySpec); + out.add(popupKeySpec); } } } if (additionalCount > 0 && additionalIndex == 0) { - // No '%' marker is found in more keys. - // Insert all additional more keys to the head of more keys. - out = CollectionUtils.arrayAsList(additionalMoreKeys, additionalIndex, additionalCount); - for (int i = 0; i < moreKeysCount; i++) { - out.add(moreKeys[i]); + // No '%' marker is found in popup keys. + // Insert all additional popup keys to the head of popup keys. + out = CollectionUtils.arrayAsList(additionalPopupKeys, additionalIndex, additionalCount); + for (int i = 0; i < popupKeysCount; i++) { + out.add(popupKeys[i]); } } else if (additionalIndex < additionalCount) { - // The number of '%' markers are less than additional more keys. - // Append remained additional more keys to the tail of more keys. - out = CollectionUtils.arrayAsList(moreKeys, 0, moreKeysCount); + // The number of '%' markers are less than additional popup keys. + // Append remained additional popup keys to the tail of popup keys. + out = CollectionUtils.arrayAsList(popupKeys, 0, popupKeysCount); for (int i = additionalIndex; i < additionalCount; i++) { - out.add(additionalMoreKeys[i]); + out.add(additionalPopupKeys[i]); } } - if (out == null && moreKeysCount > 0) { - return moreKeys; + if (out == null && popupKeysCount > 0) { + return popupKeys; } else if (out != null && out.size() > 0) { return out.toArray(new String[0]); } else { @@ -295,44 +295,44 @@ public final class MoreKeySpec { } } - public static int getIntValue(@Nullable final String[] moreKeys, final String key, + public static int getIntValue(@Nullable final String[] popupKeys, final String key, final int defaultValue) { - if (moreKeys == null) { + if (popupKeys == null) { return defaultValue; } final int keyLen = key.length(); boolean foundValue = false; int value = defaultValue; - for (int i = 0; i < moreKeys.length; i++) { - final String moreKeySpec = moreKeys[i]; - if (moreKeySpec == null || !moreKeySpec.startsWith(key)) { + for (int i = 0; i < popupKeys.length; i++) { + final String popupKeySpec = popupKeys[i]; + if (popupKeySpec == null || !popupKeySpec.startsWith(key)) { continue; } - moreKeys[i] = null; + popupKeys[i] = null; try { if (!foundValue) { - value = Integer.parseInt(moreKeySpec.substring(keyLen)); + value = Integer.parseInt(popupKeySpec.substring(keyLen)); foundValue = true; } } catch (NumberFormatException e) { throw new RuntimeException( - "integer should follow after " + key + ": " + moreKeySpec); + "integer should follow after " + key + ": " + popupKeySpec); } } return value; } - public static boolean getBooleanValue(@Nullable final String[] moreKeys, final String key) { - if (moreKeys == null) { + public static boolean getBooleanValue(@Nullable final String[] popupKeys, final String key) { + if (popupKeys == null) { return false; } boolean value = false; - for (int i = 0; i < moreKeys.length; i++) { - final String moreKeySpec = moreKeys[i]; - if (moreKeySpec == null || !moreKeySpec.equals(key)) { + for (int i = 0; i < popupKeys.length; i++) { + final String popupKeySpec = popupKeys[i]; + if (popupKeySpec == null || !popupKeySpec.equals(key)) { continue; } - moreKeys[i] = null; + popupKeys[i] = null; value = true; } return value; diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/EmojiParser.kt b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/EmojiParser.kt index daf885980..092d9c9ba 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/EmojiParser.kt +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/EmojiParser.kt @@ -32,10 +32,10 @@ class EmojiParser(private val params: KeyboardParams, private val context: Conte else -> throw(IllegalStateException("can only parse emoji categories where an array exists")) } val emojiArray = context.resources.getStringArray(emojiArrayId) - val moreEmojisArray = if (params.mId.mElementId != KeyboardId.ELEMENT_EMOJI_CATEGORY2) null + val popupEmojisArray = if (params.mId.mElementId != KeyboardId.ELEMENT_EMOJI_CATEGORY2) null else context.resources.getStringArray(R.array.emoji_people_body_more) - if (moreEmojisArray != null && emojiArray.size != moreEmojisArray.size) - throw(IllegalStateException("Inconsistent array size between codesArray and moreKeysArray")) + if (popupEmojisArray != null && emojiArray.size != popupEmojisArray.size) + throw(IllegalStateException("Inconsistent array size between codesArray and popupKeysArray")) val row = ArrayList(emojiArray.size) var currentX = params.mLeftPadding.toFloat() @@ -51,7 +51,7 @@ class EmojiParser(private val params: KeyboardParams, private val context: Conte val keyHeight = emojiKeyboardHeight * params.mDefaultRelativeRowHeight * Settings.getInstance().current.mKeyboardHeightScale // still apply height scale to key emojiArray.forEachIndexed { i, codeArraySpec -> - val keyParams = parseEmojiKey(codeArraySpec, moreEmojisArray?.get(i)?.takeIf { it.isNotEmpty() }) ?: return@forEachIndexed + val keyParams = parseEmojiKey(codeArraySpec, popupEmojisArray?.get(i)?.takeIf { it.isNotEmpty() }) ?: return@forEachIndexed keyParams.xPos = currentX keyParams.yPos = currentY keyParams.mFullWidth = keyWidth @@ -78,24 +78,24 @@ class EmojiParser(private val params: KeyboardParams, private val context: Conte return labelBuilder.toString() to Constants.CODE_OUTPUT_TEXT } - private fun parseEmojiKey(spec: String, moreKeysString: String? = null): KeyParams? { + private fun parseEmojiKey(spec: String, popupKeysString: String? = null): KeyParams? { val (label, code) = getLabelAndCode(spec) ?: return null val sb = StringBuilder() - moreKeysString?.split(";")?.let { moreKeys -> - moreKeys.forEach { + popupKeysString?.split(";")?.let { popupKeys -> + popupKeys.forEach { val (mkLabel, _) = getLabelAndCode(it) ?: return@forEach sb.append(mkLabel).append(",") } } - val moreKeysSpec = if (sb.isNotEmpty()) { + val popupKeysSpec = if (sb.isNotEmpty()) { sb.deleteCharAt(sb.length - 1) sb.toString() } else null return KeyParams( label, code, - if (moreKeysSpec != null) EMOJI_HINT_LABEL else null, - moreKeysSpec, + if (popupKeysSpec != null) EMOJI_HINT_LABEL else null, + popupKeysSpec, Key.LABEL_FLAGS_FONT_NORMAL, params ) diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/JsonKeyboardParser.kt b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/JsonKeyboardParser.kt index eadb46380..dc1721943 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/JsonKeyboardParser.kt +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/JsonKeyboardParser.kt @@ -25,7 +25,7 @@ import helium314.keyboard.keyboard.internal.keyboard_parser.floris.VariationSele * if label or code are missing one is created from the other * auto_text_key ignored (i.e. interpreted like the default TextKey) * codes of multi_text_key not used, only the label - * (currently) popups is always read to [number, main, relevant] layoutMoreKeys, no choice of which to use or which hint is provided + * (currently) popups is always read to [number, main, relevant] layoutPopupKeys, no choice of which to use or which hint is provided */ class JsonKeyboardParser(private val params: KeyboardParams, private val context: Context) : KeyboardParser(params, context) { diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/KeyboardParser.kt b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/KeyboardParser.kt index a1546c1ae..ae38a4def 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/KeyboardParser.kt +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/KeyboardParser.kt @@ -17,7 +17,6 @@ import helium314.keyboard.keyboard.internal.keyboard_parser.floris.KeyType import helium314.keyboard.keyboard.internal.keyboard_parser.floris.SimplePopups import helium314.keyboard.latin.R import helium314.keyboard.latin.common.Constants -import helium314.keyboard.latin.common.LocaleUtils import helium314.keyboard.latin.common.LocaleUtils.constructLocale import helium314.keyboard.latin.common.isEmoji import helium314.keyboard.latin.common.splitOnWhitespace @@ -26,13 +25,12 @@ import helium314.keyboard.latin.settings.Settings import helium314.keyboard.latin.spellcheck.AndroidSpellCheckerService import helium314.keyboard.latin.utils.CUSTOM_LAYOUT_PREFIX import helium314.keyboard.latin.utils.InputTypeUtils -import helium314.keyboard.latin.utils.MORE_KEYS_LAYOUT -import helium314.keyboard.latin.utils.MORE_KEYS_NUMBER +import helium314.keyboard.latin.utils.POPUP_KEYS_LAYOUT +import helium314.keyboard.latin.utils.POPUP_KEYS_NUMBER import helium314.keyboard.latin.utils.getLayoutFile import helium314.keyboard.latin.utils.runInLocale import helium314.keyboard.latin.utils.sumOf import java.io.File -import java.util.Locale /** * Abstract parser class that handles creation of keyboard from [KeyData] arranged in rows, @@ -55,7 +53,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co fun parseLayoutString(layoutContent: String): ArrayList> { params.readAttributes(context, null) params.mProximityCharsCorrectionEnabled = infos.enableProximityCharsCorrection - params.mAllowRedundantMoreKeys = infos.allowRedundantMoreKeys + params.mAllowRedundantPopupKeys = infos.allowRedundantPopupKeys if (infos.touchPositionCorrectionData == null) // need to set correctly, as it's not properly done in readAttributes with attr = null params.mTouchPositionCorrection.load(emptyArray()) else @@ -80,9 +78,9 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co } private fun createAlphaSymbolRows(baseKeys: MutableList>): ArrayList> { - addNumberRowOrMoreKeys(baseKeys) + addNumberRowOrPopupKeys(baseKeys) if (params.mId.isAlphabetKeyboard) - addSymbolMoreKeys(baseKeys) + addSymbolPopupKeys(baseKeys) val bottomRow = getBottomRowAndAdjustBaseKeys(baseKeys) // not really fast, but irrelevant compared to the loop val keysInRows = ArrayList>() @@ -177,22 +175,22 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co return keysInRows } - private fun addNumberRowOrMoreKeys(baseKeys: MutableList>) { + private fun addNumberRowOrPopupKeys(baseKeys: MutableList>) { if (!params.mId.mNumberRowEnabled && params.mId.mElementId == KeyboardId.ELEMENT_SYMBOLS) { - // replace first symbols row with number row, but use the labels as moreKeys + // replace first symbols row with number row, but use the labels as popupKeys val numberRow = params.mLocaleKeyTexts.getNumberRow() numberRow.forEachIndexed { index, keyData -> keyData.popup.symbol = baseKeys[0].getOrNull(index)?.label } baseKeys[0] = numberRow } else if (!params.mId.mNumberRowEnabled && params.mId.isAlphabetKeyboard && infos.numbersOnTopRow) { - if (baseKeys[0].any { it.popup.main != null || !it.popup.relevant.isNullOrEmpty() } // first row of baseKeys has any layout more key - && params.mMoreKeyLabelSources.let { - val layout = it.indexOf(MORE_KEYS_LAYOUT) - val number = it.indexOf(MORE_KEYS_NUMBER) + if (baseKeys[0].any { it.popup.main != null || !it.popup.relevant.isNullOrEmpty() } // first row of baseKeys has any layout popup key + && params.mPopupKeyLabelSources.let { + val layout = it.indexOf(POPUP_KEYS_LAYOUT) + val number = it.indexOf(POPUP_KEYS_NUMBER) layout != -1 && layout < number // layout before number label } ) { - // remove number from labels, to avoid awkward mix of numbers and others caused by layout more keys - params.mMoreKeyLabelSources.remove(MORE_KEYS_NUMBER) + // remove number from labels, to avoid awkward mix of numbers and others caused by layout popup keys + params.mPopupKeyLabelSources.remove(POPUP_KEYS_NUMBER) } // add number to the first 10 keys in first row baseKeys.first().take(10).forEachIndexed { index, keyData -> keyData.popup.numberIndex = index } @@ -202,7 +200,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co } } - private fun addSymbolMoreKeys(baseKeys: MutableList>) { + private fun addSymbolPopupKeys(baseKeys: MutableList>) { val layoutName = Settings.readSymbolsLayoutName(context, params.mId.locale) val layout = if (layoutName.startsWith(CUSTOM_LAYOUT_PREFIX)) { val parser = if (layoutName.endsWith("json")) JsonKeyboardParser(params, context) @@ -265,7 +263,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co "view_characters" -> "alpha" "view_symbols" -> "symbol" "enter" -> "action" - // todo (later): maybe add special moreKeys for phone and number layouts? + // todo (later): maybe add special popupKeys for phone and number layouts? "." -> if (params.mId.mElementId == KeyboardId.ELEMENT_NUMPAD) "period" else "." "," -> if (params.mId.mElementId == KeyboardId.ELEMENT_NUMPAD) "comma" else "," else -> key.label @@ -292,7 +290,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co keyParams.mBackgroundType = Key.BACKGROUND_TYPE_FUNCTIONAL if (params.mId.mElementId == KeyboardId.ELEMENT_PHONE && key.popup.main?.getPopupLabel(params)?.length?.let { it > 1 } == true) { - keyParams.mMoreKeys = null // the ABC and stuff labels should not create moreKeys + keyParams.mPopupKeys = null // the ABC and stuff labels should not create popupKeys } if (keyParams.mLabel?.length?.let { it > 1 } == true && keyParams.mLabel?.startsWith("!string/") == true) { // resolve string label @@ -417,16 +415,16 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co it.toKeyParams(params, additionalLabelFlags = Key.LABEL_FLAGS_DISABLE_HINT_LABEL or defaultLabelFlags) } - private fun getFunctionalKeyParams(def: String, label: String? = null, moreKeys: Collection? = null): KeyParams { + private fun getFunctionalKeyParams(def: String, label: String? = null, popupKeys: Collection? = null): KeyParams { val split = def.trim().splitOnWhitespace() val key = FunctionalKey.valueOf(split[0].uppercase()) val width = if (split.size == 2) split[1].substringBefore("%").toFloat() / 100f else params.mDefaultRelativeKeyWidth - return getFunctionalKeyParams(key, width, label, moreKeys) + return getFunctionalKeyParams(key, width, label, popupKeys) } - private fun getFunctionalKeyParams(key: FunctionalKey, relativeWidth: Float? = null, label: String? = null, moreKeys: Collection? = null): KeyParams { - // for comma and period: label will override default, moreKeys will be appended + private fun getFunctionalKeyParams(key: FunctionalKey, relativeWidth: Float? = null, label: String? = null, popupKeys: Collection? = null): KeyParams { + // for comma and period: label will override default, popupKeys will be appended val width = relativeWidth ?: params.mDefaultRelativeKeyWidth return when (key) { FunctionalKey.SYMBOL -> KeyParams( @@ -454,7 +452,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co Key.LABEL_FLAGS_HAS_POPUP_HINT, // previously only if normal comma, but always is more correct if (label?.first()?.isLetter() == true) Key.BACKGROUND_TYPE_NORMAL // mimic behavior of old dvorak and halmak layouts else Key.BACKGROUND_TYPE_FUNCTIONAL, - SimplePopups(moreKeys?.let { getCommaMoreKeys() + it } ?: getCommaMoreKeys()) + SimplePopups(popupKeys?.let { getCommaPopupKeys() + it } ?: getCommaPopupKeys()) ) FunctionalKey.PERIOD -> KeyParams( label ?: getPeriodLabel(), @@ -463,7 +461,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co Key.LABEL_FLAGS_HAS_POPUP_HINT or defaultLabelFlags, if (label?.first()?.isLetter() == true) Key.BACKGROUND_TYPE_NORMAL else Key.BACKGROUND_TYPE_FUNCTIONAL, - SimplePopups(moreKeys?.let { getPunctuationMoreKeys() + it } ?: getPunctuationMoreKeys()) + SimplePopups(popupKeys?.let { getPunctuationPopupKeys() + it } ?: getPunctuationPopupKeys()) ) FunctionalKey.SPACE -> KeyParams( getSpaceLabel(), @@ -484,7 +482,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co or Key.LABEL_FLAGS_HAS_POPUP_HINT or KeyboardTheme.getThemeActionAndEmojiKeyLabelFlags(params.mThemeId), Key.BACKGROUND_TYPE_ACTION, - getActionKeyMoreKeys()?.let { SimplePopups(it) } + getActionKeyPopupKeys()?.let { SimplePopups(it) } ) FunctionalKey.DELETE -> KeyParams( "!icon/delete_key|!code/key_delete", @@ -503,7 +501,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co if (params.mId.mElementId == KeyboardId.ELEMENT_ALPHABET_SHIFT_LOCK_SHIFTED || params.mId.mElementId == KeyboardId.ELEMENT_ALPHABET_SHIFT_LOCKED) Key.BACKGROUND_TYPE_STICKY_ON else Key.BACKGROUND_TYPE_STICKY_OFF, - if (params.mId.isAlphabetKeyboard) SimplePopups(listOf("!noPanelAutoMoreKey!", " |!code/key_capslock")) else null // why the alphabet morekeys actually? + if (params.mId.isAlphabetKeyboard) SimplePopups(listOf("!noPanelAutoPopupKey!", " |!code/key_capslock")) else null // why the alphabet popup keys actually? ) FunctionalKey.EMOJI -> KeyParams( "!icon/emoji_normal_key|!code/key_emoji", @@ -518,14 +516,14 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co getFunctionalKeyParams(FunctionalKey.COM, width) else getFunctionalKeyParams(FunctionalKey.EMOJI, width) FunctionalKey.COM -> KeyParams( - // todo (later): label and moreKeys could be in localeKeyTexts, handled similar to currency key + // todo (later): label and popupKeys could be in localeKeyTexts, handled similar to currency key // better not in the text files, because it should be handled per country ".com", params, width, Key.LABEL_FLAGS_AUTO_X_SCALE or Key.LABEL_FLAGS_FONT_NORMAL or Key.LABEL_FLAGS_HAS_POPUP_HINT or Key.LABEL_FLAGS_PRESERVE_CASE, Key.BACKGROUND_TYPE_FUNCTIONAL, - SimplePopups(listOf(Key.MORE_KEYS_HAS_LABELS, ".net", ".org", ".gov", ".edu")) + SimplePopups(listOf(Key.POPUP_KEYS_HAS_LABELS, ".net", ".org", ".gov", ".edu")) ) FunctionalKey.LANGUAGE_SWITCH -> KeyParams( "!icon/language_switch_key|!code/key_language_switch", @@ -580,71 +578,71 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co "!code/key_shift_enter" else "!code/key_enter" - private fun getActionKeyMoreKeys(): Collection? { + private fun getActionKeyPopupKeys(): Collection? { val action = params.mId.imeAction() val navigatePrev = params.mId.navigatePrevious() val navigateNext = params.mId.navigateNext() return when { params.mId.passwordInput() -> when { - navigatePrev && action == EditorInfo.IME_ACTION_NEXT -> createMoreKeys(MORE_KEYS_NAVIGATE_PREVIOUS) + navigatePrev && action == EditorInfo.IME_ACTION_NEXT -> createPopupKeys(POPUP_EYS_NAVIGATE_PREVIOUS) action == EditorInfo.IME_ACTION_NEXT -> null - navigateNext && action == EditorInfo.IME_ACTION_PREVIOUS -> createMoreKeys(MORE_KEYS_NAVIGATE_NEXT) + navigateNext && action == EditorInfo.IME_ACTION_PREVIOUS -> createPopupKeys(POPUP_EYS_NAVIGATE_NEXT) action == EditorInfo.IME_ACTION_PREVIOUS -> null - navigateNext && navigatePrev -> createMoreKeys(MORE_KEYS_NAVIGATE_PREVIOUS_NEXT) - navigateNext -> createMoreKeys(MORE_KEYS_NAVIGATE_NEXT) - navigatePrev -> createMoreKeys(MORE_KEYS_NAVIGATE_PREVIOUS) + navigateNext && navigatePrev -> createPopupKeys(POPUP_EYS_NAVIGATE_PREVIOUS_NEXT) + navigateNext -> createPopupKeys(POPUP_EYS_NAVIGATE_NEXT) + navigatePrev -> createPopupKeys(POPUP_EYS_NAVIGATE_PREVIOUS) else -> null } // could change definition of numbers to query a range, or have a pre-defined list, but not that crucial params.mId.isNumberLayout || params.mId.mMode in listOf(KeyboardId.MODE_EMAIL, KeyboardId.MODE_DATE, KeyboardId.MODE_TIME, KeyboardId.MODE_DATETIME) -> when { - action == EditorInfo.IME_ACTION_NEXT && navigatePrev -> createMoreKeys(MORE_KEYS_NAVIGATE_PREVIOUS) + action == EditorInfo.IME_ACTION_NEXT && navigatePrev -> createPopupKeys(POPUP_EYS_NAVIGATE_PREVIOUS) action == EditorInfo.IME_ACTION_NEXT -> null - action == EditorInfo.IME_ACTION_PREVIOUS && navigateNext -> createMoreKeys(MORE_KEYS_NAVIGATE_NEXT) + action == EditorInfo.IME_ACTION_PREVIOUS && navigateNext -> createPopupKeys(POPUP_EYS_NAVIGATE_NEXT) action == EditorInfo.IME_ACTION_PREVIOUS -> null - navigateNext && navigatePrev -> createMoreKeys(MORE_KEYS_NAVIGATE_PREVIOUS_NEXT) - navigateNext -> createMoreKeys(MORE_KEYS_NAVIGATE_NEXT) - navigatePrev -> createMoreKeys(MORE_KEYS_NAVIGATE_PREVIOUS) + navigateNext && navigatePrev -> createPopupKeys(POPUP_EYS_NAVIGATE_PREVIOUS_NEXT) + navigateNext -> createPopupKeys(POPUP_EYS_NAVIGATE_NEXT) + navigatePrev -> createPopupKeys(POPUP_EYS_NAVIGATE_PREVIOUS) else -> null } - action == EditorInfo.IME_ACTION_NEXT && navigatePrev -> createMoreKeys(MORE_KEYS_NAVIGATE_EMOJI_PREVIOUS) - action == EditorInfo.IME_ACTION_NEXT -> createMoreKeys(MORE_KEYS_NAVIGATE_EMOJI) - action == EditorInfo.IME_ACTION_PREVIOUS && navigateNext -> createMoreKeys(MORE_KEYS_NAVIGATE_EMOJI_NEXT) - action == EditorInfo.IME_ACTION_PREVIOUS -> createMoreKeys(MORE_KEYS_NAVIGATE_EMOJI) - navigateNext && navigatePrev -> createMoreKeys(MORE_KEYS_NAVIGATE_EMOJI_PREVIOUS_NEXT) - navigateNext -> createMoreKeys(MORE_KEYS_NAVIGATE_EMOJI_NEXT) - navigatePrev -> createMoreKeys(MORE_KEYS_NAVIGATE_EMOJI_PREVIOUS) - else -> createMoreKeys(MORE_KEYS_NAVIGATE_EMOJI) + action == EditorInfo.IME_ACTION_NEXT && navigatePrev -> createPopupKeys(POPUP_EYS_NAVIGATE_EMOJI_PREVIOUS) + action == EditorInfo.IME_ACTION_NEXT -> createPopupKeys(POPUP_EYS_NAVIGATE_EMOJI) + action == EditorInfo.IME_ACTION_PREVIOUS && navigateNext -> createPopupKeys(POPUP_EYS_NAVIGATE_EMOJI_NEXT) + action == EditorInfo.IME_ACTION_PREVIOUS -> createPopupKeys(POPUP_EYS_NAVIGATE_EMOJI) + navigateNext && navigatePrev -> createPopupKeys(POPUP_EYS_NAVIGATE_EMOJI_PREVIOUS_NEXT) + navigateNext -> createPopupKeys(POPUP_EYS_NAVIGATE_EMOJI_NEXT) + navigatePrev -> createPopupKeys(POPUP_EYS_NAVIGATE_EMOJI_PREVIOUS) + else -> createPopupKeys(POPUP_EYS_NAVIGATE_EMOJI) } } - private fun createMoreKeys(moreKeysDef: String): List { - val moreKeys = mutableListOf() - for (moreKey in moreKeysDef.split(",")) { - val iconPrefixRemoved = moreKey.substringAfter("!icon/") - if (iconPrefixRemoved == moreKey) { // i.e. there is no !icon/ - moreKeys.add(moreKey) + private fun createPopupKeys(popupKeysDef: String): List { + val popupKeys = mutableListOf() + for (popupKey in popupKeysDef.split(",")) { + val iconPrefixRemoved = popupKey.substringAfter("!icon/") + if (iconPrefixRemoved == popupKey) { // i.e. there is no !icon/ + popupKeys.add(popupKey) continue } val iconName = iconPrefixRemoved.substringBefore("|") val replacementText = iconName.replaceIconWithLabelIfNoDrawable() if (replacementText == iconName) { // i.e. we have the drawable - moreKeys.add(moreKey) + popupKeys.add(popupKey) } else { - moreKeys.add(Key.MORE_KEYS_HAS_LABELS) - moreKeys.add("$replacementText|${iconPrefixRemoved.substringAfter("|")}") + popupKeys.add(Key.POPUP_KEYS_HAS_LABELS) + popupKeys.add("$replacementText|${iconPrefixRemoved.substringAfter("|")}") } } // remove emoji shortcut on enter in tablet mode (like original, because bottom row always has an emoji key) // (probably not necessary, but whatever) - if (isTablet() && moreKeys.remove("!icon/emoji_action_key|!code/key_emoji")) { - val i = moreKeys.indexOfFirst { it.startsWith(Key.MORE_KEYS_FIXED_COLUMN_ORDER) } + if (isTablet() && popupKeys.remove("!icon/emoji_action_key|!code/key_emoji")) { + val i = popupKeys.indexOfFirst { it.startsWith(Key.POPUP_KEYS_FIXED_COLUMN_ORDER) } if (i > -1) { - val n = moreKeys[i].substringAfter(Key.MORE_KEYS_FIXED_COLUMN_ORDER).toIntOrNull() + val n = popupKeys[i].substringAfter(Key.POPUP_KEYS_FIXED_COLUMN_ORDER).toIntOrNull() if (n != null) - moreKeys[i] = moreKeys[i].replace(n.toString(), (n - 1).toString()) + popupKeys[i] = popupKeys[i].replace(n.toString(), (n - 1).toString()) } } - return moreKeys + return popupKeys } private fun String.replaceIconWithLabelIfNoDrawable(): String { @@ -715,7 +713,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co return params.mLocaleKeyTexts.labelComma } - private fun getCommaMoreKeys(): List { + private fun getCommaPopupKeys(): List { val keys = mutableListOf() if (!params.mId.mDeviceLocked) keys.add("!icon/clipboard_normal_key|!code/key_clipboard") @@ -730,26 +728,26 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co return keys } - private fun getPunctuationMoreKeys(): List { + private fun getPunctuationPopupKeys(): List { if (params.mId.mElementId == KeyboardId.ELEMENT_SYMBOLS || params.mId.mElementId == KeyboardId.ELEMENT_SYMBOLS_SHIFTED) return listOf("…") if (params.mId.isNumberLayout) return listOf(":", "…", ";", "∞", "π", "√", "°", "^") - val moreKeys = params.mLocaleKeyTexts.getMoreKeys("punctuation")!!.toMutableList() + val popupKeys = params.mLocaleKeyTexts.getPopupKeys("punctuation")!!.toMutableList() if (params.mId.mSubtype.isRtlSubtype) { - for (i in moreKeys.indices) - moreKeys[i] = moreKeys[i].rtlLabel(params) // for parentheses + for (i in popupKeys.indices) + popupKeys[i] = popupKeys[i].rtlLabel(params) // for parentheses } - if (isTablet() && moreKeys.contains("!") && moreKeys.contains("?")) { + if (isTablet() && popupKeys.contains("!") && popupKeys.contains("?")) { // remove ! and ? keys and reduce number in autoColumnOrder - // this makes use of removal of empty moreKeys in MoreKeySpec.insertAdditionalMoreKeys - moreKeys[moreKeys.indexOf("!")] = "" - moreKeys[moreKeys.indexOf("?")] = "" - val columns = moreKeys[0].substringAfter(Key.MORE_KEYS_AUTO_COLUMN_ORDER).toIntOrNull() + // this makes use of removal of empty popupKeys in PopupKeySpec.insertAdditionalPopupKeys + popupKeys[popupKeys.indexOf("!")] = "" + popupKeys[popupKeys.indexOf("?")] = "" + val columns = popupKeys[0].substringAfter(Key.POPUP_KEYS_AUTO_COLUMN_ORDER).toIntOrNull() if (columns != null) - moreKeys[0] = "${Key.MORE_KEYS_AUTO_COLUMN_ORDER}${columns - 1}" + popupKeys[0] = "${Key.POPUP_KEYS_AUTO_COLUMN_ORDER}${columns - 1}" } - return moreKeys + return popupKeys } private fun getSpaceLabel(): String = @@ -818,7 +816,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co params.mId.mElementId == KeyboardId.ELEMENT_ALPHABET else -> true } - val allowRedundantMoreKeys = params.mId.mElementId != KeyboardId.ELEMENT_SYMBOLS // todo: always set to false? + val allowRedundantPopupKeys = params.mId.mElementId != KeyboardId.ELEMENT_SYMBOLS // todo: always set to false? // essentially this is default for 4 row and non-alphabet layouts, maybe this could be determined automatically instead of using a list // todo: check the difference between default (i.e. none) and holo (test behavior on keyboard) val touchPositionCorrectionData = if (params.mId.isAlphabetKeyboard && layout in listOf("armenian_phonetic", "khmer", "lao", "malayalam", "pcqwerty", "thai")) @@ -828,7 +826,7 @@ abstract class KeyboardParser(private val params: KeyboardParams, private val co // custom non-json layout for non-uppercase language should not have shift key val hasShiftKey = !params.mId.isAlphabetKeyboard || layout !in listOf("hindi_compact", "bengali", "arabic", "arabic_pc", "hebrew", "kannada", "malayalam", "marathi", "farsi", "tamil", "telugu") val numbersOnTopRow = layout !in listOf("pcqwerty", "lao", "thai", "korean_sebeolsik_390", "korean_sebeolsik_final") - return LayoutInfos(labelFlags, enableProximityCharsCorrection, allowRedundantMoreKeys, touchPositionCorrectionData, hasZwnjKey, hasShiftKey, numbersOnTopRow) + return LayoutInfos(labelFlags, enableProximityCharsCorrection, allowRedundantPopupKeys, touchPositionCorrectionData, hasZwnjKey, hasShiftKey, numbersOnTopRow) } } @@ -845,9 +843,9 @@ data class LayoutInfos( // currently set in keyboardLayoutSet val enableProximityCharsCorrection: Boolean = false, // previously was false for nordic and serbian_qwertz, true for all others - val allowRedundantMoreKeys: Boolean = true, + val allowRedundantPopupKeys: Boolean = true, // there is holo, default and null - // null only for moreKeys keyboard + // null only for popupKeys keyboard val touchPositionCorrectionData: Int? = null, val hasZwnjKey: Boolean = false, val hasShiftKey: Boolean = true, @@ -877,11 +875,11 @@ fun String.rtlLabel(params: KeyboardParams): String { } } -// could make arrays right away, but they need to be copied anyway as moreKeys arrays are modified when creating KeyParams -private const val MORE_KEYS_NAVIGATE_PREVIOUS = "!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard" -private const val MORE_KEYS_NAVIGATE_NEXT = "!icon/clipboard_action_key|!code/key_clipboard,!icon/next_key|!code/key_action_next" -private const val MORE_KEYS_NAVIGATE_PREVIOUS_NEXT = "!fixedColumnOrder!3,!needsDividers!,!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard,!icon/next_key|!code/key_action_next" -private const val MORE_KEYS_NAVIGATE_EMOJI_PREVIOUS = "!fixedColumnOrder!3,!needsDividers!,!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji" -private const val MORE_KEYS_NAVIGATE_EMOJI = "!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji" -private const val MORE_KEYS_NAVIGATE_EMOJI_NEXT = "!fixedColumnOrder!3,!needsDividers!,!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji,!icon/next_key|!code/key_action_next" -private const val MORE_KEYS_NAVIGATE_EMOJI_PREVIOUS_NEXT = "!fixedColumnOrder!4,!needsDividers!,!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji,!icon/next_key|!code/key_action_next" +// could make arrays right away, but they need to be copied anyway as popupKeys arrays are modified when creating KeyParams +private const val POPUP_EYS_NAVIGATE_PREVIOUS = "!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard" +private const val POPUP_EYS_NAVIGATE_NEXT = "!icon/clipboard_action_key|!code/key_clipboard,!icon/next_key|!code/key_action_next" +private const val POPUP_EYS_NAVIGATE_PREVIOUS_NEXT = "!fixedColumnOrder!3,!needsDividers!,!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard,!icon/next_key|!code/key_action_next" +private const val POPUP_EYS_NAVIGATE_EMOJI_PREVIOUS = "!fixedColumnOrder!3,!needsDividers!,!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji" +private const val POPUP_EYS_NAVIGATE_EMOJI = "!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji" +private const val POPUP_EYS_NAVIGATE_EMOJI_NEXT = "!fixedColumnOrder!3,!needsDividers!,!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji,!icon/next_key|!code/key_action_next" +private const val POPUP_EYS_NAVIGATE_EMOJI_PREVIOUS_NEXT = "!fixedColumnOrder!4,!needsDividers!,!icon/previous_key|!code/key_action_previous,!icon/clipboard_action_key|!code/key_clipboard,!icon/emoji_action_key|!code/key_emoji,!icon/next_key|!code/key_action_next" diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/LocaleKeyTexts.kt b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/LocaleKeyTexts.kt index 13c9f94dd..5d8240e92 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/LocaleKeyTexts.kt +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/LocaleKeyTexts.kt @@ -16,8 +16,8 @@ import java.util.Locale import kotlin.math.round class LocaleKeyTexts(dataStream: InputStream?, locale: Locale) { - private val moreKeys = hashMapOf>() - private val priorityMoreKeys = hashMapOf>() + private val popupKeys = hashMapOf>() + private val priorityPopupKeys = hashMapOf>() private val extraKeys = Array?>(5) { null } var labelSymbol = "\\?123" private set @@ -32,7 +32,7 @@ class LocaleKeyTexts(dataStream: InputStream?, locale: Locale) { private var labelQuestion = "?" val currencyKey = getCurrencyKey(locale) private var numberKeys = ((1..9) + 0).map { it.toString() } - private val numbersMoreKeys = arrayOf( + private val numbersPopupKeys = arrayOf( mutableListOf("¹", "½", "⅓","¼", "⅛"), mutableListOf("²", "⅔"), mutableListOf("³", "¾", "⅜"), @@ -47,21 +47,21 @@ class LocaleKeyTexts(dataStream: InputStream?, locale: Locale) { init { readStream(dataStream, false) - // set default quote moreKeys if necessary - // should this also be done with punctuation moreKeys? - if ("\'" !in moreKeys) - moreKeys["\'"] = listOf("!fixedColumnOrder!5", "‚", "‘", "’", "‹", "›") - if ("\"" !in moreKeys) - moreKeys["\""] = listOf("!fixedColumnOrder!5", "„", "“", "”", "«", "»") - if ("!" !in moreKeys) - moreKeys["!"] = listOf("¡") - if (labelQuestion !in moreKeys) - moreKeys[labelQuestion] = if (labelQuestion == "?") listOf("¿") else listOf("?", "¿") - if ("punctuation" !in moreKeys) - moreKeys["punctuation"] = listOf("${Key.MORE_KEYS_AUTO_COLUMN_ORDER}8", "\\,", "?", "!", "#", ")", "(", "/", ";", "'", "@", ":", "-", "\"", "+", "\\%", "&") + // set default quote popupKeys if necessary + // should this also be done with punctuation popupKeys? + if ("\'" !in popupKeys) + popupKeys["\'"] = listOf("!fixedColumnOrder!5", "‚", "‘", "’", "‹", "›") + if ("\"" !in popupKeys) + popupKeys["\""] = listOf("!fixedColumnOrder!5", "„", "“", "”", "«", "»") + if ("!" !in popupKeys) + popupKeys["!"] = listOf("¡") + if (labelQuestion !in popupKeys) + popupKeys[labelQuestion] = if (labelQuestion == "?") listOf("¿") else listOf("?", "¿") + if ("punctuation" !in popupKeys) + popupKeys["punctuation"] = listOf("${Key.POPUP_KEYS_AUTO_COLUMN_ORDER}8", "\\,", "?", "!", "#", ")", "(", "/", ";", "'", "@", ":", "-", "\"", "+", "\\%", "&") } - private fun readStream(stream: InputStream?, onlyMoreKeys: Boolean) { + private fun readStream(stream: InputStream?, onlyPopupKeys: Boolean) { if (stream == null) return stream.reader().use { reader -> var mode = READER_MODE_NONE @@ -70,16 +70,16 @@ class LocaleKeyTexts(dataStream: InputStream?, locale: Locale) { val line = l.trim() if (line.isEmpty()) return@forEachLine when (line) { - "[morekeys]" -> { mode = READER_MODE_MORE_KEYS; return@forEachLine } + "[popup_keys]" -> { mode = READER_MODE_POPUP_KEYS; return@forEachLine } "[extra_keys]" -> { mode = READER_MODE_EXTRA_KEYS; return@forEachLine } "[labels]" -> { mode = READER_MODE_LABELS; return@forEachLine } "[number_row]" -> { mode = READER_MODE_NUMBER_ROW; return@forEachLine } } when (mode) { - READER_MODE_MORE_KEYS -> addMoreKeys(line) - READER_MODE_EXTRA_KEYS -> if (!onlyMoreKeys) addExtraKey(line.split(colonSpaceRegex, 2)) - READER_MODE_LABELS -> if (!onlyMoreKeys) addLabel(line.split(colonSpaceRegex, 2)) - READER_MODE_NUMBER_ROW -> setNumberRow(line.splitOnWhitespace(), onlyMoreKeys) + READER_MODE_POPUP_KEYS -> addPopupKeys(line) + READER_MODE_EXTRA_KEYS -> if (!onlyPopupKeys) addExtraKey(line.split(colonSpaceRegex, 2)) + READER_MODE_LABELS -> if (!onlyPopupKeys) addLabel(line.split(colonSpaceRegex, 2)) + READER_MODE_NUMBER_ROW -> setNumberRow(line.splitOnWhitespace(), onlyPopupKeys) } } } @@ -98,8 +98,8 @@ class LocaleKeyTexts(dataStream: InputStream?, locale: Locale) { fun getShiftSymbolLabel(isTablet: Boolean) = if (isTablet) labelShiftSymbolTablet else labelShiftSymbol - fun getMoreKeys(label: String): List? = moreKeys[label] - fun getPriorityMoreKeys(label: String): List? = priorityMoreKeys[label] + fun getPopupKeys(label: String): List? = popupKeys[label] + fun getPriorityPopupKeys(label: String): List? = priorityPopupKeys[label] // used by simple parser only, but could be possible for json as well (if necessary) fun getExtraKeys(row: Int): List? = @@ -110,33 +110,33 @@ class LocaleKeyTexts(dataStream: InputStream?, locale: Locale) { readStream(dataStream, true) } - private fun addMoreKeys(line: String) { + private fun addPopupKeys(line: String) { val split = if (line.contains("|")) - // if a moreKey contains label/code separately, there are cases where space can be in there too - // normally this should work for all moreKeys, but if we split them on whitespace there is less chance for unnecessary issues + // if a popup key contains label/code separately, there are cases where space can be in there too + // normally this should work for all popup keys, but if we split them on whitespace there is less chance for unnecessary issues line.splitOnFirstSpacesOnly() else line.splitOnWhitespace() if (split.size == 1) return val key = split.first() val priorityMarkerIndex = split.indexOf("%") if (priorityMarkerIndex > 0) { - val existingPriorityMoreKeys = priorityMoreKeys[key] - priorityMoreKeys[key] = if (existingPriorityMoreKeys == null) + val existingPriorityPopupKeys = priorityPopupKeys[key] + priorityPopupKeys[key] = if (existingPriorityPopupKeys == null) split.subList(1, priorityMarkerIndex) - else existingPriorityMoreKeys + split.subList(1, priorityMarkerIndex) - val existingMoreKeys = moreKeys[key] - moreKeys[key] = if (existingMoreKeys == null) + else existingPriorityPopupKeys + split.subList(1, priorityMarkerIndex) + val existingPopupKeys = popupKeys[key] + popupKeys[key] = if (existingPopupKeys == null) split.subList(priorityMarkerIndex, split.size) - else existingMoreKeys + split.subList(priorityMarkerIndex, split.size) + else existingPopupKeys + split.subList(priorityMarkerIndex, split.size) } else { // a but more special treatment, this should not occur together with priority marker (but technically could) - val existingMoreKeys = moreKeys[key] - val newMoreKeys = if (existingMoreKeys == null) + val existingPopupKeys = popupKeys[key] + val newPopupKeys = if (existingPopupKeys == null) split.drop(1) - else mergeMoreKeys(existingMoreKeys, split.drop(1)) - moreKeys[key] = when (key) { - "'", "\"", "«", "»" -> addFixedColumnOrder(newMoreKeys) - else -> newMoreKeys + else mergePopupKeys(existingPopupKeys, split.drop(1)) + popupKeys[key] = when (key) { + "'", "\"", "«", "»" -> addFixedColumnOrder(newPopupKeys) + else -> newPopupKeys } } } @@ -163,44 +163,44 @@ class LocaleKeyTexts(dataStream: InputStream?, locale: Locale) { } } - // set number row only, does not affect moreKeys + // set number row only, does not affect popupKeys // setting more than 10 number keys will cause crashes, but could actually be implemented at some point - private fun setNumberRow(split: List, onlyAddToMoreKeys: Boolean) { - if (onlyAddToMoreKeys) { + private fun setNumberRow(split: List, onlyAddToPopupKeys: Boolean) { + if (onlyAddToPopupKeys) { // as of now this should never be used, but better have it numberKeys.forEachIndexed { i, n -> - if (numberKeys[i] != n && n !in numbersMoreKeys[i]) - numbersMoreKeys[i].add(0, n) + if (numberKeys[i] != n && n !in numbersPopupKeys[i]) + numbersPopupKeys[i].add(0, n) } return } if (Settings.getInstance().current.mLocalizedNumberRow) { - numberKeys.forEachIndexed { i, n -> numbersMoreKeys[i].add(0, n) } + numberKeys.forEachIndexed { i, n -> numbersPopupKeys[i].add(0, n) } numberKeys = split } else { - split.forEachIndexed { i, n -> numbersMoreKeys[i].add(0, n) } + split.forEachIndexed { i, n -> numbersPopupKeys[i].add(0, n) } } } - // get number row including moreKeys + // get number row including popupKeys fun getNumberRow(): List = numberKeys.mapIndexed { i, label -> - label.toTextKey(numbersMoreKeys[i]) + label.toTextKey(numbersPopupKeys[i]) } fun getNumberLabel(numberIndex: Int?): String? = numberIndex?.let { numberKeys.getOrNull(it) } } -private fun mergeMoreKeys(original: List, added: List): List { - if (original.any { it.startsWith(Key.MORE_KEYS_AUTO_COLUMN_ORDER) } || added.any { it.startsWith(Key.MORE_KEYS_AUTO_COLUMN_ORDER) }) { - val moreKeys = (original + added).toSet() - val originalColumnCount = original.firstOrNull { it.startsWith(Key.MORE_KEYS_AUTO_COLUMN_ORDER) } - ?.substringAfter(Key.MORE_KEYS_AUTO_COLUMN_ORDER)?.toIntOrNull() - val l = moreKeys.filterNot { it.startsWith(Key.MORE_KEYS_AUTO_COLUMN_ORDER) } - if (originalColumnCount != null && moreKeys.size <= 20 // not for too wide layout +private fun mergePopupKeys(original: List, added: List): List { + if (original.any { it.startsWith(Key.POPUP_KEYS_AUTO_COLUMN_ORDER) } || added.any { it.startsWith(Key.POPUP_KEYS_AUTO_COLUMN_ORDER) }) { + val popupKeys = (original + added).toSet() + val originalColumnCount = original.firstOrNull { it.startsWith(Key.POPUP_KEYS_AUTO_COLUMN_ORDER) } + ?.substringAfter(Key.POPUP_KEYS_AUTO_COLUMN_ORDER)?.toIntOrNull() + val l = popupKeys.filterNot { it.startsWith(Key.POPUP_KEYS_AUTO_COLUMN_ORDER) } + if (originalColumnCount != null && popupKeys.size <= 20 // not for too wide layout && originalColumnCount == round((original.size - 1 + 0.1f) / 2f).toInt()) { // +0.1 f against rounding issues // we had 2 rows, and want it again - return (l + "${Key.MORE_KEYS_AUTO_COLUMN_ORDER}${round(l.size / 2f).toInt()}") + return (l + "${Key.POPUP_KEYS_AUTO_COLUMN_ORDER}${round(l.size / 2f).toInt()}") } // just drop autoColumnOrder otherwise return l @@ -208,9 +208,9 @@ private fun mergeMoreKeys(original: List, added: List): List): List { - val newMoreKeys = moreKeys.filterNot { it.startsWith(Key.MORE_KEYS_FIXED_COLUMN_ORDER) } - return listOf("${Key.MORE_KEYS_FIXED_COLUMN_ORDER}${newMoreKeys.size}") + newMoreKeys +private fun addFixedColumnOrder(popupKeys: List): List { + val newPopupKeys = popupKeys.filterNot { it.startsWith(Key.POPUP_KEYS_FIXED_COLUMN_ORDER) } + return listOf("${Key.POPUP_KEYS_FIXED_COLUMN_ORDER}${newPopupKeys.size}") + newPopupKeys } fun getOrCreate(context: Context, locale: Locale): LocaleKeyTexts = @@ -218,18 +218,18 @@ fun getOrCreate(context: Context, locale: Locale): LocaleKeyTexts = LocaleKeyTexts(getStreamForLocale(locale, context), locale) } -fun addLocaleKeyTextsToParams(context: Context, params: KeyboardParams, moreKeysSetting: Int) { +fun addLocaleKeyTextsToParams(context: Context, params: KeyboardParams, popupKeysSetting: Int) { val locales = params.mSecondaryLocales + params.mId.locale params.mLocaleKeyTexts = localeKeyTextsCache.getOrPut(locales.joinToString { it.toString() }) { - createLocaleKeyTexts(context, params, moreKeysSetting) + createLocaleKeyTexts(context, params, popupKeysSetting) } } -private fun createLocaleKeyTexts(context: Context, params: KeyboardParams, moreKeysSetting: Int): LocaleKeyTexts { +private fun createLocaleKeyTexts(context: Context, params: KeyboardParams, popupKeysSetting: Int): LocaleKeyTexts { val lkt = LocaleKeyTexts(getStreamForLocale(params.mId.locale, context), params.mId.locale) - if (moreKeysSetting == MORE_KEYS_MORE) + if (popupKeysSetting == POPUP_KEYS_MORE) lkt.addFile(context.assets.open("$LANGUAGE_TEXTS_FOLDER/all_popup_keys.txt")) - else if (moreKeysSetting == MORE_KEYS_ALL) + else if (popupKeysSetting == POPUP_KEYS_ALL) lkt.addFile(context.assets.open("$LANGUAGE_TEXTS_FOLDER/more_popup_keys.txt")) params.mSecondaryLocales.forEach { locale -> if (locale == params.mId.locale) return@forEach @@ -256,7 +256,7 @@ fun clearCache() = localeKeyTextsCache.clear() private val localeKeyTextsCache = hashMapOf() private const val READER_MODE_NONE = 0 -private const val READER_MODE_MORE_KEYS = 1 +private const val READER_MODE_POPUP_KEYS = 1 private const val READER_MODE_EXTRA_KEYS = 2 private const val READER_MODE_LABELS = 3 private const val READER_MODE_NUMBER_ROW = 4 @@ -288,8 +288,8 @@ private fun getCurrencyKey(locale: Locale): Pair> { return dollar } -private fun genericCurrencyKey(currency: String) = currency to genericCurrencyMoreKeys -private val genericCurrencyMoreKeys = arrayOf("£", "€", "$", "¢", "¥", "₱") +private fun genericCurrencyKey(currency: String) = currency to genericCurrencyPopupKeys +private val genericCurrencyPopupKeys = arrayOf("£", "€", "$", "¢", "¥", "₱") private fun getCurrency(locale: Locale): String { if (locale.country == "BD") return "৳" @@ -310,7 +310,7 @@ private fun getCurrency(locale: Locale): String { } } -// needs at least 4 moreKeys for working shift-symbol keyboard +// needs at least 4 popupKeys for working shift-symbol keyboard private val euro = "€" to arrayOf("£", "¥", "$", "¢", "₱") private val dram = "֏" to arrayOf("€", "₽", "$", "£", "¥") private val rupee = "₹" to arrayOf("£", "€", "$", "¢", "¥", "₱") @@ -321,8 +321,8 @@ private val dollar = "$" to arrayOf("£", "¢", "€", "¥", "₱") private val euroCountries = "AD|AT|BE|BG|HR|CY|CZ|DA|EE|FI|FR|DE|GR|HU|IE|IT|XK|LV|LT|LU|MT|MO|ME|NL|PL|PT|RO|SM|SK|SI|ES|VA".toRegex() private val euroLocales = "bg|ca|cs|da|de|el|en|es|et|eu|fi|fr|ga|gl|hr|hu|it|lb|lt|lv|mt|nl|pl|pt|ro|sk|sl|sq|sr|sv".toRegex() -const val MORE_KEYS_ALL = 2 -const val MORE_KEYS_MORE = 1 -const val MORE_KEYS_NORMAL = 0 +const val POPUP_KEYS_ALL = 2 +const val POPUP_KEYS_MORE = 1 +const val POPUP_KEYS_NORMAL = 0 const val LANGUAGE_TEXTS_FOLDER = "language_key_texts" diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/SimpleKeyboardParser.kt b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/SimpleKeyboardParser.kt index 4ba0848f0..e50297629 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/SimpleKeyboardParser.kt +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/SimpleKeyboardParser.kt @@ -8,9 +8,9 @@ import helium314.keyboard.keyboard.internal.keyboard_parser.floris.toTextKey import helium314.keyboard.latin.common.splitOnWhitespace /** - * Parser for simple layouts, defined only as rows of (normal) keys with moreKeys. + * Parser for simple layouts, defined only as rows of (normal) keys with popup keys. * There may be a short "extra row" for the configurable keys in the bottom row. This is two keys - * for alphabet, 3 keys for symbols and 4 keys for shift symbols. MoreKeys on period and comma get + * for alphabet, 3 keys for symbols and 4 keys for shift symbols. Popup keys on period and comma get * merged with defaults. */ class SimpleKeyboardParser( diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/KeyData.kt b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/KeyData.kt index 31e9fd397..3711d7994 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/KeyData.kt +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/KeyData.kt @@ -16,7 +16,7 @@ import helium314.keyboard.latin.common.StringUtils // taken from FlorisBoard, small modifications // popup not nullable (maybe change back, but currently that's necessary for number keys) -// added getLabel for creating moreKeys from popups (which may be abstract) +// added getLabel for creating popup keys from popups (which may be abstract) // added toKeyParams for non-abstract KeyData // compute is using KeyboardParams (for shift state and variation) // char_width_selector and kana_selector throw an error (not yet supported) diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/PopupSet.kt b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/PopupSet.kt index 012be0ea8..33347d6a6 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/PopupSet.kt +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/PopupSet.kt @@ -19,17 +19,17 @@ open class PopupSet( // get labels of all popup keys open fun getPopupKeyLabels(params: KeyboardParams): Collection? { if (main == null && relevant == null) return null - val moreKeys = mutableListOf() - main?.getPopupLabel(params)?.let { moreKeys.add(it) } - relevant?.let { moreKeys.addAll(it.map { it.getPopupLabel(params) }) } - if (moreKeys.isEmpty()) return null - return moreKeys + val popupKeys = mutableListOf() + main?.getPopupLabel(params)?.let { popupKeys.add(it) } + relevant?.let { popupKeys.addAll(it.map { it.getPopupLabel(params) }) } + if (popupKeys.isEmpty()) return null + return popupKeys } var numberIndex: Int? = null var symbol: String? = null // maybe list of keys? } -class SimplePopups(val moreKeys: Collection?) : PopupSet() { - override fun getPopupKeyLabels(params: KeyboardParams) = moreKeys +class SimplePopups(val popupKeys: Collection?) : PopupSet() { + override fun getPopupKeyLabels(params: KeyboardParams) = popupKeys } diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/TextKeyData.kt b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/TextKeyData.kt index db99158ac..8895b9052 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/TextKeyData.kt +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/floris/TextKeyData.kt @@ -144,9 +144,9 @@ class MultiTextKeyData( } } -fun String.toTextKey(moreKeys: Collection? = null, labelFlags: Int = 0): TextKeyData = +fun String.toTextKey(popupKeys: Collection? = null, labelFlags: Int = 0): TextKeyData = TextKeyData( label = this, labelFlags = labelFlags, - popup = SimplePopups(moreKeys) + popup = SimplePopups(popupKeys) ) diff --git a/app/src/main/java/helium314/keyboard/latin/App.kt b/app/src/main/java/helium314/keyboard/latin/App.kt index 92bc48d15..9377ae712 100644 --- a/app/src/main/java/helium314/keyboard/latin/App.kt +++ b/app/src/main/java/helium314/keyboard/latin/App.kt @@ -113,11 +113,11 @@ private fun upgradesWhenComingFromOldAppName(context: Context) { } // change more_keys to popup_keys if (prefs.contains("more_keys_order")) { - prefs.edit().putString(Settings.PREF_POPUP_KEYS_ORDER, prefs.getString("more_keys_order", "")).apply() + prefs.edit().putString(Settings.PREF_POPUP_KEYS_ORDER, prefs.getString("more_keys_order", "")?.replace("more_", "popup_")).apply() prefs.edit().remove("more_keys_order").apply() } if (prefs.contains("more_keys_labels_order")) { - prefs.edit().putString(Settings.PREF_POPUP_KEYS_LABELS_ORDER, prefs.getString("more_keys_labels_order", "")).apply() + prefs.edit().putString(Settings.PREF_POPUP_KEYS_LABELS_ORDER, prefs.getString("more_keys_labels_order", "")?.replace("more_", "popup_")).apply() prefs.edit().remove("more_keys_labels_order").apply() } if (prefs.contains("more_more_keys")) { diff --git a/app/src/main/java/helium314/keyboard/latin/InputView.java b/app/src/main/java/helium314/keyboard/latin/InputView.java index 2fae8a8af..806e23965 100644 --- a/app/src/main/java/helium314/keyboard/latin/InputView.java +++ b/app/src/main/java/helium314/keyboard/latin/InputView.java @@ -19,7 +19,7 @@ import helium314.keyboard.accessibility.AccessibilityUtils; import helium314.keyboard.keyboard.MainKeyboardView; import helium314.keyboard.latin.common.ColorType; import helium314.keyboard.latin.settings.Settings; -import helium314.keyboard.latin.suggestions.MoreSuggestionsView; +import helium314.keyboard.latin.suggestions.PopupSuggestionsView; import helium314.keyboard.latin.suggestions.SuggestionStripView; public final class InputView extends FrameLayout { @@ -56,9 +56,9 @@ public final class InputView extends FrameLayout { @Override protected boolean dispatchHoverEvent(final MotionEvent event) { if (AccessibilityUtils.Companion.getInstance().isTouchExplorationEnabled() - && mMainKeyboardView.isShowingMoreKeysPanel()) { - // With accessibility mode on, discard hover events while a more keys keyboard is shown. - // The {@link MoreKeysKeyboard} receives hover events directly from the platform. + && mMainKeyboardView.isShowingPopupKeysPanel()) { + // With accessibility mode on, discard hover events while a popup keys keyboard is shown. + // The {@link PopupKeysKeyboard} receives hover events directly from the platform. return true; } return super.dispatchHoverEvent(event); @@ -223,8 +223,8 @@ public final class InputView extends FrameLayout { /** * This class forwards {@link MotionEvent}s happened in the {@link MainKeyboardView} to - * {@link SuggestionStripView} when the {@link MoreSuggestionsView} is showing. - * {@link SuggestionStripView} dismisses {@link MoreSuggestionsView} when it receives any event + * {@link SuggestionStripView} when the {@link PopupSuggestionsView} is showing. + * {@link SuggestionStripView} dismisses {@link PopupSuggestionsView} when it receives any event * outside of it. */ private static class MoreSuggestionsViewCanceler diff --git a/app/src/main/java/helium314/keyboard/latin/LatinIME.java b/app/src/main/java/helium314/keyboard/latin/LatinIME.java index 40ab5734e..21f641841 100644 --- a/app/src/main/java/helium314/keyboard/latin/LatinIME.java +++ b/app/src/main/java/helium314/keyboard/latin/LatinIME.java @@ -1252,7 +1252,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // Need to set expanded touchable region only if a keyboard view is being shown. if (visibleKeyboardView.isShown()) { final int touchLeft = 0; - final int touchTop = mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY; + final int touchTop = mKeyboardSwitcher.isShowingPopupKeysPanel() ? 0 : visibleTopY; final int touchRight = visibleKeyboardView.getWidth(); final int touchBottom = inputHeight // Extend touchable region below the keyboard. diff --git a/app/src/main/java/helium314/keyboard/latin/common/Colors.kt b/app/src/main/java/helium314/keyboard/latin/common/Colors.kt index 4306eefee..09eaaa494 100644 --- a/app/src/main/java/helium314/keyboard/latin/common/Colors.kt +++ b/app/src/main/java/helium314/keyboard/latin/common/Colors.kt @@ -60,7 +60,7 @@ interface Colors { /** returns a colored drawable selected from [attr], which must contain using R.styleable.KeyboardView_* */ fun selectAndColorDrawable(attr: TypedArray, color: ColorType): Drawable { val drawable = when (color) { - KEY_BACKGROUND, BACKGROUND, ACTION_KEY_MORE_KEYS_BACKGROUND, MORE_KEYS_BACKGROUND -> + KEY_BACKGROUND, BACKGROUND, ACTION_KEY_POPUP_KEYS_BACKGROUND, POPUP_KEYS_BACKGROUND -> attr.getDrawable(R.styleable.KeyboardView_keyBackground) FUNCTIONAL_KEY_BACKGROUND -> attr.getDrawable(R.styleable.KeyboardView_functionalKeyBackground) SPACE_BAR_BACKGROUND -> { @@ -125,7 +125,7 @@ class DynamicColors(context: Context, override val themeStyle: String, override private val navBar: Int /** brightened or darkened variant of [background], to be used if exact background color would be - * bad contrast, e.g. more keys popup or no border space bar */ + * bad contrast, e.g. popup keys popup or no border space bar */ private val adjustedBackground: Int /** further brightened or darkened variant of [adjustedBackground] */ private val doubleAdjustedBackground: Int @@ -178,7 +178,7 @@ class DynamicColors(context: Context, override val themeStyle: String, override // todo (idea): make better use of the states? // could also use / create StateListDrawables in colors (though that's a style than a color...) - // this would better allow choosing e.g. cornered/rounded drawables for moreKeys or moreSuggestions + // this would better allow choosing e.g. cornered/rounded drawables for poup keys or moreSuggestions backgroundFilter = colorFilter(background) adjustedKeyText = brightenOrDarken(keyText, true) @@ -269,7 +269,7 @@ class DynamicColors(context: Context, override val themeStyle: String, override override fun get(color: ColorType): Int = when (color) { TOOL_BAR_KEY_ENABLED_BACKGROUND, EMOJI_CATEGORY_SELECTED, ACTION_KEY_BACKGROUND, CLIPBOARD_PIN, SHIFT_KEY_ICON -> accent - AUTOFILL_BACKGROUND_CHIP, GESTURE_PREVIEW, MORE_KEYS_BACKGROUND, MORE_SUGGESTIONS_BACKGROUND, KEY_PREVIEW -> adjustedBackground + AUTOFILL_BACKGROUND_CHIP, GESTURE_PREVIEW, POPUP_KEYS_BACKGROUND, MORE_SUGGESTIONS_BACKGROUND, KEY_PREVIEW -> adjustedBackground TOOL_BAR_EXPAND_KEY_BACKGROUND -> if (!isNight) accent else doubleAdjustedBackground GESTURE_TRAIL -> gesture KEY_TEXT, SUGGESTION_AUTO_CORRECT, REMOVE_SUGGESTION_ICON, @@ -280,7 +280,7 @@ class DynamicColors(context: Context, override val themeStyle: String, override SPACE_BAR_BACKGROUND -> spaceBar BACKGROUND, MAIN_BACKGROUND -> background KEY_BACKGROUND -> keyBackground - ACTION_KEY_MORE_KEYS_BACKGROUND -> if (themeStyle == STYLE_HOLO) adjustedBackground else accent + ACTION_KEY_POPUP_KEYS_BACKGROUND -> if (themeStyle == STYLE_HOLO) adjustedBackground else accent STRIP_BACKGROUND -> if (!hasKeyBorders && themeStyle == STYLE_MATERIAL) adjustedBackground else background NAVIGATION_BAR -> navBar MORE_SUGGESTIONS_HINT, SUGGESTED_WORD, SUGGESTION_TYPED_WORD, SUGGESTION_VALID_WORD -> adjustedKeyText @@ -294,9 +294,9 @@ class DynamicColors(context: Context, override val themeStyle: String, override FUNCTIONAL_KEY_BACKGROUND -> functionalKeyStateList ACTION_KEY_BACKGROUND -> actionKeyStateList SPACE_BAR_BACKGROUND -> spaceBarStateList - MORE_KEYS_BACKGROUND -> adjustedBackgroundStateList + POPUP_KEYS_BACKGROUND -> adjustedBackgroundStateList STRIP_BACKGROUND -> stripBackgroundList - ACTION_KEY_MORE_KEYS_BACKGROUND -> if (themeStyle == STYLE_HOLO) adjustedBackgroundStateList + ACTION_KEY_POPUP_KEYS_BACKGROUND -> if (themeStyle == STYLE_HOLO) adjustedBackgroundStateList else actionKeyStateList TOOL_BAR_KEY -> toolbarKeyStateList else -> null // use color filter @@ -334,9 +334,9 @@ class DynamicColors(context: Context, override val themeStyle: String, override FUNCTIONAL_KEY_BACKGROUND, KEY_BACKGROUND, BACKGROUND, SPACE_BAR_BACKGROUND, STRIP_BACKGROUND -> setColor(view.background, color) ONE_HANDED_MODE_BUTTON -> setColor(view.background, if (keyboardBackground == null) BACKGROUND else STRIP_BACKGROUND) MORE_SUGGESTIONS_BACKGROUND -> view.background.colorFilter = backgroundFilter - MORE_KEYS_BACKGROUND -> + POPUP_KEYS_BACKGROUND -> if (themeStyle != STYLE_HOLO) - setColor(view.background, MORE_KEYS_BACKGROUND) + setColor(view.background, POPUP_KEYS_BACKGROUND) else view.background.colorFilter = adjustedBackgroundFilter MAIN_BACKGROUND -> { if (keyboardBackground != null) { @@ -371,7 +371,7 @@ class DefaultColors ( ) : Colors { private val navBar: Int /** brightened or darkened variant of [background], to be used if exact background color would be - * bad contrast, e.g. more keys popup or no border space bar */ + * bad contrast, e.g. popup keys popup or no border space bar */ private val adjustedBackground: Int /** further brightened or darkened variant of [adjustedBackground] */ private val doubleAdjustedBackground: Int @@ -456,7 +456,7 @@ class DefaultColors ( TOOL_BAR_KEY_ENABLED_BACKGROUND, EMOJI_CATEGORY_SELECTED, ACTION_KEY_BACKGROUND, CLIPBOARD_PIN, SHIFT_KEY_ICON -> accent AUTOFILL_BACKGROUND_CHIP -> if (themeStyle == STYLE_MATERIAL && !hasKeyBorders) background else adjustedBackground - GESTURE_PREVIEW, MORE_KEYS_BACKGROUND, MORE_SUGGESTIONS_BACKGROUND, KEY_PREVIEW -> adjustedBackground + GESTURE_PREVIEW, POPUP_KEYS_BACKGROUND, MORE_SUGGESTIONS_BACKGROUND, KEY_PREVIEW -> adjustedBackground TOOL_BAR_EXPAND_KEY_BACKGROUND -> doubleAdjustedBackground GESTURE_TRAIL -> gesture KEY_TEXT, REMOVE_SUGGESTION_ICON, FUNCTIONAL_KEY_TEXT, KEY_ICON -> keyText @@ -466,7 +466,7 @@ class DefaultColors ( SPACE_BAR_BACKGROUND -> spaceBar BACKGROUND, MAIN_BACKGROUND -> background KEY_BACKGROUND -> keyBackground - ACTION_KEY_MORE_KEYS_BACKGROUND -> if (themeStyle == STYLE_HOLO) adjustedBackground else accent + ACTION_KEY_POPUP_KEYS_BACKGROUND -> if (themeStyle == STYLE_HOLO) adjustedBackground else accent STRIP_BACKGROUND -> if (!hasKeyBorders && themeStyle == STYLE_MATERIAL) adjustedBackground else background NAVIGATION_BAR -> navBar SUGGESTION_AUTO_CORRECT, EMOJI_CATEGORY, TOOL_BAR_KEY, TOOL_BAR_EXPAND_KEY, ONE_HANDED_MODE_BUTTON -> suggestionText @@ -481,9 +481,9 @@ class DefaultColors ( FUNCTIONAL_KEY_BACKGROUND -> functionalKeyStateList ACTION_KEY_BACKGROUND -> actionKeyStateList SPACE_BAR_BACKGROUND -> spaceBarStateList - MORE_KEYS_BACKGROUND -> adjustedBackgroundStateList + POPUP_KEYS_BACKGROUND -> adjustedBackgroundStateList STRIP_BACKGROUND -> stripBackgroundList - ACTION_KEY_MORE_KEYS_BACKGROUND -> if (themeStyle == STYLE_HOLO) adjustedBackgroundStateList + ACTION_KEY_POPUP_KEYS_BACKGROUND -> if (themeStyle == STYLE_HOLO) adjustedBackgroundStateList else actionKeyStateList TOOL_BAR_KEY -> toolbarKeyStateList else -> null // use color filter @@ -508,7 +508,7 @@ class DefaultColors ( if (view.background == null) view.setBackgroundColor(Color.WHITE) // set white to make the color filters work when (color) { - KEY_PREVIEW, MORE_KEYS_BACKGROUND -> view.background.colorFilter = adjustedBackgroundFilter + KEY_PREVIEW, POPUP_KEYS_BACKGROUND -> view.background.colorFilter = adjustedBackgroundFilter FUNCTIONAL_KEY_BACKGROUND, KEY_BACKGROUND, BACKGROUND, SPACE_BAR_BACKGROUND, STRIP_BACKGROUND -> setColor(view.background, color) ONE_HANDED_MODE_BUTTON -> setColor(view.background, if (keyboardBackground == null) BACKGROUND else STRIP_BACKGROUND) MORE_SUGGESTIONS_BACKGROUND -> view.background.colorFilter = backgroundFilter @@ -555,7 +555,7 @@ private fun activatedStateList(normal: Int, activated: Int): ColorStateList { enum class ColorType { ACTION_KEY_ICON, ACTION_KEY_BACKGROUND, - ACTION_KEY_MORE_KEYS_BACKGROUND, + ACTION_KEY_POPUP_KEYS_BACKGROUND, AUTOFILL_BACKGROUND_CHIP, BACKGROUND, CLIPBOARD_PIN, @@ -572,7 +572,7 @@ enum class ColorType { KEY_PREVIEW, MORE_SUGGESTIONS_HINT, MORE_SUGGESTIONS_BACKGROUND, - MORE_KEYS_BACKGROUND, + POPUP_KEYS_BACKGROUND, NAVIGATION_BAR, SHIFT_KEY_ICON, SPACE_BAR_BACKGROUND, diff --git a/app/src/main/java/helium314/keyboard/latin/settings/LanguageSettingsDialog.kt b/app/src/main/java/helium314/keyboard/latin/settings/LanguageSettingsDialog.kt index 7ea74b0f7..199ea2110 100644 --- a/app/src/main/java/helium314/keyboard/latin/settings/LanguageSettingsDialog.kt +++ b/app/src/main/java/helium314/keyboard/latin/settings/LanguageSettingsDialog.kt @@ -365,13 +365,13 @@ class LanguageSettingsDialog( private fun setupPopupSettings() { binding.popupOrder.setOnClickListener { - val moreKeyTypesDefault = prefs.getString(Settings.PREF_POPUP_KEYS_ORDER, MORE_KEYS_ORDER_DEFAULT)!! - reorderMoreKeysDialog(context, Settings.PREF_POPUP_KEYS_ORDER + "_" + mainLocale.toLanguageTag(), moreKeyTypesDefault, R.string.popup_order) + val popupKeyTypesDefault = prefs.getString(Settings.PREF_POPUP_KEYS_ORDER, POPUP_KEYS_ORDER_DEFAULT)!! + reorderPopupKeysDialog(context, Settings.PREF_POPUP_KEYS_ORDER + "_" + mainLocale.toLanguageTag(), popupKeyTypesDefault, R.string.popup_order) KeyboardLayoutSet.onKeyboardThemeChanged() } binding.popupLabelPriority.setOnClickListener { - val moreKeyTypesDefault = prefs.getString(Settings.PREF_POPUP_KEYS_LABELS_ORDER, MORE_KEYS_LABEL_DEFAULT)!! - reorderMoreKeysDialog(context, Settings.PREF_POPUP_KEYS_LABELS_ORDER + "_" + mainLocale.toLanguageTag(), moreKeyTypesDefault, R.string.hint_source) + val popupKeyTypesDefault = prefs.getString(Settings.PREF_POPUP_KEYS_LABELS_ORDER, POPUP_KEYS_LABEL_DEFAULT)!! + reorderPopupKeysDialog(context, Settings.PREF_POPUP_KEYS_LABELS_ORDER + "_" + mainLocale.toLanguageTag(), popupKeyTypesDefault, R.string.hint_source) KeyboardLayoutSet.onKeyboardThemeChanged() } } diff --git a/app/src/main/java/helium314/keyboard/latin/settings/PreferencesSettingsFragment.java b/app/src/main/java/helium314/keyboard/latin/settings/PreferencesSettingsFragment.java index cd78f0132..66060cfa5 100644 --- a/app/src/main/java/helium314/keyboard/latin/settings/PreferencesSettingsFragment.java +++ b/app/src/main/java/helium314/keyboard/latin/settings/PreferencesSettingsFragment.java @@ -20,7 +20,7 @@ import helium314.keyboard.keyboard.KeyboardSwitcher; import helium314.keyboard.latin.AudioAndHapticFeedbackManager; import helium314.keyboard.latin.R; import helium314.keyboard.latin.RichInputMethodManager; -import helium314.keyboard.latin.utils.MoreKeysUtilsKt; +import helium314.keyboard.latin.utils.PopupKeysUtilsKt; import helium314.keyboard.latin.utils.SubtypeSettingsKt; import helium314.keyboard.latin.utils.SubtypeUtilsKt; import helium314.keyboard.latin.utils.ToolbarUtilsKt; @@ -59,15 +59,15 @@ public final class PreferencesSettingsFragment extends SubScreenFragment { setLocalizedNumberRowVisibility(); findPreference(Settings.PREF_POPUP_KEYS_LABELS_ORDER).setVisible(getSharedPreferences().getBoolean(Settings.PREF_SHOW_HINTS, false)); findPreference(Settings.PREF_POPUP_KEYS_ORDER).setOnPreferenceClickListener((pref) -> { - MoreKeysUtilsKt.reorderMoreKeysDialog(requireContext(), Settings.PREF_POPUP_KEYS_ORDER, MoreKeysUtilsKt.MORE_KEYS_ORDER_DEFAULT, R.string.popup_order); + PopupKeysUtilsKt.reorderPopupKeysDialog(requireContext(), Settings.PREF_POPUP_KEYS_ORDER, PopupKeysUtilsKt.POPUP_KEYS_ORDER_DEFAULT, R.string.popup_order); return true; }); findPreference(Settings.PREF_POPUP_KEYS_LABELS_ORDER).setOnPreferenceClickListener((pref) -> { - MoreKeysUtilsKt.reorderMoreKeysDialog(requireContext(), Settings.PREF_POPUP_KEYS_LABELS_ORDER, MoreKeysUtilsKt.MORE_KEYS_LABEL_DEFAULT, R.string.hint_source); + PopupKeysUtilsKt.reorderPopupKeysDialog(requireContext(), Settings.PREF_POPUP_KEYS_LABELS_ORDER, PopupKeysUtilsKt.POPUP_KEYS_LABEL_DEFAULT, R.string.hint_source); return true; }); findPreference(Settings.PREF_TOOLBAR_KEYS).setOnPreferenceClickListener((pref) -> { - MoreKeysUtilsKt.reorderMoreKeysDialog(requireContext(), Settings.PREF_TOOLBAR_KEYS, ToolbarUtilsKt.getDefaultToolbarPref(), R.string.toolbar_keys); + PopupKeysUtilsKt.reorderPopupKeysDialog(requireContext(), Settings.PREF_TOOLBAR_KEYS, ToolbarUtilsKt.getDefaultToolbarPref(), R.string.toolbar_keys); return true; }); } diff --git a/app/src/main/java/helium314/keyboard/latin/settings/Settings.java b/app/src/main/java/helium314/keyboard/latin/settings/Settings.java index 56d607198..67a3b3bf8 100644 --- a/app/src/main/java/helium314/keyboard/latin/settings/Settings.java +++ b/app/src/main/java/helium314/keyboard/latin/settings/Settings.java @@ -508,11 +508,11 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang prefs.edit().putString(Settings.PREF_PINNED_TOOLBAR_KEYS, ToolbarUtilsKt.toToolbarKeyString(keys)).apply(); } - public static int readMoreMoreKeysPref(final SharedPreferences prefs) { + public static int readMorePopupKeysPref(final SharedPreferences prefs) { return switch (prefs.getString(Settings.PREF_MORE_POPUP_KEYS, "normal")) { - case "all" -> LocaleKeyTextsKt.MORE_KEYS_ALL; - case "more" -> LocaleKeyTextsKt.MORE_KEYS_MORE; - default -> LocaleKeyTextsKt.MORE_KEYS_NORMAL; + case "all" -> LocaleKeyTextsKt.POPUP_KEYS_ALL; + case "more" -> LocaleKeyTextsKt.POPUP_KEYS_MORE; + default -> LocaleKeyTextsKt.POPUP_KEYS_NORMAL; }; } diff --git a/app/src/main/java/helium314/keyboard/latin/settings/SettingsValues.java b/app/src/main/java/helium314/keyboard/latin/settings/SettingsValues.java index 5e7f58b96..38534d394 100644 --- a/app/src/main/java/helium314/keyboard/latin/settings/SettingsValues.java +++ b/app/src/main/java/helium314/keyboard/latin/settings/SettingsValues.java @@ -24,7 +24,7 @@ import helium314.keyboard.latin.RichInputMethodManager; import helium314.keyboard.latin.common.Colors; import helium314.keyboard.latin.utils.InputTypeUtils; import helium314.keyboard.latin.utils.Log; -import helium314.keyboard.latin.utils.MoreKeysUtilsKt; +import helium314.keyboard.latin.utils.PopupKeysUtilsKt; import helium314.keyboard.latin.utils.ScriptUtils; import helium314.keyboard.latin.utils.SubtypeSettingsKt; @@ -80,9 +80,9 @@ public class SettingsValues { public final int mOneHandedModeGravity; public final float mOneHandedModeScale; public final boolean mNarrowKeyGaps; - public final int mShowMoreMoreKeys; - public final List mMoreKeyTypes; - public final List mMoreKeyLabelSources; + public final int mShowMorePopupKeys; + public final List mPopupKeyTypes; + public final List mPopupKeyLabelSources; public final List mSecondaryLocales; // Use bigrams to predict the next word when there is no input for it yet public final boolean mBigramPredictionEnabled; @@ -208,16 +208,16 @@ public class SettingsValues { mOneHandedModeScale = 1f; final InputMethodSubtype selectedSubtype = SubtypeSettingsKt.getSelectedSubtype(prefs); mSecondaryLocales = Settings.getSecondaryLocales(prefs, mLocale); - mShowMoreMoreKeys = selectedSubtype.isAsciiCapable() - ? Settings.readMoreMoreKeysPref(prefs) - : LocaleKeyTextsKt.MORE_KEYS_NORMAL; + mShowMorePopupKeys = selectedSubtype.isAsciiCapable() + ? Settings.readMorePopupKeysPref(prefs) + : LocaleKeyTextsKt.POPUP_KEYS_NORMAL; mColors = Settings.getColorsForCurrentTheme(context, prefs); // read locale-specific popup key settings, fall back to global settings - final String moreKeyTypesDefault = prefs.getString(Settings.PREF_POPUP_KEYS_ORDER, MoreKeysUtilsKt.MORE_KEYS_ORDER_DEFAULT); - mMoreKeyTypes = MoreKeysUtilsKt.getEnabledMoreKeys(prefs, Settings.PREF_POPUP_KEYS_ORDER + "_" + mLocale.toLanguageTag(), moreKeyTypesDefault); - final String moreKeyLabelDefault = prefs.getString(Settings.PREF_POPUP_KEYS_LABELS_ORDER, MoreKeysUtilsKt.MORE_KEYS_LABEL_DEFAULT); - mMoreKeyLabelSources = MoreKeysUtilsKt.getEnabledMoreKeys(prefs, Settings.PREF_POPUP_KEYS_LABELS_ORDER + "_" + mLocale.toLanguageTag(), moreKeyLabelDefault); + final String popupKeyTypesDefault = prefs.getString(Settings.PREF_POPUP_KEYS_ORDER, PopupKeysUtilsKt.POPUP_KEYS_ORDER_DEFAULT); + mPopupKeyTypes = PopupKeysUtilsKt.getEnabledPopupKeys(prefs, Settings.PREF_POPUP_KEYS_ORDER + "_" + mLocale.toLanguageTag(), popupKeyTypesDefault); + final String popupKeyLabelDefault = prefs.getString(Settings.PREF_POPUP_KEYS_LABELS_ORDER, PopupKeysUtilsKt.POPUP_KEYS_LABEL_DEFAULT); + mPopupKeyLabelSources = PopupKeysUtilsKt.getEnabledPopupKeys(prefs, Settings.PREF_POPUP_KEYS_LABELS_ORDER + "_" + mLocale.toLanguageTag(), popupKeyLabelDefault); mAddToPersonalDictionary = prefs.getBoolean(Settings.PREF_ADD_TO_PERSONAL_DICTIONARY, false); mUseContactsDictionary = prefs.getBoolean(Settings.PREF_USE_CONTACTS, false); diff --git a/app/src/main/java/helium314/keyboard/latin/settings/SpacingAndPunctuations.java b/app/src/main/java/helium314/keyboard/latin/settings/SpacingAndPunctuations.java index 11f28eee8..1d72adfe4 100644 --- a/app/src/main/java/helium314/keyboard/latin/settings/SpacingAndPunctuations.java +++ b/app/src/main/java/helium314/keyboard/latin/settings/SpacingAndPunctuations.java @@ -9,12 +9,11 @@ package helium314.keyboard.latin.settings; import android.content.res.Resources; import helium314.keyboard.compat.ConfigurationCompatKt; -import helium314.keyboard.keyboard.internal.MoreKeySpec; +import helium314.keyboard.keyboard.internal.PopupKeySpec; import helium314.keyboard.latin.PunctuationSuggestions; import helium314.keyboard.latin.R; import helium314.keyboard.latin.common.Constants; import helium314.keyboard.latin.common.StringUtils; -import helium314.keyboard.latin.common.StringUtilsKt; import java.util.Arrays; import java.util.Locale; @@ -57,7 +56,7 @@ public final class SpacingAndPunctuations { // English variants. German rules (not "German typography") also have small gotchas. mUsesAmericanTypography = Locale.ENGLISH.getLanguage().equals(locale.getLanguage()); mUsesGermanRules = Locale.GERMAN.getLanguage().equals(locale.getLanguage()); - final String[] suggestPuncsSpec = MoreKeySpec.splitKeySpecs( + final String[] suggestPuncsSpec = PopupKeySpec.splitKeySpecs( res.getString(R.string.suggested_punctuations)); mSuggestPuncList = PunctuationSuggestions.newPunctuationSuggestions(suggestPuncsSpec); } diff --git a/app/src/main/java/helium314/keyboard/latin/suggestions/MoreSuggestions.java b/app/src/main/java/helium314/keyboard/latin/suggestions/MoreSuggestions.java index 433b8f1a5..ec7d5ba9a 100644 --- a/app/src/main/java/helium314/keyboard/latin/suggestions/MoreSuggestions.java +++ b/app/src/main/java/helium314/keyboard/latin/suggestions/MoreSuggestions.java @@ -167,12 +167,12 @@ public final class MoreSuggestions extends Keyboard { } public static final class Builder extends KeyboardBuilder { - private final MoreSuggestionsView mPaneView; + private final PopupSuggestionsView mPaneView; private SuggestedWords mSuggestedWords; private int mFromIndex; private int mToIndex; - public Builder(final Context context, final MoreSuggestionsView paneView) { + public Builder(final Context context, final PopupSuggestionsView paneView) { super(context, new MoreSuggestionsParam()); mPaneView = paneView; } diff --git a/app/src/main/java/helium314/keyboard/latin/suggestions/MoreSuggestionsView.java b/app/src/main/java/helium314/keyboard/latin/suggestions/PopupSuggestionsView.java similarity index 79% rename from app/src/main/java/helium314/keyboard/latin/suggestions/MoreSuggestionsView.java rename to app/src/main/java/helium314/keyboard/latin/suggestions/PopupSuggestionsView.java index 54d26fc0e..fb4ff9844 100644 --- a/app/src/main/java/helium314/keyboard/latin/suggestions/MoreSuggestionsView.java +++ b/app/src/main/java/helium314/keyboard/latin/suggestions/PopupSuggestionsView.java @@ -15,7 +15,7 @@ import androidx.annotation.NonNull; import helium314.keyboard.keyboard.Key; import helium314.keyboard.keyboard.Keyboard; import helium314.keyboard.keyboard.KeyboardActionListener; -import helium314.keyboard.keyboard.MoreKeysKeyboardView; +import helium314.keyboard.keyboard.PopupKeysKeyboardView; import helium314.keyboard.latin.R; import helium314.keyboard.latin.SuggestedWords; import helium314.keyboard.latin.SuggestedWords.SuggestedWordInfo; @@ -25,8 +25,8 @@ import helium314.keyboard.latin.suggestions.MoreSuggestions.MoreSuggestionKey; * A view that renders a virtual {@link MoreSuggestions}. It handles rendering of keys and detecting * key presses and touch movements. */ -public final class MoreSuggestionsView extends MoreKeysKeyboardView { - private static final String TAG = MoreSuggestionsView.class.getSimpleName(); +public final class PopupSuggestionsView extends PopupKeysKeyboardView { + private static final String TAG = PopupSuggestionsView.class.getSimpleName(); public static abstract class MoreSuggestionsListener extends KeyboardActionListener.Adapter { public abstract void onSuggestionSelected(final SuggestedWordInfo info); @@ -34,12 +34,12 @@ public final class MoreSuggestionsView extends MoreKeysKeyboardView { private boolean mIsInModalMode; - public MoreSuggestionsView(final Context context, final AttributeSet attrs) { - this(context, attrs, R.attr.moreKeysKeyboardViewStyle); + public PopupSuggestionsView(final Context context, final AttributeSet attrs) { + this(context, attrs, R.attr.popupKeysKeyboardViewStyle); } - public MoreSuggestionsView(final Context context, final AttributeSet attrs, - final int defStyle) { + public PopupSuggestionsView(final Context context, final AttributeSet attrs, + final int defStyle) { super(context, attrs, defStyle); } @@ -49,10 +49,10 @@ public final class MoreSuggestionsView extends MoreKeysKeyboardView { super.setKeyboard(keyboard); mIsInModalMode = false; // With accessibility mode off, {@link #mAccessibilityDelegate} is set to null at the - // above {@link MoreKeysKeyboardView#setKeyboard(Keyboard)} call. + // above {@link PopupKeysKeyboardView#setKeyboard(Keyboard)} call. // With accessibility mode on, {@link #mAccessibilityDelegate} is set to a - // {@link MoreKeysKeyboardAccessibilityDelegate} object at the above - // {@link MoreKeysKeyboardView#setKeyboard(Keyboard)} call. + // {@link PopupKeysKeyboardAccessibilityDelegate} object at the above + // {@link PopupKeysKeyboardView#setKeyboard(Keyboard)} call. if (mAccessibilityDelegate != null) { mAccessibilityDelegate.setOpenAnnounce(R.string.spoken_open_more_suggestions); mAccessibilityDelegate.setCloseAnnounce(R.string.spoken_close_more_suggestions); @@ -71,8 +71,8 @@ public final class MoreSuggestionsView extends MoreKeysKeyboardView { public void setModalMode() { mIsInModalMode = true; - // Set vertical correction to zero (Reset more keys keyboard sliding allowance - // {@link R#dimen.config_more_keys_keyboard_slide_allowance}). + // Set vertical correction to zero (Reset popup keys keyboard sliding allowance + // {@link R#dimen.config_popup_keys_keyboard_slide_allowance}). mKeyDetector.setKeyboard(getKeyboard(), -getPaddingLeft(), -getPaddingTop()); } diff --git a/app/src/main/java/helium314/keyboard/latin/suggestions/SuggestionStripView.java b/app/src/main/java/helium314/keyboard/latin/suggestions/SuggestionStripView.java index 84dba1595..55be20555 100644 --- a/app/src/main/java/helium314/keyboard/latin/suggestions/SuggestionStripView.java +++ b/app/src/main/java/helium314/keyboard/latin/suggestions/SuggestionStripView.java @@ -44,7 +44,7 @@ import android.widget.TextView; import helium314.keyboard.accessibility.AccessibilityUtils; import helium314.keyboard.keyboard.Keyboard; import helium314.keyboard.keyboard.MainKeyboardView; -import helium314.keyboard.keyboard.MoreKeysPanel; +import helium314.keyboard.keyboard.PopupKeysPanel; import helium314.keyboard.latin.AudioAndHapticFeedbackManager; import helium314.keyboard.latin.Dictionary; import helium314.keyboard.latin.R; @@ -57,7 +57,7 @@ import helium314.keyboard.latin.define.DebugFlags; import helium314.keyboard.latin.settings.DebugSettings; import helium314.keyboard.latin.settings.Settings; import helium314.keyboard.latin.settings.SettingsValues; -import helium314.keyboard.latin.suggestions.MoreSuggestionsView.MoreSuggestionsListener; +import helium314.keyboard.latin.suggestions.PopupSuggestionsView.MoreSuggestionsListener; import helium314.keyboard.latin.utils.DeviceProtectedUtils; import helium314.keyboard.latin.utils.DialogUtilsKt; import helium314.keyboard.latin.utils.Log; @@ -98,7 +98,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick MainKeyboardView mMainKeyboardView; private final View mMoreSuggestionsContainer; - private final MoreSuggestionsView mMoreSuggestionsView; + private final PopupSuggestionsView mMoreSuggestionsView; private final MoreSuggestions.Builder mMoreSuggestionsBuilder; private final ArrayList mWordViews = new ArrayList<>(); @@ -331,20 +331,20 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick } }; - private final MoreKeysPanel.Controller mMoreSuggestionsController = - new MoreKeysPanel.Controller() { + private final PopupKeysPanel.Controller mMoreSuggestionsController = + new PopupKeysPanel.Controller() { @Override - public void onDismissMoreKeysPanel() { - mMainKeyboardView.onDismissMoreKeysPanel(); + public void onDismissPopupKeysPanel() { + mMainKeyboardView.onDismissPopupKeysPanel(); } @Override - public void onShowMoreKeysPanel(final MoreKeysPanel panel) { - mMainKeyboardView.onShowMoreKeysPanel(panel); + public void onShowPopupKeysPanel(final PopupKeysPanel panel) { + mMainKeyboardView.onShowPopupKeysPanel(panel); } @Override - public void onCancelMoreKeysPanel() { + public void onCancelPopupKeysPanel() { dismissMoreSuggestionsPanel(); } }; @@ -354,7 +354,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick } public void dismissMoreSuggestionsPanel() { - mMoreSuggestionsView.dismissMoreKeysPanel(); + mMoreSuggestionsView.dismissPopupKeysPanel(); } @Override @@ -466,7 +466,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick private void removeSuggestion(TextView wordView) { final String word = wordView.getText().toString(); mListener.removeSuggestion(word); - mMoreSuggestionsView.dismissMoreKeysPanel(); + mMoreSuggestionsView.dismissPopupKeysPanel(); // show suggestions, but without the removed word final ArrayList sw = new ArrayList<>(); for (int i = 0; i < mSuggestedWords.size(); i ++) { @@ -516,7 +516,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick final int pointX = stripWidth / 2; final int pointY = -layoutHelper.mMoreSuggestionsBottomGap; - mMoreSuggestionsView.showMoreKeysPanel(this, mMoreSuggestionsController, pointX, pointY, + mMoreSuggestionsView.showPopupKeysPanel(this, mMoreSuggestionsController, pointX, pointY, mMoreSuggestionsListener); mOriginX = mLastX; mOriginY = mLastY; diff --git a/app/src/main/java/helium314/keyboard/latin/utils/CustomLayoutUtils.kt b/app/src/main/java/helium314/keyboard/latin/utils/CustomLayoutUtils.kt index a9b47847e..c7a636241 100644 --- a/app/src/main/java/helium314/keyboard/latin/utils/CustomLayoutUtils.kt +++ b/app/src/main/java/helium314/keyboard/latin/utils/CustomLayoutUtils.kt @@ -14,7 +14,7 @@ import helium314.keyboard.keyboard.KeyboardLayoutSet import helium314.keyboard.keyboard.KeyboardSwitcher import helium314.keyboard.keyboard.internal.KeyboardParams import helium314.keyboard.keyboard.internal.keyboard_parser.JsonKeyboardParser -import helium314.keyboard.keyboard.internal.keyboard_parser.MORE_KEYS_NORMAL +import helium314.keyboard.keyboard.internal.keyboard_parser.POPUP_KEYS_NORMAL import helium314.keyboard.keyboard.internal.keyboard_parser.SimpleKeyboardParser import helium314.keyboard.keyboard.internal.keyboard_parser.addLocaleKeyTextsToParams import helium314.keyboard.latin.R @@ -75,8 +75,8 @@ fun loadCustomLayout(layoutContent: String, layoutName: String, languageTag: Str private fun checkLayout(layoutContent: String, context: Context): Boolean? { val params = KeyboardParams() params.mId = KeyboardLayoutSet.getFakeKeyboardId(KeyboardId.ELEMENT_ALPHABET) - params.mMoreKeyTypes.add(MORE_KEYS_LAYOUT) - addLocaleKeyTextsToParams(context, params, MORE_KEYS_NORMAL) + params.mPopupKeyTypes.add(POPUP_KEYS_LAYOUT) + addLocaleKeyTextsToParams(context, params, POPUP_KEYS_NORMAL) try { val keys = JsonKeyboardParser(params, context).parseLayoutString(layoutContent) if (!checkKeys(keys)) @@ -109,11 +109,11 @@ private fun checkKeys(keys: List>): Boolean { Log.w(TAG, "too long text on key") return false } - if (keys.any { it.any { (it.mMoreKeys?.size ?: 0) > 20 } }) { + if (keys.any { it.any { (it.mPopupKeys?.size ?: 0) > 20 } }) { Log.w(TAG, "too many popup keys on a key") return false } - if (keys.any { it.any { it.mMoreKeys?.any { (it.mLabel?.length ?: 0) > 10 } == true } }) { + if (keys.any { it.any { it.mPopupKeys?.any { (it.mLabel?.length ?: 0) > 10 } == true } }) { Log.w(TAG, "too long text on popup key") return false } @@ -161,7 +161,7 @@ fun editCustomLayout(layoutName: String, context: Context, startContent: String? } .setNegativeButton(android.R.string.cancel, null) if (isSymbols) { - val name = if (layoutName.contains("shift")) context.getString(R.string.shift_symbols) else context.getString(R.string.more_keys_symbols) + val name = if (layoutName.contains("shift")) context.getString(R.string.shift_symbols) else context.getString(R.string.popup_keys_symbols) if (file.exists()) { builder.setNeutralButton(R.string.delete) { _, _ -> confirmDialog(context, context.getString(R.string.delete_layout, name), context.getString(R.string.delete)) { diff --git a/app/src/main/java/helium314/keyboard/latin/utils/MoreKeysUtils.kt b/app/src/main/java/helium314/keyboard/latin/utils/PopupKeysUtils.kt similarity index 57% rename from app/src/main/java/helium314/keyboard/latin/utils/MoreKeysUtils.kt rename to app/src/main/java/helium314/keyboard/latin/utils/PopupKeysUtils.kt index b68d76bc1..4a85ffa22 100644 --- a/app/src/main/java/helium314/keyboard/latin/utils/MoreKeysUtils.kt +++ b/app/src/main/java/helium314/keyboard/latin/utils/PopupKeysUtils.kt @@ -23,48 +23,48 @@ import helium314.keyboard.latin.R import helium314.keyboard.latin.settings.Settings import java.util.Collections -const val MORE_KEYS_NUMBER = "more_keys_number" -private const val MORE_KEYS_LANGUAGE_PRIORITY = "more_keys_language_priority" -const val MORE_KEYS_LAYOUT = "more_keys_layout" -private const val MORE_KEYS_SYMBOLS = "more_keys_symbols" -private const val MORE_KEYS_LANGUAGE = "more_keys_language" -const val MORE_KEYS_LABEL_DEFAULT = "$MORE_KEYS_NUMBER,true;$MORE_KEYS_LANGUAGE_PRIORITY,false;$MORE_KEYS_LAYOUT,true;$MORE_KEYS_SYMBOLS,true;$MORE_KEYS_LANGUAGE,false" -const val MORE_KEYS_ORDER_DEFAULT = "$MORE_KEYS_LANGUAGE_PRIORITY,true;$MORE_KEYS_NUMBER,true;$MORE_KEYS_SYMBOLS,true;$MORE_KEYS_LAYOUT,true;$MORE_KEYS_LANGUAGE,true" +const val POPUP_KEYS_NUMBER = "popup_keys_number" +private const val POPUP_KEYS_LANGUAGE_PRIORITY = "popup_keys_language_priority" +const val POPUP_KEYS_LAYOUT = "popup_keys_layout" +private const val POPUP_KEYS_SYMBOLS = "popup_keys_symbols" +private const val POPUP_KEYS_LANGUAGE = "popup_keys_language" +const val POPUP_KEYS_LABEL_DEFAULT = "$POPUP_KEYS_NUMBER,true;$POPUP_KEYS_LANGUAGE_PRIORITY,false;$POPUP_KEYS_LAYOUT,true;$POPUP_KEYS_SYMBOLS,true;$POPUP_KEYS_LANGUAGE,false" +const val POPUP_KEYS_ORDER_DEFAULT = "$POPUP_KEYS_LANGUAGE_PRIORITY,true;$POPUP_KEYS_NUMBER,true;$POPUP_KEYS_SYMBOLS,true;$POPUP_KEYS_LAYOUT,true;$POPUP_KEYS_LANGUAGE,true" -private val allMoreKeyTypes = listOf(MORE_KEYS_NUMBER, MORE_KEYS_LAYOUT, MORE_KEYS_SYMBOLS, MORE_KEYS_LANGUAGE, MORE_KEYS_LANGUAGE_PRIORITY) +private val allPopupKeyTypes = listOf(POPUP_KEYS_NUMBER, POPUP_KEYS_LAYOUT, POPUP_KEYS_SYMBOLS, POPUP_KEYS_LANGUAGE, POPUP_KEYS_LANGUAGE_PRIORITY) -fun createMoreKeysArray(popupSet: PopupSet<*>?, params: KeyboardParams, label: String): Array? { - // often moreKeys are empty, so we want to avoid unnecessarily creating sets - val moreKeysDelegate = lazy { mutableSetOf() } - val moreKeys by moreKeysDelegate - val types = if (params.mId.isAlphabetKeyboard) params.mMoreKeyTypes else allMoreKeyTypes +fun createPopupKeysArray(popupSet: PopupSet<*>?, params: KeyboardParams, label: String): Array? { + // often PopupKeys are empty, so we want to avoid unnecessarily creating sets + val popupKeysDelegate = lazy { mutableSetOf() } + val popupKeys by popupKeysDelegate + val types = if (params.mId.isAlphabetKeyboard) params.mPopupKeyTypes else allPopupKeyTypes types.forEach { type -> when (type) { - MORE_KEYS_NUMBER -> params.mLocaleKeyTexts.getNumberLabel(popupSet?.numberIndex)?.let { moreKeys.add(it) } - MORE_KEYS_LAYOUT -> popupSet?.getPopupKeyLabels(params)?.let { moreKeys.addAll(it) } - MORE_KEYS_SYMBOLS -> popupSet?.symbol?.let { moreKeys.add(it) } - MORE_KEYS_LANGUAGE -> params.mLocaleKeyTexts.getMoreKeys(label)?.let { moreKeys.addAll(it) } - MORE_KEYS_LANGUAGE_PRIORITY -> params.mLocaleKeyTexts.getPriorityMoreKeys(label)?.let { moreKeys.addAll(it) } + POPUP_KEYS_NUMBER -> params.mLocaleKeyTexts.getNumberLabel(popupSet?.numberIndex)?.let { popupKeys.add(it) } + POPUP_KEYS_LAYOUT -> popupSet?.getPopupKeyLabels(params)?.let { popupKeys.addAll(it) } + POPUP_KEYS_SYMBOLS -> popupSet?.symbol?.let { popupKeys.add(it) } + POPUP_KEYS_LANGUAGE -> params.mLocaleKeyTexts.getPopupKeys(label)?.let { popupKeys.addAll(it) } + POPUP_KEYS_LANGUAGE_PRIORITY -> params.mLocaleKeyTexts.getPriorityPopupKeys(label)?.let { popupKeys.addAll(it) } } } - if (!moreKeysDelegate.isInitialized() || moreKeys.isEmpty()) + if (!popupKeysDelegate.isInitialized() || popupKeys.isEmpty()) return null - val fco = moreKeys.firstOrNull { it.startsWith(Key.MORE_KEYS_FIXED_COLUMN_ORDER) } - if (fco != null && fco.substringAfter(Key.MORE_KEYS_FIXED_COLUMN_ORDER).toIntOrNull() != moreKeys.size - 1) { - val fcoExpected = moreKeys.size - moreKeys.count { it.startsWith("!") && it.endsWith("!") } - 1 - if (fco.substringAfter(Key.MORE_KEYS_FIXED_COLUMN_ORDER).toIntOrNull() != fcoExpected) - moreKeys.remove(fco) // maybe rather adjust the number instead of remove? + val fco = popupKeys.firstOrNull { it.startsWith(Key.POPUP_KEYS_FIXED_COLUMN_ORDER) } + if (fco != null && fco.substringAfter(Key.POPUP_KEYS_FIXED_COLUMN_ORDER).toIntOrNull() != popupKeys.size - 1) { + val fcoExpected = popupKeys.size - popupKeys.count { it.startsWith("!") && it.endsWith("!") } - 1 + if (fco.substringAfter(Key.POPUP_KEYS_FIXED_COLUMN_ORDER).toIntOrNull() != fcoExpected) + popupKeys.remove(fco) // maybe rather adjust the number instead of remove? } - if (moreKeys.size > 1 && (label == "(" || label == ")")) { // add fixed column order for that case (typically other variants of brackets / parentheses + if (popupKeys.size > 1 && (label == "(" || label == ")")) { // add fixed column order for that case (typically other variants of brackets / parentheses // not really fast, but no other way to add first in a LinkedHashSet - val tmp = moreKeys.toList() - moreKeys.clear() - moreKeys.add("${Key.MORE_KEYS_FIXED_COLUMN_ORDER}${tmp.size}") - moreKeys.addAll(tmp) + val tmp = popupKeys.toList() + popupKeys.clear() + popupKeys.add("${Key.POPUP_KEYS_FIXED_COLUMN_ORDER}${tmp.size}") + popupKeys.addAll(tmp) } // autoColumnOrder should be fine - val array = moreKeys.toTypedArray() + val array = popupKeys.toTypedArray() for (i in array.indices) { array[i] = transformLabel(array[i], params) } @@ -73,13 +73,13 @@ fun createMoreKeysArray(popupSet: PopupSet<*>?, params: KeyboardParams, label: S fun getHintLabel(popupSet: PopupSet<*>?, params: KeyboardParams, label: String): String? { var hintLabel: String? = null - for (type in params.mMoreKeyLabelSources) { + for (type in params.mPopupKeyLabelSources) { when (type) { - MORE_KEYS_NUMBER -> params.mLocaleKeyTexts.getNumberLabel(popupSet?.numberIndex)?.let { hintLabel = it } - MORE_KEYS_LAYOUT -> popupSet?.getPopupKeyLabels(params)?.let { hintLabel = it.firstOrNull() } - MORE_KEYS_SYMBOLS -> popupSet?.symbol?.let { hintLabel = it } - MORE_KEYS_LANGUAGE -> params.mLocaleKeyTexts.getMoreKeys(label)?.let { hintLabel = it.firstOrNull() } - MORE_KEYS_LANGUAGE_PRIORITY -> params.mLocaleKeyTexts.getPriorityMoreKeys(label)?.let { hintLabel = it.firstOrNull() } + POPUP_KEYS_NUMBER -> params.mLocaleKeyTexts.getNumberLabel(popupSet?.numberIndex)?.let { hintLabel = it } + POPUP_KEYS_LAYOUT -> popupSet?.getPopupKeyLabels(params)?.let { hintLabel = it.firstOrNull() } + POPUP_KEYS_SYMBOLS -> popupSet?.symbol?.let { hintLabel = it } + POPUP_KEYS_LANGUAGE -> params.mLocaleKeyTexts.getPopupKeys(label)?.let { hintLabel = it.firstOrNull() } + POPUP_KEYS_LANGUAGE_PRIORITY -> params.mLocaleKeyTexts.getPriorityPopupKeys(label)?.let { hintLabel = it.firstOrNull() } } if (hintLabel != null) break } @@ -98,8 +98,8 @@ private fun transformLabel(label: String, params: KeyboardParams): String = label.rtlLabel(params) } else label -/** returns a list of enabled more keys for pref [key] */ -fun getEnabledMoreKeys(prefs: SharedPreferences, key: String, defaultSetting: String): List { +/** returns a list of enabled popup keys for pref [key] */ +fun getEnabledPopupKeys(prefs: SharedPreferences, key: String, defaultSetting: String): List { return prefs.getString(key, defaultSetting)?.split(";")?.mapNotNull { val split = it.split(",") if (split.last() == "true") split.first() else null @@ -107,10 +107,10 @@ fun getEnabledMoreKeys(prefs: SharedPreferences, key: String, defaultSetting: St } /** - * show a dialog that allows re-ordering and dis/enabling the more keys list for the pref [key] - * see e.g. [MORE_KEYS_LABEL_DEFAULT] for the internally used format + * show a dialog that allows re-ordering and dis/enabling the popup keys list for the pref [key] + * see e.g. [POPUP_KEYS_LABEL_DEFAULT] for the internally used format */ -fun reorderMoreKeysDialog(context: Context, key: String, defaultSetting: String, title: Int) { +fun reorderPopupKeysDialog(context: Context, key: String, defaultSetting: String, title: Int) { val prefs = DeviceProtectedUtils.getSharedPreferences(context) val orderedItems = prefs.getString(key, defaultSetting)!!.split(";").mapTo(ArrayList()) { val both = it.split(",") @@ -127,7 +127,7 @@ fun reorderMoreKeysDialog(context: Context, key: String, defaultSetting: String, val bgColor = ContextCompat.getColor(context, R.color.sliding_items_background) val adapter = object : ListAdapter, RecyclerView.ViewHolder>(callback) { override fun onCreateViewHolder(p0: ViewGroup, p1: Int): RecyclerView.ViewHolder { - val b = LayoutInflater.from(context).inflate(R.layout.morekeys_list_item, rv, false) + val b = LayoutInflater.from(context).inflate(R.layout.popup_keys_list_item, rv, false) b.setBackgroundColor(bgColor) return object : RecyclerView.ViewHolder(b) { } } @@ -135,10 +135,10 @@ fun reorderMoreKeysDialog(context: Context, key: String, defaultSetting: String, val (text, wasChecked) = orderedItems[p1] val displayTextId = context.resources.getIdentifier(text.lowercase(), "string", context.packageName) val displayText = if (displayTextId == 0) text else context.getString(displayTextId) - p0.itemView.findViewById(R.id.morekeys_type)?.text = displayText - val switch = p0.itemView.findViewById(R.id.morekeys_switch) + p0.itemView.findViewById(R.id.popup_keys_type)?.text = displayText + val switch = p0.itemView.findViewById(R.id.popup_keys_switch) switch?.isChecked = wasChecked - switch?.isEnabled = !(key.contains(Settings.PREF_POPUP_KEYS_ORDER) && text == MORE_KEYS_LAYOUT) // layout can't be disabled + switch?.isEnabled = !(key.contains(Settings.PREF_POPUP_KEYS_ORDER) && text == POPUP_KEYS_LAYOUT) // layout can't be disabled switch?.setOnCheckedChangeListener { _, isChecked -> val position = orderedItems.indexOfFirst { it.first == text } orderedItems[position] = text to isChecked diff --git a/app/src/main/res/drawable/keyboard_key_feedback_lxx_light.xml b/app/src/main/res/drawable/keyboard_key_feedback_lxx_light.xml index 9ae64e7f3..91b097108 100644 --- a/app/src/main/res/drawable/keyboard_key_feedback_lxx_light.xml +++ b/app/src/main/res/drawable/keyboard_key_feedback_lxx_light.xml @@ -9,18 +9,18 @@ xmlns:latin="http://schemas.android.com/apk/res-auto" > - - - diff --git a/app/src/main/res/drawable/more_keys_divider.xml b/app/src/main/res/drawable/popup_keys_divider.xml similarity index 100% rename from app/src/main/res/drawable/more_keys_divider.xml rename to app/src/main/res/drawable/popup_keys_divider.xml diff --git a/app/src/main/res/layout/more_suggestions.xml b/app/src/main/res/layout/more_suggestions.xml index b76032c85..ce0535179 100644 --- a/app/src/main/res/layout/more_suggestions.xml +++ b/app/src/main/res/layout/more_suggestions.xml @@ -11,7 +11,7 @@ android:layout_height="wrap_content" android:orientation="vertical" > - - + style="?attr/popupKeysKeyboardViewStyle" /> diff --git a/app/src/main/res/layout/more_keys_keyboard_for_action_lxx.xml b/app/src/main/res/layout/popup_keys_keyboard_for_action_lxx.xml similarity index 72% rename from app/src/main/res/layout/more_keys_keyboard_for_action_lxx.xml rename to app/src/main/res/layout/popup_keys_keyboard_for_action_lxx.xml index 58587ab99..c5730e4de 100644 --- a/app/src/main/res/layout/more_keys_keyboard_for_action_lxx.xml +++ b/app/src/main/res/layout/popup_keys_keyboard_for_action_lxx.xml @@ -10,9 +10,9 @@ android:layout_height="wrap_content" android:orientation="vertical" > - + style="?attr/popupKeysKeyboardViewForActionStyle" /> diff --git a/app/src/main/res/layout/morekeys_list_item.xml b/app/src/main/res/layout/popup_keys_list_item.xml similarity index 93% rename from app/src/main/res/layout/morekeys_list_item.xml rename to app/src/main/res/layout/popup_keys_list_item.xml index 3a4ef98e8..311fe9ed7 100644 --- a/app/src/main/res/layout/morekeys_list_item.xml +++ b/app/src/main/res/layout/popup_keys_list_item.xml @@ -12,14 +12,14 @@ android:layout_width="match_parent" android:layout_height="wrap_content" > "Hoofletter-%s" "Hoofletter-I" "Hoofletter-I, kol bo" - "Alternatiewe karakters is beskikbaar" - "Alternatiewe karakters is toegemaak" + "Alternatiewe karakters is beskikbaar" + "Alternatiewe karakters is toegemaak" "Alternatiewe voorstelle is beskikbaar" "Alternatiewe voorstelle is toegemaak" diff --git a/app/src/main/res/values-am/strings-talkback-descriptions.xml b/app/src/main/res/values-am/strings-talkback-descriptions.xml index c815d0cb9..897f9332e 100644 --- a/app/src/main/res/values-am/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-am/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "አቢይ ሆሄ %s" "አቢይ ሆሄ አይ" "አቢይ ሆሄ አይ፣ ነጥብ ከላይ" - "ተለዋጭ ቁምፊዎች ይገኛሉ" - "ተለዋጭ ቁምፊዎች ተሰናብተዋል" + "ተለዋጭ ቁምፊዎች ይገኛሉ" + "ተለዋጭ ቁምፊዎች ተሰናብተዋል" "ተለዋጭ የአስተያየት ጥቆማዎች ይገኛሉ" "ተለዋጭ የአስተያየት ጥቆማዎች ተሰናብተዋል" diff --git a/app/src/main/res/values-ar/strings-talkback-descriptions.xml b/app/src/main/res/values-ar/strings-talkback-descriptions.xml index e2d2a2dc3..ba69900be 100644 --- a/app/src/main/res/values-ar/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-ar/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s كبير" "‏I كبير" "Capital I, dot above" - "تتوفر الأحرف البديلة" - "تم تجاهل الأحرف البديلة" + "تتوفر الأحرف البديلة" + "تم تجاهل الأحرف البديلة" "تتوفر الاقتراحات البديلة" "تم تجاهل الاقتراحات البديلة" diff --git a/app/src/main/res/values-az/strings-talkback-descriptions.xml b/app/src/main/res/values-az/strings-talkback-descriptions.xml index 31427c6f9..0fed62688 100644 --- a/app/src/main/res/values-az/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-az/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Böyük %s" "Böyük I" "Böyük I, üstü nöqtəli" - "Alternativ simvollar əlçatandır" - "Alternativ simvollar kənarlaşdırılıb" + "Alternativ simvollar əlçatandır" + "Alternativ simvollar kənarlaşdırılıb" "Alternativ təkliflər əlçatandır" "Alternativ təkliflər kənarlaşdırılıb" diff --git a/app/src/main/res/values-b+sr+Latn/strings-talkback-descriptions.xml b/app/src/main/res/values-b+sr+Latn/strings-talkback-descriptions.xml index fa56a41f6..57fa06553 100644 --- a/app/src/main/res/values-b+sr+Latn/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-b+sr+Latn/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Veliko %s" "Veliko I" "Veliko I sa tačkom iznad" - "Dostupni su alternativni znaci" - "Alternativni znaci su odbačeni" + "Dostupni su alternativni znaci" + "Alternativni znaci su odbačeni" "Dostupni su alternativni predlozi" "Alternativni predlozi su odbačeni" diff --git a/app/src/main/res/values-bg/strings-talkback-descriptions.xml b/app/src/main/res/values-bg/strings-talkback-descriptions.xml index e196f654c..f2e628b0e 100644 --- a/app/src/main/res/values-bg/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-bg/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Главна буква %s" "Главна буква I" "Главна буква I с точка отгоре" - "Налице са алтернативни знаци" - "Алтернативните знаци са отхвърлени" + "Налице са алтернативни знаци" + "Алтернативните знаци са отхвърлени" "Налице са алтернативни предложения" "Алтернативните предложения са отхвърлени" diff --git a/app/src/main/res/values-bn/strings-talkback-descriptions.xml b/app/src/main/res/values-bn/strings-talkback-descriptions.xml index ae7146f0d..c95132a22 100644 --- a/app/src/main/res/values-bn/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-bn/strings-talkback-descriptions.xml @@ -63,8 +63,8 @@ "বড় হাতের %s" "বড় হাতের I" "বড় হাতের I, উপরে বিন্দু" - "বিকল্প অক্ষরগুলি উপলব্ধ রয়েছে" - "বিকল্প অক্ষরগুলি সরিয়ে দেওয়া হয়" + "বিকল্প অক্ষরগুলি উপলব্ধ রয়েছে" + "বিকল্প অক্ষরগুলি সরিয়ে দেওয়া হয়" "বিকল্প প্রস্তাবনাগুলি উপলব্ধ রয়েছে" "বিকল্প প্রস্তাবনাগুলি সরিয়ে দেওয়া হয়" diff --git a/app/src/main/res/values-bs/strings-talkback-descriptions.xml b/app/src/main/res/values-bs/strings-talkback-descriptions.xml index 30b9e6c81..9b15d0ba3 100644 --- a/app/src/main/res/values-bs/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-bs/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Veliko slovo %s" "Veliko slovo I" "Veliko slovo I, s točkicom iznad" - "Dostupni su zamjenski znakovi" - "Zamjenski su znakovi isključeni" + "Dostupni su zamjenski znakovi" + "Zamjenski su znakovi isključeni" "Dostupni su zamjenski prijedlozi" "Zamjenski su prijedlozi isključeni" diff --git a/app/src/main/res/values-ca/strings-talkback-descriptions.xml b/app/src/main/res/values-ca/strings-talkback-descriptions.xml index 8deaf5bae..22b35cca0 100644 --- a/app/src/main/res/values-ca/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-ca/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s majúscula" "I majúscula" "I majúscula, punt superior" - "Hi ha caràcters alternatius disponibles." - "Els caràcters alternatius s\'ignoren." + "Hi ha caràcters alternatius disponibles." + "Els caràcters alternatius s\'ignoren." "Hi ha suggeriments alternatius disponibles." "Els suggeriments alternatius s\'ignoren." diff --git a/app/src/main/res/values-cs/strings-talkback-descriptions.xml b/app/src/main/res/values-cs/strings-talkback-descriptions.xml index b28907f83..0b25462be 100644 --- a/app/src/main/res/values-cs/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-cs/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Velký znak %s" "Velké I" "Velké I s tečkou nad" - "Alternativní znaky jsou k dispozici" - "Alternativní znaky jsou ignorovány" + "Alternativní znaky jsou k dispozici" + "Alternativní znaky jsou ignorovány" "Alternativní návrhy jsou k dispozici" "Alternativní návrhy jsou ignorovány" diff --git a/app/src/main/res/values-da/strings-talkback-descriptions.xml b/app/src/main/res/values-da/strings-talkback-descriptions.xml index 74d29a2eb..bd410f0b1 100644 --- a/app/src/main/res/values-da/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-da/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Stort %s" "Stort I" "Stort I med prik over" - "Alternative tegn er tilgængelige" - "Alternative tegn er deaktiveret" + "Alternative tegn er tilgængelige" + "Alternative tegn er deaktiveret" "Alternative forslag er tilgængelige" "Alternative forslag er deaktiveret" diff --git a/app/src/main/res/values-de/strings-talkback-descriptions.xml b/app/src/main/res/values-de/strings-talkback-descriptions.xml index bf5923c1b..871835cbb 100644 --- a/app/src/main/res/values-de/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-de/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Großbuchstabe %s" "Großbuchstabe I" "Großbuchstabe I mit übergesetztem Punkt" - "Es sind Alternativzeichen verfügbar." - "Alternativzeichen werden ausgeblendet." + "Es sind Alternativzeichen verfügbar." + "Alternativzeichen werden ausgeblendet." "Es sind Alternativvorschläge verfügbar." "Alternativvorschläge werden ausgeblendet." diff --git a/app/src/main/res/values-el/strings-talkback-descriptions.xml b/app/src/main/res/values-el/strings-talkback-descriptions.xml index 3e1fab572..1f0b29628 100644 --- a/app/src/main/res/values-el/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-el/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Κεφαλαίο %s" "Κεφαλαίο I" "Κεφαλαίο I, κουκκίδα από πάνω" - "Διατίθενται εναλλακτικοί χαρακτήρες" - "Παράβλεψη εναλλακτικών χαρακτήρων" + "Διατίθενται εναλλακτικοί χαρακτήρες" + "Παράβλεψη εναλλακτικών χαρακτήρων" "Διατίθενται εναλλακτικές προτάσεις" "Παράβλεψη εναλλακτικών προτάσεων" diff --git a/app/src/main/res/values-en-rAU/strings-talkback-descriptions.xml b/app/src/main/res/values-en-rAU/strings-talkback-descriptions.xml index 91e653c61..742bbd40b 100644 --- a/app/src/main/res/values-en-rAU/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-en-rAU/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Capital %s" "Capital I" "Capital I, dot above" - "Alternative characters are available" - "Alternative characters are dismissed" + "Alternative characters are available" + "Alternative characters are dismissed" "Alternative suggestions are available" "Alternative suggestions are dismissed" diff --git a/app/src/main/res/values-en-rCA/strings-talkback-descriptions.xml b/app/src/main/res/values-en-rCA/strings-talkback-descriptions.xml index 91e653c61..742bbd40b 100644 --- a/app/src/main/res/values-en-rCA/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-en-rCA/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Capital %s" "Capital I" "Capital I, dot above" - "Alternative characters are available" - "Alternative characters are dismissed" + "Alternative characters are available" + "Alternative characters are dismissed" "Alternative suggestions are available" "Alternative suggestions are dismissed" diff --git a/app/src/main/res/values-en-rGB/strings-talkback-descriptions.xml b/app/src/main/res/values-en-rGB/strings-talkback-descriptions.xml index 91e653c61..742bbd40b 100644 --- a/app/src/main/res/values-en-rGB/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-en-rGB/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Capital %s" "Capital I" "Capital I, dot above" - "Alternative characters are available" - "Alternative characters are dismissed" + "Alternative characters are available" + "Alternative characters are dismissed" "Alternative suggestions are available" "Alternative suggestions are dismissed" diff --git a/app/src/main/res/values-en-rIN/strings-talkback-descriptions.xml b/app/src/main/res/values-en-rIN/strings-talkback-descriptions.xml index 91e653c61..742bbd40b 100644 --- a/app/src/main/res/values-en-rIN/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-en-rIN/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Capital %s" "Capital I" "Capital I, dot above" - "Alternative characters are available" - "Alternative characters are dismissed" + "Alternative characters are available" + "Alternative characters are dismissed" "Alternative suggestions are available" "Alternative suggestions are dismissed" diff --git a/app/src/main/res/values-en-rXC/strings-talkback-descriptions.xml b/app/src/main/res/values-en-rXC/strings-talkback-descriptions.xml index 77d6fdc13..619295c74 100644 --- a/app/src/main/res/values-en-rXC/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-en-rXC/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‏‎‏‎‏‏‏‏‏‏‏‏‏‏‏‎‎‎‏‎‎‎‎‎‏‎‎‎‏‎‏‏‏‏‎‎‏‏‎‏‎‏‏‎‏‎‏‏‏‏‏‎‏‏‏‎‎‎‎‏‏‎‏‎‎‏‎‎‎‎‎‏‏‏‏‎‎‎Capital ‎‏‎‎‏‏‎%s‎‏‎‎‏‏‏‎‎‏‎‎‏‎" "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‏‎‏‎‏‏‏‏‏‏‏‏‏‏‏‎‎‎‎‎‏‏‏‎‏‎‎‏‏‎‎‎‏‏‎‎‎‏‏‎‏‏‏‏‏‏‏‏‏‎‎‎‎‏‎‏‏‏‏‎‏‎‏‎‏‎‏‎‏‏‎‎‏‏‎‎‎‎Capital I‎‏‎‎‏‎" "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‏‎‏‎‏‏‏‏‏‏‏‏‏‏‏‎‎‎‎‏‎‎‎‏‎‎‏‏‎‎‏‏‎‏‏‏‏‎‏‎‏‎‎‎‎‎‏‎‎‏‎‎‏‎‎‎‎‏‎‎‎‏‎‎‎‏‎‏‏‎‏‏‏‎‎‏‎‎Capital I, dot above‎‏‎‎‏‎" - "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‏‎‏‎‏‏‏‏‏‏‏‏‏‏‏‎‏‏‏‏‎‏‏‎‏‎‎‏‏‎‏‎‏‎‏‎‎‎‎‏‏‏‏‏‎‏‏‎‎‏‏‎‏‏‏‏‏‏‏‏‎‏‎‏‏‏‏‎‏‎‎‎‎‎‎‏‏‎Alternative characters are available‎‏‎‎‏‎" - "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‏‎‏‎‏‏‏‏‏‏‏‏‏‎‏‏‎‎‎‎‏‏‏‎‏‎‏‏‎‎‎‎‎‎‏‏‎‎‏‏‎‏‎‎‏‎‏‎‎‎‎‏‏‏‎‎‎‏‎‎‎‎‎‏‏‏‎‎‏‏‎‏‏‎‏‎‎Alternative characters are dismissed‎‏‎‎‏‎" + "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‏‎‏‎‏‏‏‏‏‏‏‏‏‏‏‎‏‏‏‏‎‏‏‎‏‎‎‏‏‎‏‎‏‎‏‎‎‎‎‏‏‏‏‏‎‏‏‎‎‏‏‎‏‏‏‏‏‏‏‏‎‏‎‏‏‏‏‎‏‎‎‎‎‎‎‏‏‎Alternative characters are available‎‏‎‎‏‎" + "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‏‎‏‎‏‏‏‏‏‏‏‏‏‎‏‏‎‎‎‎‏‏‏‎‏‎‏‏‎‎‎‎‎‎‏‏‎‎‏‏‎‏‎‎‏‎‏‎‎‎‎‏‏‏‎‎‎‏‎‎‎‎‎‏‏‏‎‎‏‏‎‏‏‎‏‎‎Alternative characters are dismissed‎‏‎‎‏‎" "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‏‎‏‎‏‏‏‏‏‏‏‏‏‎‏‏‏‎‏‎‏‎‏‏‏‎‏‎‎‎‎‏‎‏‏‏‏‎‎‎‏‏‏‏‎‎‎‎‎‏‎‎‎‎‎‎‎‎‎‏‎‏‏‏‏‎‎‎‏‎‏‎‎‎‎‎‎Alternative suggestions are available‎‏‎‎‏‎" "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‏‎‏‎‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏‏‎‏‎‎‎‏‎‏‏‎‏‎‎‎‎‏‎‏‏‏‎‎‎‏‏‏‎‏‎‎‏‏‏‎‏‏‎‎‎‏‏‏‎‎‏‏‎‎‏‎‎‎‎‎‏‏‏‎Alternative suggestions are dismissed‎‏‎‎‏‎" diff --git a/app/src/main/res/values-es-rUS/strings-talkback-descriptions.xml b/app/src/main/res/values-es-rUS/strings-talkback-descriptions.xml index 4dd3e0c5c..a2d755159 100644 --- a/app/src/main/res/values-es-rUS/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-es-rUS/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s mayúscula" "I mayúscula" "I mayúscula, con punto superior" - "Hay caracteres alternativos disponibles." - "Los caracteres alternativos se descartan." + "Hay caracteres alternativos disponibles." + "Los caracteres alternativos se descartan." "Hay sugerencias alternativas disponibles." "Las sugerencias alternativas se descartan." diff --git a/app/src/main/res/values-es/strings-talkback-descriptions.xml b/app/src/main/res/values-es/strings-talkback-descriptions.xml index 37f5457cc..c8ede9595 100644 --- a/app/src/main/res/values-es/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-es/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s mayúscula" "I mayúscula" "I maýuscula, punto superior" - "Caracteres alternativos disponibles" - "Los caracteres alternativos se descartarán" + "Caracteres alternativos disponibles" + "Los caracteres alternativos se descartarán" "Sugerencias alternativas disponibles" "Las sugerencias alternativas se descartarán" diff --git a/app/src/main/res/values-et/strings-talkback-descriptions.xml b/app/src/main/res/values-et/strings-talkback-descriptions.xml index 936be3354..5c3668129 100644 --- a/app/src/main/res/values-et/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-et/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Suurtäht %s" "Suurtäht I" "Suurtäht I, ülapunkt" - "Alternatiivsed tähemärgid on saadaval" - "Alternatiivsed tähemärgid eemaldatakse" + "Alternatiivsed tähemärgid on saadaval" + "Alternatiivsed tähemärgid eemaldatakse" "Alternatiivsed soovitused on saadaval" "Alternatiivsed soovitused eemaldatakse" diff --git a/app/src/main/res/values-eu/strings-talkback-descriptions.xml b/app/src/main/res/values-eu/strings-talkback-descriptions.xml index 555b3f8d3..e57bf9573 100644 --- a/app/src/main/res/values-eu/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-eu/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s maiuskula" "I maiuskula" "I maiuskula goi-puntuduna" - "Ordezko karaktereak erabilgarri daude" - "Ordezko karaktereak baztertu dira" + "Ordezko karaktereak erabilgarri daude" + "Ordezko karaktereak baztertu dira" "Ordezko iradokizunak erabilgarri daude" "Ordezko iradokizunak baztertu dira" diff --git a/app/src/main/res/values-fa/strings-talkback-descriptions.xml b/app/src/main/res/values-fa/strings-talkback-descriptions.xml index fb79df247..d3ca3ff20 100644 --- a/app/src/main/res/values-fa/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-fa/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "حرف بزرگ %s" "‏I بزرگ" "‏I بزرگ با نقطه بالایی" - "نویسه‌های جایگزین در دسترس هستند" - "از نویسه‌های جایگزین صرفنظر می‌شود" + "نویسه‌های جایگزین در دسترس هستند" + "از نویسه‌های جایگزین صرفنظر می‌شود" "پیشنهادهای جایگزین در دسترس هستند" "از پیشنهادهای جایگزین صرفنظر می‌شود" diff --git a/app/src/main/res/values-fi/strings-talkback-descriptions.xml b/app/src/main/res/values-fi/strings-talkback-descriptions.xml index c652131f8..19d6a0142 100644 --- a/app/src/main/res/values-fi/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-fi/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Suuraakkonen %s" "Suuraakkonen I" "Suuraakkonen I ja yläpuolinen piste" - "Vaihtoehtoisia merkkejä on saatavilla" - "Vaihtoehtoiset merkit hylättiin" + "Vaihtoehtoisia merkkejä on saatavilla" + "Vaihtoehtoiset merkit hylättiin" "Vaihtoehtoisia ehdotuksia on saatavilla" "Vaihtoehtoiset ehdotukset hylättiin" diff --git a/app/src/main/res/values-fr-rCA/strings-talkback-descriptions.xml b/app/src/main/res/values-fr-rCA/strings-talkback-descriptions.xml index da0785543..4fa6aed34 100644 --- a/app/src/main/res/values-fr-rCA/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-fr-rCA/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s majuscule" "I majuscule" "I majuscule, point en chef" - "Des caractères supplémentaires sont proposés" - "Les caractères supplémentaires sont ignorés" + "Des caractères supplémentaires sont proposés" + "Les caractères supplémentaires sont ignorés" "Des suggestions supplémentaires sont proposées" "Les suggestions supplémentaires sont ignorées" diff --git a/app/src/main/res/values-fr/strings-talkback-descriptions.xml b/app/src/main/res/values-fr/strings-talkback-descriptions.xml index f5a7e77f1..700161fcc 100644 --- a/app/src/main/res/values-fr/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-fr/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s majuscule" "I majuscule" "I majuscule, point en chef" - "Des caractères supplémentaires sont disponibles." - "Les caractères supplémentaires sont ignorés." + "Des caractères supplémentaires sont disponibles." + "Les caractères supplémentaires sont ignorés." "Des suggestions supplémentaires sont disponibles." "Les suggestions supplémentaires sont ignorées." diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 38c98a89c..0d8da4c84 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -211,11 +211,11 @@ Nouveau dictionnaire: Affiche les caractères alternatifs lors d\'un appui long Sélectionner la source des indices Sélectionner l\'ordre des touches des popups - Nombre - Langue - Langue (prioritaire) - Disposition - Symboles + Nombre + Langue + Langue (prioritaire) + Disposition + Symboles Sélectionner les touches de la barre d\'outils Presse-papier Effacer presse-papier @@ -297,10 +297,10 @@ Nouveau dictionnaire: %s (Akkhor) Espace automatique après la ponctuation Insertion automatique d\'un espace après la ponctuation lors de la saisie d\'un nouveau mot - Afficher plus de signes diacritiques dans les popups - Afficher les variantes définies dans les langues du clavier (par défaut) - Ajouter des variantes générales - Ajouter toutes les variantes disponibles + Afficher plus de signes diacritiques dans les popups + Afficher les variantes définies dans les langues du clavier (par défaut) + Ajouter des variantes générales + Ajouter toutes les variantes disponibles Détection d\'URL Essaye de détecter les URL et autres éléments similaires comme un seul mot "Utiliser les langues du système" diff --git a/app/src/main/res/values-gl/strings-talkback-descriptions.xml b/app/src/main/res/values-gl/strings-talkback-descriptions.xml index 43f0b7032..3048f9020 100644 --- a/app/src/main/res/values-gl/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-gl/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s maiúscula" "I maiúscula" "I maiúscula, punto superior" - "Os caracteres alternativos están dispoñibles" - "Descártanse os caracteres alternativos" + "Os caracteres alternativos están dispoñibles" + "Descártanse os caracteres alternativos" "As suxestións alternativas están dispoñibles" "Descártanse as suxestións alternativas" diff --git a/app/src/main/res/values-gu/strings-talkback-descriptions.xml b/app/src/main/res/values-gu/strings-talkback-descriptions.xml index 482ffbd6e..d3313b91d 100644 --- a/app/src/main/res/values-gu/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-gu/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "કેપિટલ %s" "કેપિટલ I" "કેપિટલ I, ઉપર ડોટ" - "વૈકલ્પિક અક્ષરો ઉપલબ્ધ છે" - "વૈકલ્પિક અક્ષરો કાઢી નાખવામાં આવે છે" + "વૈકલ્પિક અક્ષરો ઉપલબ્ધ છે" + "વૈકલ્પિક અક્ષરો કાઢી નાખવામાં આવે છે" "વૈકલ્પિક સૂચનો ઉપલબ્ધ છે" "વૈકલ્પિક સૂચનો કાઢી નાખવામાં આવે છે" diff --git a/app/src/main/res/values-hi/strings-talkback-descriptions.xml b/app/src/main/res/values-hi/strings-talkback-descriptions.xml index b12579836..346a597bf 100644 --- a/app/src/main/res/values-hi/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-hi/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "बड़ा %s" "बड़ा आई" "बड़ा आई, बिंदु ऊपर" - "वैकल्पिक वर्ण उपलब्ध हैं" - "वैकल्पिक वर्ण ख़ारिज कर दिए जाते हैं" + "वैकल्पिक वर्ण उपलब्ध हैं" + "वैकल्पिक वर्ण ख़ारिज कर दिए जाते हैं" "वैकल्पिक सुझाव उपलब्ध हैं" "वैकल्पिक सुझाव ख़ारिज कर दिए जाते हैं" diff --git a/app/src/main/res/values-hr/strings-talkback-descriptions.xml b/app/src/main/res/values-hr/strings-talkback-descriptions.xml index 11fad586b..d35827f3d 100644 --- a/app/src/main/res/values-hr/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-hr/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Veliko slovo %s" "Veliko slovo I" "Veliko slovo I, s točkicom iznad" - "Dostupni su zamjenski znakovi" - "Zamjenski su znakovi isključeni" + "Dostupni su zamjenski znakovi" + "Zamjenski su znakovi isključeni" "Dostupni su zamjenski prijedlozi" "Zamjenski su prijedlozi isključeni" diff --git a/app/src/main/res/values-hu/strings-talkback-descriptions.xml b/app/src/main/res/values-hu/strings-talkback-descriptions.xml index 5ec25c74e..92e591ef4 100644 --- a/app/src/main/res/values-hu/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-hu/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Nagy %s" "Nagy I" "Nagy I, felette ponttal" - "Az alternatív karakterek elérhetők" - "Az alternatív karakterek billentyűzete bezárva" + "Az alternatív karakterek elérhetők" + "Az alternatív karakterek billentyűzete bezárva" "Az alternatív javaslatok elérhetők" "Az alternatív javaslatok panel bezárva" diff --git a/app/src/main/res/values-hy/strings-talkback-descriptions.xml b/app/src/main/res/values-hy/strings-talkback-descriptions.xml index 27357c5de..137715568 100644 --- a/app/src/main/res/values-hy/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-hy/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Մեծատառ %s" "Մեծատառ I" "Մեծատառ I, վերևում կետիկ" - "Լրացուցիչ տառանշաններով ստեղնաշարը հասանելի է" - "Լրացուցիչ տառանշաններով ստեղնաշարը փակված է" + "Լրացուցիչ տառանշաններով ստեղնաշարը հասանելի է" + "Լրացուցիչ տառանշաններով ստեղնաշարը փակված է" "Լրացուցիչ հուշումներով վահանակը հասանելի է" "Լրացուցիչ հուշումներով վահանակը փակված է" diff --git a/app/src/main/res/values-in/strings-talkback-descriptions.xml b/app/src/main/res/values-in/strings-talkback-descriptions.xml index f25b7d800..b785282f1 100644 --- a/app/src/main/res/values-in/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-in/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Huruf kapital %s" "Huruf kapital I" "Huruf kapital I dengan aksen titik di bagian atas" - "Karakter alternatif tersedia" - "Karakter alternatif ditolak" + "Karakter alternatif tersedia" + "Karakter alternatif ditolak" "Saran alternatif tersedia" "Saran alternatif ditolak" diff --git a/app/src/main/res/values-is/strings-talkback-descriptions.xml b/app/src/main/res/values-is/strings-talkback-descriptions.xml index 70475f956..2a68f4002 100644 --- a/app/src/main/res/values-is/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-is/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Hástafurinn %s" "Hástafurinn I" "Hástafurinn I með depli" - "Aukalegir stafir eru í boði" - "Aukalegum stöfum lokað" + "Aukalegir stafir eru í boði" + "Aukalegum stöfum lokað" "Aukalegar tillögur eru í boði" "Aukalegum tillögum lokað" diff --git a/app/src/main/res/values-it/strings-talkback-descriptions.xml b/app/src/main/res/values-it/strings-talkback-descriptions.xml index edbc4e39f..c28e7164f 100644 --- a/app/src/main/res/values-it/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-it/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s maiuscola" "I maiuscola" "I maiuscola, punto sovrascritto" - "Sono disponibili caratteri alternativi" - "I caratteri alternativi vengono ignorati" + "Sono disponibili caratteri alternativi" + "I caratteri alternativi vengono ignorati" "Sono disponibili suggerimenti alternativi" "I suggerimenti alternativi vengono ignorati" diff --git a/app/src/main/res/values-iw/strings-talkback-descriptions.xml b/app/src/main/res/values-iw/strings-talkback-descriptions.xml index ba1588a5a..3f5f1ceee 100644 --- a/app/src/main/res/values-iw/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-iw/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s גדולה" "‏I גדולה" "‏I גדולה, נקודה מעל" - "תווים חלופיים זמינים" - "תווים חלופיים נדחים" + "תווים חלופיים זמינים" + "תווים חלופיים נדחים" "הצעות חלופיות זמינות" "הצעות חלופיות נדחות" diff --git a/app/src/main/res/values-ja/strings-talkback-descriptions.xml b/app/src/main/res/values-ja/strings-talkback-descriptions.xml index ec61d0391..87f55825f 100644 --- a/app/src/main/res/values-ja/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-ja/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "大文字%s" "大文字I" "大文字I、上点" - "代替文字が利用可能です" - "代替文字が消去されます" + "代替文字が利用可能です" + "代替文字が消去されます" "代替候補が利用可能です" "代替候補が消去されます" diff --git a/app/src/main/res/values-ka/strings-talkback-descriptions.xml b/app/src/main/res/values-ka/strings-talkback-descriptions.xml index 345cb6328..a9ef42a17 100644 --- a/app/src/main/res/values-ka/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-ka/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "დიდი %s" "დიდი I" "Capital I, dot above" - "ალტერნატიული სიმბოლოები ხელმისაწვდომია" - "ალტერნატიული სიმბოლოები გამოტოვებულია" + "ალტერნატიული სიმბოლოები ხელმისაწვდომია" + "ალტერნატიული სიმბოლოები გამოტოვებულია" "ალტერნატიული შეთავაზებები ხელმისაწვდომია" "ალტერნატიული შეთავაზებები გამოტოვებულია" diff --git a/app/src/main/res/values-kk/strings-talkback-descriptions.xml b/app/src/main/res/values-kk/strings-talkback-descriptions.xml index 16ccfccbd..d4bab9d15 100644 --- a/app/src/main/res/values-kk/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-kk/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Бас %s" "Бас I" "Үстінде нүктесі бар бас I" - "Баламалы таңбалар қол жетімді" - "Баламалы таңбалар еленбейді" + "Баламалы таңбалар қол жетімді" + "Баламалы таңбалар еленбейді" "Баламалы ұсыныстар қол жетімді" "Баламалы ұсыныстар еленбейді" diff --git a/app/src/main/res/values-km/strings-talkback-descriptions.xml b/app/src/main/res/values-km/strings-talkback-descriptions.xml index 8f6636af3..f91f0685f 100644 --- a/app/src/main/res/values-km/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-km/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "អក្សរ​ធំ %s" "I ធំ" "I ធំមានចំណុចពីលើ" - "តួអក្សរ​ជំនួស​អាច​ប្រើ​បាន" - "បាន​បដិសេធ​តួអក្សរ​ជំនួស" + "តួអក្សរ​ជំនួស​អាច​ប្រើ​បាន" + "បាន​បដិសេធ​តួអក្សរ​ជំនួស" "ការ​ស្នើ​ជំនួស​អាច​ប្រើ​បាន" "បាន​បដិសេធ​ការ​ស្នើ​ជំនួស" diff --git a/app/src/main/res/values-kn/strings-talkback-descriptions.xml b/app/src/main/res/values-kn/strings-talkback-descriptions.xml index c74ab730f..63aea412e 100644 --- a/app/src/main/res/values-kn/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-kn/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "ಕ್ಯಾಪಿಟಲ್ %s" "ಕ್ಯಾಪಿಟಲ್ I" "ಕ್ಯಾಪಿಟಲ್ I, ಮೇಲೆ ಡಾಟ್" - "ಪರ್ಯಾಯ ಅಕ್ಷರಗಳು ಲಭ್ಯ" - "ಪರ್ಯಾಯ ಅಕ್ಷರಗಳನ್ನು ವಜಾಗೊಳಿಸಲಾಗಿದೆ" + "ಪರ್ಯಾಯ ಅಕ್ಷರಗಳು ಲಭ್ಯ" + "ಪರ್ಯಾಯ ಅಕ್ಷರಗಳನ್ನು ವಜಾಗೊಳಿಸಲಾಗಿದೆ" "ಪರ್ಯಾಯ ಸಲಹೆಗಳು ಲಭ್ಯ" "ಪರ್ಯಾಯ ಸಲಹೆಗಳನ್ನು ವಜಾಗೊಳಿಸಲಾಗಿದೆ" diff --git a/app/src/main/res/values-ko/strings-talkback-descriptions.xml b/app/src/main/res/values-ko/strings-talkback-descriptions.xml index e74a8c7bc..53fb400a1 100644 --- a/app/src/main/res/values-ko/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-ko/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "대문자 %s" "대문자 아이" "대문자 아이, 위 닷" - "대체 문자를 사용할 수 있습니다" - "대체 문자를 닫았습니다." + "대체 문자를 사용할 수 있습니다" + "대체 문자를 닫았습니다." "대체 추천 단어를 사용할 수 있습니다" "대체 추천 단어를 닫았습니다." diff --git a/app/src/main/res/values-ky/strings-talkback-descriptions.xml b/app/src/main/res/values-ky/strings-talkback-descriptions.xml index a031c778a..23582d557 100644 --- a/app/src/main/res/values-ky/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-ky/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Баш тамга %s" "Баш тамга I" "Баш тамга I, төбөсүндө чекити бар" - "Альтернативалуу белгилер бар" - "Альтернативалуу белгилер этибарга алынбайт" + "Альтернативалуу белгилер бар" + "Альтернативалуу белгилер этибарга алынбайт" "Альтернативалуу сунуштар бар" "Альтернативалуу сунуштар этибарга алынбайт" diff --git a/app/src/main/res/values-land/config.xml b/app/src/main/res/values-land/config.xml index e76609454..f68b9a5c7 100644 --- a/app/src/main/res/values-land/config.xml +++ b/app/src/main/res/values-land/config.xml @@ -14,11 +14,11 @@ 176.0dp 45%p - - 44.8dp + + 44.8dp - - 53.76dp + + 53.76dp 2.727%p 0.0%p @@ -26,8 +26,8 @@ 1.020%p 4.85%p 0.920%p - - -22.4dp + + -22.4dp 1.6dp 80dp 0dp diff --git a/app/src/main/res/values-lo/strings-talkback-descriptions.xml b/app/src/main/res/values-lo/strings-talkback-descriptions.xml index 6d2130cfc..9c84f3847 100644 --- a/app/src/main/res/values-lo/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-lo/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "ໂຕ​ພິມ​ໃຫຍ່ %s" "ໂຕ​ພິມ​ໃຫຍ່ I" "​ໂຕພິມ​ໃຫຍ່ I ມີ​ຈ້ຳ​ເມັດ​ຢູ່​ເທິງ" - "​ມີ​ໂຕ​ອັກ​ສອນ​ສຳ​ຮອງ​ໃຫ້​ເລືອກ" - "​ປິດ​ໂຕ​ອັກ​ສອນ​ສຳ​ຮອງ​ແລ້ວ" + "​ມີ​ໂຕ​ອັກ​ສອນ​ສຳ​ຮອງ​ໃຫ້​ເລືອກ" + "​ປິດ​ໂຕ​ອັກ​ສອນ​ສຳ​ຮອງ​ແລ້ວ" "​ມີ​ຄຳ​ແນະ​ນຳ​ສຳ​ຮອງ​ໃຫ້​ເລືອກ" "​ປິດ​ການ​ແນະ​ນຳ​ສຳ​ຮອງ​ແລ້ວ" diff --git a/app/src/main/res/values-lt/strings-talkback-descriptions.xml b/app/src/main/res/values-lt/strings-talkback-descriptions.xml index b5e2615f9..de1d7def4 100644 --- a/app/src/main/res/values-lt/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-lt/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Didžioji %s" "Didžioji I" "Didžioji I su tašku viršuje" - "Alternatyvūs ženklai pasiekiami" - "Alternatyvūs simboliai atmetami" + "Alternatyvūs ženklai pasiekiami" + "Alternatyvūs simboliai atmetami" "Alternatyvūs pasiūlymai pasiekiami" "Alternatyvūs pasiūlymai atmetami" diff --git a/app/src/main/res/values-lv/strings-talkback-descriptions.xml b/app/src/main/res/values-lv/strings-talkback-descriptions.xml index 4c82dc7cf..d2066ead3 100644 --- a/app/src/main/res/values-lv/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-lv/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Lielais burts “%s”" "Lielais burts “I”" "Lielais burts “I” ar punktu virs tā" - "Ir pieejamas alternatīvas rakstzīmes." - "Alternatīvās rakstzīmes netiek rādītas." + "Ir pieejamas alternatīvas rakstzīmes." + "Alternatīvās rakstzīmes netiek rādītas." "Ir pieejami alternatīvi ieteikumi." "Alternatīvie ieteikumi netiek rādīti." diff --git a/app/src/main/res/values-mk/strings-talkback-descriptions.xml b/app/src/main/res/values-mk/strings-talkback-descriptions.xml index 17c819041..322079066 100644 --- a/app/src/main/res/values-mk/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-mk/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Голема буква %s" "Голема буква I" "Голема буква I, со точка одозгора" - "Достапни се алтернативни знаци" - "Алтернативните знаци се отфрлени" + "Достапни се алтернативни знаци" + "Алтернативните знаци се отфрлени" "Достапни се алтернативни предлози" "Алтернативните предлози се отфрлени" diff --git a/app/src/main/res/values-ml/strings-talkback-descriptions.xml b/app/src/main/res/values-ml/strings-talkback-descriptions.xml index 78a12dbc6..a824c9ad0 100644 --- a/app/src/main/res/values-ml/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-ml/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "വലിയക്ഷരം %s" "വലിയക്ഷരം I" "വലിയക്ഷരം I, മുകളിൽ ഡോട്ട്" - "ഇതര പ്രതീകങ്ങൾ ലഭ്യമാണ്" - "ഇതര പ്രതീകങ്ങൾ നിരസിച്ചു" + "ഇതര പ്രതീകങ്ങൾ ലഭ്യമാണ്" + "ഇതര പ്രതീകങ്ങൾ നിരസിച്ചു" "ഇതര നിർദ്ദേശങ്ങൾ ലഭ്യമാണ്" "ഇതര നിർദ്ദേശങ്ങൾ നിരസിച്ചു" diff --git a/app/src/main/res/values-mn/strings-talkback-descriptions.xml b/app/src/main/res/values-mn/strings-talkback-descriptions.xml index daa2f675f..5b9287c92 100644 --- a/app/src/main/res/values-mn/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-mn/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Том %s" "Том I" "Том I, дээрээ цэгтэй" - "Бусад тэмдэгтүүд ашиглах боломжтой" - "Бусад тэмдэгтүүдийг хаагдсан" + "Бусад тэмдэгтүүд ашиглах боломжтой" + "Бусад тэмдэгтүүдийг хаагдсан" "Бусад санал болголтууд ашиглах боломжтой" "Бусад санал болголтууд хаагдсан" diff --git a/app/src/main/res/values-mr/strings-talkback-descriptions.xml b/app/src/main/res/values-mr/strings-talkback-descriptions.xml index 29feb88bc..e0a1dd73f 100644 --- a/app/src/main/res/values-mr/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-mr/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "कॅपिटल %s" "कॅपिटल आय" "कॅपिटल आय, वर बिंदू" - "वैकल्पिक वर्ण उपलब्ध आहेत" - "वैकल्पिक वर्ण डिसमिस केले आहेत" + "वैकल्पिक वर्ण उपलब्ध आहेत" + "वैकल्पिक वर्ण डिसमिस केले आहेत" "वैकल्पिक सूचना उपलब्ध आहेत" "वैकल्पिक सूचना डिसमिस केलेल्या आहेत" diff --git a/app/src/main/res/values-ms/strings-talkback-descriptions.xml b/app/src/main/res/values-ms/strings-talkback-descriptions.xml index 87ff84361..8ef81b6de 100644 --- a/app/src/main/res/values-ms/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-ms/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Huruf besar %s" "I huruf besar" "I huruf besar, titik di atas" - "Aksara alternatif adalah tersedia" - "Aksara alternatif diketepikan" + "Aksara alternatif adalah tersedia" + "Aksara alternatif diketepikan" "Cadangan alternatif tersedia" "Cadangan alternatif diketepikan" diff --git a/app/src/main/res/values-my/strings-talkback-descriptions.xml b/app/src/main/res/values-my/strings-talkback-descriptions.xml index bde1c93f8..85f789595 100644 --- a/app/src/main/res/values-my/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-my/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "စာလုံးကြီး %s" "I အကြီး" "I အကြီး၊ အပေါ်မှာ အစက်" - "အစားထိုးစရာ စာလုံးများ ရှိနိုင်" - "အစားထိုးစရာ စာလုံးများကို ပယ်ထား" + "အစားထိုးစရာ စာလုံးများ ရှိနိုင်" + "အစားထိုးစရာ စာလုံးများကို ပယ်ထား" "အစားထိုးစရာ အကြံပေးချက်များ ရှိနိုင်" "အစားထိုးစရာ အကြံပေးချက်များကို ပယ်ထား" diff --git a/app/src/main/res/values-nb/strings-talkback-descriptions.xml b/app/src/main/res/values-nb/strings-talkback-descriptions.xml index 7d84439f9..715bd242c 100644 --- a/app/src/main/res/values-nb/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-nb/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Stor %s" "Stor I" "Stor I med prikk over" - "Alternative tegn er tilgjengelige" - "Alternative tegn fjernes" + "Alternative tegn er tilgjengelige" + "Alternative tegn fjernes" "Alternative forslag er tilgjengelige" "Alternative forslag fjernes" diff --git a/app/src/main/res/values-ne/strings-talkback-descriptions.xml b/app/src/main/res/values-ne/strings-talkback-descriptions.xml index aae3b5e69..5cf849c54 100644 --- a/app/src/main/res/values-ne/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-ne/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Capital %s" "Capital I" "Capital I, dot above" - "वैकल्पिक वर्णहरू उपलब्ध छन्" - "वैकल्पिक वर्णहरू खारेज गरियो" + "वैकल्पिक वर्णहरू उपलब्ध छन्" + "वैकल्पिक वर्णहरू खारेज गरियो" "वैकल्पिक सुझावहरू उपलब्ध छन्" "वैकल्पिक सुझावहरू खारिज गरियो" diff --git a/app/src/main/res/values-nl/strings-talkback-descriptions.xml b/app/src/main/res/values-nl/strings-talkback-descriptions.xml index 0a54b3c0a..11bfbe4da 100644 --- a/app/src/main/res/values-nl/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-nl/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Hoofdletter %s" "Hoofdletter I" "Hoofdletter I, punt erboven" - "Alternatieve tekens zijn beschikbaar" - "Alternatieve tekens worden verwijderd" + "Alternatieve tekens zijn beschikbaar" + "Alternatieve tekens worden verwijderd" "Alternatieve suggesties zijn beschikbaar" "Alternatieve suggesties worden verwijderd" diff --git a/app/src/main/res/values-pa/strings-talkback-descriptions.xml b/app/src/main/res/values-pa/strings-talkback-descriptions.xml index 9d3c2cf22..1360b80bf 100644 --- a/app/src/main/res/values-pa/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-pa/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "ਕੈਪੀਟਲ %s" "ਕੈਪੀਟਲ I" "ਕੈਪੀਟਲ I, ਉੱਪਰ ਬਿੰਦੀ" - "ਬਦਲਵੇਂ ਅੱਖਰ ਉਪਲਬਧ ਹਨ" - "ਬਦਲਵੇਂ ਅੱਖਰ ਖਾਰਜ ਕੀਤੇ ਗਏ ਹਨ" + "ਬਦਲਵੇਂ ਅੱਖਰ ਉਪਲਬਧ ਹਨ" + "ਬਦਲਵੇਂ ਅੱਖਰ ਖਾਰਜ ਕੀਤੇ ਗਏ ਹਨ" "ਬਦਲਵੇਂ ਸੁਝਾਅ ਉਪਲਬਧ ਹਨ" "ਬਦਲਵੇਂ ਸੁਝਾਅ ਬਰਖਾਸਤ ਕੀਤੇ ਗਏ ਹਨ" diff --git a/app/src/main/res/values-pl/strings-talkback-descriptions.xml b/app/src/main/res/values-pl/strings-talkback-descriptions.xml index fa90cd3a8..b36aa7639 100644 --- a/app/src/main/res/values-pl/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-pl/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Wielka litera %s" "Wielka litera I" "Wielka litera I z kropką" - "Alternatywne znaki są dostępne" - "Alternatywne znaki zostały zamknięte" + "Alternatywne znaki są dostępne" + "Alternatywne znaki zostały zamknięte" "Alternatywne propozycje są dostępne" "Alternatywne propozycje zostały zamknięte" diff --git a/app/src/main/res/values-pt-rPT/strings-talkback-descriptions.xml b/app/src/main/res/values-pt-rPT/strings-talkback-descriptions.xml index d448c866a..d6ba3a26f 100644 --- a/app/src/main/res/values-pt-rPT/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-pt-rPT/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s maiúsculo" "I maiúsculo" "I maiúsculo, ponto sobreposto" - "Os carateres alternativos estão disponíveis" - "Os carateres alternativos são ignorados" + "Os carateres alternativos estão disponíveis" + "Os carateres alternativos são ignorados" "As sugestões alternativas estão disponíveis" "As sugestões alternativas são ignoradas" diff --git a/app/src/main/res/values-pt/strings-talkback-descriptions.xml b/app/src/main/res/values-pt/strings-talkback-descriptions.xml index b19a9042b..4d0195ccc 100644 --- a/app/src/main/res/values-pt/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-pt/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s maiúscula" "I maiúscula" "I maiúscula, ponto acima" - "Caracteres alternativos estão disponíveis" - "Caracteres alternativos foram descartados" + "Caracteres alternativos estão disponíveis" + "Caracteres alternativos foram descartados" "Sugestões alternativas estão disponíveis" "Sugestões alternativas foram descartadas" diff --git a/app/src/main/res/values-ro/strings-talkback-descriptions.xml b/app/src/main/res/values-ro/strings-talkback-descriptions.xml index 45a842e83..32b34bcf4 100644 --- a/app/src/main/res/values-ro/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-ro/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s mare" "I mare" "I mare, punct deasupra" - "Sunt disponibile caractere alternative" - "S-au închis caracterele alternative" + "Sunt disponibile caractere alternative" + "S-au închis caracterele alternative" "Sunt disponibile sugestii alternative" "S-au închis sugestiile alternative" diff --git a/app/src/main/res/values-ru/strings-talkback-descriptions.xml b/app/src/main/res/values-ru/strings-talkback-descriptions.xml index 0fb8ec61e..5c97fca93 100644 --- a/app/src/main/res/values-ru/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-ru/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Заглавная %s." "Заглавная латинская I." "Заглавная латинская I с точкой сверху." - "Доступны дополнительные символы." - "Дополнительные символы скрыты." + "Доступны дополнительные символы." + "Дополнительные символы скрыты." "Доступны дополнительные подсказки." "Дополнительные подсказки скрыты." diff --git a/app/src/main/res/values-si/strings-talkback-descriptions.xml b/app/src/main/res/values-si/strings-talkback-descriptions.xml index d560fbcde..42fa5082b 100644 --- a/app/src/main/res/values-si/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-si/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "ලොකු %s" "ලොකු I" "ලොකු I, ඉහළින් තිත" - "විකල්ප අකුරු තිබේ" - "විකල්ප අකුරු අස් කරන ලදි" + "විකල්ප අකුරු තිබේ" + "විකල්ප අකුරු අස් කරන ලදි" "විකල්ප යෝජනා තිබේ" "විකල්ප යෝජනා අස් කරන ලදි" diff --git a/app/src/main/res/values-sk/strings-talkback-descriptions.xml b/app/src/main/res/values-sk/strings-talkback-descriptions.xml index 62b0fa6f0..dee1ad47e 100644 --- a/app/src/main/res/values-sk/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-sk/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Veľké písmeno – %s" "Veľké I" "Veľké I s bodkou nad písmenom" - "Alternatívne znaky sú dostupné" - "Alternatívne znaky boli zrušené" + "Alternatívne znaky sú dostupné" + "Alternatívne znaky boli zrušené" "Alternatívne návrhy sú dostupné" "Alternatívne návrhy boli zrušené" diff --git a/app/src/main/res/values-sl/strings-talkback-descriptions.xml b/app/src/main/res/values-sl/strings-talkback-descriptions.xml index 25ede4623..cd2773aad 100644 --- a/app/src/main/res/values-sl/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-sl/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Velika črka %s" "Velika črka I" "Velika črka I s piko zgoraj" - "Nadomestni znaki so na voljo" - "Nadomestni znaki se ne upoštevajo" + "Nadomestni znaki so na voljo" + "Nadomestni znaki se ne upoštevajo" "Nadomestni predlogi so na voljo" "Nadomestni predlogi se ne upoštevajo" diff --git a/app/src/main/res/values-sq/strings-talkback-descriptions.xml b/app/src/main/res/values-sq/strings-talkback-descriptions.xml index 8ed05a4fb..2a23fabf6 100644 --- a/app/src/main/res/values-sq/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-sq/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Kapitalja e %s" "I e madhe" "I e madhe me pikë sipër" - "Karaktere alternative mundësohen gjithashtu" - "Karakteret alternative hiqen" + "Karaktere alternative mundësohen gjithashtu" + "Karakteret alternative hiqen" "Sugjerime alternative mundësohen gjithashtu" "Sugjerimet alternative hiqen" diff --git a/app/src/main/res/values-sr/strings-talkback-descriptions.xml b/app/src/main/res/values-sr/strings-talkback-descriptions.xml index 36b7cd912..732ed6cf5 100644 --- a/app/src/main/res/values-sr/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-sr/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Велико %s" "Велико И" "Велико И са тачком изнад" - "Доступни су алтернативни знаци" - "Алтернативни знаци су одбачени" + "Доступни су алтернативни знаци" + "Алтернативни знаци су одбачени" "Доступни су алтернативни предлози" "Алтернативни предлози су одбачени" diff --git a/app/src/main/res/values-sv/strings-talkback-descriptions.xml b/app/src/main/res/values-sv/strings-talkback-descriptions.xml index 1cb559792..591d05a94 100644 --- a/app/src/main/res/values-sv/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-sv/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Versalt %s" "Versalt I" "Versalt I, punkt ovanför" - "Alternativa tecken är tillgängliga" - "Alternativa tecken avvisas" + "Alternativa tecken är tillgängliga" + "Alternativa tecken avvisas" "Alternativa förslag är tillgängliga" "Alternativa förslag avvisas" diff --git a/app/src/main/res/values-sw/strings-talkback-descriptions.xml b/app/src/main/res/values-sw/strings-talkback-descriptions.xml index f4a3d7e3a..331fafc61 100644 --- a/app/src/main/res/values-sw/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-sw/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Herufi kubwa %s" "Herufi I kubwa" "Herufi I kubwa, alama ya kitone inayowekwa sehemu ya juu ya herufi katika alfabeti za Kilatini na Kivietnamu" - "Herufi mbadala zinapatikana" - "Herufi mbadala huondolewa" + "Herufi mbadala zinapatikana" + "Herufi mbadala huondolewa" "Mapendekezo mbadala yanapatikana" "Mapendekezo mbadala huondolewa" diff --git a/app/src/main/res/values-sw430dp/config-per-form-factor.xml b/app/src/main/res/values-sw430dp/config-per-form-factor.xml index f14687b19..d87ffcefb 100644 --- a/app/src/main/res/values-sw430dp/config-per-form-factor.xml +++ b/app/src/main/res/values-sw430dp/config-per-form-factor.xml @@ -12,8 +12,8 @@ true false true - - false + false false diff --git a/app/src/main/res/values-sw600dp-land/config.xml b/app/src/main/res/values-sw600dp-land/config.xml index 53cfc4426..9d00149e4 100644 --- a/app/src/main/res/values-sw600dp-land/config.xml +++ b/app/src/main/res/values-sw600dp-land/config.xml @@ -12,7 +12,7 @@ 283.5dp 40%p - 81.9dp + 81.9dp 2.727%p 0.0%p diff --git a/app/src/main/res/values-sw600dp/config-per-form-factor.xml b/app/src/main/res/values-sw600dp/config-per-form-factor.xml index 8b5d49d53..21942e781 100644 --- a/app/src/main/res/values-sw600dp/config-per-form-factor.xml +++ b/app/src/main/res/values-sw600dp/config-per-form-factor.xml @@ -12,8 +12,8 @@ false false false - - false + false false diff --git a/app/src/main/res/values-sw600dp/config.xml b/app/src/main/res/values-sw600dp/config.xml index 2cf35ae8a..3fac28c12 100644 --- a/app/src/main/res/values-sw600dp/config.xml +++ b/app/src/main/res/values-sw600dp/config.xml @@ -18,11 +18,11 @@ 46%p -35.0%p - 63.0dp - 6dp + 63.0dp + 6dp - 98.3dp + 98.3dp 2.335%p 4.0%p @@ -31,7 +31,7 @@ 4.5%p 1.565%p - -31.5dp + -31.5dp 50% 42% diff --git a/app/src/main/res/values-sw768dp-land/config.xml b/app/src/main/res/values-sw768dp-land/config.xml index fadf0ca90..a31505101 100644 --- a/app/src/main/res/values-sw768dp-land/config.xml +++ b/app/src/main/res/values-sw768dp-land/config.xml @@ -19,7 +19,7 @@ 3.690%p 1.030%p - 81.9dp + 81.9dp 43% 50% diff --git a/app/src/main/res/values-sw768dp/config-per-form-factor.xml b/app/src/main/res/values-sw768dp/config-per-form-factor.xml index 898dc94d9..49f7e17c4 100644 --- a/app/src/main/res/values-sw768dp/config-per-form-factor.xml +++ b/app/src/main/res/values-sw768dp/config-per-form-factor.xml @@ -12,8 +12,8 @@ false false false - - true + true false diff --git a/app/src/main/res/values-sw768dp/config.xml b/app/src/main/res/values-sw768dp/config.xml index 150908d1b..578de4d85 100644 --- a/app/src/main/res/values-sw768dp/config.xml +++ b/app/src/main/res/values-sw768dp/config.xml @@ -19,14 +19,14 @@ 1.066%p 3.312%p 1.066%p - - -31.5dp + + -31.5dp - 63.0dp - 12dp + 63.0dp + 12dp - - 98.3dp + + 98.3dp 50% 40% diff --git a/app/src/main/res/values-ta/strings-talkback-descriptions.xml b/app/src/main/res/values-ta/strings-talkback-descriptions.xml index aa86492fb..90b84b907 100644 --- a/app/src/main/res/values-ta/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-ta/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "பேரெழுத்து %s" "பேரெழுத்து I" "பேரெழுத்து I, மேல் புள்ளி" - "மாற்று எழுத்துக்குறிகள் உள்ளன" - "மாற்று எழுத்துக்குறிகள் நிராகரிக்கப்பட்டன" + "மாற்று எழுத்துக்குறிகள் உள்ளன" + "மாற்று எழுத்துக்குறிகள் நிராகரிக்கப்பட்டன" "மாற்று பரிந்துரைகள் உள்ளன" "மாற்று பரிந்துரைகள் நிராகரிக்கப்பட்டன" diff --git a/app/src/main/res/values-te/strings-talkback-descriptions.xml b/app/src/main/res/values-te/strings-talkback-descriptions.xml index c2564167c..ed96df904 100644 --- a/app/src/main/res/values-te/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-te/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "క్యాపిటల్ %s" "క్యాపిటల్ I" "క్యాపిటల్ I, ఎగువన చుక్క" - "ప్రత్యామ్నాయ అక్షరాలు అందుబాటులో ఉన్నాయి" - "ప్రత్యామ్నాయ అక్షరాలు తీసివేయబడ్డాయి" + "ప్రత్యామ్నాయ అక్షరాలు అందుబాటులో ఉన్నాయి" + "ప్రత్యామ్నాయ అక్షరాలు తీసివేయబడ్డాయి" "ప్రత్యామ్నాయ సూచనలు అందుబాటులో ఉన్నాయి" "ప్రత్యామ్నాయ సూచనలు తీసివేయబడ్డాయి" diff --git a/app/src/main/res/values-th/strings-talkback-descriptions.xml b/app/src/main/res/values-th/strings-talkback-descriptions.xml index 72dfed36f..ad17bb60c 100644 --- a/app/src/main/res/values-th/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-th/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s ตัวใหญ่" "I ตัวใหญ่" "I ตัวใหญ่เติมจุดด้านบน" - "อักขระทางเลือกพร้อมใช้งาน" - "ปิดอักขระทางเลือกแล้ว" + "อักขระทางเลือกพร้อมใช้งาน" + "ปิดอักขระทางเลือกแล้ว" "ข้อเสนอแนะทางเลือกพร้อมใช้งาน" "ปิดข้อเสนอแนะทางเลือกแล้ว" diff --git a/app/src/main/res/values-tl/strings-talkback-descriptions.xml b/app/src/main/res/values-tl/strings-talkback-descriptions.xml index e5469cad3..50466050f 100644 --- a/app/src/main/res/values-tl/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-tl/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Capital %s" "Capital I" "Capital I, tuldok sa itaas" - "Available ang mga alternatibong character" - "Dini-dismiss ang mga alternatibong character" + "Available ang mga alternatibong character" + "Dini-dismiss ang mga alternatibong character" "Available ang mga alternatibong suhestyon" "Dini-dismiss ang mga alternatibong suhestyon" diff --git a/app/src/main/res/values-tr/strings-talkback-descriptions.xml b/app/src/main/res/values-tr/strings-talkback-descriptions.xml index 755d119af..11442ef93 100644 --- a/app/src/main/res/values-tr/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-tr/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Büyük Harf %s" "Büyük Harf I" "Büyük Harf I, üst noktalı" - "Alternatif karakterler kullanılabilir" - "Alternatif karakterler yoksayılır" + "Alternatif karakterler kullanılabilir" + "Alternatif karakterler yoksayılır" "Alternatif öneriler kullanılabilir" "Alternatif öneriler yoksayılır" diff --git a/app/src/main/res/values-uk/strings-talkback-descriptions.xml b/app/src/main/res/values-uk/strings-talkback-descriptions.xml index 8827e382c..86a62bba0 100644 --- a/app/src/main/res/values-uk/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-uk/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Велика %s" "Велика I" "Велика I, крапка вгорі" - "Доступні альтернативні символи" - "Альтернативні символи відхилено" + "Доступні альтернативні символи" + "Альтернативні символи відхилено" "Доступні альтернативні пропозиції" "Альтернативні пропозиції відхилено" diff --git a/app/src/main/res/values-ur/strings-talkback-descriptions.xml b/app/src/main/res/values-ur/strings-talkback-descriptions.xml index 63f70e3b7..7707c59a5 100644 --- a/app/src/main/res/values-ur/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-ur/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "بڑی %s" "‏بڑی I" "‏بڑی I، اوپر ڈاٹ" - "متبادل حروف دستیاب ہیں" - "متبادل حروف کو مسترد کر دیا گیا ہے" + "متبادل حروف دستیاب ہیں" + "متبادل حروف کو مسترد کر دیا گیا ہے" "متبادل تجاویز دستیاب ہیں" "متبادل تجاویز کو مسترد کر دیا گیا ہے" diff --git a/app/src/main/res/values-uz/strings-talkback-descriptions.xml b/app/src/main/res/values-uz/strings-talkback-descriptions.xml index cca79d7c3..b2c169eb7 100644 --- a/app/src/main/res/values-uz/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-uz/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Bosh harf bilan yozilgan %s" "Katta I harfi" "Tepasida nuqtasi bor katta I harfi" - "Muqobil belgilar mavjud" - "Muqobil belgilar tushirib qoldirildi" + "Muqobil belgilar mavjud" + "Muqobil belgilar tushirib qoldirildi" "Muqobil takliflar mavjud" "Muqobil takliflar tushirib qoldirildi" diff --git a/app/src/main/res/values-vi/strings-talkback-descriptions.xml b/app/src/main/res/values-vi/strings-talkback-descriptions.xml index 155eb5ba0..15831a2e1 100644 --- a/app/src/main/res/values-vi/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-vi/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "%s hoa" "I hoa" "I hoa, dấu chấm phía trên" - "Có ký tự thay thế" - "Ký tự thay thế đã bị loại bỏ" + "Có ký tự thay thế" + "Ký tự thay thế đã bị loại bỏ" "Có đề xuất thay thế" "Đề xuất thay thế đã bị loại bỏ" diff --git a/app/src/main/res/values-zh-rCN/strings-talkback-descriptions.xml b/app/src/main/res/values-zh-rCN/strings-talkback-descriptions.xml index 53b4ca2ed..de893cb7d 100644 --- a/app/src/main/res/values-zh-rCN/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-zh-rCN/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "拉丁文大写字母%s" "拉丁文大写字母I" "带上点的拉丁文大写字母I" - "有可用的替代字符" - "已关闭替代字符" + "有可用的替代字符" + "已关闭替代字符" "有可用的其他建议字词" "已关闭其他建议字词" diff --git a/app/src/main/res/values-zh-rHK/strings-talkback-descriptions.xml b/app/src/main/res/values-zh-rHK/strings-talkback-descriptions.xml index 621ec062e..b2a305362 100644 --- a/app/src/main/res/values-zh-rHK/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-zh-rHK/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "大寫 %s" "大寫 I" "上方加點的大寫 I" - "有可用的替代字元" - "已關閉替代字元" + "有可用的替代字元" + "已關閉替代字元" "有可用的建議字詞" "已關閉其他建議字詞" diff --git a/app/src/main/res/values-zh-rTW/strings-talkback-descriptions.xml b/app/src/main/res/values-zh-rTW/strings-talkback-descriptions.xml index ff6f3b6c2..cf3be87ec 100644 --- a/app/src/main/res/values-zh-rTW/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-zh-rTW/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "大寫 %s" "大寫 I" "上方加點的大寫 I" - "有可用的替代字元" - "已關閉替代字元" + "有可用的替代字元" + "已關閉替代字元" "有可用的建議字詞" "已關閉其他建議字詞" diff --git a/app/src/main/res/values-zu/strings-talkback-descriptions.xml b/app/src/main/res/values-zu/strings-talkback-descriptions.xml index 9ce2a7e16..ee6bc147c 100644 --- a/app/src/main/res/values-zu/strings-talkback-descriptions.xml +++ b/app/src/main/res/values-zu/strings-talkback-descriptions.xml @@ -62,8 +62,8 @@ "Ufeleba %s" "Ufeleba I" "Ufeleba I, icashazi ngenhla" - "Ezinye izinhlamvu ziyatholakala" - "Ezinye izinhlamvu ziyalahlwa" + "Ezinye izinhlamvu ziyatholakala" + "Ezinye izinhlamvu ziyalahlwa" "Ezinye iziphakamiso ziyatholakala" "Ezinye iziphakamiso ziyalahlwa" diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 2f1d1bb49..eed6dbb86 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -19,12 +19,12 @@ - - - - - - + + + + + + @@ -61,7 +61,7 @@ - + @@ -104,13 +104,13 @@ - - - - + + + + - - + + @@ -159,7 +159,7 @@ - + @@ -229,8 +229,8 @@ - - + + @@ -284,16 +284,8 @@ Code value represented in hexadecimal prefixed with "0x" or code value reference using "!code/" notation. --> - - - - - - + + @@ -340,7 +332,7 @@ - - - + + diff --git a/app/src/main/res/values/config-common.xml b/app/src/main/res/values/config-common.xml index a8bc47851..f8c4abc2d 100644 --- a/app/src/main/res/values/config-common.xml +++ b/app/src/main/res/values/config-common.xml @@ -33,7 +33,7 @@ 100 10 3000 - 5 + 5 1200 @@ -90,7 +90,7 @@ 36% 100 - + 12dp 6dp 32.0dp diff --git a/app/src/main/res/values/config-per-form-factor.xml b/app/src/main/res/values/config-per-form-factor.xml index 782940092..b27018d24 100644 --- a/app/src/main/res/values/config-per-form-factor.xml +++ b/app/src/main/res/values/config-per-form-factor.xml @@ -12,7 +12,7 @@ true false true - - false + false diff --git a/app/src/main/res/values/config.xml b/app/src/main/res/values/config.xml index 8763a3ad8..a25ef277e 100644 --- a/app/src/main/res/values/config.xml +++ b/app/src/main/res/values/config.xml @@ -20,11 +20,11 @@ 46%p -61.8%p - 52.8dp + 52.8dp - - 63.36dp - 8dp + + 63.36dp + 8dp 2.335%p 4.669%p @@ -32,8 +32,8 @@ 1.739%p 3.527%p 1.089%p - - -26.4dp + + -26.4dp 40.0dp 80dp 0dp diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index aa95c522b..082b0a296 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -95,14 +95,14 @@ @string/language_switch_key_switch_input_method @string/language_switch_key_switch_both - + normal more all - - @string/show_more_keys_normal - @string/show_more_keys_more - @string/show_more_keys_all + + @string/show_popup_keys_normal + @string/show_popup_keys_more + @string/show_popup_keys_all diff --git a/app/src/main/res/values/strings-talkback-descriptions.xml b/app/src/main/res/values/strings-talkback-descriptions.xml index 70858740b..dcfecae67 100644 --- a/app/src/main/res/values/strings-talkback-descriptions.xml +++ b/app/src/main/res/values/strings-talkback-descriptions.xml @@ -134,10 +134,10 @@ Note that depending on locale, the lower-case of this letter is U+0069 or U+0131. --> Capital I, dot above - - Alternative characters are available - - Alternative characters are dismissed + + Alternative characters are available + + Alternative characters are dismissed Alternative suggestions are available diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 72279ae46..0f0e3e098 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -194,14 +194,14 @@ Autospace after punctuation Automatically insert space after punctuation when typing a new word - - Show more letters with diacritics in popup + + Show more letters with diacritics in popup - Show variants defined in keyboard languages (default) + Show variants defined in keyboard languages (default) - Add common variants + Add common variants - Add all available variants + Add all available variants URL detection @@ -210,7 +210,7 @@ Force incognito mode Disable learning of new words - + More keys Languages & Layouts @@ -230,12 +230,12 @@ Select hint source Select popup key order - - Number row - Language - Language (priority) - Layout - Symbols + + Number row + Language + Language (priority) + Layout + Symbols Select toolbar keys diff --git a/app/src/main/res/values/themes-common.xml b/app/src/main/res/values/themes-common.xml index 6b17d1739..24e4a4b4c 100644 --- a/app/src/main/res/values/themes-common.xml +++ b/app/src/main/res/values/themes-common.xml @@ -19,8 +19,8 @@ @fraction/config_keyboard_bottom_padding_holo @fraction/config_keyboard_left_padding @fraction/config_keyboard_right_padding - @xml/kbd_more_keys_keyboard_template - @integer/config_max_more_keys_column + @xml/kbd_popup_keys_keyboard_template + @integer/config_max_popup_keys_column @@ -93,7 +93,7 @@ @drawable/ic_clipboard_pin_holo_dark diff --git a/app/src/main/res/values/themes-lxx-base.xml b/app/src/main/res/values/themes-lxx-base.xml index 30975e37e..d954130fd 100644 --- a/app/src/main/res/values/themes-lxx-base.xml +++ b/app/src/main/res/values/themes-lxx-base.xml @@ -12,9 +12,9 @@ @style/MainKeyboardView.LXX_Base @style/EmojiPalettesView.LXX_Base @style/ClipboardHistoryView.LXX_Base - @style/MoreKeysKeyboard.LXX_Base - @style/MoreKeysKeyboardView.LXX_Base - @style/MoreKeysKeyboardView.LXX_Base.Action + @style/PopupKeysKeyboard.LXX_Base + @style/PopupKeysKeyboardView.LXX_Base + @style/PopupKeysKeyboardView.LXX_Base.Action @style/SuggestionStripView.LXX_Base @style/SuggestionWord.LXX_Base @@ -40,7 +40,7 @@ name="MainKeyboardView.LXX_Base" parent="KeyboardView.LXX_Base" > - @layout/more_keys_keyboard_for_action_lxx + @layout/popup_keys_keyboard_for_action_lxx @drawable/keyboard_key_feedback_lxx_light @dimen/config_key_preview_height_lxx @dimen/config_key_preview_offset_lxx @@ -77,7 +77,7 @@ @drawable/ic_clipboard_pin_lxx diff --git a/app/src/main/res/values/themes-rounded-base.xml b/app/src/main/res/values/themes-rounded-base.xml index a04bdd10c..a8ff93204 100644 --- a/app/src/main/res/values/themes-rounded-base.xml +++ b/app/src/main/res/values/themes-rounded-base.xml @@ -12,9 +12,9 @@ @style/MainKeyboardView.Rounded_Base @style/EmojiPalettesView.Rounded_Base @style/ClipboardHistoryView.Rounded_Base - @style/MoreKeysKeyboard.Rounded_Base - @style/MoreKeysKeyboardView.Rounded_Base - @style/MoreKeysKeyboardView.Rounded_Base.Action + @style/PopupKeysKeyboard.Rounded_Base + @style/PopupKeysKeyboardView.Rounded_Base + @style/PopupKeysKeyboardView.Rounded_Base.Action @style/SuggestionStripView.Rounded_Base @style/SuggestionWord.Rounded_Base @@ -46,7 +46,7 @@ name="MainKeyboardView.Rounded_Base" parent="KeyboardView.Rounded_Base" > - @layout/more_keys_keyboard_for_action_lxx + @layout/popup_keys_keyboard_for_action_lxx @drawable/keyboard_key_feedback_lxx_light @dimen/config_key_preview_height_lxx @dimen/config_key_preview_offset_lxx @@ -86,7 +86,7 @@