Compare commits

...

95 Commits

Author SHA1 Message Date
lm41
11a41f30e4 Temp 2025-08-02 00:27:30 +02:00
Patrick Goldinger
c035e19cfc Merge pull request #3000 from florisboard/feat/upgrade-to-jetpref-v3
Upgrade to JetPref v3
2025-08-01 16:58:14 +02:00
Patrick Goldinger
8d30403676 Upgrade Kotlin to 2.2.0 2025-08-01 16:47:43 +02:00
Patrick Goldinger
2886a24fcc Upgrade JetPref to 0.3.0-beta01 2025-08-01 16:22:20 +02:00
Patrick Goldinger
352c98205c Fix toasts being constructed on non-main threads 2025-07-31 13:03:13 +02:00
Patrick Goldinger
18c76b7195 Bump JetPref snapshot version 2025-07-30 02:14:49 +02:00
Patrick Goldinger
ea0712225a Fix backup and restore again 2025-07-30 01:35:51 +02:00
Patrick Goldinger
1132eaf59b Upgrade ThemeManager.kt to use Kotlin flows 2025-07-29 17:42:41 +02:00
Patrick Goldinger
cba85f1c0e Rework common collect(Latest)In functions 2025-07-29 16:41:36 +02:00
Patrick Goldinger
15dba9f33a Fix backup and restore functionality 2025-07-29 16:13:13 +02:00
Patrick Goldinger
3859528120 Try fix JvmTarget inconsistencies 2025-07-28 16:38:13 +02:00
Patrick Goldinger
046d253382 Upgrade to JetPref v3 2025-07-28 16:08:57 +02:00
Lars Mühlbauer
c55a87862f Remove enforcement for navigationBarContrast (#2987)
* Remove enforcement for navigationBarContrast

* Use luminance for color contrast detection

* Always use light icons when background image is present
2025-07-22 01:10:29 +02:00
Patrick Goldinger
ee08c58db2 Release v0.5.0-beta02 2025-07-18 15:59:23 +02:00
Patrick Goldinger
05d4a5cf62 Update README.md (#2984)
Updates the milestone version numbers
2025-07-18 15:56:38 +02:00
florisboard-bot
c5c8f7a4c3 Update translations from Crowdin 2025-07-18 15:44:11 +02:00
Patrick Goldinger
ce3aee93d6 Merge pull request #2719 from florisboard/reproducible-builds
Add support for reproducible builds
2025-07-18 15:25:00 +02:00
Patrick Goldinger
96340f7277 Remove old flake build config 2025-07-16 23:11:28 +02:00
Patrick Goldinger
d0dcf5be38 Improve repr_build assemble.sh script 2025-07-16 23:03:09 +02:00
Patrick Goldinger
15450a760e Add ability for APK/AAB signing in repr_build setup 2025-07-16 22:28:14 +02:00
Patrick Goldinger
de0027d87e Add Gradle cache sharing & Add sha256sum generation 2025-07-16 20:24:03 +02:00
Patrick Goldinger
c7e83fca21 Add option to pass custom output directory 2025-07-16 15:29:11 +02:00
Lars Mühlbauer
115dc5c42a Add support for physical keyboard settings (#2981) 2025-07-16 14:41:49 +02:00
Patrick Goldinger
c78cf84d6c Fix Android SDK location and rename to repr_build 2025-07-16 12:58:03 +02:00
Lars Mühlbauer
5e59f144dd Update ROADMAP.md (#2980)
* Update ROADMAP.md

This commit updated the roadmap to include the latest changes,
especially that the 0.5 update was split and word suggestions
are pushed down to 0.6.

* Add time base theme switching to ROADMAP

* Mark spaces in uri bug as fixed in ROADMAP

* Fix typos
2025-07-16 00:55:59 +02:00
Patrick Goldinger
564c075763 Fix files with spaces causing UI issues (#2982) 2025-07-16 00:31:49 +02:00
Lars Mühlbauer
86365d393b Re-add time based theme switching (#2977)
* Add prefs for time based theme switching

* Implement time based theme switching

* Update to jetpref 0.2.0-rc04

* Remove hardcoded strings
2025-07-15 23:56:44 +02:00
Patrick Goldinger
45a0c9ef63 Upgrade gradle/actions/wrapper-validation to v4 2025-07-15 23:16:42 +02:00
Patrick Goldinger
25da6be1a4 Upgrade CMake to 4.0.2 2025-07-15 23:15:01 +02:00
Patrick Goldinger
976afc2e51 Fiz containerization failing for aab builds 2025-07-15 22:47:39 +02:00
Patrick Goldinger
d994da8c97 Rework containerization and add track logic 2025-07-15 22:30:31 +02:00
Patrick Goldinger
40a22a762a Add containerization config for building the project 2025-07-15 16:53:18 +02:00
Patrick Goldinger
264b9ff98b Add -Wl,--build-id=none linker option
Required for reproducible builds to work
2025-07-15 16:52:54 +02:00
Patrick Goldinger
f1b7ddedb8 Add new tools version catalog 2025-07-15 16:51:53 +02:00
Lars Mühlbauer
b1665f61e5 Remove checks for API 26 as this is the min API (#2972) 2025-07-15 11:49:29 +02:00
Patrick Goldinger
0fa663f658 Release v0.5.0-beta01 2025-07-11 00:54:31 +02:00
florisboard-bot
b7f5bf267d Update translations from Crowdin 2025-07-11 00:08:54 +02:00
Lars Mühlbauer
8563f37c98 Refactor FlorisCopyToClipboardActivity (#2968)
* Refactor FlorisCopyToClipboardActivity

* Apply review suggestions
2025-07-10 22:13:05 +02:00
Patrick Goldinger
d3a2e50dda Merge pull request #2963 from florisboard/fix/font-import-mime-types
Relax font mime-type importing restrictions
2025-07-10 12:23:48 +02:00
Patrick Goldinger
29562c9980 Add custom MimeTypeFilter 2025-07-09 14:02:22 +02:00
Patrick Goldinger
5bbb5cfbce Relax font mime-type importing restrictions (#2957) 2025-07-09 14:02:22 +02:00
Lars Mühlbauer
4ada583418 Remove obsolete api level check and simplify logic (#2967)
* Remove obsolete api level check and simplify logic

* Remove obsolete min api level checks
2025-07-09 01:42:46 +02:00
eqilnou
200a195ae6 Add subscripts and missing fractions in number row popups (#2947)
* Add subscripts and missing fractions in western arabic number row

Add subscripts and missing fractions (1/ and 0/3) in western_arabic.json number row layout

* Add subscripts and missing fractions in bengali number row

Added subscripts and missing fractions (1/ and 0/3) in bengali.json number row layout

* Fix ordering of hints for character "1" in western arabic number row

* Add subscripts and missing fractions in devanagari number row

Added subscripts and missing fractions (1/ and 0/3) in devanagari.json number row layout

* Add subscripts and missing fractions in eastern arabic number row

Added subscripts and missing fractions (1/ and 0/3) in eastern_arabic.json number row layout

* Add subscripts and missing fractions in gujarati number row

Added subscripts and missing fractions (1/ and 0/3) in gujarati.json number row layout

* Add subscripts and missing fractions in gurmukhi number row

Added subscripts and missing fractions (1/ and 0/3) in gurmukhi.json number row layout

* Add subscripts and missing fractions in kannada number row

Added subscripts and missing fractions in kannada.json number row layout

* Add subscripts and missing fractions in malayalam number row

Added subscripts and missing fractions in malayalam.json number row layout

* Add subscripts and missing fractions in oriya number row layout

Added subscripts and missing fractions in oriya.json number row layout

* Add subscripts and missing fractions in persian number row

Added subscripts and missing fractions in persian.json number row layout

* Add subscripts and missing fractions in tamil number row

Added subscripts and missing fractions in tamil.json number row layout

* Add subscripts and missing fractions in telugu number row

Added subscripts and missing fractions in telugu.json number row layout

* Add subscripts and missing fractions in warang_citi number row

Added subscripts and missing fractions in warang_citi.json number row layout

* Add subscripts and missing fractions in thai number row

Added subscripts and missing fractions in thai.json number row layout

* Fix ordering of fractions 3/n in western arabic number row

* Fix ordering of fractions 3/n in thai number row

* Fix label of digit '4' in cjk number row

Use the correct symbol U+FF14 instead of U+FF13
2025-07-09 01:16:13 +02:00
MikayelB
fa910692bc Fix Amenian phonetic layout addition (#2904) 2025-07-09 01:02:39 +02:00
Patrick Goldinger
c3545d1625 Merge pull request #2966 from florisboard/chore/update-gradle-and-fix-release-build
Update gradle and fix build error [ExtraTranslation]
2025-07-09 00:55:48 +02:00
lm41
300ca755ec Update to gradle version 8.14.3 2025-07-08 21:20:54 +02:00
lm41
3efb760787 Ignore extra translations when building FlorisBoard 2025-07-08 16:23:10 +02:00
Lars Mühlbauer
647f7c106b Fix always enabling one-hand mode after prefs migration (#2962) 2025-07-07 19:55:35 +02:00
Lars Mühlbauer
d998f8fe0c Fix numbering in setup screen on api < 33 (Android 13 and below) (#2960) 2025-07-07 19:48:14 +02:00
Lars Mühlbauer
b7020d7cc9 Fix gestures not working on api 34+ (Android 14+) (#2959) 2025-07-07 19:44:16 +02:00
Patrick Goldinger
5b874fc22a Release v0.5.0-alpha04 2025-06-04 00:36:53 +02:00
Patrick Goldinger
4a6fad851c Upgrade to Gradle 8.14.1 2025-06-04 00:36:05 +02:00
florisboard-bot
6de6b37f6f Update translations from Crowdin 2025-06-03 23:44:35 +02:00
Patrick Goldinger
d2eb6fd1c4 Merge pull request #2938 from florisboard/feat/clipboard-sorting-and-timestamps
Clipboard filtering and timestamp display
2025-06-03 23:41:53 +02:00
Patrick Goldinger
4b84a1ed40 Adapt other default themes to new element names/styles 2025-06-03 23:17:02 +02:00
Patrick Goldinger
a1d4079ef9 Add display of clipboard timestamps (#2926) 2025-06-03 23:11:10 +02:00
Patrick Goldinger
ba6d401447 Add style for clipboard item description and improve icons
Co-authored-by: Lars Mühlbauer <lm41@lm41.xyz>
2025-05-31 16:17:24 +02:00
Patrick Goldinger
43168fc31f Add SnyggChip
Co-authored-by: Lars Mühlbauer <lm41@lm41.xyz>
2025-05-31 16:17:24 +02:00
Patrick Goldinger
d234d30154 Improve clipboard item style
Co-authored-by: Lars Mühlbauer <lm41@lm41.xyz>
2025-05-31 16:17:24 +02:00
Patrick Goldinger
e010a22863 Add clipboard filter by item type (#2925)
Co-authored-by: Lars Mühlbauer <lm41@lm41.xyz>
2025-05-31 16:17:24 +02:00
Patrick Goldinger
da3b99fda8 Upgrade to Compose 1.8 and Migrate to Compose BOM (#2931)
* Upgrade AGP to 8.9.3 and Gradle to 8.11.1

* Upgrade to Compose 1.8 & Migrate to Compose BOM
2025-05-31 16:14:14 +02:00
Patrick Goldinger
23f58496e3 Upgrade to Compose 1.8 & Migrate to Compose BOM 2025-05-31 16:08:29 +02:00
Patrick Goldinger
40ecbe1428 Upgrade AGP to 8.9.3 and Gradle to 8.11.1 2025-05-30 13:34:40 +02:00
szgabor3
62a2131fa8 Update hu.json (#2922)
I suggest modifications for main alternatives to key 
o -> ó instead of ö
u -> ú instead of ü
as those (ö and ü) already have their own keys on the keyboard.
So this way the main alternatives fit better to the similars (e.g. a-á, e-é, i-í) and the layout becomes more conveniently usable.
2025-05-27 20:51:50 +02:00
Patrick Goldinger
df8f96396f Merge pull request #2927 from florisboard/feat/clipboard-history-improvements
Clipboard history UI improvements
2025-05-25 01:48:27 +02:00
Patrick Goldinger
bace0259ec Rework element names of clipboard item popup (#2908) 2025-05-25 01:37:35 +02:00
Patrick Goldinger
64f062307d Remove restriction of clipboard item visible character length (#2900) 2025-05-25 01:18:24 +02:00
Patrick Goldinger
2ca69f8fa9 Rework clipboard history grid implementation (#2906) 2025-05-25 01:09:29 +02:00
Lars Mühlbauer
f8537a2245 Move the checklist to the bottom and correct typos (#2924) 2025-05-24 22:54:27 +02:00
Patrick Goldinger
cdb6707850 Fix theme editor navbar color bug (#2920) 2025-05-21 01:19:11 +02:00
Patrick Goldinger
35db9be1bf Revert "Fix ignored paths not applied to pull_request in workflow (#2917)" (#2919)
This reverts commit 8551bb6842.
2025-05-21 00:43:05 +02:00
Patrick Goldinger
8551bb6842 Fix ignored paths not applied to pull_request in workflow (#2917) 2025-05-21 00:28:59 +02:00
Patrick Goldinger
9ad5bc68d3 Improve issue templates, contrib guidelines, and roadmap (#2916)
* Improve repo issue templates

Co-authored-by: Lars Mühlbauer <lm41@lm41.xyz>

* Improve repo contribution guidelines

Co-authored-by: Lars Mühlbauer <lm41@lm41.xyz>

* Adjust roadmap to 0.5 dev cycle

Co-authored-by: Lars Mühlbauer <lm41@lm41.xyz>

---------

Co-authored-by: Lars Mühlbauer <lm41@lm41.xyz>
2025-05-21 00:16:23 +02:00
klaurence
ebf5c0f898 Fix one-handed button migration (#2907)
* Update AppPrefs.kt

* Fix one-handed button migration (florisboard/florisboard#2905)

* Fix accidentally-missing brace

* Try to fix null exception
2025-05-15 22:47:52 +02:00
Patrick Goldinger
f913b4f7db Release v0.5.0-alpha03 2025-05-14 02:08:57 +02:00
florisboard-bot
4f966385ec Update translations from Crowdin 2025-05-14 02:05:58 +02:00
Patrick Goldinger
e2ce63a2e9 Add mode attribute to select element styles (#2899)
* Add `mode` attribute to element styles

Co-authored-by: Lars Mühlbauer <lm41@lm41.xyz>

* Add `mode` attribute to key popup elements

---------

Co-authored-by: Lars Mühlbauer <lm41@lm41.xyz>
2025-05-14 02:04:07 +02:00
Patrick Goldinger
64603c4692 Fix theme state bugs (#2897)
Also enable Compose strong skipping mode
2025-05-13 22:50:13 +02:00
Patrick Goldinger
90d3fbfdf1 Merge pull request #2895 from florisboard/fix/smartbar-default-style
Fix Smartbar styles (actions, candidates, ...)
2025-05-13 20:34:54 +02:00
Patrick Goldinger
1f01c56c68 Fix font size multiplier not having any effect (#2896) 2025-05-13 20:21:15 +02:00
MikayelB
c0a5486619 Fix Armenian layout in extension.json (#2871)
The Armenian Alt Phonetic json was configured but wasn't properly added to extension.json, that's why it doesn't show up in the layout menu.
2025-05-13 02:51:58 +02:00
Patrick Goldinger
511802cb25 Disallow clip on window element styles 2025-05-13 01:18:09 +02:00
Patrick Goldinger
eb057ecaf5 Fix Smartbar extended actions style (#2881) 2025-05-13 01:11:21 +02:00
Patrick Goldinger
f93938b43a Allow fine-tuned styling of Smartbar candidates (#2887) 2025-05-13 00:44:56 +02:00
Patrick Goldinger
2b7f8212c7 Allow fine-tuned styling of Smartbar action tiles (#2887) 2025-05-13 00:15:00 +02:00
Patrick Goldinger
44c2c6e9c1 Fix fallback style of Smartbar shared actions toggle 2025-05-12 23:29:22 +02:00
Patrick Goldinger
a2cfe091a6 Add SnyggListItem / Allow styling of subtype pnale list items (#2893)
* Add SnyggListItem and allow subtype list to be styled (#2885)

* Update default themes regarding subtype panel style

* Fix text overflow issues for default subtype panel list item style
2025-05-12 23:16:54 +02:00
Patrick Goldinger
4d9b4d5522 Merge pull request #2890 from florisboard/fix/snygg-v2-minor-issues
Small fixes in new theme editor
2025-05-11 10:57:51 +02:00
Patrick Goldinger
defe45fec6 Fix theme editor rules being cut off (#2888) 2025-05-10 22:15:16 +02:00
Patrick Goldinger
c6721067bf Fix translation error in media theme category (#2886) 2025-05-10 21:54:33 +02:00
Patrick Goldinger
a7f55d4589 Fix theme manager dropdown state not updating (#2876) 2025-05-10 00:35:34 +02:00
Patrick Goldinger
eb2e260924 Fix version suffix missing minus delimiter (#2874) (#2875) 2025-05-09 23:48:54 +02:00
Patrick Goldinger
4950533409 Add distinct filtering to Smartbar quick actions in prefs migration
Co-authored-by: Lars Mühlbauer <lm41@lm41.xyz>
2025-05-09 22:16:28 +02:00
Patrick Goldinger
813047fb40 Add option to reset Smartbar quick actions from devtools 2025-05-09 22:16:28 +02:00
Patrick Goldinger
96f3dccfc2 Fix Smartbar quick actions duplicated in prefs migration
Co-authored-by: Lars Mühlbauer <lm41@lm41.xyz>
2025-05-09 22:16:28 +02:00
218 changed files with 7620 additions and 2422 deletions

11
.dockerignore Normal file
View File

@@ -0,0 +1,11 @@
**/.*/
!.git/
**/build/
**/dist/
**/out/
**/target/
utils/
!utils/repr_build/scripts/
.env
gradlew.bat
local.properties

1
.envrc
View File

@@ -1 +0,0 @@
use_flake

View File

@@ -1,4 +1,4 @@
name: Bug Report
name: 🐛 Bug Report
description: Create a report to help FlorisBoard improve
labels:
- "bug"
@@ -62,3 +62,14 @@ body:
placeholder: e.g. 10, Stock
validations:
required: true
- type: checkboxes
id: checklist
attributes:
label: "Checklist"
options:
- label: "I made sure that there are *no existing issues* - [open](https://github.com/florisboard/florisboard/issues) or [closed](https://github.com/florisboard/florisboard/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have read and understood the [contribution guidelines](https://github.com/florisboard/florisboard/blob/main/CONTRIBUTING.md)."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise."
required: true

View File

@@ -1,8 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/florisboard/florisboard/discussions/new?category=q-a
about: Ask here if you have a question about FlorisBoard or need assistance
- name: General feedback
url: https://github.com/florisboard/florisboard/discussions/new?category=feedback
about: Give general feedback about this project
- name: 💬 Matrix
url: https://matrix.to/#/#florisboard:matrix.org
about: General chat about FlorisBoard and quick Q/A
- name: ❓ Questions / Feedback
url: https://github.com/florisboard/florisboard/discussions/new/choose
about: Post your questions or feedback in the discussions panel

View File

@@ -1,4 +1,4 @@
name: Crash report
name: 💥 Crash report
description: Create a report with a generated crash log attached to help FlorisBoard improve
labels:
- "bug"
@@ -36,3 +36,14 @@ body:
description: Paste the generated crash log below
validations:
required: true
- type: checkboxes
id: checklist
attributes:
label: "Checklist"
options:
- label: "I made sure that there are *no existing issues* - [open](https://github.com/florisboard/florisboard/issues) or [closed](https://github.com/florisboard/florisboard/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have read and understood the [contribution guidelines](https://github.com/florisboard/florisboard/blob/main/CONTRIBUTING.md)."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the crash report will be dismissed otherwise."
required: true

View File

@@ -1,4 +1,4 @@
name: Feature request / Suggestion
name: Feature request
description: Suggest an idea for this project
labels:
- "proposal"
@@ -20,3 +20,14 @@ body:
description: Please explain your idea in a precise way.
validations:
required: true
- type: checkboxes
id: checklist
attributes:
label: "Checklist"
options:
- label: "I made sure that there are *no existing issues* - [open](https://github.com/florisboard/florisboard/issues) or [closed](https://github.com/florisboard/florisboard/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have read and understood the [contribution guidelines](https://github.com/florisboard/florisboard/blob/main/CONTRIBUTING.md)."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise."
required: true

View File

@@ -25,14 +25,14 @@ jobs:
with:
submodules: recursive
- uses: gradle/actions/wrapper-validation@v3
- uses: gradle/actions/wrapper-validation@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Set up CMake and Ninja
uses: lukka/get-cmake@latest
uses: lukka/get-cmake@v4.0.2
- name: Build with Gradle
run: ./gradlew clean assembleDebug
- uses: actions/upload-artifact@v4

View File

@@ -4,32 +4,34 @@ Thanks for considering contributing to FlorisBoard!
There are several ways to contribute to FlorisBoard. This document provides some general guidelines for each type of contribution.
## General contributions
The FlorisBoard community is international, as such we require all contributions, including issues, pull requests, and participation in the Matrix chat to be in English and follow the [code of conduct](https://github.com/florisboard/florisboard/blob/main/CODE_OF_CONDUCT.md). Contributions not adhering to these requirements will be dismissed. Thanks for making the FlorisBoard community an inclusive and safe space for everyone!
### Translation
## Non-code contributions
To make FlorisBoard accessible in as many languages as possible, the platform [Crowdin](https://crowdin.florisboard.patrickgold.dev) is used to crowdsource and manage translations. The list of languages in Crowdin covers a good range of languages, but feel free to send an email to [florisboard@patrickgold.dev](mailto:florisboard@patrickgold.dev) to request a new language.
### Translations
To make FlorisBoard accessible in as many languages as possible, the platform [Crowdin](https://crowdin.florisboard.patrickgold.dev) is used to crowdsource and manage translations. The list of languages in Crowdin covers a good range of languages, but feel free to email [florisboard@patrickgold.dev](mailto:florisboard@patrickgold.dev) to request a new language.
> [!IMPORTANT]
> This is the only source of translations - **PRs that add/update translations are not accepted.**
### Feedback
You can [give general feedback](https://github.com/florisboard/florisboard/discussions/new?category=feedback) directly here on GitHub. This is the preferred way to give feedback, as it allows not only for me to read and respond to feedback, but for everyone in this community.
### Bug reporting
This kind of contribution is the most important, as it tells where FlorisBoard has flaws and thus should be improved to maximize stability and user experience. To make this process as smooth as possible, please use the pre-made [issue template](.github/ISSUE_TEMPLATE/bug_report.md) for bug reporting. This makes it easy for us to understand what the bug is and how to solve it.
Allows us to see where FlorisBoard has flaws and should be improved to maximize stability and user experience. To make this process as smooth as possible, please use the pre-made [bug report template](https://github.com/florisboard/florisboard/issues/new?template=bug_report.yml). This makes it easy for us to understand what the bug is and how to solve it.
#### Capturing error logs
Logs are captured by FlorisBoard's crash handler, which gives you the ability to copy it to the clipboard and paste it in GitHub. This is the preferred way to capture logs.
Logs are captured by FlorisBoard's crash handler, which gives you the ability to copy it to the clipboard and paste it in the crash report [issue template](https://github.com/florisboard/florisboard/issues/new?template=crash_report.yml). This is the preferred way to capture logs.
Alternatively, you can also use ADB (Android Debug Bridge) to capture the error log. This is recommended for experienced users only.
### Feature proposals
Use the feature proposal issue template to suggest a new idea or improvement for this project.
Use the feature proposal [issue template](https://github.com/florisboard/florisboard/issues/new?template=feature_request.yml) to suggest a new idea or improvement for this project.
### Feedback
You can [give general feedback](https://github.com/florisboard/florisboard/discussions/new?category=feedback) directly here on GitHub. This is the preferred way to give feedback, as it allows not only for me to read and respond to feedback, but for everyone in this community.
## Code contributions
@@ -38,15 +40,15 @@ You are always welcome to contribute new features or work on existing issues, th
> [!NOTE]
> If you intend to implement a bigger feature please coordinate with us so we can prevent that there's a major difference in expected implementation.
If you are overwhelmed by the code don't hesistate to ask for help in the [dev chat](https://matrix.to/#/#florisboard-dev:matrix.org) or the discussions tab! Some issues are also marked as good first issue, which are easy to do tasks.
If you are overwhelmed by the code don't hesitate to ask for help in the [dev chat](https://matrix.to/#/#florisboard-dev:matrix.org) or the discussions tab! Some issues are also marked as good first issue, which are easy to do tasks.
### System requirements for development
- Desktop PC with Linux or WSL2 (Windows)
- MacOS and Windows without WSL2 probably works too however there's no official support
- At least 16GB of RAM (because of Android Studio)
- At least 16GB of RAM (because of Android Studio / IntelliJ)
- The following tools must be installed:
- Android Studio (bundles SDK and NDK)
- Android Studio (bundles SDK and NDK) or IntelliJ with Android and Compose plugin
- Java 17
- CMake 3.22+
- Clang 15+
@@ -64,34 +66,7 @@ If you want to manually build the project without Android Studio you must ensure
and Gradle should take care of every build task.
## Joining the team
If you want to join the core maintainer/moderator team on a volunteer basis and be part of this project's journey that's great to hear!
### Basic Requirements
- A passion for seeing FlorisBoard flourish
- Good English skills for team and public communication
- A GitHub account and a Matrix handle
### Why Join
You'll have the chance to work directly with me and other team members. While the general idea is for us to work on all kinds of different aspects of the project as a team, if you're particularly interested in a specific area (e.g., UI, extensions, text processing), that's totally okay too!
### Available Roles
Currently the following roles are available and need help:
Role Description | Required Dev Experience
---|---
Software Developer (Kotlin) for Core App | Java/Kotlin development experience (on Android)
Software Developer (Rust) for Native Core | Some Rust development experience
GitHub Issues/Discussions Moderator | None
Crowdin Translation Verifier | Language proficiency for the language you want to verify
Interested? Feel free to dm me ([@patrickgold](https://matrix.to/#/@patrickgold:matrix.org)) on Matrix or send an email to [florisboard@patrickgold.dev](mailto:florisboard@patrickgold.dev).
## Donating
Alternatively you can also show your support by buying me a coffee, so I can stay up all night and chase away bugs or add new cool stuff :)
You can also show your support by buying me a coffee, so I can stay up all night and chase away bugs or add new cool stuff :)
See the `Sponsors` button for available options!

View File

@@ -64,7 +64,7 @@ fully respecting your privacy. Currently in early-beta state.
</tr>
</table>
Beginning with v0.6.0 FlorisBoard will enter the public beta on Google Play.
Beginning with v0.7 FlorisBoard will enter the public beta on Google Play.
## Highlighted features
- Integrated clipboard manager / history
@@ -74,7 +74,7 @@ Beginning with v0.6.0 FlorisBoard will enter the public beta on Google Play.
> [!IMPORTANT]
> Word suggestions/spell checking are not included in the current releases
> and are a major goal for the v0.5 milestone.
> and are a major goal for the v0.6 milestone.
Feature roadmap: See [ROADMAP.md](ROADMAP.md)

View File

@@ -1,44 +1,63 @@
# Roadmap
This feature roadmap intents to provide transparency to what is planned to be added to FlorisBoard in the foreseeable future. Note that there are no ETAs for any version milestones down below, experience has shown these won't hold anyways.
This feature roadmap intents to provide transparency to what is planned to be added to FlorisBoard in the foreseeable future. Note that there are no ETAs for any version milestones down below, experience has shown these won't hold anyway.
Each major milestone has associated alpha/beta releases, so if you are interested in previewing features quicker, keep an eye out! Each major 0.x release has also patch releases after the initial major release, which will be published on both the stable and preview tracks.
## 0.5
## 0.5 (currently in development)
- Implement predictive text support / spell checking
- Consider adding proximity-based key typo detection
- Add new extension type: Language Pack
- Basically groups all locale-relevant data (predictive base model, emoji suggestion data, ...)
in a dynamically importable extension file
- New text processing logic (maybe moved back / split to 0.6)
- Add floating keyboard mode
- New keyboard layout engine + file syntax based on the upcoming Unicode Keyboard v3 standard
- Add Tablet mode / Optimizations for landscape input based on new keyboard layout engine
- Add support for any remaining new features introduced with Android 13
> [!NOTE]
> The milestone 0.5 was split, thus the word suggestions now come with version 0.6. The old version 0.6 has been moved down and is now 0.7. The time it takes to implement word suggestions will not change, but we can now release the new theme editor earlier, which would otherwise lie dormant.
- [ ] Theme rework part II / Snygg v2
- [x] See https://github.com/florisboard/florisboard/pull/2855
- [x] Spaces in URI bug (See https://github.com/florisboard/florisboard/issues/2898)
- [ ] Rework cache manager (See https://github.com/florisboard/florisboard/issues/2870)
- [x] Re-add time based theme switching (See https://github.com/florisboard/florisboard/pull/2977)
- [ ] Add support for any remaining new features introduced with Android 13 / 14
- [ ] Proper physical keyboard support (See https://github.com/florisboard/florisboard/issues/2815)
- [x] Raise minimum required Android version from Android 7 (SDK level 24) to Android 8 (SDK level 26)
## 0.6
- Complete rework of the Emoji panel
- Emoji search
- Fully scrollable emoji list (soft category borders)
- More granular themeing options
- Layout customization (e.g. placement of category buttons)
- Maybe: consider upgrading to emoji2 for better unified system-wide emoji styles
- Reimplementation of glide typing with the new layout engine and predictive text core
- Prepare FlorisBoard repository and app store presence for public beta release on Google Play (will go live with stable 0.6)
- Rework branding images and texts of FlorisBoard for the app stores
- Focus on stability and experience improvements of the app and keyboard
- Add support for new features introduced with Android 14 / 15
- Not finalized, but planned: raise minimum required Android version from Android 7 (SDK level 24) to Android 8 (SDK level 26)
- [ ] Implement predictive text support / spell checking
- [ ] Add new extension type: Language Pack
- Basically groups all locale-relevant data (predictive base model, emoji suggestion data, ...)
in a dynamically importable extension file
## k3lp
> [!NOTE]
> The development of k3lp is not tied to a florisboard version and takes place on [codeberg.org](https://codeberg.org/k3lp/k3lp) simultaneously.
- [ ] New keyboard layout engine + file syntax based on the upcoming Unicode Keyboard v3 standard
- [ ] Add Tablet mode / Optimizations for landscape input based on new keyboard layout engine
## 0.7+
> [!NOTE]
> From 0.6 onwards we plan to have more stable 0.X releases but with at most one large feature per release, thus having a much quicker iteration of new features on the stable track, which is a benefit for everyone involved.
- [ ] Add floating keyboard mode
- [ ] New text processing logic
- [ ] Complete rework of the Emoji panel
- [ ] Emoji search
- [ ] Fully scrollable emoji list (soft category borders)
- [ ] Side scrollable emoji list (swipe for next category)
- [ ] More granular theming options
- [ ] Layout customization (e.g. placement of category buttons)
- [ ] Maybe: consider upgrading to emoji2 for better unified system-wide emoji styles
- [ ] Reimplementation of glide typing with the new layout engine and predictive text core
- [ ] Prepare FlorisBoard repository and app store presence for public beta release on Google Play (will go live with stable 0.7)
- [ ] Rework branding images and texts of FlorisBoard for the app stores
- [ ] Focus on stability and experience improvements of the app and keyboard
- [ ] Add support for new features introduced with Android 15 / 16
## Backlog / Planned (unassigned)
**Features that MAY be added (even in versions mentioned above) or dismissed**
- Full on-board layout editor which allows users to create their own layouts without writing a JSON file
- Theme rework part II
- Adaptive themes v2
- Voice-to-text with Mozilla's open-source voice service (or any other oss voice provider)
- Text translation
- Stickers/GIFs

View File

@@ -15,7 +15,6 @@
*/
import java.io.ByteArrayOutputStream
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag
plugins {
alias(libs.plugins.agp.application)
@@ -29,25 +28,29 @@ plugins {
val projectMinSdk: String by project
val projectTargetSdk: String by project
val projectCompileSdk: String by project
val projectBuildToolsVersion: String by project
val projectNdkVersion: String by project
val projectVersionCode: String by project
val projectVersionName: String by project
val projectVersionNameSuffix = projectVersionName.substringAfter("-", "")
val projectVersionNameSuffix = projectVersionName.substringAfter("-", "").let { suffix ->
if (suffix.isNotEmpty()) {
"-$suffix"
} else {
suffix
}
}
android {
namespace = "dev.patrickgold.florisboard"
compileSdk = projectCompileSdk.toInt()
buildToolsVersion = projectBuildToolsVersion
ndkVersion = projectNdkVersion
buildToolsVersion = tools.versions.buildTools.get()
ndkVersion = tools.versions.ndk.get()
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
freeCompilerArgs = listOf(
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-Xjvm-default=all-compatibility",
@@ -149,7 +152,13 @@ android {
}
aboutLibraries {
configPath = "app/src/main/config"
collect {
configPath = file("src/main/config")
}
}
lint {
baseline = file("lint.xml")
}
testOptions {
@@ -162,21 +171,21 @@ android {
}
}
composeCompiler {
// DO NOT ENABLE STRONG SKIPPING! This project currently relies on
// recomposition on parent state change to update the UI correctly.
featureFlags.add(ComposeFeatureFlag.StrongSkipping.disabled())
}
tasks.withType<Test> {
useJUnitPlatform()
}
dependencies {
val composeBom = platform(libs.androidx.compose.bom)
implementation(composeBom)
// testImplementation(composeBom)
// androidTestImplementation(composeBom)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.activity.ktx)
implementation(libs.androidx.autofill)
implementation(libs.androidx.collection.ktx)
implementation(libs.androidx.compose.material.icons)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.runtime.livedata)
implementation(libs.androidx.compose.ui)
@@ -186,7 +195,6 @@ dependencies {
implementation(libs.androidx.emoji2)
implementation(libs.androidx.emoji2.views)
implementation(libs.androidx.exifinterface)
implementation(libs.androidx.material.icons)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.profileinstaller)
ksp(libs.androidx.room.compiler)
@@ -198,6 +206,7 @@ dependencies {
implementation(libs.mikepenz.aboutlibraries.compose)
implementation(libs.patrickgold.compose.tooltip)
implementation(libs.patrickgold.jetpref.datastore.model)
ksp(libs.patrickgold.jetpref.datastore.model.processor)
implementation(libs.patrickgold.jetpref.datastore.ui)
implementation(libs.patrickgold.jetpref.material.ui)
@@ -207,6 +216,7 @@ dependencies {
implementation(project(":lib:native"))
implementation(project(":lib:snygg"))
testImplementation(libs.kotlin.test.junit5)
androidTestImplementation(libs.androidx.test.ext)
androidTestImplementation(libs.androidx.test.espresso.core)
}

View File

@@ -1,3 +1,3 @@
<lint>
<issue id="UsingMaterialAndMaterial3Libraries" severity="ignore" />
<issue id="ExtraTranslation" severity="warning"/>
</lint>

View File

@@ -17,6 +17,13 @@
"direction": "rtl",
"modifier": "org.florisboard.layouts:arabic"
},
{
"id": "armenian_alt_phonetic",
"label": "Armenian Alt Phonetic",
"authors": [ "MikayelB" ],
"direction": "ltr",
"modifier": "org.florisboard.layouts:armenian"
},
{
"id": "western_armenian",
"label": "Armenian (Western)",

View File

@@ -3,46 +3,52 @@
{ "code": 2535, "label": "১", "type": "numeric", "popup": {
"main": { "code": 49, "label": "1" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 185, "label": "¹" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
} },
{ "code": 2536, "label": "২", "type": "numeric", "popup": {
"main": { "code": 50, "label": "2" },
"relevant": [
{ "code": 8532, "label": "" },
{ "code": 8322, "label": ""},
{ "code": 178, "label": "²" },
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
} },
{ "code": 2537, "label": "৩", "type": "numeric", "popup": {
"main": { "code": 51, "label": "3" },
"relevant": [
{ "code": 8535, "label": "⅗" },
{ "code": 190, "label": "¾" },
{ "code": 179, "label": "³" },
{ "code": 8540, "label": "⅜" }
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "⅜" },
{ "code": 8323, "label": "₃"},
{ "code": 179, "label": "³" }
]
} },
{ "code": 2538, "label": "", "type": "numeric", "popup": {
"main": { "code": 52, "label": "4" },
"relevant": [
{ "code": 8536, "label": "" },
{ "code": 8308, "label": "⁴" }
{ "code": 8324, "label": "" },
{ "code": 8308, "label": "⁴" },
{ "code": 8536, "label": "⅘" }
]
} },
{ "code": 2539, "label": "৫", "type": "numeric", "popup": {
"main": { "code": 53, "label": "5" },
"relevant": [
{ "code": 8538, "label": "⅚" },
{ "code": 8325, "label": "₅" },
{ "code": 8309, "label": "⁵" },
{ "code": 8541, "label": "⅝" }
]
@@ -50,6 +56,7 @@
{ "code": 2540, "label": "৬", "type": "numeric", "popup": {
"main": { "code": 54, "label": "6" },
"relevant": [
{ "code": 8326, "label": "₆" },
{ "code": 8310, "label": "⁶" }
]
} },
@@ -57,27 +64,32 @@
"main": { "code": 55, "label": "7" },
"relevant": [
{ "code": 8542, "label": "⅞" },
{ "code": 8327, "label": "₇" },
{ "code": 8311, "label": "⁷" }
]
} },
{ "code": 2542, "label": "৮", "type": "numeric", "popup": {
"main": { "code": 56, "label": "8" },
"relevant": [
{ "code": 8328, "label": "₈" },
{ "code": 8312, "label": "⁸" }
]
} },
{ "code": 2543, "label": "৯", "type": "numeric", "popup": {
"main": { "code": 57, "label": "9" },
"relevant": [
{ "code": 8329, "label": "₉" },
{ "code": 8313, "label": "⁹" }
]
} },
{ "code": 2534, "label": "", "type": "numeric", "popup": {
"main": { "code": 48, "label": "0" },
"relevant": [
{ "code": 8319, "label": "ⁿ" },
{ "code": 8709, "label": "∅" },
{ "code": 8304, "label": "" }
{ "code": 8319, "label": "" },
{ "code": 8304, "label": "⁰" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
} }
]

View File

@@ -33,7 +33,7 @@
{ "code": 32902, "label": "肆" },
{ "code": 18825, "label": "䦉" },
{ "code": 20118, "label": "亖" },
{ "code": 65300, "label": "" }
{ "code": 65300, "label": "" }
]
} },
{ "code": 20116, "label": "五", "type": "numeric", "popup": {

View File

@@ -3,46 +3,52 @@
{ "code": 2407, "label": "१", "type": "numeric", "popup": {
"main": { "code": 49, "label": "1" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 185, "label": "¹" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
} },
{ "code": 2408, "label": "२", "type": "numeric", "popup": {
"main": { "code": 50, "label": "2" },
"relevant": [
{ "code": 8532, "label": "" },
{ "code": 8322, "label": ""},
{ "code": 178, "label": "²" },
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
} },
{ "code": 2409, "label": "३", "type": "numeric", "popup": {
"main": { "code": 51, "label": "3" },
"relevant": [
{ "code": 8535, "label": "⅗" },
{ "code": 190, "label": "¾" },
{ "code": 179, "label": "³" },
{ "code": 8540, "label": "⅜" }
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "⅜" },
{ "code": 8323, "label": "₃"},
{ "code": 179, "label": "³" }
]
} },
{ "code": 2410, "label": "४", "type": "numeric", "popup": {
"main": { "code": 52, "label": "4" },
"relevant": [
{ "code": 8536, "label": "" },
{ "code": 8308, "label": "⁴" }
{ "code": 8324, "label": "" },
{ "code": 8308, "label": "⁴" },
{ "code": 8536, "label": "⅘" }
]
} },
{ "code": 2411, "label": "५", "type": "numeric", "popup": {
"main": { "code": 53, "label": "5" },
"relevant": [
{ "code": 8538, "label": "⅚" },
{ "code": 8325, "label": "₅" },
{ "code": 8309, "label": "⁵" },
{ "code": 8541, "label": "⅝" }
]
@@ -50,6 +56,7 @@
{ "code": 2412, "label": "६", "type": "numeric", "popup": {
"main": { "code": 54, "label": "6" },
"relevant": [
{ "code": 8326, "label": "₆" },
{ "code": 8310, "label": "⁶" }
]
} },
@@ -57,27 +64,32 @@
"main": { "code": 55, "label": "7" },
"relevant": [
{ "code": 8542, "label": "⅞" },
{ "code": 8327, "label": "₇" },
{ "code": 8311, "label": "⁷" }
]
} },
{ "code": 2414, "label": "८", "type": "numeric", "popup": {
"main": { "code": 56, "label": "8" },
"relevant": [
{ "code": 8328, "label": "₈" },
{ "code": 8312, "label": "⁸" }
]
} },
{ "code": 2415, "label": "९", "type": "numeric", "popup": {
"main": { "code": 57, "label": "9" },
"relevant": [
{ "code": 8329, "label": "₉" },
{ "code": 8313, "label": "⁹" }
]
} },
{ "code": 2406, "label": "", "type": "numeric", "popup": {
"main": { "code": 48, "label": "0" },
"relevant": [
{ "code": 8319, "label": "ⁿ" },
{ "code": 8709, "label": "∅" },
{ "code": 8304, "label": "" }
{ "code": 8319, "label": "" },
{ "code": 8304, "label": "⁰" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
} }
]

View File

@@ -3,46 +3,52 @@
{ "code": 1633, "label": "١", "type": "numeric", "popup": {
"main": { "code": 49, "label": "1" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 185, "label": "¹" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
} },
{ "code": 1634, "label": "٢", "type": "numeric", "popup": {
"main": { "code": 50, "label": "2" },
"relevant": [
{ "code": 8532, "label": "" },
{ "code": 8322, "label": ""},
{ "code": 178, "label": "²" },
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
} },
{ "code": 1635, "label": "٣", "type": "numeric", "popup": {
"main": { "code": 51, "label": "3" },
"relevant": [
{ "code": 8535, "label": "⅗" },
{ "code": 190, "label": "¾" },
{ "code": 179, "label": "³" },
{ "code": 8540, "label": "⅜" }
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "⅜" },
{ "code": 8323, "label": "₃"},
{ "code": 179, "label": "³" }
]
} },
{ "code": 1636, "label": "٤", "type": "numeric", "popup": {
"main": { "code": 52, "label": "4" },
"relevant": [
{ "code": 8536, "label": "" },
{ "code": 8308, "label": "⁴" }
{ "code": 8324, "label": "" },
{ "code": 8308, "label": "⁴" },
{ "code": 8536, "label": "⅘" }
]
} },
{ "code": 1637, "label": "٥", "type": "numeric", "popup": {
"main": { "code": 53, "label": "5" },
"relevant": [
{ "code": 8538, "label": "⅚" },
{ "code": 8325, "label": "₅" },
{ "code": 8309, "label": "⁵" },
{ "code": 8541, "label": "⅝" }
]
@@ -50,6 +56,7 @@
{ "code": 1638, "label": "٦", "type": "numeric", "popup": {
"main": { "code": 54, "label": "6" },
"relevant": [
{ "code": 8326, "label": "₆" },
{ "code": 8310, "label": "⁶" }
]
} },
@@ -57,27 +64,32 @@
"main": { "code": 55, "label": "7" },
"relevant": [
{ "code": 8542, "label": "⅞" },
{ "code": 8327, "label": "₇" },
{ "code": 8311, "label": "⁷" }
]
} },
{ "code": 1640, "label": "٨", "type": "numeric", "popup": {
"main": { "code": 56, "label": "8" },
"relevant": [
{ "code": 8328, "label": "₈" },
{ "code": 8312, "label": "⁸" }
]
} },
{ "code": 1641, "label": "٩", "type": "numeric", "popup": {
"main": { "code": 57, "label": "9" },
"relevant": [
{ "code": 8329, "label": "₉" },
{ "code": 8313, "label": "⁹" }
]
} },
{ "code": 1632, "label": "٠", "type": "numeric", "popup": {
"main": { "code": 48, "label": "0" },
"relevant": [
{ "code": 8319, "label": "ⁿ" },
{ "code": 8709, "label": "∅" },
{ "code": 8304, "label": "" }
{ "code": 8319, "label": "" },
{ "code": 8304, "label": "⁰" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
} }
]

View File

@@ -3,46 +3,52 @@
{ "code": 2791, "label": "૧", "type": "numeric", "popup": {
"main": { "code": 49, "label": "1" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 185, "label": "¹" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
} },
{ "code": 2792, "label": "૨", "type": "numeric", "popup": {
"main": { "code": 50, "label": "2" },
"relevant": [
{ "code": 8532, "label": "" },
{ "code": 8322, "label": ""},
{ "code": 178, "label": "²" },
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
} },
{ "code": 2793, "label": "૩", "type": "numeric", "popup": {
"main": { "code": 51, "label": "3" },
"relevant": [
{ "code": 8535, "label": "⅗" },
{ "code": 190, "label": "¾" },
{ "code": 179, "label": "³" },
{ "code": 8540, "label": "⅜" }
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "⅜" },
{ "code": 8323, "label": "₃"},
{ "code": 179, "label": "³" }
]
} },
{ "code": 2794, "label": "૪", "type": "numeric", "popup": {
"main": { "code": 52, "label": "4" },
"relevant": [
{ "code": 8536, "label": "" },
{ "code": 8308, "label": "⁴" }
{ "code": 8324, "label": "" },
{ "code": 8308, "label": "⁴" },
{ "code": 8536, "label": "⅘" }
]
} },
{ "code": 2795, "label": "૫", "type": "numeric", "popup": {
"main": { "code": 53, "label": "5" },
"relevant": [
{ "code": 8538, "label": "⅚" },
{ "code": 8325, "label": "₅" },
{ "code": 8309, "label": "⁵" },
{ "code": 8541, "label": "⅝" }
]
@@ -50,6 +56,7 @@
{ "code": 2796, "label": "૬", "type": "numeric", "popup": {
"main": { "code": 54, "label": "6" },
"relevant": [
{ "code": 8326, "label": "₆" },
{ "code": 8310, "label": "⁶" }
]
} },
@@ -57,27 +64,32 @@
"main": { "code": 55, "label": "7" },
"relevant": [
{ "code": 8542, "label": "⅞" },
{ "code": 8327, "label": "₇" },
{ "code": 8311, "label": "⁷" }
]
} },
{ "code": 2798, "label": "૮", "type": "numeric", "popup": {
"main": { "code": 56, "label": "8" },
"relevant": [
{ "code": 8328, "label": "₈" },
{ "code": 8312, "label": "⁸" }
]
} },
{ "code": 2799, "label": "૯", "type": "numeric", "popup": {
"main": { "code": 57, "label": "9" },
"relevant": [
{ "code": 8329, "label": "₉" },
{ "code": 8313, "label": "⁹" }
]
} },
{ "code": 2790, "label": "", "type": "numeric", "popup": {
"main": { "code": 48, "label": "0" },
"relevant": [
{ "code": 8319, "label": "ⁿ" },
{ "code": 8709, "label": "∅" },
{ "code": 8304, "label": "" }
{ "code": 8319, "label": "" },
{ "code": 8304, "label": "⁰" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
} }
]

View File

@@ -3,46 +3,52 @@
{ "code": 2663, "label": "", "type": "numeric", "popup": {
"main": { "code": 49, "label": "1" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 185, "label": "¹" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
} },
{ "code": 2664, "label": "੨", "type": "numeric", "popup": {
"main": { "code": 50, "label": "2" },
"relevant": [
{ "code": 8532, "label": "" },
{ "code": 8322, "label": ""},
{ "code": 178, "label": "²" },
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
} },
{ "code": 2665, "label": "੩", "type": "numeric", "popup": {
"main": { "code": 51, "label": "3" },
"relevant": [
{ "code": 8535, "label": "⅗" },
{ "code": 190, "label": "¾" },
{ "code": 179, "label": "³" },
{ "code": 8540, "label": "⅜" }
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "⅜" },
{ "code": 8323, "label": "₃"},
{ "code": 179, "label": "³" }
]
} },
{ "code": 2666, "label": "", "type": "numeric", "popup": {
"main": { "code": 52, "label": "4" },
"relevant": [
{ "code": 8536, "label": "" },
{ "code": 8308, "label": "⁴" }
{ "code": 8324, "label": "" },
{ "code": 8308, "label": "⁴" },
{ "code": 8536, "label": "⅘" }
]
} },
{ "code": 2667, "label": "੫", "type": "numeric", "popup": {
"main": { "code": 53, "label": "5" },
"relevant": [
{ "code": 8538, "label": "⅚" },
{ "code": 8325, "label": "₅" },
{ "code": 8309, "label": "⁵" },
{ "code": 8541, "label": "⅝" }
]
@@ -50,6 +56,7 @@
{ "code": 2668, "label": "੬", "type": "numeric", "popup": {
"main": { "code": 54, "label": "6" },
"relevant": [
{ "code": 8326, "label": "₆" },
{ "code": 8310, "label": "⁶" }
]
} },
@@ -57,27 +64,32 @@
"main": { "code": 55, "label": "7" },
"relevant": [
{ "code": 8542, "label": "⅞" },
{ "code": 8327, "label": "₇" },
{ "code": 8311, "label": "⁷" }
]
} },
{ "code": 2670, "label": "੮", "type": "numeric", "popup": {
"main": { "code": 56, "label": "8" },
"relevant": [
{ "code": 8328, "label": "₈" },
{ "code": 8312, "label": "⁸" }
]
} },
{ "code": 2671, "label": "੯", "type": "numeric", "popup": {
"main": { "code": 57, "label": "9" },
"relevant": [
{ "code": 8329, "label": "₉" },
{ "code": 8313, "label": "⁹" }
]
} },
{ "code": 2662, "label": "", "type": "numeric", "popup": {
"main": { "code": 48, "label": "0" },
"relevant": [
{ "code": 8319, "label": "ⁿ" },
{ "code": 8709, "label": "∅" },
{ "code": 8304, "label": "" }
{ "code": 8319, "label": "" },
{ "code": 8304, "label": "⁰" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
} }
]

View File

@@ -3,46 +3,52 @@
{ "code": 3303, "label": "೧", "type": "numeric", "popup": {
"main": { "code": 49, "label": "1" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 185, "label": "¹" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
} },
{ "code": 3304, "label": "೨", "type": "numeric", "popup": {
"main": { "code": 50, "label": "2" },
"relevant": [
{ "code": 8532, "label": "" },
{ "code": 8322, "label": ""},
{ "code": 178, "label": "²" },
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
} },
{ "code": 3305, "label": "೩", "type": "numeric", "popup": {
"main": { "code": 51, "label": "3" },
"relevant": [
{ "code": 8535, "label": "⅗" },
{ "code": 190, "label": "¾" },
{ "code": 179, "label": "³" },
{ "code": 8540, "label": "⅜" }
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "⅜" },
{ "code": 8323, "label": "₃"},
{ "code": 179, "label": "³" }
]
} },
{ "code": 3306, "label": "೪", "type": "numeric", "popup": {
"main": { "code": 52, "label": "4" },
"relevant": [
{ "code": 8536, "label": "" },
{ "code": 8308, "label": "⁴" }
{ "code": 8324, "label": "" },
{ "code": 8308, "label": "⁴" },
{ "code": 8536, "label": "⅘" }
]
} },
{ "code": 3307, "label": "೫", "type": "numeric", "popup": {
"main": { "code": 53, "label": "5" },
"relevant": [
{ "code": 8538, "label": "⅚" },
{ "code": 8325, "label": "₅" },
{ "code": 8309, "label": "⁵" },
{ "code": 8541, "label": "⅝" }
]
@@ -50,6 +56,7 @@
{ "code": 3308, "label": "೬", "type": "numeric", "popup": {
"main": { "code": 54, "label": "6" },
"relevant": [
{ "code": 8326, "label": "₆" },
{ "code": 8310, "label": "⁶" }
]
} },
@@ -57,27 +64,32 @@
"main": { "code": 55, "label": "7" },
"relevant": [
{ "code": 8542, "label": "⅞" },
{ "code": 8327, "label": "₇" },
{ "code": 8311, "label": "⁷" }
]
} },
{ "code": 3310, "label": "೮", "type": "numeric", "popup": {
"main": { "code": 56, "label": "8" },
"relevant": [
{ "code": 8328, "label": "₈" },
{ "code": 8312, "label": "⁸" }
]
} },
{ "code": 3311, "label": "೯", "type": "numeric", "popup": {
"main": { "code": 57, "label": "9" },
"relevant": [
{ "code": 8329, "label": "₉" },
{ "code": 8313, "label": "⁹" }
]
} },
{ "code": 3302, "label": "", "type": "numeric", "popup": {
"main": { "code": 48, "label": "0" },
"relevant": [
{ "code": 8319, "label": "ⁿ" },
{ "code": 8709, "label": "∅" },
{ "code": 8304, "label": "" }
{ "code": 8319, "label": "" },
{ "code": 8304, "label": "⁰" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
} }
]

View File

@@ -3,46 +3,52 @@
{ "code": 3431, "label": "൧", "type": "numeric", "popup": {
"main": { "code": 49, "label": "1" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 185, "label": "¹" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
} },
{ "code": 3432, "label": "൨", "type": "numeric", "popup": {
"main": { "code": 50, "label": "2" },
"relevant": [
{ "code": 8532, "label": "" },
{ "code": 8322, "label": ""},
{ "code": 178, "label": "²" },
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
} },
{ "code": 3433, "label": "൩", "type": "numeric", "popup": {
"main": { "code": 51, "label": "3" },
"relevant": [
{ "code": 8535, "label": "⅗" },
{ "code": 190, "label": "¾" },
{ "code": 179, "label": "³" },
{ "code": 8540, "label": "⅜" }
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "⅜" },
{ "code": 8323, "label": "₃"},
{ "code": 179, "label": "³" }
]
} },
{ "code": 3434, "label": "൪", "type": "numeric", "popup": {
"main": { "code": 52, "label": "4" },
"relevant": [
{ "code": 8536, "label": "" },
{ "code": 8308, "label": "⁴" }
{ "code": 8324, "label": "" },
{ "code": 8308, "label": "⁴" },
{ "code": 8536, "label": "⅘" }
]
} },
{ "code": 3435, "label": "൫", "type": "numeric", "popup": {
"main": { "code": 53, "label": "5" },
"relevant": [
{ "code": 8538, "label": "⅚" },
{ "code": 8325, "label": "₅" },
{ "code": 8309, "label": "⁵" },
{ "code": 8541, "label": "⅝" }
]
@@ -50,6 +56,7 @@
{ "code": 3436, "label": "൬", "type": "numeric", "popup": {
"main": { "code": 54, "label": "6" },
"relevant": [
{ "code": 8326, "label": "₆" },
{ "code": 8310, "label": "⁶" }
]
} },
@@ -57,27 +64,32 @@
"main": { "code": 55, "label": "7" },
"relevant": [
{ "code": 8542, "label": "⅞" },
{ "code": 8327, "label": "₇" },
{ "code": 8311, "label": "⁷" }
]
} },
{ "code": 3438, "label": "൮", "type": "numeric", "popup": {
"main": { "code": 56, "label": "8" },
"relevant": [
{ "code": 8328, "label": "₈" },
{ "code": 8312, "label": "⁸" }
]
} },
{ "code": 3439, "label": "൯", "type": "numeric", "popup": {
"main": { "code": 57, "label": "9" },
"relevant": [
{ "code": 8329, "label": "₉" },
{ "code": 8313, "label": "⁹" }
]
} },
{ "code": 3430, "label": "", "type": "numeric", "popup": {
"main": { "code": 48, "label": "0" },
"relevant": [
{ "code": 8319, "label": "ⁿ" },
{ "code": 8709, "label": "∅" },
{ "code": 8304, "label": "" }
{ "code": 8319, "label": "" },
{ "code": 8304, "label": "⁰" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
} }
]

View File

@@ -3,46 +3,52 @@
{ "code": 2919, "label": "୧", "type": "numeric", "popup": {
"main": { "code": 49, "label": "1" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 185, "label": "¹" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
} },
{ "code": 2920, "label": "", "type": "numeric", "popup": {
"main": { "code": 50, "label": "2" },
"relevant": [
{ "code": 8532, "label": "" },
{ "code": 8322, "label": ""},
{ "code": 178, "label": "²" },
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
} },
{ "code": 2921, "label": "୩", "type": "numeric", "popup": {
"main": { "code": 51, "label": "3" },
"relevant": [
{ "code": 8535, "label": "⅗" },
{ "code": 190, "label": "¾" },
{ "code": 179, "label": "³" },
{ "code": 8540, "label": "⅜" }
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "⅜" },
{ "code": 8323, "label": "₃"},
{ "code": 179, "label": "³" }
]
} },
{ "code": 2922, "label": "୪", "type": "numeric", "popup": {
"main": { "code": 52, "label": "4" },
"relevant": [
{ "code": 8536, "label": "" },
{ "code": 8308, "label": "⁴" }
{ "code": 8324, "label": "" },
{ "code": 8308, "label": "⁴" },
{ "code": 8536, "label": "⅘" }
]
} },
{ "code": 2923, "label": "୫", "type": "numeric", "popup": {
"main": { "code": 53, "label": "5" },
"relevant": [
{ "code": 8538, "label": "⅚" },
{ "code": 8325, "label": "₅" },
{ "code": 8309, "label": "⁵" },
{ "code": 8541, "label": "⅝" }
]
@@ -50,6 +56,7 @@
{ "code": 2924, "label": "୬", "type": "numeric", "popup": {
"main": { "code": 54, "label": "6" },
"relevant": [
{ "code": 8326, "label": "₆" },
{ "code": 8310, "label": "⁶" }
]
} },
@@ -57,27 +64,32 @@
"main": { "code": 55, "label": "7" },
"relevant": [
{ "code": 8542, "label": "⅞" },
{ "code": 8327, "label": "₇" },
{ "code": 8311, "label": "⁷" }
]
} },
{ "code": 2926, "label": "୮", "type": "numeric", "popup": {
"main": { "code": 56, "label": "8" },
"relevant": [
{ "code": 8328, "label": "₈" },
{ "code": 8312, "label": "⁸" }
]
} },
{ "code": 2927, "label": "୯", "type": "numeric", "popup": {
"main": { "code": 57, "label": "9" },
"relevant": [
{ "code": 8329, "label": "₉" },
{ "code": 8313, "label": "⁹" }
]
} },
{ "code": 2918, "label": "", "type": "numeric", "popup": {
"main": { "code": 48, "label": "0" },
"relevant": [
{ "code": 8319, "label": "ⁿ" },
{ "code": 8709, "label": "∅" },
{ "code": 8304, "label": "" }
{ "code": 8319, "label": "" },
{ "code": 8304, "label": "⁰" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
} }
]

View File

@@ -3,46 +3,52 @@
{ "code": 1777, "label": "۱", "type": "numeric", "popup": {
"main": { "code": 49, "label": "1" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 185, "label": "¹" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
} },
{ "code": 1778, "label": "۲", "type": "numeric", "popup": {
"main": { "code": 50, "label": "2" },
"relevant": [
{ "code": 8532, "label": "" },
{ "code": 8322, "label": ""},
{ "code": 178, "label": "²" },
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
} },
{ "code": 1779, "label": "۳", "type": "numeric", "popup": {
"main": { "code": 51, "label": "3" },
"relevant": [
{ "code": 8535, "label": "⅗" },
{ "code": 190, "label": "¾" },
{ "code": 179, "label": "³" },
{ "code": 8540, "label": "⅜" }
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "⅜" },
{ "code": 8323, "label": "₃"},
{ "code": 179, "label": "³" }
]
} },
{ "code": 1780, "label": "۴", "type": "numeric", "popup": {
"main": { "code": 52, "label": "4" },
"relevant": [
{ "code": 8536, "label": "" },
{ "code": 8308, "label": "⁴" }
{ "code": 8324, "label": "" },
{ "code": 8308, "label": "⁴" },
{ "code": 8536, "label": "⅘" }
]
} },
{ "code": 1781, "label": "۵", "type": "numeric", "popup": {
"main": { "code": 53, "label": "5" },
"relevant": [
{ "code": 8538, "label": "⅚" },
{ "code": 8325, "label": "₅" },
{ "code": 8309, "label": "⁵" },
{ "code": 8541, "label": "⅝" }
]
@@ -50,6 +56,7 @@
{ "code": 1782, "label": "۶", "type": "numeric", "popup": {
"main": { "code": 54, "label": "6" },
"relevant": [
{ "code": 8326, "label": "₆" },
{ "code": 8310, "label": "⁶" }
]
} },
@@ -57,27 +64,32 @@
"main": { "code": 55, "label": "7" },
"relevant": [
{ "code": 8542, "label": "⅞" },
{ "code": 8327, "label": "₇" },
{ "code": 8311, "label": "⁷" }
]
} },
{ "code": 1784, "label": "۸", "type": "numeric", "popup": {
"main": { "code": 56, "label": "8" },
"relevant": [
{ "code": 8328, "label": "₈" },
{ "code": 8312, "label": "⁸" }
]
} },
{ "code": 1785, "label": "۹", "type": "numeric", "popup": {
"main": { "code": 57, "label": "9" },
"relevant": [
{ "code": 8329, "label": "₉" },
{ "code": 8313, "label": "⁹" }
]
} },
{ "code": 1776, "label": "۰", "type": "numeric", "popup": {
"main": { "code": 48, "label": "0" },
"relevant": [
{ "code": 8319, "label": "ⁿ" },
{ "code": 8709, "label": "∅" },
{ "code": 8304, "label": "" }
{ "code": 8319, "label": "" },
{ "code": 8304, "label": "⁰" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
} }
]

View File

@@ -3,46 +3,52 @@
{ "code": 3047, "label": "௧", "type": "numeric", "popup": {
"main": { "code": 49, "label": "1" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 185, "label": "¹" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
} },
{ "code": 3048, "label": "௨", "type": "numeric", "popup": {
"main": { "code": 50, "label": "2" },
"relevant": [
{ "code": 8532, "label": "" },
{ "code": 8322, "label": ""},
{ "code": 178, "label": "²" },
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
} },
{ "code": 3049, "label": "௩", "type": "numeric", "popup": {
"main": { "code": 51, "label": "3" },
"relevant": [
{ "code": 8535, "label": "⅗" },
{ "code": 190, "label": "¾" },
{ "code": 179, "label": "³" },
{ "code": 8540, "label": "⅜" }
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "⅜" },
{ "code": 8323, "label": "₃"},
{ "code": 179, "label": "³" }
]
} },
{ "code": 3050, "label": "௪", "type": "numeric", "popup": {
"main": { "code": 52, "label": "4" },
"relevant": [
{ "code": 8536, "label": "" },
{ "code": 8308, "label": "⁴" }
{ "code": 8324, "label": "" },
{ "code": 8308, "label": "⁴" },
{ "code": 8536, "label": "⅘" }
]
} },
{ "code": 3051, "label": "௫", "type": "numeric", "popup": {
"main": { "code": 53, "label": "5" },
"relevant": [
{ "code": 8538, "label": "⅚" },
{ "code": 8325, "label": "₅" },
{ "code": 8309, "label": "⁵" },
{ "code": 8541, "label": "⅝" }
]
@@ -50,6 +56,7 @@
{ "code": 3052, "label": "௬", "type": "numeric", "popup": {
"main": { "code": 54, "label": "6" },
"relevant": [
{ "code": 8326, "label": "₆" },
{ "code": 8310, "label": "⁶" }
]
} },
@@ -57,27 +64,32 @@
"main": { "code": 55, "label": "7" },
"relevant": [
{ "code": 8542, "label": "⅞" },
{ "code": 8327, "label": "₇" },
{ "code": 8311, "label": "⁷" }
]
} },
{ "code": 3054, "label": "௮", "type": "numeric", "popup": {
"main": { "code": 56, "label": "8" },
"relevant": [
{ "code": 8328, "label": "₈" },
{ "code": 8312, "label": "⁸" }
]
} },
{ "code": 3055, "label": "௯", "type": "numeric", "popup": {
"main": { "code": 57, "label": "9" },
"relevant": [
{ "code": 8329, "label": "₉" },
{ "code": 8313, "label": "⁹" }
]
} },
{ "code": 3046, "label": "", "type": "numeric", "popup": {
"main": { "code": 48, "label": "0" },
"relevant": [
{ "code": 8319, "label": "ⁿ" },
{ "code": 8709, "label": "∅" },
{ "code": 8304, "label": "" }
{ "code": 8319, "label": "" },
{ "code": 8304, "label": "⁰" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
} }
]

View File

@@ -3,46 +3,52 @@
{ "code": 3175, "label": "౧", "type": "numeric", "popup": {
"main": { "code": 49, "label": "1" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 185, "label": "¹" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
} },
{ "code": 3176, "label": "౨", "type": "numeric", "popup": {
"main": { "code": 50, "label": "2" },
"relevant": [
{ "code": 8532, "label": "" },
{ "code": 8322, "label": ""},
{ "code": 178, "label": "²" },
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
} },
{ "code": 3177, "label": "౩", "type": "numeric", "popup": {
"main": { "code": 51, "label": "3" },
"relevant": [
{ "code": 8535, "label": "⅗" },
{ "code": 190, "label": "¾" },
{ "code": 179, "label": "³" },
{ "code": 8540, "label": "⅜" }
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "⅜" },
{ "code": 8323, "label": "₃"},
{ "code": 179, "label": "³" }
]
} },
{ "code": 3178, "label": "౪", "type": "numeric", "popup": {
"main": { "code": 52, "label": "4" },
"relevant": [
{ "code": 8536, "label": "" },
{ "code": 8308, "label": "⁴" }
{ "code": 8324, "label": "" },
{ "code": 8308, "label": "⁴" },
{ "code": 8536, "label": "⅘" }
]
} },
{ "code": 3179, "label": "౫", "type": "numeric", "popup": {
"main": { "code": 53, "label": "5" },
"relevant": [
{ "code": 8538, "label": "⅚" },
{ "code": 8325, "label": "₅" },
{ "code": 8309, "label": "⁵" },
{ "code": 8541, "label": "⅝" }
]
@@ -50,6 +56,7 @@
{ "code": 3180, "label": "౬", "type": "numeric", "popup": {
"main": { "code": 54, "label": "6" },
"relevant": [
{ "code": 8326, "label": "₆" },
{ "code": 8310, "label": "⁶" }
]
} },
@@ -57,27 +64,32 @@
"main": { "code": 55, "label": "7" },
"relevant": [
{ "code": 8542, "label": "⅞" },
{ "code": 8327, "label": "₇" },
{ "code": 8311, "label": "⁷" }
]
} },
{ "code": 3182, "label": "౮", "type": "numeric", "popup": {
"main": { "code": 56, "label": "8" },
"relevant": [
{ "code": 8328, "label": "₈" },
{ "code": 8312, "label": "⁸" }
]
} },
{ "code": 3183, "label": "౯", "type": "numeric", "popup": {
"main": { "code": 57, "label": "9" },
"relevant": [
{ "code": 8329, "label": "₉" },
{ "code": 8313, "label": "⁹" }
]
} },
{ "code": 3174, "label": "", "type": "numeric", "popup": {
"main": { "code": 48, "label": "0" },
"relevant": [
{ "code": 8319, "label": "ⁿ" },
{ "code": 8709, "label": "∅" },
{ "code": 8304, "label": "" }
{ "code": 8319, "label": "" },
{ "code": 8304, "label": "⁰" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
} }
]

View File

@@ -3,20 +3,23 @@
{ "code": 3665, "label": "๑", "type": "numeric", "popup": {
"main": { "code": 185, "label": "¹" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
} },
{ "code": 3666, "label": "๒", "type": "numeric", "popup": {
"main": { "code": 178, "label": "²" },
"relevant": [
{ "code": 8322, "label": "₂"},
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
@@ -24,44 +27,59 @@
{ "code": 3667, "label": "๓", "type": "numeric", "popup": {
"main": { "code": 179, "label": "³" },
"relevant": [
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "" },
{ "code": 8323, "label": "₃"},
{ "code": 190, "label": "¾" },
{ "code": 8540, "label": "" }
{ "code": 8535, "label": "" }
]
} },
{ "code": 3668, "label": "๔", "type": "numeric", "popup": {
"main": { "code": 8308, "label": "⁴" },
"relevant": [
{ "code": 8324, "label": "₄" },
{ "code": 8536, "label": "⅘" }
]
} },
{ "code": 3669, "label": "๕", "type": "numeric", "popup": {
"main": { "code": 8309, "label": "⁵" },
"relevant": [
{ "code": 8325, "label": "₅" },
{ "code": 8538, "label": "⅚" },
{ "code": 8541, "label": "⅝" }
]
} },
{ "code": 3670, "label": "๖", "type": "numeric", "popup": {
"main": { "code": 8310, "label": "⁶" }
"main": { "code": 8310, "label": "⁶" },
"relevant": [
{ "code": 8326, "label": "₆" }
]
} },
{ "code": 3671, "label": "๗", "type": "numeric", "popup": {
"main": { "code": 8311, "label": "⁷" },
"relevant": [
{ "code": 8327, "label": "₇" },
{ "code": 8542, "label": "⅞" }
]
} },
{ "code": 3672, "label": "๘", "type": "numeric", "popup": {
"main": { "code": 8312, "label": "⁸" }
"main": { "code": 8312, "label": "⁸" },
"relevant": [
{ "code": 8328, "label": "₈" }
]
} },
{ "code": 3673, "label": "๙", "type": "numeric", "popup": {
"main": { "code": 8313, "label": "⁹" }
"main": { "code": 8313, "label": "⁹" },
"relevant": [
{ "code": 8329, "label": "₉" }
]
} },
{ "code": 3664, "label": "", "type": "numeric", "popup": {
"main": { "code": 8304, "label": "⁰" },
"relevant": [
{ "code": 8709, "label": "∅" },
{ "code": 8319, "label": "ⁿ" }
{ "code": 8319, "label": "ⁿ" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
} }
]

View File

@@ -3,46 +3,52 @@
{ "code": 71905, "label": "𑣡", "type": "numeric", "popup": {
"main": { "code": 49, "label": "1" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 185, "label": "¹" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
} },
{ "code": 71906, "label": "𑣢", "type": "numeric", "popup": {
"main": { "code": 50, "label": "2" },
"relevant": [
{ "code": 8532, "label": "" },
{ "code": 8322, "label": ""},
{ "code": 178, "label": "²" },
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
} },
{ "code": 71907, "label": "𑣣", "type": "numeric", "popup": {
"main": { "code": 51, "label": "3" },
"relevant": [
{ "code": 8535, "label": "⅗" },
{ "code": 190, "label": "¾" },
{ "code": 179, "label": "³" },
{ "code": 8540, "label": "⅜" }
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "⅜" },
{ "code": 8323, "label": "₃"},
{ "code": 179, "label": "³" }
]
} },
{ "code": 71908, "label": "𑣤", "type": "numeric", "popup": {
"main": { "code": 52, "label": "4" },
"relevant": [
{ "code": 8536, "label": "" },
{ "code": 8308, "label": "⁴" }
{ "code": 8324, "label": "" },
{ "code": 8308, "label": "⁴" },
{ "code": 8536, "label": "⅘" }
]
} },
{ "code": 71909, "label": "𑣥", "type": "numeric", "popup": {
"main": { "code": 53, "label": "5" },
"relevant": [
{ "code": 8538, "label": "⅚" },
{ "code": 8325, "label": "₅" },
{ "code": 8309, "label": "⁵" },
{ "code": 8541, "label": "⅝" }
]
@@ -50,6 +56,7 @@
{ "code": 71910, "label": "𑣦", "type": "numeric", "popup": {
"main": { "code": 54, "label": "6" },
"relevant": [
{ "code": 8326, "label": "₆" },
{ "code": 8310, "label": "⁶" }
]
} },
@@ -57,27 +64,32 @@
"main": { "code": 55, "label": "7" },
"relevant": [
{ "code": 8542, "label": "⅞" },
{ "code": 8327, "label": "₇" },
{ "code": 8311, "label": "⁷" }
]
} },
{ "code": 71912, "label": "𑣨", "type": "numeric", "popup": {
"main": { "code": 56, "label": "8" },
"relevant": [
{ "code": 8328, "label": "₈" },
{ "code": 8312, "label": "⁸" }
]
} },
{ "code": 71913, "label": "𑣩", "type": "numeric", "popup": {
"main": { "code": 57, "label": "9" },
"relevant": [
{ "code": 8329, "label": "₉" },
{ "code": 8313, "label": "⁹" }
]
} },
{ "code": 71904, "label": "𑣠", "type": "numeric", "popup": {
"main": { "code": 48, "label": "0" },
"relevant": [
{ "code": 8319, "label": "ⁿ" },
{ "code": 8709, "label": "∅" },
{ "code": 8304, "label": "" }
{ "code": 8319, "label": "" },
{ "code": 8304, "label": "⁰" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
} }
]

View File

@@ -10,15 +10,17 @@
"code": 49, "label": "1", "type": "numeric", "popup": {
"main": { "code": 185, "label": "¹" },
"relevant": [
{ "code": 8537, "label": "" },
{ "code": 8321, "label": "" },
{ "code": 8528, "label": "⅐" },
{ "code": 8539, "label": "⅛" },
{ "code": 8529, "label": "⅑" },
{ "code": 8530, "label": "⅒" },
{ "code": 8543, "label": "⅟" },
{ "code": 189, "label": "½" },
{ "code": 8531, "label": "⅓" },
{ "code": 188, "label": "¼" },
{ "code": 8533, "label": "⅕" }
{ "code": 8533, "label": "⅕" },
{ "code": 8537, "label": "⅙" }
]
}
}
@@ -29,6 +31,7 @@
"code": 50, "label": "2", "type": "numeric", "popup": {
"main": { "code": 178, "label": "²" },
"relevant": [
{ "code": 8322, "label": "₂"},
{ "code": 8532, "label": "⅔" },
{ "code": 8534, "label": "⅖" }
]
@@ -45,9 +48,10 @@
"code": 51, "label": "3", "type": "numeric", "popup": {
"main": { "code": 179, "label": "³" },
"relevant": [
{ "code": 8535, "label": "" },
{ "code": 8540, "label": "" },
{ "code": 8323, "label": "₃"},
{ "code": 190, "label": "¾" },
{ "code": 8540, "label": "" }
{ "code": 8535, "label": "" }
]
}
}
@@ -68,6 +72,7 @@
"code": 52, "label": "4", "type": "numeric", "popup": {
"main": { "code": 8308, "label": "⁴" },
"relevant": [
{ "code": 8324, "label": "₄" },
{ "code": 8536, "label": "⅘" }
]
}
@@ -86,6 +91,7 @@
"code": 53, "label": "5", "type": "numeric", "popup": {
"main": { "code": 8309, "label": "⁵" },
"relevant": [
{ "code": 8325, "label": "₅" },
{ "code": 8538, "label": "⅚" },
{ "code": 8541, "label": "⅝" }
]
@@ -105,7 +111,10 @@
},
"default": {
"code": 54, "label": "6", "type": "numeric", "popup": {
"main": { "code": 8310, "label": "⁶" }
"main": { "code": 8310, "label": "⁶" },
"relevant": [
{ "code": 8326, "label": "₆" }
]
}
}
},
@@ -115,6 +124,7 @@
"code": 55, "label": "7", "type": "numeric", "popup": {
"main": { "code": 8311, "label": "⁷" },
"relevant": [
{ "code": 8327, "label": "₇" },
{ "code": 8542, "label": "⅞" }
]
}
@@ -132,7 +142,10 @@
},
"default": {
"code": 56, "label": "8", "type": "numeric", "popup": {
"main": { "code": 8312, "label": "⁸" }
"main": { "code": 8312, "label": "⁸" },
"relevant": [
{ "code": 8328, "label": "₈" }
]
}
}
},
@@ -160,7 +173,10 @@
},
"default": {
"code": 57, "label": "9", "type": "numeric", "popup": {
"main": { "code": 8313, "label": "⁹" }
"main": { "code": 8313, "label": "⁹" },
"relevant": [
{ "code": 8329, "label": "₉" }
]
}
}
},
@@ -191,7 +207,9 @@
"main": { "code": 8304, "label": "⁰" },
"relevant": [
{ "code": 8709, "label": "∅" },
{ "code": 8319, "label": "ⁿ" }
{ "code": 8319, "label": "ⁿ" },
{ "code": 8585, "label": "↉" },
{ "code": 8320, "label": "₀" }
]
}
}

View File

@@ -401,6 +401,16 @@
"characters": "org.florisboard.layouts:qwertz"
}
},
{
"languageTag": "hy",
"composer": "org.florisboard.composers:appender",
"currencySet": "org.florisboard.currencysets:armenian_dram",
"popupMapping": "org.florisboard.localization:hy",
"preferred": {
"characters": "org.florisboard.layouts:armenian_alt_phonetic",
"symbols": "org.florisboard.layouts:armenian"
}
},
{
"languageTag": "hy",
"composer": "org.florisboard.composers:appender",

View File

@@ -10,9 +10,9 @@
"main": { "$": "auto_text_key" ,"code" : 237, "label": "í" }
},
"o": {
"main": { "$": "auto_text_key", "code" : 246, "label": "ö" },
"main": { "$": "auto_text_key", "code" : 243, "label": "ó" },
"relevant": [
{ "$": "auto_text_key", "code" : 243, "label": "ó" },
{ "$": "auto_text_key", "code" : 246, "label": "ö" },
{ "$": "auto_text_key", "code" : 337, "label": "ő" }
]
},
@@ -22,9 +22,9 @@
]
},
"u": {
"main": { "$": "auto_text_key", "code" : 252, "label": "ü" },
"main": { "$": "auto_text_key", "code" : 250, "label": "ú" },
"relevant": [
{ "$": "auto_text_key", "code" : 250, "label": "ú" },
{ "$": "auto_text_key", "code" : 252, "label": "ü" },
{ "$": "auto_text_key", "code" : 369, "label": "ű" }
]
},

View File

@@ -6,6 +6,7 @@
"--secondary": "#ff9800",
"--secondary-variant": "#e65100",
"--background": "#e0e0e0",
"--background-variant": "#d0d0d0",
"--surface": "#ffffff",
"--surface-variant": "#f5f5f5",
@@ -27,13 +28,13 @@
"--on-surface-variant": "#5f5f5f",
"--shape": "rounded-corner(8dp, 8dp, 8dp, 8dp)",
"--shape-variant": "rounded-corner(12dp, 12dp, 12dp, 12dp)"
"--shape-variant": "rounded-corner(12dp, 12dp, 12dp, 12dp)",
"--shape-chip": "rounded-corner(50%, 50%, 50%, 50%)"
},
"window": {
"background": "var(--background)",
"foreground": "var(--on-background)",
"clip": "no"
"foreground": "var(--on-background)"
},
"key": {
@@ -110,6 +111,7 @@
"smartbar-extended-actions-toggle": {
"background": "transparent",
"foreground": "var(--on-surface-variant)",
"margin": "6dp",
"shape": "circle()"
},
"smartbar-action-key": {
@@ -120,23 +122,34 @@
"smartbar-action-key:disabled": {
"foreground": "var(--on-background-disabled)"
},
"smartbar-actions-overflow": {
"margin": "4dp"
},
"smartbar-actions-overflow-customize-button": {
"background": "var(--primary)",
"foreground": "var(--on-primary)",
"font-size": "14sp",
"margin": "0dp 8dp 0dp 0dp",
"shape": "rounded-corner(24dp, 24dp, 24dp, 24dp)"
},
"smartbar-action-tile": {
"background": "transparent",
"background": "var(--background-variant)",
"foreground": "var(--on-background)",
"font-size": "14sp",
"shape": "var(--shape)",
"text-max-lines": "2",
"margin": "4dp",
"padding": "4dp",
"shape": "rounded-corner(20%, 20%, 20%, 20%)",
"text-align": "center",
"text-max-lines": "2",
"text-overflow": "ellipsis"
},
"smartbar-action-tile:disabled": {
"foreground": "var(--on-background-disabled)"
},
"smartbar-actions-overflow-customize-button": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"shape": "circle()"
"smartbar-action-tile-icon": {
"font-size": "24sp",
"margin": "0dp 0dp 0dp 8dp"
},
"smartbar-actions-editor": {
@@ -194,6 +207,10 @@
"background": "var(--surface)",
"foreground": "var(--on-surface)"
},
"smartbar-candidate-word-secondary-text": {
"font-size": "8sp",
"margin": "0dp 2dp 0dp 0dp"
},
"smartbar-candidate-clip": {
"background": "transparent",
"foreground": "var(--on-background)",
@@ -208,6 +225,9 @@
"background": "var(--surface)",
"foreground": "var(--on-surface)"
},
"smartbar-candidate-clip-icon": {
"margin": "0dp 0dp 4dp 0dp"
},
"smartbar-candidate-spacer": {
"foreground": "var(--spacer-color)"
},
@@ -229,31 +249,80 @@
},
"clipboard-subheader": {
"font-size": "14sp",
"margin": "6dp"
"margin": "6dp 10dp 6dp 6dp"
},
"clipboard-content": {
"padding": "10dp"
"padding": "10dp 0dp"
},
"clipboard-filter-row": {
"background": "var(--background-variant)",
"foreground": "var(--on-background)",
"padding": "0dp 0dp 4dp 0dp",
"shape": "var(--shape-variant)"
},
"clipboard-filter-chip": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"margin": "4dp 4dp 0dp 4dp",
"padding": "8dp 4dp",
"shape": "var(--shape-chip)"
},
"clipboard-filter-chip[state=`active`]": {
"background": "var(--primary)",
"foreground": "var(--on-primary)"
},
"clipboard-filter-chip-text": {
"margin": "4dp 0dp 0dp 0dp"
},
"clipboard-grid": {
"shape": "var(--shape-variant)"
},
"clipboard-item": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"margin": "4dp",
"padding": "12dp 8dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp",
"text-max-lines": "10",
"text-overflow": "ellipsis"
},
"clipboard-item[type=`text`]": {
"padding": "12dp 8dp"
},
"clipboard-item-description": {
"font-size": "12sp",
"font-style": "italic"
},
"clipboard-item-popup": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"margin": "4dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
},
"clipboard-item-popup": {
"clipboard-item-popup[type=`text`]": {
"padding": "12dp 8dp"
},
"clipboard-item-timestamp": {
"font-size": "11sp",
"padding": "16dp 8dp"
},
"clipboard-item-actions": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"margin": "4dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
},
"clipboard-item-popup-action": {
"clipboard-item-action": {
"font-size": "16sp",
"padding": "12dp"
},
"clipboard-item-action-text": {
"margin": "4dp 0dp 0dp 0dp"
},
"clipboard-clear-all-dialog": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
@@ -378,5 +447,17 @@
"text-align": "center",
"text-max-lines": "1",
"text-overflow": "ellipsis"
},
"subtype-panel-list-item": {
"font-size": "16sp",
"padding": "16dp"
},
"subtype-panel-list-item-icon-leading": {
"font-size": "24sp",
"padding": "0dp 0dp 16dp 0dp"
},
"subtype-panel-list-item-text": {
"text-max-lines": "1",
"text-overflow": "ellipsis"
}
}

View File

@@ -6,6 +6,7 @@
"--secondary": "#ff9800",
"--secondary-variant": "#e65100",
"--background": "#e0e0e0",
"--background-variant": "#d0d0d0",
"--surface": "#f0f0f0",
"--surface-variant": "#ffffff",
@@ -27,13 +28,13 @@
"--on-surface-variant": "#5f5f5f",
"--shape": "rounded-corner(8dp, 8dp, 8dp, 8dp)",
"--shape-variant": "rounded-corner(12dp, 12dp, 12dp, 12dp)"
"--shape-variant": "rounded-corner(12dp, 12dp, 12dp, 12dp)",
"--shape-chip": "rounded-corner(50%, 50%, 50%, 50%)"
},
"window": {
"background": "var(--background)",
"foreground": "var(--on-background)",
"clip": "no"
"foreground": "var(--on-background)"
},
"key": {
@@ -112,6 +113,7 @@
"smartbar-extended-actions-toggle": {
"background": "transparent",
"foreground": "var(--on-surface-variant)",
"margin": "6dp",
"shape": "circle()"
},
"smartbar-action-key": {
@@ -126,28 +128,36 @@
"smartbar-action-key:disabled": {
"foreground": "var(--on-background-disabled)"
},
"smartbar-actions-overflow": {
"margin": "4dp"
},
"smartbar-actions-overflow-customize-button": {
"background": "var(--primary)",
"foreground": "var(--on-primary)",
"font-size": "14sp",
"margin": "0dp 8dp 0dp 0dp",
"shape": "rounded-corner(24dp, 24dp, 24dp, 24dp)"
},
"smartbar-action-tile": {
"background": "transparent",
"background": "var(--background-variant)",
"foreground": "var(--on-background)",
"font-size": "14sp",
"shape": "var(--shape)",
"text-max-lines": "2",
"margin": "4dp",
"padding": "4dp",
"shape": "rounded-corner(20%, 20%, 20%, 20%)",
"text-align": "center",
"text-max-lines": "2",
"text-overflow": "ellipsis"
},
"smartbar-action-tile:pressed": {
"background": "var(--surface)",
"foreground": "var(--on-surface)"
},
"smartbar-action-tile:disabled": {
"foreground": "var(--on-background-disabled)"
},
"smartbar-actions-overflow-customize-button": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"shape": "circle()"
"smartbar-action-tile-icon": {
"font-size": "24sp",
"margin": "0dp 0dp 0dp 8dp"
},
"smartbar-actions-editor": {
"background": "var(--background)",
"foreground": "var(--on-background)",
@@ -203,6 +213,10 @@
"background": "var(--surface)",
"foreground": "var(--on-background)"
},
"smartbar-candidate-word-secondary-text": {
"font-size": "8sp",
"margin": "0dp 2dp 0dp 0dp"
},
"smartbar-candidate-clip": {
"background": "transparent",
"foreground": "var(--on-background)",
@@ -217,13 +231,15 @@
"background": "var(--surface)",
"foreground": "var(--on-background)"
},
"smartbar-candidate-clip-icon": {
"margin": "0dp 0dp 4dp 0dp"
},
"smartbar-candidate-spacer": {
"foreground": "var(--surface)"
},
"clipboard-header": {
"background": "transparent",
"foreground": "var(--on-surface)",
"foreground": "var(--on-background)",
"font-size": "16sp"
},
"clipboard-header-button": {
@@ -239,32 +255,80 @@
},
"clipboard-subheader": {
"font-size": "14sp",
"margin": "6dp"
"margin": "6dp 10dp 6dp 6dp"
},
"clipboard-content": {
"padding": "10dp"
"padding": "10dp 0dp"
},
"clipboard-filter-row": {
"background": "var(--background-variant)",
"foreground": "var(--on-background)",
"padding": "0dp 0dp 4dp 0dp",
"shape": "var(--shape-variant)"
},
"clipboard-filter-chip": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"margin": "4dp 4dp 0dp 4dp",
"padding": "8dp 4dp",
"shape": "var(--shape-chip)"
},
"clipboard-filter-chip[state=`active`]": {
"background": "var(--primary)",
"foreground": "var(--on-primary)"
},
"clipboard-filter-chip-text": {
"margin": "4dp 0dp 0dp 0dp"
},
"clipboard-grid": {
"shape": "var(--shape-variant)"
},
"clipboard-item": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"margin": "4dp",
"padding": "12dp 8dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
"shadow-elevation": "2dp",
"text-max-lines": "10",
"text-overflow": "ellipsis"
},
"clipboard-item[type=`text`]": {
"padding": "12dp 8dp"
},
"clipboard-item-description": {
"font-size": "12sp",
"font-style": "italic"
},
"clipboard-item-popup": {
"background": "var(--surface-variant)",
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"margin": "4dp",
"padding": "12dp 8dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
},
"clipboard-item-popup-action": {
"clipboard-item-popup[type=`text`]": {
"padding": "12dp 8dp"
},
"clipboard-item-timestamp": {
"font-size": "11sp",
"padding": "16dp 8dp"
},
"clipboard-item-actions": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"margin": "4dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
},
"clipboard-item-action": {
"font-size": "16sp",
"padding": "12dp"
},
"clipboard-item-action-text": {
"margin": "4dp 0dp 0dp 0dp"
},
"clipboard-clear-all-dialog": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
@@ -389,6 +453,17 @@
"text-align": "center",
"text-max-lines": "1",
"text-overflow": "ellipsis"
},
"subtype-panel-list-item": {
"font-size": "16sp",
"padding": "16dp"
},
"subtype-panel-list-item-icon-leading": {
"font-size": "24sp",
"padding": "0dp 0dp 16dp 0dp"
},
"subtype-panel-list-item-text": {
"text-max-lines": "1",
"text-overflow": "ellipsis"
}
}

View File

@@ -6,6 +6,7 @@
"--secondary": "#f57c00",
"--secondary-variant": "#e65100",
"--background": "#212121",
"--background-variant": "#313131",
"--surface": "#424242",
"--surface-variant": "#616161",
"--popup-surface": "#757575",
@@ -22,13 +23,13 @@
"--on-surface-variant": "#a0a0a0",
"--shape": "rounded-corner(8dp, 8dp, 8dp, 8dp)",
"--shape-variant": "rounded-corner(12dp, 12dp, 12dp, 12dp)"
"--shape-variant": "rounded-corner(12dp, 12dp, 12dp, 12dp)",
"--shape-chip": "rounded-corner(50%, 50%, 50%, 50%)"
},
"window": {
"background": "var(--background)",
"foreground": "var(--on-background)",
"clip": "no"
"foreground": "var(--on-background)"
},
"key": {
@@ -91,6 +92,7 @@
"key-popup-extended-indicator": {
"font-size": "16sp"
},
"smartbar": {
"font-size": "18sp"
},
@@ -104,6 +106,7 @@
"smartbar-extended-actions-toggle": {
"background": "transparent",
"foreground": "var(--on-surface-variant)",
"margin": "6dp",
"shape": "circle()"
},
"smartbar-action-key": {
@@ -114,23 +117,34 @@
"smartbar-action-key:disabled": {
"foreground": "var(--on-background-disabled)"
},
"smartbar-actions-overflow": {
"margin": "4dp"
},
"smartbar-actions-overflow-customize-button": {
"background": "var(--primary)",
"foreground": "var(--on-primary)",
"font-size": "14sp",
"margin": "0dp 8dp 0dp 0dp",
"shape": "rounded-corner(24dp, 24dp, 24dp, 24dp)"
},
"smartbar-action-tile": {
"background": "transparent",
"background": "var(--background-variant)",
"foreground": "var(--on-background)",
"font-size": "14sp",
"shape": "var(--shape)",
"text-max-lines": "2",
"margin": "4dp",
"padding": "4dp",
"shape": "rounded-corner(20%, 20%, 20%, 20%)",
"text-align": "center",
"text-max-lines": "2",
"text-overflow": "ellipsis"
},
"smartbar-action-tile:disabled": {
"foreground": "var(--on-background-disabled)"
},
"smartbar-actions-overflow-customize-button": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"shape": "circle()"
"smartbar-action-tile-icon": {
"font-size": "24sp",
"margin": "0dp 0dp 0dp 8dp"
},
"smartbar-actions-editor": {
@@ -188,6 +202,10 @@
"background": "var(--surface)",
"foreground": "var(--on-surface)"
},
"smartbar-candidate-word-secondary-text": {
"font-size": "8sp",
"margin": "0dp 2dp 0dp 0dp"
},
"smartbar-candidate-clip": {
"background": "transparent",
"foreground": "var(--on-background)",
@@ -202,6 +220,9 @@
"background": "var(--surface)",
"foreground": "var(--on-surface)"
},
"smartbar-candidate-clip-icon": {
"margin": "0dp 0dp 4dp 0dp"
},
"smartbar-candidate-spacer": {
"foreground": "var(--spacer-color)"
},
@@ -223,31 +244,80 @@
},
"clipboard-subheader": {
"font-size": "14sp",
"margin": "6dp"
"margin": "6dp 10dp 6dp 6dp"
},
"clipboard-content": {
"padding": "10dp"
"padding": "10dp 0dp"
},
"clipboard-filter-row": {
"background": "var(--background-variant)",
"foreground": "var(--on-background)",
"padding": "0dp 0dp 4dp 0dp",
"shape": "var(--shape-variant)"
},
"clipboard-filter-chip": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"margin": "4dp 4dp 0dp 4dp",
"padding": "8dp 4dp",
"shape": "var(--shape-chip)"
},
"clipboard-filter-chip[state=`active`]": {
"background": "var(--primary)",
"foreground": "var(--on-primary)"
},
"clipboard-filter-chip-text": {
"margin": "4dp 0dp 0dp 0dp"
},
"clipboard-grid": {
"shape": "var(--shape-variant)"
},
"clipboard-item": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"margin": "4dp",
"padding": "12dp 8dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp",
"text-max-lines": "10",
"text-overflow": "ellipsis"
},
"clipboard-item[type=`text`]": {
"padding": "12dp 8dp"
},
"clipboard-item-description": {
"font-size": "12sp",
"font-style": "italic"
},
"clipboard-item-popup": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"margin": "4dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
},
"clipboard-item-popup": {
"clipboard-item-popup[type=`text`]": {
"padding": "12dp 8dp"
},
"clipboard-item-timestamp": {
"font-size": "11sp",
"padding": "16dp 8dp"
},
"clipboard-item-actions": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"margin": "4dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
},
"clipboard-item-popup-action": {
"clipboard-item-action": {
"font-size": "16sp",
"padding": "12dp"
},
"clipboard-item-action-text": {
"margin": "4dp 0dp 0dp 0dp"
},
"clipboard-clear-all-dialog": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
@@ -371,5 +441,17 @@
"text-align": "center",
"text-max-lines": "1",
"text-overflow": "ellipsis"
},
"subtype-panel-list-item": {
"font-size": "16sp",
"padding": "16dp"
},
"subtype-panel-list-item-icon-leading": {
"font-size": "24sp",
"padding": "0dp 0dp 16dp 0dp"
},
"subtype-panel-list-item-text": {
"text-max-lines": "1",
"text-overflow": "ellipsis"
}
}

View File

@@ -6,6 +6,7 @@
"--secondary": "#f57c00",
"--secondary-variant": "#e65100",
"--background": "#212121",
"--background-variant": "#313131",
"--surface": "#424242",
"--surface-variant": "#616161",
"--popup-surface": "#757575",
@@ -22,13 +23,13 @@
"--on-surface-variant": "#a0a0a0",
"--shape": "rounded-corner(8dp, 8dp, 8dp, 8dp)",
"--shape-variant": "rounded-corner(12dp, 12dp, 12dp, 12dp)"
"--shape-variant": "rounded-corner(12dp, 12dp, 12dp, 12dp)",
"--shape-chip": "rounded-corner(50%, 50%, 50%, 50%)"
},
"window": {
"background": "var(--background)",
"foreground": "var(--on-background)",
"clip": "no"
"foreground": "var(--on-background)"
},
"key": {
@@ -93,6 +94,7 @@
"key-popup-extended-indicator": {
"font-size": "16sp"
},
"smartbar": {
"font-size": "18sp"
},
@@ -106,6 +108,7 @@
"smartbar-extended-actions-toggle": {
"background": "transparent",
"foreground": "var(--on-surface-variant)",
"margin": "6dp",
"shape": "circle()"
},
"smartbar-action-key": {
@@ -120,28 +123,36 @@
"smartbar-action-key:disabled": {
"foreground": "var(--on-background-disabled)"
},
"smartbar-actions-overflow": {
"margin": "4dp"
},
"smartbar-actions-overflow-customize-button": {
"background": "var(--primary)",
"foreground": "var(--on-primary)",
"font-size": "14sp",
"margin": "0dp 8dp 0dp 0dp",
"shape": "rounded-corner(24dp, 24dp, 24dp, 24dp)"
},
"smartbar-action-tile": {
"background": "transparent",
"background": "var(--background-variant)",
"foreground": "var(--on-background)",
"font-size": "14sp",
"shape": "var(--shape)",
"text-max-lines": "2",
"margin": "4dp",
"padding": "4dp",
"shape": "rounded-corner(20%, 20%, 20%, 20%)",
"text-align": "center",
"text-max-lines": "2",
"text-overflow": "ellipsis"
},
"smartbar-action-tile:pressed": {
"background": "var(--surface)",
"foreground": "var(--on-surface)"
},
"smartbar-action-tile:disabled": {
"foreground": "var(--on-background-disabled)"
},
"smartbar-actions-overflow-customize-button": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"shape": "circle()"
"smartbar-action-tile-icon": {
"font-size": "24sp",
"margin": "0dp 0dp 0dp 8dp"
},
"smartbar-actions-editor": {
"background": "var(--background)",
"foreground": "var(--on-background)",
@@ -197,6 +208,10 @@
"background": "var(--surface)",
"foreground": "var(--on-background)"
},
"smartbar-candidate-word-secondary-text": {
"font-size": "8sp",
"margin": "0dp 2dp 0dp 0dp"
},
"smartbar-candidate-clip": {
"background": "transparent",
"foreground": "var(--on-background)",
@@ -211,13 +226,15 @@
"background": "var(--surface)",
"foreground": "var(--on-background)"
},
"smartbar-candidate-clip-icon": {
"margin": "0dp 0dp 4dp 0dp"
},
"smartbar-candidate-spacer": {
"foreground": "var(--surface)"
},
"clipboard-header": {
"background": "transparent",
"foreground": "var(--on-surface)",
"foreground": "var(--on-background)",
"font-size": "16sp"
},
"clipboard-header-button": {
@@ -233,32 +250,80 @@
},
"clipboard-subheader": {
"font-size": "14sp",
"margin": "6dp"
"margin": "6dp 10dp 6dp 6dp"
},
"clipboard-content": {
"padding": "10dp"
"padding": "10dp 0dp"
},
"clipboard-filter-row": {
"background": "var(--background-variant)",
"foreground": "var(--on-background)",
"padding": "0dp 0dp 4dp 0dp",
"shape": "var(--shape-variant)"
},
"clipboard-filter-chip": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"margin": "4dp 4dp 0dp 4dp",
"padding": "8dp 4dp",
"shape": "var(--shape-chip)"
},
"clipboard-filter-chip[state=`active`]": {
"background": "var(--primary)",
"foreground": "var(--on-primary)"
},
"clipboard-filter-chip-text": {
"margin": "4dp 0dp 0dp 0dp"
},
"clipboard-grid": {
"shape": "var(--shape-variant)"
},
"clipboard-item": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"margin": "4dp",
"padding": "12dp 8dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
"shadow-elevation": "2dp",
"text-max-lines": "10",
"text-overflow": "ellipsis"
},
"clipboard-item[type=`text`]": {
"padding": "12dp 8dp"
},
"clipboard-item-description": {
"font-size": "12sp",
"font-style": "italic"
},
"clipboard-item-popup": {
"background": "var(--surface-variant)",
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"margin": "4dp",
"padding": "12dp 8dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
},
"clipboard-item-popup-action": {
"clipboard-item-popup[type=`text`]": {
"padding": "12dp 8dp"
},
"clipboard-item-timestamp": {
"font-size": "11sp",
"padding": "16dp 8dp"
},
"clipboard-item-actions": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"margin": "4dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
},
"clipboard-item-action": {
"font-size": "16sp",
"padding": "12dp"
},
"clipboard-item-action-text": {
"margin": "4dp 0dp 0dp 0dp"
},
"clipboard-clear-all-dialog": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
@@ -382,5 +447,17 @@
"text-align": "center",
"text-max-lines": "1",
"text-overflow": "ellipsis"
},
"subtype-panel-list-item": {
"font-size": "16sp",
"padding": "16dp"
},
"subtype-panel-list-item-icon-leading": {
"font-size": "24sp",
"padding": "0dp 0dp 16dp 0dp"
},
"subtype-panel-list-item-text": {
"text-max-lines": "1",
"text-overflow": "ellipsis"
}
}

View File

@@ -6,6 +6,7 @@
"--secondary": "#ff9800",
"--secondary-variant": "#804c00",
"--background": "#000000",
"--background-variant": "#111111",
"--surface": "#212121",
"--surface-variant": "#3d3d3d",
"--popup-surface": "#424242",
@@ -22,13 +23,13 @@
"--on-surface-variant": "#ffffff73",
"--shape": "rounded-corner(8dp, 8dp, 8dp, 8dp)",
"--shape-variant": "rounded-corner(12dp, 12dp, 12dp, 12dp)"
"--shape-variant": "rounded-corner(12dp, 12dp, 12dp, 12dp)",
"--shape-chip": "rounded-corner(50%, 50%, 50%, 50%)"
},
"window": {
"background": "var(--background)",
"foreground": "var(--on-background)",
"clip": "no"
"foreground": "var(--on-background)"
},
"key": {
@@ -91,6 +92,7 @@
"key-popup-extended-indicator": {
"font-size": "16sp"
},
"smartbar": {
"font-size": "18sp"
},
@@ -104,6 +106,7 @@
"smartbar-extended-actions-toggle": {
"background": "transparent",
"foreground": "var(--on-surface-variant)",
"margin": "6dp",
"shape": "circle()"
},
"smartbar-action-key": {
@@ -118,23 +121,34 @@
"smartbar-action-key:disabled": {
"foreground": "var(--on-background-disabled)"
},
"smartbar-actions-overflow": {
"margin": "4dp"
},
"smartbar-actions-overflow-customize-button": {
"background": "var(--primary)",
"foreground": "var(--on-primary)",
"font-size": "14sp",
"margin": "0dp 8dp 0dp 0dp",
"shape": "rounded-corner(24dp, 24dp, 24dp, 24dp)"
},
"smartbar-action-tile": {
"background": "transparent",
"background": "var(--background-variant)",
"foreground": "var(--on-background)",
"font-size": "14sp",
"shape": "var(--shape)",
"text-max-lines": "2",
"margin": "4dp",
"padding": "4dp",
"shape": "rounded-corner(20%, 20%, 20%, 20%)",
"text-align": "center",
"text-max-lines": "2",
"text-overflow": "ellipsis"
},
"smartbar-action-tile:disabled": {
"foreground": "var(--on-background-disabled)"
},
"smartbar-actions-overflow-customize-button": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"shape": "circle()"
"smartbar-action-tile-icon": {
"font-size": "24sp",
"margin": "0dp 0dp 0dp 8dp"
},
"smartbar-actions-editor": {
@@ -192,6 +206,10 @@
"background": "var(--surface)",
"foreground": "var(--on-surface)"
},
"smartbar-candidate-word-secondary-text": {
"font-size": "8sp",
"margin": "0dp 2dp 0dp 0dp"
},
"smartbar-candidate-clip": {
"background": "transparent",
"foreground": "var(--on-background)",
@@ -206,6 +224,9 @@
"background": "var(--surface)",
"foreground": "var(--on-surface)"
},
"smartbar-candidate-clip-icon": {
"margin": "0dp 0dp 4dp 0dp"
},
"smartbar-candidate-spacer": {
"foreground": "var(--spacer-color)"
},
@@ -227,31 +248,80 @@
},
"clipboard-subheader": {
"font-size": "14sp",
"margin": "6dp"
"margin": "6dp 10dp 6dp 6dp"
},
"clipboard-content": {
"padding": "10dp"
"padding": "10dp 0dp"
},
"clipboard-filter-row": {
"background": "var(--background-variant)",
"foreground": "var(--on-background)",
"padding": "0dp 0dp 4dp 0dp",
"shape": "var(--shape-variant)"
},
"clipboard-filter-chip": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"margin": "4dp 4dp 0dp 4dp",
"padding": "8dp 4dp",
"shape": "var(--shape-chip)"
},
"clipboard-filter-chip[state=`active`]": {
"background": "var(--primary)",
"foreground": "var(--on-primary)"
},
"clipboard-filter-chip-text": {
"margin": "4dp 0dp 0dp 0dp"
},
"clipboard-grid": {
"shape": "var(--shape-variant)"
},
"clipboard-item": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"margin": "4dp",
"padding": "12dp 8dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp",
"text-max-lines": "10",
"text-overflow": "ellipsis"
},
"clipboard-item[type=`text`]": {
"padding": "12dp 8dp"
},
"clipboard-item-description": {
"font-size": "12sp",
"font-style": "italic"
},
"clipboard-item-popup": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"margin": "4dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
},
"clipboard-item-popup": {
"clipboard-item-popup[type=`text`]": {
"padding": "12dp 8dp"
},
"clipboard-item-timestamp": {
"font-size": "11sp",
"padding": "16dp 8dp"
},
"clipboard-item-actions": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"margin": "4dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
},
"clipboard-item-popup-action": {
"clipboard-item-action": {
"font-size": "16sp",
"padding": "12dp"
},
"clipboard-item-action-text": {
"margin": "4dp 0dp 0dp 0dp"
},
"clipboard-clear-all-dialog": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
@@ -375,5 +445,17 @@
"text-align": "center",
"text-max-lines": "1",
"text-overflow": "ellipsis"
},
"subtype-panel-list-item": {
"font-size": "16sp",
"padding": "16dp"
},
"subtype-panel-list-item-icon-leading": {
"font-size": "24sp",
"padding": "0dp 0dp 16dp 0dp"
},
"subtype-panel-list-item-text": {
"text-max-lines": "1",
"text-overflow": "ellipsis"
}
}

View File

@@ -6,6 +6,7 @@
"--secondary": "#ff9800",
"--secondary-variant": "#804c00",
"--background": "#000000",
"--background-variant": "#111111",
"--surface": "#212121",
"--surface-variant": "#3d3d3d",
"--popup-surface": "#424242",
@@ -22,13 +23,13 @@
"--on-surface-variant": "#ffffff73",
"--shape": "rounded-corner(8dp, 8dp, 8dp, 8dp)",
"--shape-variant": "rounded-corner(12dp, 12dp, 12dp, 12dp)"
"--shape-variant": "rounded-corner(12dp, 12dp, 12dp, 12dp)",
"--shape-chip": "rounded-corner(50%, 50%, 50%, 50%)"
},
"window": {
"background": "var(--background)",
"foreground": "var(--on-background)",
"clip": "no"
"foreground": "var(--on-background)"
},
"key": {
@@ -93,6 +94,7 @@
"key-popup-extended-indicator": {
"font-size": "16sp"
},
"smartbar": {
"font-size": "18sp"
},
@@ -106,6 +108,7 @@
"smartbar-extended-actions-toggle": {
"background": "transparent",
"foreground": "var(--on-surface-variant)",
"margin": "6dp",
"shape": "circle()"
},
"smartbar-action-key": {
@@ -120,28 +123,36 @@
"smartbar-action-key:disabled": {
"foreground": "var(--on-background-disabled)"
},
"smartbar-actions-overflow": {
"margin": "4dp"
},
"smartbar-actions-overflow-customize-button": {
"background": "var(--primary)",
"foreground": "var(--on-primary)",
"font-size": "14sp",
"margin": "0dp 8dp 0dp 0dp",
"shape": "rounded-corner(24dp, 24dp, 24dp, 24dp)"
},
"smartbar-action-tile": {
"background": "transparent",
"background": "var(--background-variant)",
"foreground": "var(--on-background)",
"font-size": "14sp",
"shape": "var(--shape)",
"text-max-lines": "2",
"margin": "4dp",
"padding": "4dp",
"shape": "rounded-corner(20%, 20%, 20%, 20%)",
"text-align": "center",
"text-max-lines": "2",
"text-overflow": "ellipsis"
},
"smartbar-action-tile:pressed": {
"background": "var(--surface)",
"foreground": "var(--on-surface)"
},
"smartbar-action-tile:disabled": {
"foreground": "var(--on-background-disabled)"
},
"smartbar-actions-overflow-customize-button": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"shape": "circle()"
"smartbar-action-tile-icon": {
"font-size": "24sp",
"margin": "0dp 0dp 0dp 8dp"
},
"smartbar-actions-editor": {
"background": "var(--background)",
"foreground": "var(--on-background)",
@@ -197,6 +208,10 @@
"background": "var(--surface)",
"foreground": "var(--on-background)"
},
"smartbar-candidate-word-secondary-text": {
"font-size": "8sp",
"margin": "0dp 2dp 0dp 0dp"
},
"smartbar-candidate-clip": {
"background": "transparent",
"foreground": "var(--on-background)",
@@ -211,13 +226,15 @@
"background": "var(--surface)",
"foreground": "var(--on-background)"
},
"smartbar-candidate-clip-icon": {
"margin": "0dp 0dp 4dp 0dp"
},
"smartbar-candidate-spacer": {
"foreground": "var(--surface)"
},
"clipboard-header": {
"background": "transparent",
"foreground": "var(--on-surface)",
"foreground": "var(--on-background)",
"font-size": "16sp"
},
"clipboard-header-button": {
@@ -233,32 +250,80 @@
},
"clipboard-subheader": {
"font-size": "14sp",
"margin": "6dp"
"margin": "6dp 10dp 6dp 6dp"
},
"clipboard-content": {
"padding": "10dp"
"padding": "10dp 0dp"
},
"clipboard-filter-row": {
"background": "var(--background-variant)",
"foreground": "var(--on-background)",
"padding": "0dp 0dp 4dp 0dp",
"shape": "var(--shape-variant)"
},
"clipboard-filter-chip": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"margin": "4dp 4dp 0dp 4dp",
"padding": "8dp 4dp",
"shape": "var(--shape-chip)"
},
"clipboard-filter-chip[state=`active`]": {
"background": "var(--primary)",
"foreground": "var(--on-primary)"
},
"clipboard-filter-chip-text": {
"margin": "4dp 0dp 0dp 0dp"
},
"clipboard-grid": {
"shape": "var(--shape-variant)"
},
"clipboard-item": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"margin": "4dp",
"padding": "12dp 8dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
"shadow-elevation": "2dp",
"text-max-lines": "10",
"text-overflow": "ellipsis"
},
"clipboard-item[type=`text`]": {
"padding": "12dp 8dp"
},
"clipboard-item-description": {
"font-size": "12sp",
"font-style": "italic"
},
"clipboard-item-popup": {
"background": "var(--surface-variant)",
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"font-size": "14sp",
"margin": "4dp",
"padding": "12dp 8dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
},
"clipboard-item-popup-action": {
"clipboard-item-popup[type=`text`]": {
"padding": "12dp 8dp"
},
"clipboard-item-timestamp": {
"font-size": "11sp",
"padding": "16dp 8dp"
},
"clipboard-item-actions": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
"margin": "4dp",
"shape": "var(--shape-variant)",
"shadow-elevation": "2dp"
},
"clipboard-item-action": {
"font-size": "16sp",
"padding": "12dp"
},
"clipboard-item-action-text": {
"margin": "4dp 0dp 0dp 0dp"
},
"clipboard-clear-all-dialog": {
"background": "var(--surface)",
"foreground": "var(--on-surface)",
@@ -382,5 +447,17 @@
"text-align": "center",
"text-max-lines": "1",
"text-overflow": "ellipsis"
},
"subtype-panel-list-item": {
"font-size": "16sp",
"padding": "16dp"
},
"subtype-panel-list-item-icon-leading": {
"font-size": "24sp",
"padding": "0dp 0dp 16dp 0dp"
},
"subtype-panel-list-item-text": {
"text-max-lines": "1",
"text-overflow": "ellipsis"
}
}

View File

@@ -23,8 +23,10 @@ import android.content.ContextWrapper
import android.content.Intent
import android.content.IntentFilter
import android.os.Handler
import android.util.Log
import androidx.core.os.UserManagerCompat
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.ime.clipboard.ClipboardManager
import dev.patrickgold.florisboard.ime.core.SubtypeManager
import dev.patrickgold.florisboard.ime.dictionary.DictionaryManager
@@ -40,7 +42,11 @@ import dev.patrickgold.florisboard.lib.devtools.Flog
import dev.patrickgold.florisboard.lib.devtools.LogTopic
import dev.patrickgold.florisboard.lib.devtools.flogError
import dev.patrickgold.florisboard.lib.ext.ExtensionManager
import dev.patrickgold.jetpref.datastore.JetPref
import dev.patrickgold.jetpref.datastore.runtime.initAndroid
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.launch
import org.florisboard.lib.kotlin.io.deleteContentsRecursively
import org.florisboard.lib.kotlin.tryOrNull
import org.florisboard.libnative.dummyAdd
@@ -63,8 +69,9 @@ class FlorisApplication : Application() {
}
}
private val prefs by florisPreferenceModel()
private val mainHandler by lazy { Handler(mainLooper) }
private val scope = CoroutineScope(Dispatchers.Default)
val preferenceStoreLoaded = MutableStateFlow(false)
val cacheManager = lazy { CacheManager(this) }
val clipboardManager = lazy { ClipboardManager(this) }
@@ -80,7 +87,6 @@ class FlorisApplication : Application() {
super.onCreate()
FlorisApplicationReference = WeakReference(this)
try {
JetPref.configure(saveIntervalMs = 500)
Flog.install(
context = this,
isFloggingEnabled = BuildConfig.DEBUG,
@@ -108,7 +114,14 @@ class FlorisApplication : Application() {
fun init() {
cacheDir?.deleteContentsRecursively()
prefs.initializeBlocking(this)
scope.launch {
val result = FlorisPreferenceStore.initAndroid(
context = this@FlorisApplication,
datastoreName = FlorisPreferenceModel.NAME,
)
Log.i("PREFS", result.toString())
preferenceStoreLoaded.value = true
}
extensionManager.value.init()
clipboardManager.value.initializeForContext(this)
DictionaryManager.init(this)

View File

@@ -75,8 +75,8 @@ import androidx.compose.ui.viewinterop.AndroidView
import androidx.core.view.WindowCompat
import androidx.lifecycle.lifecycleScope
import dev.patrickgold.florisboard.app.FlorisAppActivity
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.app.devtools.DevtoolsOverlay
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.ime.ImeUiMode
import dev.patrickgold.florisboard.ime.clipboard.ClipboardInputLayout
import dev.patrickgold.florisboard.ime.core.SelectSubtypePanel
@@ -119,8 +119,9 @@ import org.florisboard.lib.android.AndroidVersion
import org.florisboard.lib.android.isOrientationLandscape
import org.florisboard.lib.android.isOrientationPortrait
import org.florisboard.lib.android.showShortToast
import org.florisboard.lib.android.showShortToastSync
import org.florisboard.lib.android.systemServiceOrNull
import org.florisboard.lib.kotlin.collectLatestIn
import org.florisboard.lib.kotlin.collectIn
import org.florisboard.lib.snygg.ui.SnyggBox
import org.florisboard.lib.snygg.ui.SnyggButton
import org.florisboard.lib.snygg.ui.SnyggRow
@@ -246,12 +247,12 @@ class FlorisImeService : LifecycleInputMethodService() {
}
}
}
ims.showShortToast("Failed to find voice IME, do you have one installed?")
ims.showShortToastSync("Failed to find voice IME, do you have one installed?")
return false
}
}
private val prefs by florisPreferenceModel()
private val prefs by FlorisPreferenceStore
private val editorInstance by editorInstance()
private val keyboardManager by keyboardManager()
private val nlpManager by nlpManager()
@@ -277,20 +278,23 @@ class FlorisImeService : LifecycleInputMethodService() {
super.onCreate()
FlorisImeServiceReference = WeakReference(this)
WindowCompat.setDecorFitsSystemWindows(window.window!!, false)
subtypeManager.activeSubtypeFlow.collectLatestIn(lifecycleScope) { subtype ->
subtypeManager.activeSubtypeFlow.collectIn(lifecycleScope) { subtype ->
val config = Configuration(resources.configuration)
if (prefs.localization.displayKeyboardLabelsInSubtypeLanguage.get()) {
config.setLocale(subtype.primaryLocale.base)
}
resourcesContext = createConfigurationContext(config)
}
prefs.localization.displayKeyboardLabelsInSubtypeLanguage.observeForever { shouldSync ->
prefs.localization.displayKeyboardLabelsInSubtypeLanguage.asFlow().collectIn(lifecycleScope) { shouldSync ->
val config = Configuration(resources.configuration)
if (shouldSync) {
config.setLocale(subtypeManager.activeSubtype.primaryLocale.base)
}
resourcesContext = createConfigurationContext(config)
}
prefs.physicalKeyboard.showOnScreenKeyboard.asFlow().collectIn(lifecycleScope) {
updateInputViewShown()
}
@Suppress("DEPRECATION") // We do not retrieve the wallpaper but only listen to changes
registerReceiver(wallpaperChangeReceiver, IntentFilter(Intent.ACTION_WALLPAPER_CHANGED))
}
@@ -356,6 +360,13 @@ class FlorisImeService : LifecycleInputMethodService() {
}
}
override fun onEvaluateInputViewShown(): Boolean {
val config = resources.configuration
return super.onEvaluateInputViewShown()
|| config.keyboard == Configuration.KEYBOARD_NOKEYS
|| prefs.physicalKeyboard.showOnScreenKeyboard.get()
}
override fun onUpdateSelection(
oldSelStart: Int,
oldSelEnd: Int,
@@ -398,7 +409,6 @@ class FlorisImeService : LifecycleInputMethodService() {
flogInfo(LogTopic.IMS_EVENTS)
}
isWindowShown = true
themeManager.updateActiveTheme()
inputFeedbackController.updateSystemPrefsState()
}
@@ -588,6 +598,10 @@ class FlorisImeService : LifecycleInputMethodService() {
@Composable
private fun ImeUi() {
val state by keyboardManager.activeState.collectAsState()
val attributes = mapOf(
FlorisImeUi.Attr.Mode to state.keyboardMode.toString(),
FlorisImeUi.Attr.ShiftState to state.inputShiftState.toString(),
)
val layoutDirection = LocalLayoutDirection.current
LaunchedEffect(layoutDirection) {
keyboardManager.activeState.layoutDirection = layoutDirection
@@ -595,7 +609,7 @@ class FlorisImeService : LifecycleInputMethodService() {
CompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Ltr) {
SnyggBox(
elementName = FlorisImeUi.Window.elementName,
attributes = mapOf(FlorisImeUi.Attr.ShiftState to state.inputShiftState.attrName()),
attributes = attributes,
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()
@@ -604,6 +618,7 @@ class FlorisImeService : LifecycleInputMethodService() {
// Do not remove below line or touch input may get stuck
.pointerInteropFilter { false },
supportsBackgroundImage = true,
allowClip = false,
) {
val configuration = LocalConfiguration.current
val bottomOffset by if (configuration.isOrientationPortrait()) {
@@ -754,7 +769,8 @@ class FlorisImeService : LifecycleInputMethodService() {
modifier = Modifier.fillMaxSize(),
verticalAlignment = Alignment.CenterVertically,
) {
SnyggBox(FlorisImeUi.ExtractedLandscapeInputLayout.elementName,
SnyggBox(
elementName = FlorisImeUi.ExtractedLandscapeInputLayout.elementName,
modifier = Modifier
.fillMaxHeight()
.weight(1f),

View File

@@ -20,7 +20,7 @@ import android.service.textservice.SpellCheckerService
import android.view.textservice.SentenceSuggestionsInfo
import android.view.textservice.SuggestionsInfo
import android.view.textservice.TextInfo
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.ime.core.Subtype
import dev.patrickgold.florisboard.ime.dictionary.DictionaryManager
import dev.patrickgold.florisboard.ime.nlp.SpellingLanguageMode
@@ -33,7 +33,7 @@ import kotlinx.coroutines.runBlocking
import org.florisboard.lib.kotlin.map
class FlorisSpellCheckerService : SpellCheckerService() {
private val prefs by florisPreferenceModel()
private val prefs by FlorisPreferenceStore
private val dictionaryManager get() = DictionaryManager.default()
private val nlpManager by nlpManager()
private val subtypeManager by subtypeManager()

View File

@@ -23,6 +23,7 @@ import androidx.compose.ui.platform.LocalConfiguration
import dev.patrickgold.florisboard.app.settings.theme.DisplayKbdAfterDialogs
import dev.patrickgold.florisboard.app.settings.theme.SnyggLevel
import dev.patrickgold.florisboard.app.setup.NotificationPermissionState
import dev.patrickgold.florisboard.ime.clipboard.CLIPBOARD_HISTORY_NUM_GRID_COLUMNS_AUTO
import dev.patrickgold.florisboard.ime.core.DisplayLanguageNamesIn
import dev.patrickgold.florisboard.ime.core.Subtype
import dev.patrickgold.florisboard.ime.input.CapitalizationBehavior
@@ -56,7 +57,10 @@ import dev.patrickgold.florisboard.lib.compose.ColorPreferenceSerializer
import dev.patrickgold.florisboard.lib.ext.ExtensionComponentName
import dev.patrickgold.florisboard.lib.observeAsTransformingState
import dev.patrickgold.florisboard.lib.util.VersionName
import dev.patrickgold.jetpref.datastore.JetPref
import dev.patrickgold.jetpref.datastore.annotations.Preferences
import dev.patrickgold.jetpref.datastore.jetprefDataStoreOf
import dev.patrickgold.jetpref.datastore.model.LocalTime
import dev.patrickgold.jetpref.datastore.model.PreferenceData
import dev.patrickgold.jetpref.datastore.model.PreferenceMigrationEntry
import dev.patrickgold.jetpref.datastore.model.PreferenceModel
import dev.patrickgold.jetpref.datastore.model.observeAsState
@@ -66,9 +70,14 @@ import org.florisboard.lib.android.AndroidVersion
import org.florisboard.lib.android.isOrientationPortrait
import org.florisboard.lib.color.DEFAULT_GREEN
fun florisPreferenceModel() = JetPref.getOrCreatePreferenceModel(AppPrefs::class, ::AppPrefs)
val FlorisPreferenceStore = jetprefDataStoreOf(FlorisPreferenceModel::class)
@Preferences
abstract class FlorisPreferenceModel : PreferenceModel() {
companion object {
const val NAME = "florisboard-app-prefs"
}
class AppPrefs : PreferenceModel("florisboard-app-prefs") {
val clipboard = Clipboard()
inner class Clipboard {
val useInternalClipboard = boolean(
@@ -87,6 +96,23 @@ class AppPrefs : PreferenceModel("florisboard-app-prefs") {
key = "clipboard__history_enabled",
default = false,
)
val numHistoryGridColumnsPortrait = int(
key = "clipboard__num_history_grid_columns_portrait",
default = CLIPBOARD_HISTORY_NUM_GRID_COLUMNS_AUTO,
)
val numHistoryGridColumnsLandscape = int(
key = "clipboard__num_history_grid_columns_landscape",
default = CLIPBOARD_HISTORY_NUM_GRID_COLUMNS_AUTO,
)
@Composable
fun numHistoryGridColumns(): PreferenceData<Int> {
val configuration = LocalConfiguration.current
return if (configuration.isOrientationPortrait()) {
numHistoryGridColumnsPortrait
} else {
numHistoryGridColumnsLandscape
}
}
val cleanUpOld = boolean(
key = "clipboard__clean_up_old",
default = false,
@@ -619,6 +645,14 @@ class AppPrefs : PreferenceModel("florisboard-app-prefs") {
)
}
val physicalKeyboard = PhysicalKeyboard()
inner class PhysicalKeyboard {
val showOnScreenKeyboard = boolean(
key = "physical_keyboard__show_on_screen_keyboard",
default = false,
)
}
val smartbar = Smartbar()
inner class Smartbar {
val enabled = boolean(
@@ -730,14 +764,14 @@ class AppPrefs : PreferenceModel("florisboard-app-prefs") {
},
serializer = ColorPreferenceSerializer,
)
//val sunriseTime = localTime(
// key = "theme__sunrise_time",
// default = LocalTime.of(6, 0),
//)
//val sunsetTime = localTime(
// key = "theme__sunset_time",
// default = LocalTime.of(18, 0),
//)
val sunriseTime = localTime(
key = "theme__sunrise_time",
default = LocalTime(6, 0),
)
val sunsetTime = localTime(
key = "theme__sunset_time",
default = LocalTime(18, 0),
)
val editorColorRepresentation = enum(
key = "theme__editor_color_representation",
default = ColorRepresentation.HEX,
@@ -800,31 +834,33 @@ class AppPrefs : PreferenceModel("florisboard-app-prefs") {
//Migrate one hand mode prefs keep until: 0.7 dev cycle
"keyboard__one_handed_mode" -> {
if (entry.rawValue != "OFF") {
val prefs by florisPreferenceModel()
prefs.keyboard.oneHandedModeEnabled.set(true)
entry.keepAsIs()
} else {
if (entry.rawValue == "OFF") {
entry.reset()
} else {
entry.keepAsIs()
}
}
"smartbar__action_arrangement" -> {
fun migrateAction(action: QuickAction): QuickAction {
return if (action is QuickAction.InsertKey && action.data.code == KeyCode.COMPACT_LAYOUT_TO_RIGHT) {
action.copy(TextKeyData.TOGGLE_COMPACT_LAYOUT)
} else {
action
}
}
val arrangement = QuickActionJsonConfig.decodeFromString<QuickActionArrangement>(entry.rawValue)
var newArrangement = arrangement.copy(
dynamicActions = arrangement.dynamicActions.map { action ->
if (action is QuickAction.InsertKey && action.data.code == KeyCode.COMPACT_LAYOUT_TO_RIGHT) {
action.copy(TextKeyData.TOGGLE_COMPACT_LAYOUT)
} else {
action
}
}
stickyAction = arrangement.stickyAction?.let{ migrateAction(it) },
dynamicActions = arrangement.dynamicActions.map { migrateAction(it) },
hiddenActions = arrangement.hiddenActions.map { migrateAction(it) },
)
if (QuickAction.InsertKey(TextKeyData.LANGUAGE_SWITCH) !in newArrangement) {
newArrangement = newArrangement.copy(
dynamicActions = newArrangement.dynamicActions.plus(QuickAction.InsertKey(TextKeyData.LANGUAGE_SWITCH))
)
}
val json = QuickActionJsonConfig.encodeToString(newArrangement)
val json = QuickActionJsonConfig.encodeToString(newArrangement.distinct())
entry.transform(rawValue = json)
}

View File

@@ -24,7 +24,9 @@ import dev.patrickgold.florisboard.ime.core.DisplayLanguageNamesIn
import dev.patrickgold.florisboard.ime.input.CapitalizationBehavior
import dev.patrickgold.florisboard.ime.input.HapticVibrationMode
import dev.patrickgold.florisboard.ime.input.InputFeedbackActivationMode
import dev.patrickgold.florisboard.ime.input.InputShiftState
import dev.patrickgold.florisboard.ime.keyboard.IncognitoMode
import dev.patrickgold.florisboard.ime.keyboard.KeyboardMode
import dev.patrickgold.florisboard.ime.keyboard.SpaceBarMode
import dev.patrickgold.florisboard.ime.landscapeinput.LandscapeInputUiMode
import dev.patrickgold.florisboard.ime.media.emoji.EmojiHistory
@@ -364,6 +366,58 @@ private val ENUM_DISPLAY_ENTRIES = mapOf<Pair<KClass<*>, String>, @Composable ()
)
}
},
InputShiftState::class to DEFAULT to {
listPrefEntries {
entry(
key = InputShiftState.UNSHIFTED,
label = stringRes(R.string.enum__input_shift_state__unshifted),
)
entry(
key = InputShiftState.SHIFTED_MANUAL,
label = stringRes(R.string.enum__input_shift_state__shifted_manual),
)
entry(
key = InputShiftState.SHIFTED_AUTOMATIC,
label = stringRes(R.string.enum__input_shift_state__shifted_automatic),
)
entry(
key = InputShiftState.CAPS_LOCK,
label = stringRes(R.string.enum__input_shift_state__caps_lock),
)
}
},
KeyboardMode::class to DEFAULT to {
listPrefEntries {
entry(
key = KeyboardMode.CHARACTERS,
label = stringRes(R.string.enum__keyboard_mode__characters),
)
entry(
key = KeyboardMode.SYMBOLS,
label = stringRes(R.string.enum__keyboard_mode__symbols),
)
entry(
key = KeyboardMode.SYMBOLS2,
label = stringRes(R.string.enum__keyboard_mode__symbols2),
)
entry(
key = KeyboardMode.NUMERIC,
label = stringRes(R.string.enum__keyboard_mode__numeric),
)
entry(
key = KeyboardMode.NUMERIC_ADVANCED,
label = stringRes(R.string.enum__keyboard_mode__numeric_advanced),
)
entry(
key = KeyboardMode.PHONE,
label = stringRes(R.string.enum__keyboard_mode__phone),
)
entry(
key = KeyboardMode.PHONE2,
label = stringRes(R.string.enum__keyboard_mode__phone2),
)
}
},
LandscapeInputUiMode::class to DEFAULT to {
listPrefEntries {
entry(

View File

@@ -39,12 +39,14 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalConfiguration
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.core.view.WindowCompat
import androidx.lifecycle.lifecycleScope
import androidx.navigation.NavController
import androidx.navigation.compose.rememberNavController
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.apptheme.FlorisAppTheme
import dev.patrickgold.florisboard.app.ext.ExtensionImportScreenType
import dev.patrickgold.florisboard.app.setup.NotificationPermissionState
import dev.patrickgold.florisboard.appContext
import dev.patrickgold.florisboard.cacheManager
import dev.patrickgold.florisboard.lib.FlorisLocale
import dev.patrickgold.florisboard.lib.compose.LocalPreviewFieldController
@@ -59,6 +61,8 @@ import dev.patrickgold.jetpref.datastore.ui.ProvideDefaultDialogPrefStrings
import org.florisboard.lib.android.AndroidVersion
import org.florisboard.lib.android.hideAppIcon
import org.florisboard.lib.android.showAppIcon
import org.florisboard.lib.kotlin.collectIn
import java.util.concurrent.atomic.AtomicBoolean
enum class AppTheme(val id: String) {
AUTO("auto"),
@@ -73,7 +77,8 @@ val LocalNavController = staticCompositionLocalOf<NavController> {
}
class FlorisAppActivity : ComponentActivity() {
private val prefs by florisPreferenceModel()
private val prefs by FlorisPreferenceStore
private val appContext by appContext()
private val cacheManager by cacheManager()
private var appTheme by mutableStateOf(AppTheme.AUTO)
private var showAppIcon = true
@@ -83,37 +88,37 @@ class FlorisAppActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
// Splash screen should be installed before calling super.onCreate()
installSplashScreen().apply {
setKeepOnScreenCondition { !prefs.datastoreReadyStatus.get() }
setKeepOnScreenCondition { !appContext.preferenceStoreLoaded.value }
}
super.onCreate(savedInstanceState)
WindowCompat.setDecorFitsSystemWindows(window, false)
prefs.other.settingsTheme.observe(this) {
prefs.other.settingsTheme.asFlow().collectIn(lifecycleScope) {
appTheme = it
}
prefs.other.settingsLanguage.observe(this) {
prefs.other.settingsLanguage.asFlow().collectIn(lifecycleScope) {
val config = Configuration(resources.configuration)
val locale = if (it == "auto") FlorisLocale.default() else FlorisLocale.fromTag(it)
config.setLocale(locale.base)
resourcesContext = createConfigurationContext(config)
}
if (AndroidVersion.ATMOST_API28_P) {
prefs.other.showAppIcon.observe(this) {
prefs.other.showAppIcon.asFlow().collectIn(lifecycleScope) {
showAppIcon = it
}
}
//Check if android 13+ is running and the NotificationPermission is not set
if (AndroidVersion.ATLEAST_API33_T &&
prefs.internal.notificationPermissionState.get() == NotificationPermissionState.NOT_SET
) {
// update pref value to show the setup screen again again
prefs.internal.isImeSetUp.set(false)
}
// We defer the setContent call until the datastore model is loaded, until then the splash screen stays drawn
prefs.datastoreReadyStatus.observe(this) { isModelLoaded ->
if (!isModelLoaded) return@observe
val isModelLoaded = AtomicBoolean(false)
appContext.preferenceStoreLoaded.collectIn(lifecycleScope) { loaded ->
if (!loaded || isModelLoaded.getAndSet(true)) return@collectIn
// Check if android 13+ is running and the NotificationPermission is not set
if (AndroidVersion.ATLEAST_API33_T &&
prefs.internal.notificationPermissionState.get() == NotificationPermissionState.NOT_SET
) {
// update pref value to show the setup screen again
prefs.internal.isImeSetUp.set(false)
}
AppVersionUtils.updateVersionOnInstallAndLastUse(this, prefs)
setContent {
ProvideLocalizedResources(resourcesContext) {

View File

@@ -47,8 +47,9 @@ import dev.patrickgold.florisboard.app.settings.HomeScreen
import dev.patrickgold.florisboard.app.settings.about.AboutScreen
import dev.patrickgold.florisboard.app.settings.about.ProjectLicenseScreen
import dev.patrickgold.florisboard.app.settings.about.ThirdPartyLicensesScreen
import dev.patrickgold.florisboard.app.settings.advanced.OtherScreen
import dev.patrickgold.florisboard.app.settings.advanced.BackupScreen
import dev.patrickgold.florisboard.app.settings.advanced.OtherScreen
import dev.patrickgold.florisboard.app.settings.advanced.PhysicalKeyboardScreen
import dev.patrickgold.florisboard.app.settings.advanced.RestoreScreen
import dev.patrickgold.florisboard.app.settings.clipboard.ClipboardScreen
import dev.patrickgold.florisboard.app.settings.dictionary.DictionaryScreen
@@ -111,6 +112,7 @@ object Routes {
const val Media = "settings/media"
const val Other = "settings/other"
const val PhysicalKeyboard = "settings/other/physical-keyboard"
const val Backup = "settings/other/backup"
const val Restore = "settings/other/restore"
@@ -240,6 +242,7 @@ object Routes {
composableWithDeepLink(Settings.Media) { MediaScreen() }
composableWithDeepLink(Settings.Other) { OtherScreen() }
composableWithDeepLink(Settings.PhysicalKeyboard) { PhysicalKeyboardScreen() }
composableWithDeepLink(Settings.Backup) { BackupScreen() }
composableWithDeepLink(Settings.Restore) { RestoreScreen() }

View File

@@ -29,9 +29,8 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.core.view.WindowCompat
import dev.patrickgold.florisboard.app.AppTheme
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.jetpref.datastore.model.observeAsState
import org.florisboard.lib.android.AndroidVersion
import org.florisboard.lib.color.ColorMappings
/*private val AmoledDarkColorPalette = darkColorScheme(
@@ -79,7 +78,7 @@ fun getColorScheme(
context: Context,
theme: AppTheme,
): ColorScheme {
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val accentColor by prefs.other.accentColor.observeAsState()
val isDark = isSystemInDarkTheme()

View File

@@ -37,6 +37,7 @@ import dev.patrickgold.florisboard.lib.compose.FlorisScreen
import dev.patrickgold.florisboard.lib.compose.stringRes
import dev.patrickgold.jetpref.datastore.model.observeAsState
import org.florisboard.lib.android.showLongToast
import org.florisboard.lib.android.showLongToastSync
import org.florisboard.lib.kotlin.io.subDir
import org.florisboard.lib.kotlin.io.subFile
import java.util.Locale
@@ -66,9 +67,9 @@ fun AndroidLocalesScreen() = FlorisScreen {
out.appendLine()
}
}
context.showLongToast("Exported available system locales to \"${txtFile.path}\"")
context.showLongToastSync("Exported available system locales to \"${txtFile.path}\"")
} catch (e: Exception) {
context.showLongToast(
context.showLongToastSync(
R.string.error__snackbar_message_template,
"error_message" to e.message.toString(),
)

View File

@@ -29,7 +29,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
@@ -40,7 +39,7 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.clipboardManager
import dev.patrickgold.florisboard.editorInstance
import dev.patrickgold.florisboard.ime.keyboard.CachedLayout
@@ -64,7 +63,7 @@ private val DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH-mm-ss", FlorisLocale.
@Composable
fun DevtoolsOverlay(modifier: Modifier = Modifier) {
val context = LocalContext.current
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val keyboardManager by context.keyboardManager()
val themeManager by context.themeManager()
@@ -75,7 +74,7 @@ fun DevtoolsOverlay(modifier: Modifier = Modifier) {
val showInlineAutofillOverlay by prefs.devtools.showInlineAutofillOverlay.observeAsState()
val debugLayoutResult by keyboardManager.layoutManager.debugLayoutComputationResultFlow.collectAsState()
val themeInfo by themeManager.activeThemeInfo.observeAsState()
val themeInfo by themeManager.activeThemeInfo.collectAsState()
CompositionLocalProvider(
LocalContentColor provides Color.White,
@@ -97,7 +96,7 @@ fun DevtoolsOverlay(modifier: Modifier = Modifier) {
if (devtoolsEnabled && showInlineAutofillOverlay && AndroidVersion.ATLEAST_API30_R) {
DevtoolsInlineAutofillOverlay()
}
val loadFailure = themeInfo?.loadFailure
val loadFailure = themeInfo.loadFailure
if (loadFailure != null) {
DevtoolsStylesheetFailedToLoadOverlay(loadFailure)
}
@@ -163,13 +162,13 @@ private fun DevtoolsLastLayoutComputationOverlay(debugLayoutResult: DebugLayoutC
return@DevtoolsOverlayBox
}
DevtoolsSubGroup(title = "main") {
PrintResult(debugLayoutResult!!.main)
PrintResult(debugLayoutResult.main)
}
DevtoolsSubGroup(title = "mod") {
PrintResult(debugLayoutResult!!.mod)
PrintResult(debugLayoutResult.mod)
}
DevtoolsSubGroup(title = "ext") {
PrintResult(debugLayoutResult!!.ext)
PrintResult(debugLayoutResult.ext)
}
}
}

View File

@@ -20,6 +20,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.platform.LocalContext
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.LocalNavController
@@ -27,6 +28,8 @@ import dev.patrickgold.florisboard.app.Routes
import dev.patrickgold.florisboard.extensionManager
import dev.patrickgold.florisboard.ime.dictionary.DictionaryManager
import dev.patrickgold.florisboard.ime.dictionary.FlorisUserDictionaryDatabase
import dev.patrickgold.florisboard.ime.smartbar.quickaction.QuickActionArrangement
import dev.patrickgold.florisboard.ime.smartbar.quickaction.QuickActionJsonConfig
import org.florisboard.lib.android.AndroidSettings
import org.florisboard.lib.android.showLongToast
import dev.patrickgold.florisboard.lib.compose.FlorisConfirmDeleteDialog
@@ -36,7 +39,9 @@ import dev.patrickgold.jetpref.datastore.model.observeAsState
import dev.patrickgold.jetpref.datastore.ui.Preference
import dev.patrickgold.jetpref.datastore.ui.PreferenceGroup
import dev.patrickgold.jetpref.datastore.ui.SwitchPreference
import kotlinx.coroutines.launch
import org.florisboard.lib.android.AndroidVersion
import org.florisboard.lib.android.showLongToastSync
class DebugOnPurposeCrashException : Exception(
"Success! The app crashed purposely to display this beautiful screen we all love :)"
@@ -50,6 +55,7 @@ fun DevtoolsScreen() = FlorisScreen {
val context = LocalContext.current
val navController = LocalNavController.current
val extensionManager by context.extensionManager()
val scope = rememberCoroutineScope()
val (showDialog, setShowDialog) = remember { mutableStateOf(false) }
@@ -104,10 +110,21 @@ fun DevtoolsScreen() = FlorisScreen {
onClick = { setShowDialog(true) },
enabledIf = { prefs.devtools.enabled isEqualTo true },
)
Preference(
title = stringRes(R.string.devtools__reset_quick_actions_to_default__label),
summary = stringRes(R.string.devtools__reset_quick_actions_to_default__summary),
onClick = {
scope.launch {
prefs.smartbar.actionArrangement.set(QuickActionArrangement.Default)
}
context.showLongToastSync(R.string.devtools__reset_quick_actions_to_default__toast_success)
},
enabledIf = { prefs.devtools.enabled isEqualTo true },
)
Preference(
title = stringRes(R.string.devtools__reset_flag__label, "flag_name" to "isImeSetUp"),
summary = stringRes(R.string.devtools__reset_flag_is_ime_set_up__summary),
onClick = { prefs.internal.isImeSetUp.set(false) },
onClick = { scope.launch { prefs.internal.isImeSetUp.set(false) } },
enabledIf = { prefs.devtools.enabled isEqualTo true },
)
Preference(
@@ -189,14 +206,14 @@ fun DevtoolsScreen() = FlorisScreen {
title = "keyboardExtensions",
summary = extensionManager.keyboardExtensions.internalModuleDir.absolutePath,
onClick = {
context.showLongToast(extensionManager.keyboardExtensions.internalModuleDir.absolutePath)
context.showLongToastSync(extensionManager.keyboardExtensions.internalModuleDir.absolutePath)
},
)
Preference(
title = "themes",
summary = extensionManager.themes.internalModuleDir.absolutePath,
onClick = {
context.showLongToast(extensionManager.themes.internalModuleDir.absolutePath)
context.showLongToastSync(extensionManager.themes.internalModuleDir.absolutePath)
},
)
}

View File

@@ -38,7 +38,7 @@ import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.sp
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.clipboardManager
import dev.patrickgold.florisboard.lib.compose.FlorisButton
import dev.patrickgold.florisboard.lib.compose.FlorisScreen
@@ -47,6 +47,7 @@ import dev.patrickgold.florisboard.lib.compose.florisScrollbar
import dev.patrickgold.florisboard.lib.compose.stringRes
import dev.patrickgold.florisboard.lib.devtools.Devtools
import org.florisboard.lib.android.showShortToast
import org.florisboard.lib.android.showShortToastSync
// TODO: This screen is just a quick thrown-together thing and needs further enhancing in the UI
@Composable
@@ -54,7 +55,7 @@ fun ExportDebugLogScreen() = FlorisScreen {
title = stringRes(R.string.devtools__debuglog__title)
scrollable = false
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val context = LocalContext.current
val clipboardManager by context.clipboardManager()
@@ -74,7 +75,7 @@ fun ExportDebugLogScreen() = FlorisScreen {
FlorisButton(
onClick = {
clipboardManager.addNewPlaintext(debugLog!!.joinToString("\n"))
context.showShortToast(context.getString(R.string.devtools__debuglog__copied_to_clipboard))
context.showShortToastSync(context.getString(R.string.devtools__debuglog__copied_to_clipboard))
},
modifier = Modifier,
text = stringRes(R.string.devtools__debuglog__copy_log),
@@ -83,7 +84,7 @@ fun ExportDebugLogScreen() = FlorisScreen {
FlorisButton(
onClick = {
clipboardManager.addNewPlaintext(formattedDebugLog!!.joinToString("\n"))
context.showShortToast(context.getString(R.string.devtools__debuglog__copied_to_clipboard))
context.showShortToastSync(context.getString(R.string.devtools__debuglog__copied_to_clipboard))
},
text = stringRes(R.string.devtools__debuglog__copy_for_github),
enabled = debugLog != null,

View File

@@ -46,7 +46,6 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.core.content.MimeTypeFilter
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.lib.cache.CacheManager
import dev.patrickgold.florisboard.lib.compose.FlorisIconButton
@@ -60,24 +59,26 @@ import java.util.*
import org.florisboard.lib.android.query
import org.florisboard.lib.android.readToFile
import org.florisboard.lib.android.showLongToast
import org.florisboard.lib.android.showLongToastSync
import org.florisboard.lib.android.showShortToast
import org.florisboard.lib.android.showShortToastSync
import org.florisboard.lib.kotlin.io.parentDir
import org.florisboard.lib.kotlin.io.subDir
import org.florisboard.lib.kotlin.io.subFile
import org.florisboard.lib.kotlin.mimeTypeFilterOf
const val FONTS = "fonts"
const val IMAGES = "images"
val MIME_TYPES = mapOf(
FONTS to listOf(
FONTS to mimeTypeFilterOf(
// Source: https://www.alienfactory.co.uk/articles/mime-types-for-web-fonts-in-bedsheet#mimeTypes
"font/*",
"application/vnd.ms-fontobject", // .eot
"application/font-woff", // .woff
"application/x-font-truetype", // .ttf
"application/x-font-opentype", // .otf
"application/font-*",
"application/x-font-*",
"application/vnd.ms-fontobject",
),
IMAGES to listOf(
IMAGES to mimeTypeFilterOf(
"image/*",
),
)
@@ -118,9 +119,9 @@ fun ExtensionEditFilesScreen(workspace: CacheManager.ExtEditorWorkspace<*>) = Fl
val tempFile = context.cacheDir.subFile("temp_${UUID.randomUUID()}")
context.contentResolver.readToFile(uri, tempFile)
val mimeType = context.contentResolver.getType(uri)
val types = MIME_TYPES[currentImportDest!!]!!
checkNotNull(MimeTypeFilter.matches(mimeType, types.toTypedArray())) {
"Given file mime type was '$mimeType', expected one of $types"
val filter = MIME_TYPES[currentImportDest!!]!!
check(filter.matches(mimeType)) {
"Given file mime type was '$mimeType', expected one of ${filter.types}"
}
val fileName = context.contentResolver.query(uri, arrayOf(OpenableColumns.DISPLAY_NAME)).use { cursor ->
if (cursor == null || !cursor.moveToFirst()) return@use null
@@ -187,9 +188,9 @@ fun ExtensionEditFilesScreen(workspace: CacheManager.ExtEditorWorkspace<*>) = Fl
allowOutsideDismissal = true,
onNeutral = {
if (file.delete()) {
context.showShortToast("Successfully deleted")
context.showShortToastSync("Successfully deleted")
} else {
context.showShortToast("Failed to delete")
context.showShortToastSync("Failed to delete")
}
dialogFile = null
version++
@@ -197,18 +198,18 @@ fun ExtensionEditFilesScreen(workspace: CacheManager.ExtEditorWorkspace<*>) = Fl
onConfirm = {
val newFile = file.parentFile!!.subFile(fileNameInput).canonicalFile
if (newFile.parentFile != file.canonicalFile.parentFile) {
context.showLongToast("Invalid file name!")
context.showLongToastSync("Invalid file name!")
return@JetPrefAlertDialog
}
if (newFile.exists()) {
context.showShortToast("Filename already exists.")
context.showShortToastSync("Filename already exists.")
return@JetPrefAlertDialog
}
val success = file.renameTo(newFile)
if (success) {
context.showShortToast("Successfully renamed")
context.showShortToastSync("Successfully renamed")
} else {
context.showShortToast("Failed to rename the file.")
context.showShortToastSync("Failed to rename the file.")
}
dialogFile = null
version++
@@ -258,13 +259,13 @@ fun ExtensionEditFilesScreen(workspace: CacheManager.ExtEditorWorkspace<*>) = Fl
dir.mkdirs()
val file = dir.subFile(fileName)
if (file.parentDir != workspace.extDir.subDir(dest)) {
context.showShortToast("Invalid file name")
context.showShortToastSync("Invalid file name")
} else if (file.exists()) {
context.showShortToast("File already exists")
context.showShortToastSync("File already exists")
} else {
val tempFile = result.first
if (!tempFile.renameTo(file)) {
context.showShortToast("Failed to rename file")
context.showShortToastSync("Failed to rename file")
tempFile.delete()
}
currentImportDest = null

View File

@@ -90,6 +90,7 @@ import dev.patrickgold.jetpref.material.ui.JetPrefAlertDialog
import dev.patrickgold.jetpref.material.ui.JetPrefTextField
import java.util.*
import org.florisboard.lib.android.showLongToast
import org.florisboard.lib.android.showLongToastSync
import org.florisboard.lib.kotlin.io.deleteContentsRecursively
import org.florisboard.lib.kotlin.io.subDir
import org.florisboard.lib.kotlin.io.subFile
@@ -287,7 +288,7 @@ private fun EditScreen(
stylesheetFile.writeText(stylesheet)
}.onFailure {
// TODO: better error handling
context.showLongToast(it.message.toString())
context.showLongToastSync(it.message.toString())
return
}
} else {
@@ -665,7 +666,7 @@ private fun <T : ExtensionComponent> CreateComponentScreen(
when (createFrom) {
CreateFrom.EMPTY -> {
if (editor.themes.any { it.id == newId.trim() }) {
context.showLongToast("A theme with this ID already exists!")
context.showLongToastSync("A theme with this ID already exists!")
} else {
val componentEditor = ThemeExtensionComponentEditor(
id = newId.trim(),

View File

@@ -27,6 +27,7 @@ import org.florisboard.lib.android.showLongToast
import dev.patrickgold.florisboard.lib.compose.FlorisScreen
import dev.patrickgold.florisboard.lib.ext.Extension
import dev.patrickgold.florisboard.lib.ext.ExtensionDefaults
import org.florisboard.lib.android.showLongToastSync
@Composable
fun ExtensionExportScreen(id: String) {
@@ -61,9 +62,9 @@ private fun ExportScreen(ext: Extension) = FlorisScreen {
return@rememberLauncherForActivityResult
}
runCatching { extensionManager.export(ext, uri) }.onSuccess {
context.showLongToast(R.string.ext__export__success)
context.showLongToastSync(R.string.ext__export__success)
}.onFailure { error ->
context.showLongToast(R.string.ext__export__failure, "error_message" to error.localizedMessage)
context.showLongToastSync(R.string.ext__export__failure, "error_message" to error.localizedMessage)
}
navController.popBackStack()
},

View File

@@ -61,6 +61,7 @@ import dev.patrickgold.florisboard.lib.compose.defaultFlorisOutlinedBox
import dev.patrickgold.florisboard.lib.compose.florisHorizontalScroll
import dev.patrickgold.florisboard.lib.compose.stringRes
import dev.patrickgold.florisboard.lib.io.FileRegistry
import org.florisboard.lib.android.showLongToastSync
import org.florisboard.lib.kotlin.resultOk
enum class ExtensionImportScreenType(
@@ -188,10 +189,10 @@ fun ExtensionImportScreen(type: ExtensionImportScreenType, initUuid: String?) =
}
}.onSuccess {
workspace.close()
context.showLongToast(R.string.ext__import__success)
context.showLongToastSync(R.string.ext__import__success)
navController.popBackStack()
}.onFailure { error ->
context.showLongToast(R.string.ext__import__failure, "error_message" to error.localizedMessage)
context.showLongToastSync(R.string.ext__import__failure, "error_message" to error.localizedMessage)
}
}
}

View File

@@ -62,6 +62,7 @@ import dev.patrickgold.florisboard.lib.ext.Extension
import dev.patrickgold.florisboard.lib.ext.ExtensionMaintainer
import dev.patrickgold.florisboard.lib.ext.ExtensionMeta
import dev.patrickgold.florisboard.lib.io.FlorisRef
import org.florisboard.lib.android.showLongToastSync
@Composable
fun ExtensionViewScreen(id: String) {
@@ -202,7 +203,7 @@ private fun ViewScreen(ext: Extension) = FlorisScreen {
}.onSuccess {
navController.popBackStack()
}.onFailure { error ->
context.showLongToast(
context.showLongToastSync(
R.string.error__snackbar_message,
"error_message" to error.localizedMessage,
)

View File

@@ -19,7 +19,6 @@ package dev.patrickgold.florisboard.app.settings
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.Assignment
import androidx.compose.material.icons.filled.Adb
import androidx.compose.material.icons.filled.Extension
import androidx.compose.material.icons.filled.Gesture
import androidx.compose.material.icons.filled.Language

View File

@@ -21,8 +21,9 @@ import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.mikepenz.aboutlibraries.ui.compose.LibraryDefaults
import com.mikepenz.aboutlibraries.ui.compose.m3.LibrariesContainer
import com.mikepenz.aboutlibraries.ui.compose.m3.LibraryDefaults
import com.mikepenz.aboutlibraries.ui.compose.m3.libraryColors
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.lib.compose.FlorisScreen
import dev.patrickgold.florisboard.lib.compose.florisScrollbar

View File

@@ -32,6 +32,7 @@ import androidx.compose.runtime.State
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
@@ -41,6 +42,8 @@ import androidx.core.app.ShareCompat
import androidx.core.content.FileProvider
import dev.patrickgold.florisboard.BuildConfig
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.FlorisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.app.LocalNavController
import dev.patrickgold.florisboard.cacheManager
import dev.patrickgold.florisboard.clipboardManager
@@ -57,11 +60,14 @@ import dev.patrickgold.florisboard.lib.devtools.flogError
import dev.patrickgold.florisboard.lib.ext.ExtensionManager
import dev.patrickgold.florisboard.lib.io.FileRegistry
import dev.patrickgold.florisboard.lib.io.ZipUtils
import dev.patrickgold.jetpref.datastore.jetprefDatastoreDir
import dev.patrickgold.jetpref.datastore.runtime.AndroidAppDataStorage
import dev.patrickgold.jetpref.datastore.runtime.FileBasedStorage
import dev.patrickgold.jetpref.material.ui.JetPrefListItem
import kotlinx.coroutines.launch
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import org.florisboard.lib.android.showLongToast
import org.florisboard.lib.android.showLongToastSync
import org.florisboard.lib.android.writeFromFile
import org.florisboard.lib.kotlin.io.subDir
import org.florisboard.lib.kotlin.io.subFile
@@ -136,6 +142,7 @@ fun BackupScreen() = FlorisScreen {
val navController = LocalNavController.current
val context = LocalContext.current
val cacheManager by context.cacheManager()
val scope = rememberCoroutineScope()
var backupDestination by remember { mutableStateOf(Backup.Destination.FILE_SYS) }
val backupFilesSelector = remember { Backup.FilesSelector() }
@@ -155,22 +162,24 @@ fun BackupScreen() = FlorisScreen {
context.contentResolver.writeFromFile(uri, backupWorkspace!!.zipFile)
backupWorkspace!!.close()
}.onSuccess {
context.showLongToast(R.string.backup_and_restore__back_up__success)
context.showLongToastSync(R.string.backup_and_restore__back_up__success)
navController.popBackStack()
}.onFailure { error ->
flogError { error.stackTraceToString() }
context.showLongToast(R.string.backup_and_restore__back_up__failure, "error_message" to error.message)
context.showLongToastSync(R.string.backup_and_restore__back_up__failure, "error_message" to error.message)
backupWorkspace = null
}
},
)
fun prepareBackupWorkspace() {
suspend fun prepareBackupWorkspace() {
val workspace = cacheManager.backupAndRestore.new()
if (backupFilesSelector.jetprefDatastore) {
context.jetprefDatastoreDir.let { dir ->
dir.copyRecursively(workspace.inputDir.subDir(dir.name))
}
val fileBasedStorage = workspace.inputDir
.subDir(AndroidAppDataStorage.JETPREF_DIR_NAME)
.subFile("${FlorisPreferenceModel.NAME}.${AndroidAppDataStorage.JETPREF_FILE_EXT}")
.let { FileBasedStorage(it.path) }
FlorisPreferenceStore.export(fileBasedStorage).getOrThrow()
}
val workspaceFilesDir = workspace.inputDir.subDir("files")
if (backupFilesSelector.imeKeyboard) {
@@ -225,7 +234,7 @@ fun BackupScreen() = FlorisScreen {
backupWorkspace = workspace
}
fun prepareAndPerformBackup() {
suspend fun prepareAndPerformBackup() {
runCatching {
if (backupWorkspace == null || backupWorkspace!!.isClosed()) {
prepareBackupWorkspace()
@@ -265,7 +274,7 @@ fun BackupScreen() = FlorisScreen {
)
ButtonBarButton(
onClick = {
prepareAndPerformBackup()
scope.launch { prepareAndPerformBackup() }
},
text = stringRes(R.string.action__back_up),
enabled = backupFilesSelector.atLeastOneSelected(),

View File

@@ -45,6 +45,7 @@ import dev.patrickgold.jetpref.datastore.ui.PreferenceGroup
import dev.patrickgold.jetpref.datastore.ui.SwitchPreference
import dev.patrickgold.jetpref.datastore.ui.isMaterialYou
import dev.patrickgold.jetpref.datastore.ui.listPrefEntries
import dev.patrickgold.jetpref.datastore.ui.vectorResource
import org.florisboard.lib.android.AndroidVersion
import org.florisboard.lib.color.ColorMappings
@@ -154,6 +155,11 @@ fun OtherScreen() = FlorisScreen {
},
enabledIf = { AndroidVersion.ATMOST_API28_P },
)
Preference(
icon = vectorResource(R.drawable.ic_keyboard_keys),
title = stringRes(R.string.physical_keyboard__title),
onClick = { navController.navigate(Routes.Settings.PhysicalKeyboard) },
)
Preference(
icon = Icons.Default.Adb,
title = stringRes(R.string.devtools__title),

View File

@@ -0,0 +1,69 @@
/*
* Copyright (C) 2025 The FlorisBoard Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.patrickgold.florisboard.app.settings.advanced
import android.content.Intent
import android.content.res.Configuration
import android.provider.Settings
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalContext
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.lib.compose.FlorisScreen
import dev.patrickgold.florisboard.lib.compose.stringRes
import dev.patrickgold.jetpref.datastore.ui.Preference
import dev.patrickgold.jetpref.datastore.ui.SwitchPreference
@Composable
fun PhysicalKeyboardScreen() = FlorisScreen {
title = stringRes(R.string.physical_keyboard__title)
val context = LocalContext.current
val physicalKeyboardAttached by remember {
mutableStateOf(context.resources.configuration.keyboard != Configuration.KEYBOARD_NOKEYS)
}
val activityForResult = rememberLauncherForActivityResult(
ActivityResultContracts.StartActivityForResult()
) { }
content {
if (physicalKeyboardAttached) {
Preference(
title = stringRes(R.string.physical_keyboard__system_settings__title),
summary = stringRes(R.string.physical_keyboard__system_settings__summary),
onClick = {
activityForResult.launch(Intent(Settings.ACTION_HARD_KEYBOARD_SETTINGS))
}
)
} else {
Preference(
title = stringRes(R.string.physical_keyboard__system_settings__title),
summary = stringRes(R.string.physical_keyboard__system_settings__summary_not_attached),
)
}
SwitchPreference(
pref = prefs.physicalKeyboard.showOnScreenKeyboard,
title = stringRes(R.string.physical_keyboard__show_on_screen_keyboard__title),
summary = stringRes(R.string.physical_keyboard__show_on_screen_keyboard__summary),
)
}
}

View File

@@ -43,8 +43,9 @@ import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.unit.dp
import dev.patrickgold.florisboard.BuildConfig
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.FlorisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.app.LocalNavController
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.cacheManager
import dev.patrickgold.florisboard.clipboardManager
import dev.patrickgold.florisboard.ime.clipboard.provider.ClipboardFileStorage
@@ -60,13 +61,16 @@ import dev.patrickgold.florisboard.lib.compose.defaultFlorisOutlinedBox
import dev.patrickgold.florisboard.lib.compose.stringRes
import dev.patrickgold.florisboard.lib.ext.ExtensionManager
import dev.patrickgold.florisboard.lib.io.ZipUtils
import dev.patrickgold.jetpref.datastore.JetPref
import dev.patrickgold.jetpref.datastore.runtime.AndroidAppDataStorage
import dev.patrickgold.jetpref.datastore.runtime.FileBasedStorage
import dev.patrickgold.jetpref.datastore.runtime.ImportStrategy
import dev.patrickgold.jetpref.datastore.ui.Preference
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.florisboard.lib.android.readToFile
import org.florisboard.lib.android.showLongToast
import org.florisboard.lib.android.showLongToastSync
import org.florisboard.lib.kotlin.io.deleteContentsRecursively
import org.florisboard.lib.kotlin.io.readJson
import org.florisboard.lib.kotlin.io.subDir
@@ -79,11 +83,6 @@ object Restore {
const val MIN_VERSION_CODE = 64
const val PACKAGE_NAME = "dev.patrickgold.florisboard"
const val BACKUP_ARCHIVE_FILE_NAME = "backup.zip"
enum class Mode {
MERGE,
ERASE_AND_OVERWRITE;
}
}
@Composable
@@ -91,13 +90,12 @@ fun RestoreScreen() = FlorisScreen {
title = stringRes(R.string.backup_and_restore__restore__title)
previewFieldVisible = false
val prefs by florisPreferenceModel()
val navController = LocalNavController.current
val context = LocalContext.current
val cacheManager by context.cacheManager()
val restoreFilesSelector = remember { Backup.FilesSelector() }
var restoreMode by remember { mutableStateOf(Restore.Mode.MERGE) }
var importStrategy by remember { mutableStateOf(ImportStrategy.Merge) }
// TODO: rememberCoroutineScope() is unusable because it provides the scope in a cancelled state, which does
// not make sense at all. I suspect that this is a bug and once it is resolved we can use it here again.
val restoreScope = remember { CoroutineScope(Dispatchers.Main) }
@@ -138,7 +136,7 @@ fun RestoreScreen() = FlorisScreen {
}
restoreWorkspace = workspace
}.onFailure { error ->
context.showLongToast(
context.showLongToastSync(
R.string.backup_and_restore__restore__failure,
"error_message" to error.localizedMessage,
)
@@ -148,15 +146,13 @@ fun RestoreScreen() = FlorisScreen {
suspend fun performRestore() {
val workspace = restoreWorkspace!!
val shouldReset = restoreMode == Restore.Mode.ERASE_AND_OVERWRITE
val shouldReset = importStrategy == ImportStrategy.Erase
if (restoreFilesSelector.jetprefDatastore) {
val datastoreFile = workspace.outputDir
.subDir(JetPref.JETPREF_DIR_NAME)
.subFile("${prefs.name}.${JetPref.JETPREF_FILE_EXT}")
if (datastoreFile.exists()) {
prefs.datastorePersistenceHandler?.loadPrefs(datastoreFile, shouldReset)
prefs.datastorePersistenceHandler?.persistPrefs()
}
val fileBasedStorage = workspace.outputDir
.subDir(AndroidAppDataStorage.JETPREF_DIR_NAME)
.subFile("${FlorisPreferenceModel.NAME}.${AndroidAppDataStorage.JETPREF_FILE_EXT}")
.let { FileBasedStorage(it.path) }
FlorisPreferenceStore.import(importStrategy, fileBasedStorage).getOrThrow()
}
val workspaceFilesDir = workspace.outputDir.subDir("files")
if (restoreFilesSelector.imeKeyboard) {
@@ -275,16 +271,16 @@ fun RestoreScreen() = FlorisScreen {
) {
RadioListItem(
onClick = {
restoreMode = Restore.Mode.MERGE
importStrategy = ImportStrategy.Merge
},
selected = restoreMode == Restore.Mode.MERGE,
selected = importStrategy == ImportStrategy.Merge,
text = stringRes(R.string.backup_and_restore__restore__mode_merge),
)
RadioListItem(
onClick = {
restoreMode = Restore.Mode.ERASE_AND_OVERWRITE
importStrategy = ImportStrategy.Erase
},
selected = restoreMode == Restore.Mode.ERASE_AND_OVERWRITE,
selected = importStrategy == ImportStrategy.Erase,
text = stringRes(R.string.backup_and_restore__restore__mode_erase_and_overwrite),
)
}
@@ -293,7 +289,7 @@ fun RestoreScreen() = FlorisScreen {
runCatching {
restoreDataFromFileSystemLauncher.launch("*/*")
}.onFailure { error ->
context.showLongToast(
context.showLongToastSync(
R.string.backup_and_restore__restore__failure,
"error_message" to error.localizedMessage,
)

View File

@@ -18,6 +18,7 @@ package dev.patrickgold.florisboard.app.settings.clipboard
import androidx.compose.runtime.Composable
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.ime.clipboard.CLIPBOARD_HISTORY_NUM_GRID_COLUMNS_AUTO
import dev.patrickgold.florisboard.lib.compose.FlorisScreen
import dev.patrickgold.florisboard.lib.compose.pluralsRes
import dev.patrickgold.florisboard.lib.compose.stringRes
@@ -75,6 +76,24 @@ fun ClipboardScreen() = FlorisScreen {
title = stringRes(R.string.pref__clipboard__enable_clipboard_history__label),
summary = stringRes(R.string.pref__clipboard__enable_clipboard_history__summary),
)
DialogSliderPreference(
primaryPref = prefs.clipboard.numHistoryGridColumnsPortrait,
secondaryPref = prefs.clipboard.numHistoryGridColumnsLandscape,
title = stringRes(R.string.pref__clipboard__num_history_grid_columns__label),
primaryLabel = stringRes(R.string.screen_orientation__portrait),
secondaryLabel = stringRes(R.string.screen_orientation__landscape),
valueLabel = { numGridColumns ->
if (numGridColumns == CLIPBOARD_HISTORY_NUM_GRID_COLUMNS_AUTO) {
stringRes(R.string.general__auto)
} else {
numGridColumns.toString()
}
},
min = 0,
max = 10,
stepIncrement = 1,
enabledIf = { prefs.clipboard.historyEnabled isEqualTo true },
)
SwitchPreference(
prefs.clipboard.cleanUpOld,
title = stringRes(R.string.pref__clipboard__clean_up_old__label),

View File

@@ -68,6 +68,7 @@ import dev.patrickgold.jetpref.material.ui.JetPrefTextField
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.florisboard.lib.android.showLongToast
import org.florisboard.lib.android.showLongToastSync
import org.florisboard.lib.android.stringRes
private val AllLanguagesLocale = FlorisLocale.from(language = "zz")
@@ -143,16 +144,16 @@ fun UserDictionaryScreen(type: UserDictionaryType) = FlorisScreen {
UserDictionaryType.SYSTEM -> dictionaryManager.systemUserDictionaryDatabase()
}
if (db == null) {
context.showLongToast("Database handle is null, failed to import")
context.showLongToastSync("Database handle is null, failed to import")
return@rememberLauncherForActivityResult
}
runCatching {
db.importCombinedList(context, uri)
}.onSuccess {
buildUi()
context.showLongToast(R.string.settings__udm__dictionary_import_success)
context.showLongToastSync(R.string.settings__udm__dictionary_import_success)
}.onFailure { error ->
context.showLongToast("Error: ${error.localizedMessage}")
context.showLongToastSync("Error: ${error.localizedMessage}")
}
},
)
@@ -168,15 +169,15 @@ fun UserDictionaryScreen(type: UserDictionaryType) = FlorisScreen {
UserDictionaryType.SYSTEM -> dictionaryManager.systemUserDictionaryDatabase()
}
if (db == null) {
context.showLongToast("Database handle is null, failed to export")
context.showLongToastSync("Database handle is null, failed to export")
return@rememberLauncherForActivityResult
}
runCatching {
db.exportCombinedList(context, uri)
}.onSuccess {
context.showLongToast(R.string.settings__udm__dictionary_export_success)
context.showLongToastSync(R.string.settings__udm__dictionary_export_success)
}.onFailure { error ->
context.showLongToast("Error: ${error.localizedMessage}")
context.showLongToastSync("Error: ${error.localizedMessage}")
}
},
)

View File

@@ -20,11 +20,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.enumDisplayEntriesOf
import dev.patrickgold.florisboard.ime.input.InputFeedbackActivationMode
import dev.patrickgold.florisboard.ime.input.HapticVibrationMode
import org.florisboard.lib.android.AndroidVersion
import org.florisboard.lib.android.systemVibratorOrNull
import org.florisboard.lib.android.vibrate
import dev.patrickgold.florisboard.ime.input.InputFeedbackActivationMode
import dev.patrickgold.florisboard.lib.compose.FlorisScreen
import dev.patrickgold.florisboard.lib.compose.stringRes
import dev.patrickgold.jetpref.datastore.ui.DialogSliderPreference
@@ -32,6 +29,8 @@ import dev.patrickgold.jetpref.datastore.ui.ExperimentalJetPrefDatastoreUi
import dev.patrickgold.jetpref.datastore.ui.ListPreference
import dev.patrickgold.jetpref.datastore.ui.PreferenceGroup
import dev.patrickgold.jetpref.datastore.ui.SwitchPreference
import org.florisboard.lib.android.systemVibratorOrNull
import org.florisboard.lib.android.vibrate
@OptIn(ExperimentalJetPrefDatastoreUi::class)
@Composable
@@ -138,8 +137,6 @@ fun InputFeedbackScreen() = FlorisScreen {
summary = { strength ->
if (vibrator == null || !vibrator.hasVibrator()) {
stringRes(R.string.pref__input_feedback__haptic_vibration_strength__summary_no_vibrator)
} else if (AndroidVersion.ATMOST_API25_N_MR1) {
stringRes(R.string.pref__input_feedback__haptic_vibration_strength__summary_unsupported_android_version)
} else if (!vibrator.hasAmplitudeControl()) {
stringRes(R.string.pref__input_feedback__haptic_vibration_strength__summary_no_amplitude_ctrl)
} else {
@@ -157,7 +154,7 @@ fun InputFeedbackScreen() = FlorisScreen {
prefs.inputFeedback.hapticEnabled isEqualTo true &&
prefs.inputFeedback.hapticVibrationMode isEqualTo HapticVibrationMode.USE_VIBRATOR_DIRECTLY &&
vibrator != null && vibrator.hasVibrator() &&
AndroidVersion.ATLEAST_API26_O && vibrator.hasAmplitudeControl()
vibrator.hasAmplitudeControl()
},
)
SwitchPreference(

View File

@@ -41,10 +41,10 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.app.LocalNavController
import dev.patrickgold.florisboard.app.Routes
import dev.patrickgold.florisboard.app.ext.ExtensionImportScreenType
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.extensionManager
import dev.patrickgold.florisboard.ime.nlp.LanguagePackComponent
import org.florisboard.lib.android.showLongToast
@@ -61,6 +61,7 @@ import dev.patrickgold.florisboard.lib.observeAsNonNullState
import dev.patrickgold.jetpref.datastore.ui.ExperimentalJetPrefDatastoreUi
import dev.patrickgold.jetpref.datastore.ui.Preference
import dev.patrickgold.jetpref.material.ui.JetPrefListItem
import org.florisboard.lib.android.showLongToastSync
enum class LanguagePackManagerScreenAction(val id: String) {
MANAGE("manage-installed-language-packs");
@@ -75,7 +76,7 @@ fun LanguagePackManagerScreen(action: LanguagePackManagerScreenAction?) = Floris
else -> error("LanguagePack manager screen action must not be null")
})
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val navController = LocalNavController.current
val context = LocalContext.current
val extensionManager by context.extensionManager()
@@ -199,7 +200,7 @@ fun LanguagePackManagerScreen(action: LanguagePackManagerScreenAction?) = Floris
runCatching {
extensionManager.delete(languagePackExtToDelete!!)
}.onFailure { error ->
context.showLongToast(
context.showLongToastSync(
R.string.error__snackbar_message,
"error_message" to error.localizedMessage,
)

View File

@@ -44,8 +44,8 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.unit.dp
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.app.LocalNavController
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.ime.core.DisplayLanguageNamesIn
import dev.patrickgold.florisboard.lib.FlorisLocale
import dev.patrickgold.florisboard.lib.compose.FlorisScreen
@@ -61,7 +61,7 @@ fun SelectLocaleScreen() = FlorisScreen {
title = stringRes(R.string.settings__localization__subtype_select_locale)
scrollable = false
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val navController = LocalNavController.current
val displayLanguageNamesIn by prefs.localization.displayLanguageNamesIn.observeAsState()

View File

@@ -58,9 +58,9 @@ import androidx.compose.ui.unit.dp
import androidx.lifecycle.Observer
import androidx.lifecycle.compose.LocalLifecycleOwner
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.app.LocalNavController
import dev.patrickgold.florisboard.app.Routes
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.ime.core.DisplayLanguageNamesIn
import dev.patrickgold.florisboard.ime.core.Subtype
import dev.patrickgold.florisboard.ime.core.SubtypeJsonConfig
@@ -86,7 +86,6 @@ import dev.patrickgold.florisboard.subtypeManager
import dev.patrickgold.jetpref.datastore.model.observeAsState
import dev.patrickgold.jetpref.material.ui.JetPrefAlertDialog
import dev.patrickgold.jetpref.material.ui.JetPrefListItem
import kotlinx.serialization.encodeToString
private val SelectComponentName = ExtensionComponentName("00", "00")
private val SelectNlpProviderId = SelectComponentName.toString()
@@ -186,7 +185,7 @@ fun SubtypeEditorScreen(id: Long?) = FlorisScreen {
val selectValue = stringRes(R.string.settings__localization__subtype_select_placeholder)
val selectListValues = remember(selectValue) { listOf(selectValue) }
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val navController = LocalNavController.current
val context = LocalContext.current
val configuration = LocalConfiguration.current

View File

@@ -27,8 +27,8 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.app.enumDisplayEntriesOf
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.ime.media.emoji.EmojiHistory
import dev.patrickgold.florisboard.ime.media.emoji.EmojiHistoryHelper
import dev.patrickgold.florisboard.ime.media.emoji.EmojiSkinTone
@@ -52,7 +52,7 @@ fun MediaScreen() = FlorisScreen {
previewFieldVisible = true
iconSpaceReserved = true
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
var shouldDelete by remember { mutableStateOf<ShouldDelete?>(null) }
val scope = rememberCoroutineScope()

View File

@@ -68,7 +68,7 @@ fun SmartbarScreen() = FlorisScreen {
// TODO: schedule to remove this preference in the future, but keep it for now so users
// know why the setting is not available anymore. Also force enable it for UI display.
SideEffect {
prefs.smartbar.sharedActionsAutoExpandCollapse.set(true)
// prefs.smartbar.sharedActionsAutoExpandCollapse.set(true)
}
SwitchPreference(
prefs.smartbar.sharedActionsAutoExpandCollapse,

View File

@@ -16,6 +16,7 @@
package dev.patrickgold.florisboard.app.settings.theme
import android.net.Uri
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.background
import androidx.compose.foundation.border
@@ -655,7 +656,7 @@ private fun PropertyValueEditor(
JetPrefListItem(
modifier = Modifier.clickable {
val relPath = file.path.removePrefix(workspace.extDir.path)
inputStr = "flex:$relPath"
inputStr = "flex:" + Uri.encode(relPath, "/")
onValueChange(SnyggUriValue(inputStr))
showSelectFileDialog = false
},

View File

@@ -69,6 +69,7 @@ import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.enumDisplayEntriesOf
import dev.patrickgold.florisboard.ime.input.InputKeyEventReceiver
import dev.patrickgold.florisboard.ime.input.InputShiftState
import dev.patrickgold.florisboard.ime.keyboard.ComputingEvaluator
@@ -95,13 +96,16 @@ import dev.patrickgold.jetpref.material.ui.JetPrefDropdown
import dev.patrickgold.jetpref.material.ui.JetPrefTextField
import dev.patrickgold.jetpref.material.ui.JetPrefTextFieldDefaults
import org.florisboard.lib.android.showShortToast
import org.florisboard.lib.android.showShortToastSync
import org.florisboard.lib.android.stringRes
import org.florisboard.lib.kotlin.curlyFormat
import org.florisboard.lib.snygg.SnyggAnnotationRule
import org.florisboard.lib.snygg.SnyggAttributes
import org.florisboard.lib.snygg.SnyggElementRule
import org.florisboard.lib.snygg.SnyggRule
import org.florisboard.lib.snygg.SnyggSelector
import org.florisboard.lib.snygg.ui.NonNullSaver
import kotlin.reflect.KClass
private val TransparentTextSelectionColors = TextSelectionColors(
handleColor = Color.Transparent,
@@ -240,11 +244,13 @@ internal fun EditRuleDialog(
}
}
DialogProperty(text = stringRes(R.string.settings__theme_editor__rule_selectors)) {
Row(modifier = Modifier.florisHorizontalScroll()) {
//TODO: LazyRow
Row(
modifier = Modifier.florisHorizontalScroll(),
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
// TODO: avoid code duplication
FlorisChip(
onClick = { updateCurrentRule(SnyggSelector.PRESSED) },
modifier = Modifier.padding(end = 4.dp),
text = when (level) {
SnyggLevel.DEVELOPER -> SnyggSelector.PRESSED.id
else -> stringRes(R.string.snygg__rule_selector__pressed)
@@ -253,7 +259,6 @@ internal fun EditRuleDialog(
)
FlorisChip(
onClick = { updateCurrentRule(SnyggSelector.FOCUS) },
modifier = Modifier.padding( end = 4.dp),
text = when (level) {
SnyggLevel.DEVELOPER -> SnyggSelector.FOCUS.id
else -> stringRes(R.string.snygg__rule_selector__focus)
@@ -262,7 +267,6 @@ internal fun EditRuleDialog(
)
FlorisChip(
onClick = { updateCurrentRule(SnyggSelector.HOVER) },
modifier = Modifier.padding( end = 4.dp),
text = when (level) {
SnyggLevel.DEVELOPER -> SnyggSelector.HOVER.id
else -> stringRes(R.string.snygg__rule_selector__hover)
@@ -312,22 +316,17 @@ internal fun EditRuleDialog(
)
},
) {
Text(
modifier = Modifier.padding(vertical = 4.dp),
text = stringRes(
if (codes.isEmpty()) {
R.string.settings__theme_editor__no_codes_defined
} else {
R.string.settings__theme_editor__codes_defined
}
),
fontStyle = FontStyle.Italic,
)
FlowRow {
if (codes.isEmpty()) {
Text(
text = stringRes(R.string.settings__theme_editor__no_codes_defined),
fontStyle = FontStyle.Italic,
)
}
FlowRow(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
for (code in codes) {
FlorisChip(
onClick = { editCodeDialogValue = code },
text = code.toString(),
text = code,
selected = editCodeDialogValue == code,
shape = MaterialTheme.shapes.medium,
)
@@ -335,78 +334,23 @@ internal fun EditRuleDialog(
}
}
val shiftStateUnshifted = remember(currentRule) {
attributes[FlorisImeUi.Attr.ShiftState]?.contains(InputShiftState.UNSHIFTED.attrName()) == true
}
val shiftStateShiftedManual = remember(currentRule) {
attributes[FlorisImeUi.Attr.ShiftState]?.contains(InputShiftState.SHIFTED_MANUAL.attrName()) == true
}
val shiftStateShiftedAutomatic = remember(currentRule) {
attributes[FlorisImeUi.Attr.ShiftState]?.contains(InputShiftState.SHIFTED_AUTOMATIC.attrName()) == true
}
val shiftStateCapsLock = remember(currentRule) {
attributes[FlorisImeUi.Attr.ShiftState]?.contains(InputShiftState.CAPS_LOCK.attrName()) == true
}
DialogProperty(text = stringRes(R.string.settings__theme_editor__rule_shift_states)) {
FlowRow(horizontalArrangement = Arrangement.spacedBy(4.dp)) {
FlorisChip(
onClick = {
currentRule = copy(
attributes = attributes.toggling(
FlorisImeUi.Attr.ShiftState to InputShiftState.UNSHIFTED.attrName()
)
)
},
text = when (level) {
SnyggLevel.DEVELOPER -> InputShiftState.UNSHIFTED.attrName()
else -> stringRes(R.string.enum__input_shift_state__unshifted)
},
selected = shiftStateUnshifted,
)
FlorisChip(
onClick = {
currentRule = copy(
attributes = attributes.toggling(
FlorisImeUi.Attr.ShiftState to InputShiftState.SHIFTED_MANUAL.attrName()
)
)
},
text = when (level) {
SnyggLevel.DEVELOPER -> InputShiftState.SHIFTED_MANUAL.attrName()
else -> stringRes(R.string.enum__input_shift_state__shifted_manual)
},
selected = shiftStateShiftedManual,
)
FlorisChip(
onClick = {
currentRule = copy(
attributes = attributes.toggling(
FlorisImeUi.Attr.ShiftState to InputShiftState.SHIFTED_AUTOMATIC.attrName()
)
)
},
text = when (level) {
SnyggLevel.DEVELOPER -> InputShiftState.SHIFTED_AUTOMATIC.attrName()
else -> stringRes(R.string.enum__input_shift_state__shifted_automatic)
},
selected = shiftStateShiftedAutomatic,
)
FlorisChip(
onClick = {
currentRule = copy(
attributes = attributes.toggling(
FlorisImeUi.Attr.ShiftState to InputShiftState.CAPS_LOCK.attrName()
)
)
},
text = when (level) {
SnyggLevel.DEVELOPER -> InputShiftState.CAPS_LOCK.attrName()
else -> stringRes(R.string.enum__input_shift_state__caps_lock)
},
selected = shiftStateCapsLock,
)
}
}
EnumLikeAttributeBox(
text = stringRes(R.string.settings__theme_editor__rule_modes),
enumClass = KeyboardMode::class,
attribute = FlorisImeUi.Attr.Mode,
attributes = attributes,
setAttributes = { currentRule = copy(attributes = it) },
level = level,
)
EnumLikeAttributeBox(
text = stringRes(R.string.settings__theme_editor__rule_shift_states),
enumClass = InputShiftState::class,
attribute = FlorisImeUi.Attr.ShiftState,
attributes = attributes,
setAttributes = { currentRule = copy(attributes = it) },
level = level,
)
}
}
}
@@ -463,7 +407,7 @@ private fun EditCodeValueDialog(
}
if (!isFlorisBoardEnabled || !isFlorisBoardSelected) {
lastRecordingToast?.cancel()
lastRecordingToast = context.showShortToast(
lastRecordingToast = context.showShortToastSync(
R.string.settings__theme_editor__code_recording_requires_default_ime_floris,
"app_name" to context.stringRes(R.string.floris_app_name),
)
@@ -489,12 +433,12 @@ private fun EditCodeValueDialog(
val defaultReceiver = keyboardManager.inputEventDispatcher.keyEventReceiver
keyboardManager.inputEventDispatcher.keyEventReceiver = receiver
lastRecordingToast?.cancel()
lastRecordingToast = context.showShortToast(R.string.settings__theme_editor__code_recording_started)
lastRecordingToast = context.showShortToastSync(R.string.settings__theme_editor__code_recording_started)
focusRequester.requestFocus()
onDispose {
keyboardManager.inputEventDispatcher.keyEventReceiver = defaultReceiver
lastRecordingToast?.cancel()
lastRecordingToast = context.showShortToast(R.string.settings__theme_editor__code_recording_stopped)
lastRecordingToast = context.showShortToastSync(R.string.settings__theme_editor__code_recording_stopped)
}
}
}
@@ -715,3 +659,79 @@ private fun TextKeyDataPreviewBox(
}
}
}
@OptIn(ExperimentalLayoutApi::class)
@Composable
private fun <V : Any> EnumLikeAttributeBox(
text: String,
enumClass: KClass<V>,
attribute: String,
attributes: SnyggAttributes,
setAttributes: (SnyggAttributes) -> Unit,
level: SnyggLevel,
) {
val allEntries = enumDisplayEntriesOf(enumClass)
val (alreadyAddedEntries, notYetAddedEntries) = remember(attributes, attribute) {
allEntries.partition { entry ->
attributes[attribute]?.contains(entry.key.toString()) == true
}
}
var showAddDialog by remember { mutableStateOf(false) }
DialogProperty(
text = text,
trailingIconTitle = {
FlorisIconButton(
onClick = { showAddDialog = true },
modifier = Modifier.offset(x = 12.dp),
icon = Icons.Default.Add,
)
},
) {
FlowRow(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
for (entry in alreadyAddedEntries) {
FlorisChip(
onClick = {
setAttributes(attributes.excluding(attribute to entry.key.toString()))
},
text = entry.label,
)
}
if (alreadyAddedEntries.isEmpty()) {
Text(
text = stringRes(R.string.settings__theme_editor__no_codes_defined),
fontStyle = FontStyle.Italic,
)
}
}
}
if (showAddDialog) {
JetPrefAlertDialog(
title = stringRes(R.string.action__add),
dismissLabel = stringRes(R.string.action__cancel),
onDismiss = { showAddDialog = false },
) {
FlowRow(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
for (entry in notYetAddedEntries) {
FlorisChip(
onClick = {
setAttributes(attributes.including(attribute to entry.key.toString()))
showAddDialog = false
},
text = when (level) {
SnyggLevel.DEVELOPER -> entry.key.toString()
else -> entry.label
},
)
}
}
if (notYetAddedEntries.isEmpty()) {
Text(
text = stringRes(R.string.settings__theme_editor__no_enum_value_to_add_anymore),
fontStyle = FontStyle.Italic,
)
}
}
}
}

View File

@@ -20,8 +20,8 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.runtime.Composable
import androidx.compose.ui.unit.dp
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.app.enumDisplayEntriesOf
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.lib.compose.stringRes
import dev.patrickgold.jetpref.datastore.ui.ListPreference
import dev.patrickgold.jetpref.datastore.ui.PreferenceLayout
@@ -37,7 +37,7 @@ fun FineTuneDialog(onDismiss: () -> Unit) {
onDismiss = onDismiss,
contentPadding = FineTuneContentPadding,
) {
PreferenceLayout(florisPreferenceModel(), iconSpaceReserved = false) {
PreferenceLayout(FlorisPreferenceStore, iconSpaceReserved = false) {
ListPreference(
listPref = prefs.theme.editorLevel,
title = stringRes(R.string.settings__theme_editor__fine_tune__level),

View File

@@ -30,7 +30,6 @@ import androidx.compose.material.icons.automirrored.filled.FormatAlignLeft
import androidx.compose.material.icons.automirrored.filled.FormatAlignRight
import androidx.compose.material.icons.automirrored.filled.WrapText
import androidx.compose.material.icons.filled.AttachFile
import androidx.compose.material.icons.filled.CheckBox
import androidx.compose.material.icons.filled.CheckBoxOutlineBlank
import androidx.compose.material.icons.filled.FontDownload
import androidx.compose.material.icons.filled.FormatAlignCenter
@@ -57,7 +56,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.jetpref.datastore.model.observeAsState
import org.florisboard.lib.snygg.value.SnyggCutCornerDpShapeValue
import org.florisboard.lib.snygg.value.SnyggDefinedVarValue
@@ -121,7 +120,7 @@ internal fun SnyggValueIcon(
modifier: Modifier = Modifier,
spec: SnyggValueIcon.Spec = SnyggValueIcon.Normal,
) {
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val context = LocalContext.current
val accentColor by prefs.theme.accentColor.observeAsState()

View File

@@ -70,9 +70,9 @@ import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.app.apptheme.Shapes
import dev.patrickgold.florisboard.app.ext.ExtensionComponentView
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.ime.theme.FlorisImeUi
import dev.patrickgold.florisboard.ime.theme.ThemeExtensionComponent
import dev.patrickgold.florisboard.ime.theme.ThemeExtensionComponentEditor
@@ -100,6 +100,7 @@ import dev.patrickgold.jetpref.material.ui.JetPrefTextField
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.florisboard.lib.android.showLongToast
import org.florisboard.lib.android.showLongToastSync
import org.florisboard.lib.kotlin.io.subFile
import org.florisboard.lib.snygg.SnyggAnnotationRule
import org.florisboard.lib.snygg.SnyggElementRule
@@ -145,7 +146,7 @@ fun ThemeEditorScreen(
title = stringRes(R.string.ext__editor__edit_component__title_theme)
scrollable = false
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val context = LocalContext.current
val focusManager = LocalFocusManager.current
val themeManager by context.themeManager()
@@ -186,7 +187,7 @@ fun ThemeEditorScreen(
}.also { editor.stylesheetEditor = it }
}
val definedVariables = remember(stylesheetEditor.rules) {
val definedVariables = remember(stylesheetEditor.rules, workspace.version) {
stylesheetEditor.rules.firstNotNullOfOrNull { (rule, propertySet) ->
if (rule is SnyggAnnotationRule.Defines && propertySet is SnyggSinglePropertySetEditor) {
propertySet.properties
@@ -196,7 +197,7 @@ fun ThemeEditorScreen(
} ?: emptyMap()
}
val fontNames = remember(stylesheetEditor.rules) {
val fontNames = remember(stylesheetEditor.rules, workspace.version) {
stylesheetEditor.rules.mapNotNull { (rule, _) ->
if (rule is SnyggAnnotationRule.Font) {
rule.fontName
@@ -309,13 +310,14 @@ fun ThemeEditorScreen(
}
DisposableEffect(workspace.version) {
themeManager.previewThemeInfo = ThemeManager.ThemeInfo.DEFAULT.copy(
themeManager.previewThemeInfo.value = ThemeManager.ThemeInfo.DEFAULT.copy(
name = extPreviewTheme(System.currentTimeMillis().toString()),
config = editor.build(),
stylesheet = stylesheetEditor.build(),
loadedDir = workspace.extDir,
)
onDispose {
themeManager.previewThemeInfo = null
themeManager.previewThemeInfo.value = null
}
}
@@ -632,7 +634,7 @@ private fun ComponentMetaEditorDialog(
if (!allFieldsValid) {
showValidationErrors = true
} else if (id != editor.id && (workspace.editor as? ThemeExtensionEditor)?.themes?.find { it.id == id.trim() } != null) {
context.showLongToast("A theme with this ID already exists!")
context.showLongToastSync("A theme with this ID already exists!")
} else {
workspace.update {
editor.id = id.trim()
@@ -730,7 +732,6 @@ private fun SnyggRuleRow(
style = MaterialTheme.typography.bodyMedium,
color = LocalContentColor.current.copy(alpha = 0.56f),
fontFamily = FontFamily.Monospace,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
}
@@ -750,7 +751,7 @@ private fun SnyggRuleRow(
text = context.translateElementName(rule, level),
style = MaterialTheme.typography.bodyMedium,
fontFamily = FontFamily.Monospace,
maxLines = 1,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
)
Row(modifier = Modifier.fillMaxWidth()) {

View File

@@ -29,10 +29,11 @@ import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.key
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.extensionManager
import dev.patrickgold.florisboard.ime.theme.ThemeExtensionComponent
import dev.patrickgold.florisboard.lib.compose.FlorisOutlinedBox
@@ -45,6 +46,7 @@ import dev.patrickgold.florisboard.lib.observeAsNonNullState
import dev.patrickgold.florisboard.themeManager
import dev.patrickgold.jetpref.datastore.model.observeAsState
import dev.patrickgold.jetpref.material.ui.JetPrefListItem
import kotlinx.coroutines.launch
enum class ThemeManagerScreenAction(val id: String) {
SELECT_DAY("select-day"),
@@ -60,10 +62,11 @@ fun ThemeManagerScreen(action: ThemeManagerScreenAction?) = FlorisScreen {
})
previewFieldVisible = true
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val context = LocalContext.current
val extensionManager by context.extensionManager()
val themeManager by context.themeManager()
val scope = rememberCoroutineScope()
val indexedThemeExtensions by extensionManager.themes.observeAsNonNullState()
val extGroupedThemes = remember(indexedThemeExtensions) {
@@ -83,7 +86,7 @@ fun ThemeManagerScreen(action: ThemeManagerScreenAction?) = FlorisScreen {
val extComponentName = ExtensionComponentName(extId, componentId)
when (action) {
ThemeManagerScreenAction.SELECT_DAY,
ThemeManagerScreenAction.SELECT_NIGHT -> {
ThemeManagerScreenAction.SELECT_NIGHT -> scope.launch {
getThemeIdPref().set(extComponentName)
}
}
@@ -96,9 +99,9 @@ fun ThemeManagerScreen(action: ThemeManagerScreenAction?) = FlorisScreen {
content {
DisposableEffect(activeThemeId) {
themeManager.previewThemeId = activeThemeId
themeManager.previewThemeId.value = activeThemeId
onDispose {
themeManager.previewThemeId = null
themeManager.previewThemeId.value = null
}
}
val grayColor = LocalContentColor.current.copy(alpha = 0.56f)

View File

@@ -16,19 +16,18 @@
package dev.patrickgold.florisboard.app.settings.theme
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Brightness2
import androidx.compose.material.icons.filled.BrightnessAuto
import androidx.compose.material.icons.filled.ColorLens
import androidx.compose.material.icons.filled.DarkMode
import androidx.compose.material.icons.filled.LightMode
import androidx.compose.material.icons.filled.WbTwilight
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.LocalNavController
import dev.patrickgold.florisboard.app.Routes
@@ -37,7 +36,6 @@ import dev.patrickgold.florisboard.app.ext.AddonManagementReferenceBox
import dev.patrickgold.florisboard.app.ext.ExtensionListScreenType
import dev.patrickgold.florisboard.ime.theme.ThemeManager
import dev.patrickgold.florisboard.ime.theme.ThemeMode
import dev.patrickgold.florisboard.lib.compose.FlorisInfoCard
import dev.patrickgold.florisboard.lib.compose.FlorisScreen
import dev.patrickgold.florisboard.lib.compose.stringRes
import dev.patrickgold.florisboard.lib.ext.ExtensionComponentName
@@ -45,6 +43,7 @@ import dev.patrickgold.florisboard.themeManager
import dev.patrickgold.jetpref.datastore.model.observeAsState
import dev.patrickgold.jetpref.datastore.ui.ColorPickerPreference
import dev.patrickgold.jetpref.datastore.ui.ListPreference
import dev.patrickgold.jetpref.datastore.ui.LocalTimePickerPreference
import dev.patrickgold.jetpref.datastore.ui.Preference
import dev.patrickgold.jetpref.datastore.ui.isMaterialYou
import org.florisboard.lib.color.ColorMappings
@@ -60,41 +59,21 @@ fun ThemeScreen() = FlorisScreen {
@Composable
fun ThemeManager.getThemeLabel(id: ExtensionComponentName): String {
val configs by indexedThemeConfigs.observeAsState()
configs?.get(id)?.let { return it.label }
val configs by indexedThemeConfigs.collectAsState()
configs[id]?.let { return it.label }
return id.toString()
}
content {
val themeMode by prefs.theme.mode.observeAsState()
val dayThemeId by prefs.theme.dayThemeId.observeAsState()
val nightThemeId by prefs.theme.nightThemeId.observeAsState()
/*Card(modifier = Modifier.padding(8.dp)) {
Column(modifier = Modifier.padding(8.dp)) {
Text("If you want to give feedback on the new stylesheet editor and theme engine, please do so in below linked feedback thread:\n")
Button(onClick = {
context.launchUrl("https://github.com/florisboard/florisboard/discussions/1531")
}) {
Text("Open Feedback Thread")
}
}
}*/
ListPreference(
prefs.theme.mode,
icon = Icons.Default.BrightnessAuto,
title = stringRes(R.string.pref__theme__mode__label),
entries = enumDisplayEntriesOf(ThemeMode::class),
)
if (themeMode == ThemeMode.FOLLOW_TIME) {
FlorisInfoCard(
modifier = Modifier.padding(8.dp),
text = """
The theme mode "Follow time" is not available in this beta release.
""".trimIndent()
)
}
Preference(
icon = Icons.Default.LightMode,
title = stringRes(R.string.pref__theme__day),
@@ -113,6 +92,18 @@ fun ThemeScreen() = FlorisScreen {
navController.navigate(Routes.Settings.ThemeManager(ThemeManagerScreenAction.SELECT_NIGHT))
},
)
LocalTimePickerPreference(
pref = prefs.theme.sunriseTime,
title = stringRes(R.string.pref__theme__sunrise_time__label),
icon = Icons.Default.WbTwilight,
enabledIf = { prefs.theme.mode isEqualTo ThemeMode.FOLLOW_TIME },
)
LocalTimePickerPreference(
pref = prefs.theme.sunsetTime,
title = stringRes(R.string.pref__theme__sunset_time__label),
icon = Icons.Default.Brightness2,
enabledIf = { prefs.theme.mode isEqualTo ThemeMode.FOLLOW_TIME },
)
ColorPickerPreference(
pref = prefs.theme.accentColor,
title = stringRes(R.string.pref__theme__theme_accent_color__label),

View File

@@ -33,6 +33,7 @@ import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -40,11 +41,11 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.AppPrefs
import dev.patrickgold.florisboard.app.FlorisAppActivity
import dev.patrickgold.florisboard.app.FlorisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.app.LocalNavController
import dev.patrickgold.florisboard.app.Routes
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.lib.compose.FlorisBulletSpacer
import dev.patrickgold.florisboard.lib.compose.FlorisScreen
import dev.patrickgold.florisboard.lib.compose.FlorisScreenScope
@@ -57,10 +58,11 @@ import dev.patrickgold.florisboard.lib.util.launchActivity
import dev.patrickgold.florisboard.lib.util.launchUrl
import dev.patrickgold.jetpref.datastore.model.observeAsState
import dev.patrickgold.jetpref.datastore.ui.PreferenceUiScope
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.florisboard.lib.android.AndroidVersion
@Composable
fun SetupScreen() = FlorisScreen {
title = stringRes(R.string.setup__title)
@@ -70,7 +72,8 @@ fun SetupScreen() = FlorisScreen {
val navController = LocalNavController.current
val context = LocalContext.current
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val scope = rememberCoroutineScope()
val isFlorisBoardEnabled by InputMethodUtils.observeIsFlorisboardEnabled(foregroundOnly = true)
val isFlorisBoardSelected by InputMethodUtils.observeIsFlorisboardSelected(foregroundOnly = true)
@@ -78,10 +81,12 @@ fun SetupScreen() = FlorisScreen {
val requestNotification =
rememberLauncherForActivityResult(ActivityResultContracts.RequestPermission()) { isGranted ->
if (isGranted) {
prefs.internal.notificationPermissionState.set(NotificationPermissionState.GRANTED)
} else {
prefs.internal.notificationPermissionState.set(NotificationPermissionState.DENIED)
scope.launch {
if (isGranted) {
prefs.internal.notificationPermissionState.set(NotificationPermissionState.GRANTED)
} else {
prefs.internal.notificationPermissionState.set(NotificationPermissionState.DENIED)
}
}
}
@@ -91,7 +96,8 @@ fun SetupScreen() = FlorisScreen {
context,
navController,
requestNotification,
hasNotificationPermission
hasNotificationPermission,
scope,
)
}
@@ -103,6 +109,7 @@ private fun FlorisScreenScope.content(
navController: NavController,
requestNotification: ManagedActivityResultLauncher<String, Boolean>,
hasNotificationPermission: NotificationPermissionState,
scope: CoroutineScope,
) {
val stepState = rememberSaveable(saver = FlorisStepState.Saver) {
@@ -158,7 +165,7 @@ private fun FlorisScreenScope.content(
Spacer(modifier = Modifier.height(16.dp))
},
steps = steps(
context, navController, requestNotification
context, navController, requestNotification, scope
),
footer = {
footer(context)
@@ -189,10 +196,11 @@ private fun footer(context: Context) {
}
@Composable
private fun PreferenceUiScope<AppPrefs>.steps(
private fun PreferenceUiScope<FlorisPreferenceModel>.steps(
context: Context,
navController: NavController,
requestNotification: ManagedActivityResultLauncher<String, Boolean>,
scope: CoroutineScope,
): List<FlorisStep> {
return listOfNotNull(
@@ -232,7 +240,7 @@ private fun PreferenceUiScope<AppPrefs>.steps(
StepText(stringRes(R.string.setup__finish_up__description_p1))
StepText(stringRes(R.string.setup__finish_up__description_p2))
StepButton(label = stringRes(R.string.setup__finish_up__finish_btn)) {
this@steps.prefs.internal.isImeSetUp.set(true)
scope.launch { this@steps.prefs.internal.isImeSetUp.set(true) }
navController.navigate(Routes.Settings.Home) {
popUpTo(Routes.Setup.Screen) {
inclusive = true

View File

@@ -22,9 +22,9 @@ import android.media.MediaMetadataRetriever
import android.media.ThumbnailUtils
import android.provider.MediaStore
import android.util.Size
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.combinedClickable
@@ -41,35 +41,54 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.sizeIn
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope
import androidx.compose.foundation.lazy.staggeredgrid.LazyVerticalStaggeredGrid
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridItemSpan
import androidx.compose.foundation.lazy.staggeredgrid.items
import androidx.compose.foundation.lazy.staggeredgrid.rememberLazyStaggeredGridState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.automirrored.outlined.Backspace
import androidx.compose.material.icons.filled.ClearAll
import androidx.compose.material.icons.filled.Edit
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material.icons.filled.DeleteSweep
import androidx.compose.material.icons.filled.FilterList
import androidx.compose.material.icons.filled.FilterListOff
import androidx.compose.material.icons.filled.Image
import androidx.compose.material.icons.filled.Link
import androidx.compose.material.icons.filled.Movie
import androidx.compose.material.icons.filled.Phone
import androidx.compose.material.icons.filled.TextFields
import androidx.compose.material.icons.filled.ToggleOff
import androidx.compose.material.icons.filled.ToggleOn
import androidx.compose.material.icons.filled.Videocam
import androidx.compose.material.icons.outlined.ContentPaste
import androidx.compose.material.icons.outlined.Email
import androidx.compose.material.icons.outlined.PushPin
import androidx.compose.material3.Icon
import androidx.compose.material3.ripple
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.mutableStateSetOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.clipboardManager
import dev.patrickgold.florisboard.ime.ImeUiMode
import dev.patrickgold.florisboard.ime.clipboard.provider.ClipboardFileStorage
@@ -77,37 +96,51 @@ import dev.patrickgold.florisboard.ime.clipboard.provider.ClipboardItem
import dev.patrickgold.florisboard.ime.clipboard.provider.ItemType
import dev.patrickgold.florisboard.ime.keyboard.FlorisImeSizing
import dev.patrickgold.florisboard.ime.media.KeyboardLikeButton
import dev.patrickgold.florisboard.ime.smartbar.AnimationDuration
import dev.patrickgold.florisboard.ime.smartbar.VerticalEnterTransition
import dev.patrickgold.florisboard.ime.smartbar.VerticalExitTransition
import dev.patrickgold.florisboard.ime.text.keyboard.TextKeyData
import dev.patrickgold.florisboard.ime.theme.FlorisImeUi
import dev.patrickgold.florisboard.keyboardManager
import dev.patrickgold.florisboard.lib.compose.FlorisStaggeredVerticalGrid
import dev.patrickgold.florisboard.lib.compose.LocalLocalizedDateTimeFormatter
import dev.patrickgold.florisboard.lib.compose.autoMirrorForRtl
import dev.patrickgold.florisboard.lib.compose.florisHorizontalScroll
import dev.patrickgold.florisboard.lib.compose.florisVerticalScroll
import dev.patrickgold.florisboard.lib.compose.rippleClickable
import dev.patrickgold.florisboard.lib.compose.stringRes
import dev.patrickgold.florisboard.lib.observeAsNonNullState
import dev.patrickgold.florisboard.lib.observeAsTransformingState
import dev.patrickgold.florisboard.lib.util.NetworkUtils
import dev.patrickgold.jetpref.datastore.model.observeAsState
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.florisboard.lib.android.AndroidKeyguardManager
import org.florisboard.lib.android.AndroidVersion
import org.florisboard.lib.android.showShortToast
import org.florisboard.lib.android.showShortToastSync
import org.florisboard.lib.android.systemService
import org.florisboard.lib.snygg.SnyggQueryAttributes
import org.florisboard.lib.snygg.ui.SnyggBox
import org.florisboard.lib.snygg.ui.SnyggButton
import org.florisboard.lib.snygg.ui.SnyggChip
import org.florisboard.lib.snygg.ui.SnyggColumn
import org.florisboard.lib.snygg.ui.SnyggIcon
import org.florisboard.lib.snygg.ui.SnyggIconButton
import org.florisboard.lib.snygg.ui.SnyggRow
import org.florisboard.lib.snygg.ui.SnyggText
import java.time.Instant
private val ItemWidth = 200.dp
private val DialogWidth = 240.dp
const val CLIPBOARD_HISTORY_NUM_GRID_COLUMNS_AUTO: Int = 0
@Composable
fun ClipboardInputLayout(
modifier: Modifier = Modifier,
) {
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val scope = rememberCoroutineScope()
val context = LocalContext.current
val clipboardManager by context.clipboardManager()
val keyboardManager by context.keyboardManager()
@@ -115,13 +148,38 @@ fun ClipboardInputLayout(
val deviceLocked = androidKeyguardManager.let { it.isDeviceLocked || it.isKeyguardLocked }
val historyEnabled by prefs.clipboard.historyEnabled.observeAsState()
val history by clipboardManager.history.observeAsNonNullState()
val unfilteredHistory by clipboardManager.history.observeAsNonNullState()
var isFilterRowShown by remember { mutableStateOf(false) }
val activeFilterTypes = remember { mutableStateSetOf<ItemType>() }
val history = remember(unfilteredHistory, activeFilterTypes.toSet()) {
if (activeFilterTypes.isEmpty()) {
unfilteredHistory
} else {
unfilteredHistory.all
.filter { activeFilterTypes.contains(it.type) }
.let { ClipboardManager.ClipboardHistory(it) }
}
}
val gridState = rememberLazyStaggeredGridState()
var popupItem by remember(history) { mutableStateOf<ClipboardItem?>(null) }
var showClearAllHistory by remember { mutableStateOf(false) }
fun isPopupSurfaceActive() = popupItem != null || showClearAllHistory
LaunchedEffect(isFilterRowShown) {
delay(AnimationDuration.toLong())
if (!isFilterRowShown) {
activeFilterTypes.clear()
}
}
LaunchedEffect(activeFilterTypes.toSet()) {
gridState.scrollToItem(0)
}
@Composable
fun HeaderRow() {
SnyggRow(FlorisImeUi.ClipboardHeader.elementName,
@@ -149,7 +207,7 @@ fun ClipboardInputLayout(
)
SnyggIconButton(
elementName = FlorisImeUi.ClipboardHeaderButton.elementName,
onClick = { prefs.clipboard.historyEnabled.set(!historyEnabled) },
onClick = { scope.launch { prefs.clipboard.historyEnabled.set(!historyEnabled) } },
modifier = sizeModifier.autoMirrorForRtl(),
enabled = !deviceLocked && !isPopupSurfaceActive(),
) {
@@ -165,22 +223,24 @@ fun ClipboardInputLayout(
elementName = FlorisImeUi.ClipboardHeaderButton.elementName,
onClick = { showClearAllHistory = true },
modifier = sizeModifier.autoMirrorForRtl(),
enabled = !deviceLocked && historyEnabled && history.all.isNotEmpty() && !isPopupSurfaceActive(),
enabled = !deviceLocked && historyEnabled && unfilteredHistory.all.isNotEmpty() && !isPopupSurfaceActive(),
) {
SnyggIcon(
imageVector = Icons.Default.ClearAll,
imageVector = Icons.Default.DeleteSweep,
)
}
SnyggIconButton(
elementName = FlorisImeUi.ClipboardHeaderButton.elementName,
onClick = {
context.showShortToast("TODO: implement inline clip item editing")
},
onClick = { isFilterRowShown = !isFilterRowShown },
modifier = sizeModifier,
enabled = !deviceLocked && historyEnabled && !isPopupSurfaceActive(),
enabled = !deviceLocked && historyEnabled && unfilteredHistory.all.isNotEmpty() && !isPopupSurfaceActive(),
) {
SnyggIcon(
imageVector = Icons.Default.Edit,
imageVector = if (!isFilterRowShown) {
Icons.Default.FilterList
} else {
Icons.Default.FilterListOff
},
)
}
KeyboardLikeButton(
@@ -194,14 +254,19 @@ fun ClipboardInputLayout(
}
}
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun ClipItemView(
elementName: String,
item: ClipboardItem,
contentScrollInsteadOfClip: Boolean,
modifier: Modifier = Modifier,
) {
SnyggBox(FlorisImeUi.ClipboardItem.elementName,
val attributes = remember(item) {
mapOf("type" to item.type.toString().lowercase())
}
SnyggBox(
elementName = elementName,
attributes = attributes,
modifier = modifier.fillMaxWidth(),
clickAndSemanticsModifier = Modifier.combinedClickable(
interactionSource = remember { MutableInteractionSource() },
@@ -284,7 +349,11 @@ fun ClipboardInputLayout(
} else {
val text = item.stringRepresentation()
Column {
ClipTextItemDescription(text)
ClipTextItemDescription(
elementName = FlorisImeUi.ClipboardItemDescription.elementName,
attributes = attributes,
text = text,
)
SnyggText(
modifier = Modifier
.fillMaxWidth()
@@ -302,43 +371,121 @@ fun ClipboardInputLayout(
modifier = Modifier.fillMaxSize(),
) {
val historyAlpha by animateFloatAsState(targetValue = if (isPopupSurfaceActive()) 0.12f else 1f)
SnyggColumn(
modifier = Modifier
.fillMaxSize()
.alpha(historyAlpha)
.florisVerticalScroll(),
val staggeredGridCells by prefs.clipboard.numHistoryGridColumns()
.observeAsTransformingState { numGridColumns ->
if (numGridColumns == CLIPBOARD_HISTORY_NUM_GRID_COLUMNS_AUTO) {
StaggeredGridCells.Adaptive(160.dp)
} else {
StaggeredGridCells.Fixed(numGridColumns)
}
}
fun LazyStaggeredGridScope.clipboardItems(
items: List<ClipboardItem>,
key: String,
@StringRes title: Int,
) {
if (history.pinned.isNotEmpty()) {
ClipCategoryTitle(
text = stringRes(R.string.clipboard__group_pinned),
)
FlorisStaggeredVerticalGrid(maxColumnWidth = ItemWidth) {
for (item in history.pinned) {
ClipItemView(item, contentScrollInsteadOfClip = false)
}
if (items.isNotEmpty()) {
item(key, span = StaggeredGridItemSpan.FullLine) {
ClipCategoryTitle(text = stringRes(title))
}
}
if (history.recent.isNotEmpty()) {
ClipCategoryTitle(
text = stringRes(R.string.clipboard__group_recent),
)
FlorisStaggeredVerticalGrid(maxColumnWidth = ItemWidth) {
for (item in history.recent) {
ClipItemView(item, contentScrollInsteadOfClip = false)
}
}
}
if (history.other.isNotEmpty()) {
ClipCategoryTitle(
text = stringRes(R.string.clipboard__group_other),
)
FlorisStaggeredVerticalGrid(maxColumnWidth = ItemWidth) {
for (item in history.other) {
ClipItemView(item, contentScrollInsteadOfClip = false)
}
items(items) { item ->
ClipItemView(
elementName = FlorisImeUi.ClipboardItem.elementName,
item = item,
contentScrollInsteadOfClip = false,
)
}
}
}
Column(
modifier = Modifier
.matchParentSize()
.alpha(historyAlpha),
) {
AnimatedVisibility(
visible = isFilterRowShown,
enter = VerticalEnterTransition,
exit = VerticalExitTransition,
) {
SnyggRow(
elementName = FlorisImeUi.ClipboardFilterRow.elementName,
modifier = Modifier.fillMaxWidth(),
clickAndSemanticsModifier = Modifier.florisHorizontalScroll(),
) {
@Composable
fun FilterChip(
imageVector: ImageVector,
text: String,
itemType: ItemType,
) {
val active = activeFilterTypes.contains(itemType)
val attributes = remember(active) {
mapOf(
"state" to if (active) "active" else "inactive",
"type" to itemType.toString().lowercase(),
)
}
SnyggChip(
elementName = FlorisImeUi.ClipboardFilterChip.elementName,
attributes = attributes,
onClick = {
if (!activeFilterTypes.add(itemType)) {
activeFilterTypes.remove(itemType)
}
},
imageVector = imageVector,
text = text,
)
}
FilterChip(
imageVector = Icons.Default.TextFields,
text = "Text",
itemType = ItemType.TEXT,
)
FilterChip(
imageVector = Icons.Default.Image,
text = "Images",
itemType = ItemType.IMAGE,
)
FilterChip(
imageVector = Icons.Default.Movie,
text = "Videos",
itemType = ItemType.VIDEO,
)
}
}
SnyggBox(FlorisImeUi.ClipboardGrid.elementName,
modifier = Modifier
.fillMaxWidth()
.weight(1f),
) {
LazyVerticalStaggeredGrid(
modifier = Modifier.fillMaxSize(),
state = gridState,
columns = staggeredGridCells,
) {
clipboardItems(
items = history.pinned,
key = "pinned-header",
title = R.string.clipboard__group_pinned,
)
clipboardItems(
items = history.recent,
key = "recent-header",
title = R.string.clipboard__group_recent,
)
clipboardItems(
items = history.other,
key = "other-header",
title = R.string.clipboard__group_other,
)
}
}
}
if (popupItem != null) {
SnyggRow(
modifier = Modifier
@@ -349,44 +496,57 @@ fun ClipboardInputLayout(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceAround,
) {
ClipItemView(
modifier = Modifier.widthIn(max = ItemWidth),
item = popupItem!!,
contentScrollInsteadOfClip = true,
)
SnyggColumn(FlorisImeUi.ClipboardItemPopup.elementName) {
PopupAction(
iconId = R.drawable.ic_pin,
text = stringRes(if (popupItem!!.isPinned) {
R.string.clip__unpin_item
} else {
R.string.clip__pin_item
}),
) {
if (popupItem!!.isPinned) {
clipboardManager.unpinClip(popupItem!!)
} else {
clipboardManager.pinClip(popupItem!!)
SnyggColumn(modifier = Modifier.weight(0.5f)) {
ClipItemView(
elementName = FlorisImeUi.ClipboardItemPopup.elementName,
modifier = Modifier.widthIn(max = ItemWidth),
item = popupItem!!,
contentScrollInsteadOfClip = true,
)
SnyggBox(FlorisImeUi.ClipboardItemTimestamp.elementName) {
val formatter = LocalLocalizedDateTimeFormatter.current
SnyggText(
modifier = Modifier.fillMaxWidth(),
text = formatter.format(Instant.ofEpochMilli(popupItem!!.creationTimestampMs)),
)
}
}
SnyggColumn(modifier = Modifier.weight(0.5f)) {
SnyggColumn(FlorisImeUi.ClipboardItemActions.elementName) {
PopupAction(
icon = Icons.Outlined.PushPin,
text = stringRes(if (popupItem!!.isPinned) {
R.string.clip__unpin_item
} else {
R.string.clip__pin_item
}),
) {
if (popupItem!!.isPinned) {
clipboardManager.unpinClip(popupItem!!)
} else {
clipboardManager.pinClip(popupItem!!)
}
popupItem = null
}
PopupAction(
icon = Icons.Default.Delete,
text = stringRes(R.string.clip__delete_item),
) {
clipboardManager.deleteClip(popupItem!!)
popupItem = null
}
PopupAction(
icon = Icons.Outlined.ContentPaste,
text = stringRes(R.string.clip__paste_item),
) {
clipboardManager.pasteItem(popupItem!!)
popupItem = null
}
popupItem = null
}
PopupAction(
iconId = R.drawable.ic_delete,
text = stringRes(R.string.clip__delete_item),
) {
clipboardManager.deleteClip(popupItem!!)
popupItem = null
}
PopupAction(
iconId = R.drawable.ic_content_paste,
text = stringRes(R.string.clip__paste_item),
) {
clipboardManager.pasteItem(popupItem!!)
popupItem = null
}
}
}
}
if (showClearAllHistory) {
SnyggRow(
modifier = Modifier
@@ -427,8 +587,9 @@ fun ClipboardInputLayout(
attributes = mapOf("action" to "yes"),
onClick = {
clipboardManager.clearHistory()
context.showShortToast(R.string.clipboard__cleared_history)
context.showShortToastSync(R.string.clipboard__cleared_history)
showClearAllHistory = false
isFilterRowShown = false
},
) {
SnyggText(
@@ -472,7 +633,7 @@ fun ClipboardInputLayout(
text = stringRes(R.string.clipboard__disabled__message),
)
SnyggButton(FlorisImeUi.ClipboardHistoryDisabledButton.elementName,
onClick = { prefs.clipboard.historyEnabled.set(true) },
onClick = { scope.launch { prefs.clipboard.historyEnabled.set(true) } },
modifier = Modifier.align(Alignment.End),
) {
SnyggText(
@@ -509,7 +670,7 @@ fun ClipboardInputLayout(
HistoryLockedView()
} else {
if (historyEnabled) {
if (history.all.isNotEmpty()) {
if (history.all.isNotEmpty() || !activeFilterTypes.isEmpty()) {
HistoryMainView()
} else {
HistoryEmptyView()
@@ -534,36 +695,40 @@ private fun ClipCategoryTitle(
@Composable
private fun ClipTextItemDescription(
elementName: String,
attributes: SnyggQueryAttributes,
text: String,
modifier: Modifier = Modifier,
): Unit = with(LocalDensity.current) {
val iconId: Int?
val icon: ImageVector?
val description: String?
when {
NetworkUtils.isEmailAddress(text) -> {
iconId = R.drawable.ic_email
icon = Icons.Outlined.Email
description = stringRes(R.string.clipboard__item_description_email)
}
NetworkUtils.isUrl(text) -> {
iconId = R.drawable.ic_link
icon = Icons.Default.Link
description = stringRes(R.string.clipboard__item_description_url)
}
NetworkUtils.isPhoneNumber(text) -> {
iconId = R.drawable.ic_phone
icon = Icons.Default.Phone
description = stringRes(R.string.clipboard__item_description_phone)
}
else -> {
iconId = null
icon = null
description = null
}
}
if (iconId != null && description != null) {
if (icon != null && description != null) {
SnyggRow(
elementName = elementName,
attributes = attributes,
modifier = modifier,
verticalAlignment = Alignment.CenterVertically,
) {
SnyggIcon(
painter = painterResource(id = iconId),
imageVector = icon,
)
SnyggText(
modifier = Modifier.weight(1f),
@@ -575,19 +740,19 @@ private fun ClipTextItemDescription(
@Composable
private fun PopupAction(
@DrawableRes iconId: Int,
icon: ImageVector,
text: String,
modifier: Modifier = Modifier,
onClick: () -> Unit,
) {
SnyggRow(FlorisImeUi.ClipboardItemPopupAction.elementName,
SnyggRow(FlorisImeUi.ClipboardItemAction.elementName,
modifier = modifier.rippleClickable(onClick = onClick),
verticalAlignment = Alignment.CenterVertically,
) {
SnyggIcon(FlorisImeUi.ClipboardItemPopupActionIcon.elementName,
painter = painterResource(iconId),
SnyggIcon(FlorisImeUi.ClipboardItemActionIcon.elementName,
imageVector = icon,
)
SnyggText(FlorisImeUi.ClipboardItemPopupActionText.elementName,
SnyggText(FlorisImeUi.ClipboardItemActionText.elementName,
modifier = Modifier.weight(1f),
text = text,
)

View File

@@ -17,11 +17,10 @@
package dev.patrickgold.florisboard.ime.clipboard
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.appContext
import dev.patrickgold.florisboard.editorInstance
import dev.patrickgold.florisboard.ime.clipboard.provider.ClipboardHistoryDao
@@ -44,6 +43,7 @@ import org.florisboard.lib.android.AndroidClipboardManager
import org.florisboard.lib.android.AndroidClipboardManager_OnPrimaryClipChangedListener
import org.florisboard.lib.android.setOrClearPrimaryClip
import org.florisboard.lib.android.showShortToast
import org.florisboard.lib.android.showShortToastSync
import org.florisboard.lib.android.systemService
import org.florisboard.lib.kotlin.tryOrNull
import java.io.Closeable
@@ -91,7 +91,7 @@ class ClipboardManager(
}
}
private val prefs by florisPreferenceModel()
private val prefs by FlorisPreferenceStore
private val appContext by context.appContext()
private val editorInstance by context.editorInstance()
private val systemClipboardManager = context.systemService(AndroidClipboardManager::class)
@@ -355,7 +355,7 @@ class ClipboardManager(
val editorInstance by appContext.editorInstance()
editorInstance.commitClipboardItem(item).also { result ->
if (!result) {
appContext.showShortToast("Failed to paste item.")
appContext.showShortToastSync("Failed to paste item.")
}
}
}

View File

@@ -19,8 +19,8 @@ package dev.patrickgold.florisboard.ime.clipboard
import android.content.ClipData
import android.content.Intent
import android.graphics.Bitmap
import android.graphics.ImageDecoder
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.provider.MediaStore
import androidx.activity.ComponentActivity
@@ -47,22 +47,25 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.app.apptheme.FlorisAppTheme
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.lib.compose.ProvideLocalizedResources
import dev.patrickgold.florisboard.lib.compose.stringRes
import dev.patrickgold.jetpref.datastore.model.observeAsState
import org.florisboard.lib.android.AndroidClipboardManager
import org.florisboard.lib.android.AndroidVersion
import org.florisboard.lib.android.stringRes
import org.florisboard.lib.android.systemService
import org.florisboard.lib.kotlin.mimeTypeFilterOf
class FlorisCopyToClipboardActivity : ComponentActivity() {
private var error: CopyToClipboardError? = null
private var bitmap: Bitmap? = null
private val clipboardManager by lazy { systemService(AndroidClipboardManager::class) }
private val filter = mimeTypeFilterOf("image/*")
internal enum class CopyToClipboardError {
UNKNOWN_ERROR,
ANDROID_VERSION_TO_OLD_ERROR,
TYPE_NOT_SUPPORTED_ERROR;
@Composable
@@ -70,88 +73,100 @@ class FlorisCopyToClipboardActivity : ComponentActivity() {
val textId = when (this) {
UNKNOWN_ERROR -> R.string.send_to_clipboard__unknown_error
TYPE_NOT_SUPPORTED_ERROR -> R.string.send_to_clipboard__type_not_supported_error
ANDROID_VERSION_TO_OLD_ERROR -> R.string.send_to_clipboard__android_version_to_old_error
}
return stringRes(id = textId)
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
handleIntent(intent)
setContent {
Content()
}
}
override fun onPause() {
finish()
super.onPause()
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val systemClipboardManager = this.systemService(AndroidClipboardManager::class)
private fun handleIntent(intent: Intent) {
val type = intent.type
val action = intent.action
val prefs by florisPreferenceModel()
if (Intent.ACTION_SEND != action || type == null) {
error = CopyToClipboardError.UNKNOWN_ERROR
} else {
if (type.startsWith("image/")) {
val hasExtraStream = intent.hasExtra(Intent.EXTRA_STREAM)
if (!hasExtraStream) {
error = CopyToClipboardError.TYPE_NOT_SUPPORTED_ERROR
} else {
// pasting images via virtual keyboard only available since Android 7.1 (API 25)
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1) {
error = CopyToClipboardError.ANDROID_VERSION_TO_OLD_ERROR
} else {
val uri: Uri? =
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
@Suppress("DEPRECATION")
intent.getParcelableExtra(Intent.EXTRA_STREAM)
} else {
intent.getParcelableExtra(Intent.EXTRA_STREAM, Uri::class.java)
}
val clip = ClipData.newUri(contentResolver, "image", uri)
systemClipboardManager.setPrimaryClip(clip)
bitmap = MediaStore.Images.Media.getBitmap(this.contentResolver, uri)
}
}
} else {
error = CopyToClipboardError.TYPE_NOT_SUPPORTED_ERROR
}
return
}
if (!filter.matches(type) || !intent.hasExtra(Intent.EXTRA_STREAM)) {
error = CopyToClipboardError.TYPE_NOT_SUPPORTED_ERROR
return
}
setContent {
ProvideLocalizedResources(this, forceLayoutDirection = LayoutDirection.Ltr) {
val theme by prefs.other.settingsTheme.observeAsState()
FlorisAppTheme(theme) {
BottomSheet {
Row {
Text(
text = error?.showError()
?: bitmap?.let { stringRes(id = R.string.send_to_clipboard__description__copied_image_to_clipboard) }
?: stringRes(R.string.send_to_clipboard__unknown_error),
textAlign = TextAlign.Center,
modifier = Modifier.weight(1f),
val uri: Uri? =
if (AndroidVersion.ATLEAST_API33_T) {
intent.getParcelableExtra(Intent.EXTRA_STREAM, Uri::class.java)
} else {
@Suppress("DEPRECATION")
intent.getParcelableExtra(Intent.EXTRA_STREAM)
}
if (uri == null) {
error = CopyToClipboardError.TYPE_NOT_SUPPORTED_ERROR
return
}
bitmap = uriToBitmap(uri)
}
private fun uriToBitmap(uri: Uri): Bitmap {
val clip = ClipData.newUri(contentResolver, "image", uri)
clipboardManager.setPrimaryClip(clip)
return if (AndroidVersion.ATLEAST_API28_P) {
val source = ImageDecoder.createSource(contentResolver, uri)
ImageDecoder.decodeBitmap(source)
} else {
@Suppress("DEPRECATION")
MediaStore.Images.Media.getBitmap(contentResolver, uri)
}
}
@Composable
private fun Content() {
val prefs by FlorisPreferenceStore
ProvideLocalizedResources(this, forceLayoutDirection = LayoutDirection.Ltr) {
val theme by prefs.other.settingsTheme.observeAsState()
FlorisAppTheme(theme) {
BottomSheet {
Row {
Text(
text = error?.showError()
?: bitmap?.let { stringRes(id = R.string.send_to_clipboard__description__copied_image_to_clipboard) }
?: stringRes(R.string.send_to_clipboard__unknown_error),
textAlign = TextAlign.Center,
modifier = Modifier.weight(1f),
)
}
bitmap?.let {
Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.Center) {
Image(
modifier = Modifier
.padding(start = 64.dp, end = 64.dp, top = 32.dp, bottom = 8.dp),
bitmap = bitmap!!.asImageBitmap(),
contentDescription = null
)
}
bitmap?.let {
Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.Center) {
Image(
modifier = Modifier
.padding(start = 64.dp, end = 64.dp, top = 32.dp, bottom = 8.dp),
bitmap = bitmap!!.asImageBitmap(),
contentDescription = null
)
}
}
}
}
}
}
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
internal fun BottomSheet(
private fun BottomSheet(
content: @Composable ColumnScope.() -> Unit,
) {
ModalBottomSheet(
@@ -165,9 +180,7 @@ class FlorisCopyToClipboardActivity : ComponentActivity() {
.align(Alignment.End)
.padding(16.dp),
onClick = { finish() },
colors = ButtonDefaults.textButtonColors(
//containerColor = buttonContainer.background.solidColor(context = context),
)
colors = ButtonDefaults.textButtonColors(),
) {
Text(text = stringRes(id = R.string.action__ok))
}

View File

@@ -260,7 +260,7 @@ data class ClipboardItem @OptIn(ExperimentalSerializationApi::class) constructor
fun stringRepresentation(): String {
return when {
text != null -> text.take(500)
text != null -> text
uri != null -> "(Image) $uri"
else -> "#ERROR"
}

View File

@@ -17,7 +17,6 @@
package dev.patrickgold.florisboard.ime.core
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.safeDrawingPadding
import androidx.compose.foundation.lazy.LazyColumn
@@ -26,8 +25,6 @@ import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.RadioButtonChecked
import androidx.compose.material.icons.filled.RadioButtonUnchecked
import androidx.compose.material3.Icon
import androidx.compose.material3.ListItemDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
@@ -38,11 +35,11 @@ import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.ime.keyboard.KeyboardState
import dev.patrickgold.florisboard.ime.theme.FlorisImeUi
import dev.patrickgold.florisboard.keyboardManager
import dev.patrickgold.florisboard.lib.compose.rippleClickable
import dev.patrickgold.florisboard.lib.compose.stringRes
import dev.patrickgold.florisboard.subtypeManager
import dev.patrickgold.jetpref.material.ui.JetPrefListItem
import org.florisboard.lib.snygg.ui.SnyggBox
import org.florisboard.lib.snygg.ui.SnyggColumn
import org.florisboard.lib.snygg.ui.SnyggListItem
import org.florisboard.lib.snygg.ui.SnyggRow
import org.florisboard.lib.snygg.ui.SnyggText
@@ -71,7 +68,7 @@ fun SelectSubtypePanel(modifier: Modifier = Modifier) {
)
}
Box {
SnyggBox(FlorisImeUi.SubtypePanelList.elementName) {
LazyColumn(
state = listState,
) {
@@ -81,22 +78,17 @@ fun SelectSubtypePanel(modifier: Modifier = Modifier) {
it.id
}
) {
JetPrefListItem(
modifier = Modifier
.fillMaxWidth()
.rippleClickable {
subtypeManager.switchToSubtypeById(it.id)
keyboardManager.activeState.isSubtypeSelectionVisible = false
},
icon = {
if (currentlySelected == it.id) {
Icon(Icons.Default.RadioButtonChecked, null)
} else {
Icon(Icons.Default.RadioButtonUnchecked, null)
}
SnyggListItem(
elementName = FlorisImeUi.SubtypePanelListItem.elementName,
onClick = {
subtypeManager.switchToSubtypeById(it.id)
keyboardManager.activeState.isSubtypeSelectionVisible = false
},
leadingImageVector = when {
currentlySelected == it.id -> Icons.Default.RadioButtonChecked
else -> Icons.Default.RadioButtonUnchecked
},
text = it.primaryLocale.displayName(),
colors = ListItemDefaults.colors(),
)
}
}

View File

@@ -17,15 +17,18 @@
package dev.patrickgold.florisboard.ime.core
import android.content.Context
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.ime.keyboard.CurrencySet
import dev.patrickgold.florisboard.keyboardManager
import dev.patrickgold.florisboard.lib.FlorisLocale
import dev.patrickgold.florisboard.lib.devtools.flogDebug
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.serialization.encodeToString
import kotlinx.coroutines.launch
import kotlinx.serialization.json.Json
import org.florisboard.lib.kotlin.collectLatestIn
val SubtypeJsonConfig = Json {
encodeDefaults = true
@@ -38,8 +41,9 @@ val SubtypeJsonConfig = Json {
* helper methods for the in-keyboard language switch process.
*/
class SubtypeManager(context: Context) {
private val prefs by florisPreferenceModel()
private val prefs by FlorisPreferenceStore
private val keyboardManager by context.keyboardManager()
private val scope = CoroutineScope(Dispatchers.Default)
private val _subtypesFlow = MutableStateFlow(listOf<Subtype>())
val subtypesFlow = _subtypesFlow.asStateFlow()
@@ -54,7 +58,7 @@ class SubtypeManager(context: Context) {
private set(v) { _activeSubtypeFlow.value = v }
init {
prefs.localization.subtypes.observeForever { listRaw ->
prefs.localization.subtypes.asFlow().collectLatestIn(scope) { listRaw ->
flogDebug { listRaw }
val list = if (listRaw.isNotBlank()) {
SubtypeJsonConfig.decodeFromString<List<Subtype>>(listRaw)
@@ -66,7 +70,7 @@ class SubtypeManager(context: Context) {
}
}
private fun persistNewSubtypeList(list: List<Subtype>) {
private fun persistNewSubtypeList(list: List<Subtype>) = scope.launch {
val listRaw = SubtypeJsonConfig.encodeToString(list)
prefs.localization.subtypes.set(listRaw)
}
@@ -78,7 +82,7 @@ class SubtypeManager(context: Context) {
* @return The active subtype or null, if the subtype list is empty or no new active subtype
* could be determined.
*/
private fun evaluateActiveSubtype(list: List<Subtype>) {
private fun evaluateActiveSubtype(list: List<Subtype>) = scope.launch {
val activeSubtypeId = prefs.localization.activeSubtypeId.get()
val subtype = list.find { it.id == activeSubtypeId } ?: list.firstOrNull() ?: Subtype.DEFAULT
if (subtype.id != activeSubtypeId) {
@@ -184,7 +188,7 @@ class SubtypeManager(context: Context) {
/**
* Switch to the previous subtype in the subtype list if possible.
*/
fun switchToPrevSubtype() {
fun switchToPrevSubtype() = scope.launch {
val subtypeList = subtypes
val cachedActiveSubtype = activeSubtype
var triggerNextSubtype = false
@@ -207,7 +211,7 @@ class SubtypeManager(context: Context) {
/**
* Switch to the next subtype in the subtype list if possible.
*/
fun switchToNextSubtype() {
fun switchToNextSubtype() = scope.launch {
val subtypeList = subtypes
val cachedActiveSubtype = activeSubtype
var triggerNextSubtype = false
@@ -227,7 +231,7 @@ class SubtypeManager(context: Context) {
activeSubtype = newActiveSubtype
}
fun switchToSubtypeById(id: Long) {
fun switchToSubtypeById(id: Long) = scope.launch {
if (subtypes.any { it.id == id }) {
activeSubtype = getSubtypeById(id)!!
prefs.localization.activeSubtypeId.set(id)

View File

@@ -18,7 +18,7 @@ package dev.patrickgold.florisboard.ime.dictionary
import android.content.Context
import androidx.room.Room
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.ime.nlp.SuggestionCandidate
import dev.patrickgold.florisboard.ime.nlp.WordSuggestionCandidate
import dev.patrickgold.florisboard.lib.FlorisLocale
@@ -29,7 +29,7 @@ import java.lang.ref.WeakReference
*/
class DictionaryManager private constructor(context: Context) {
private val applicationContext: WeakReference<Context> = WeakReference(context.applicationContext ?: context)
private val prefs by florisPreferenceModel()
private val prefs by FlorisPreferenceStore
private var florisUserDictionaryDatabase: FlorisUserDictionaryDatabase? = null
private var systemUserDictionaryDatabase: SystemUserDictionaryDatabase? = null

View File

@@ -19,39 +19,38 @@ package dev.patrickgold.florisboard.ime.editor
import android.content.ClipDescription
import android.content.ContentUris
import android.content.Context
import android.content.Intent
import android.view.KeyEvent
import androidx.core.view.inputmethod.InputConnectionCompat
import androidx.core.view.inputmethod.InputContentInfoCompat
import dev.patrickgold.florisboard.FlorisImeService
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.appContext
import dev.patrickgold.florisboard.clipboardManager
import dev.patrickgold.florisboard.ime.clipboard.provider.ClipboardFileStorage
import dev.patrickgold.florisboard.ime.clipboard.provider.ClipboardItem
import dev.patrickgold.florisboard.ime.clipboard.provider.ItemType
import dev.patrickgold.florisboard.ime.keyboard.KeyboardMode
import dev.patrickgold.florisboard.ime.input.InputShiftState
import dev.patrickgold.florisboard.ime.keyboard.IncognitoMode
import dev.patrickgold.florisboard.ime.keyboard.KeyboardMode
import dev.patrickgold.florisboard.ime.nlp.SuggestionCandidate
import dev.patrickgold.florisboard.ime.text.composing.Appender
import dev.patrickgold.florisboard.ime.text.composing.Composer
import dev.patrickgold.florisboard.ime.text.key.KeyVariation
import dev.patrickgold.florisboard.keyboardManager
import org.florisboard.lib.android.AndroidVersion
import org.florisboard.lib.android.showShortToast
import dev.patrickgold.florisboard.lib.ext.ExtensionComponentName
import dev.patrickgold.florisboard.nlpManager
import dev.patrickgold.florisboard.subtypeManager
import kotlinx.coroutines.runBlocking
import java.util.concurrent.atomic.AtomicInteger
import kotlinx.coroutines.runBlocking
import org.florisboard.lib.android.showShortToast
import org.florisboard.lib.android.showShortToastSync
class EditorInstance(context: Context) : AbstractEditorInstance(context) {
companion object {
private const val SPACE = " "
}
private val prefs by florisPreferenceModel()
private val prefs by FlorisPreferenceStore
private val appContext by context.appContext()
private val clipboardManager by context.clipboardManager()
private val keyboardManager by context.keyboardManager()
@@ -324,16 +323,7 @@ class EditorInstance(context: Context) : AbstractEditorInstance(context) {
)
val ic = currentInputConnection() ?: return false
ic.finishComposingText()
var flags = 0
if (AndroidVersion.ATLEAST_API25_N_MR1) {
flags = flags or InputConnectionCompat.INPUT_CONTENT_GRANT_READ_URI_PERMISSION
} else {
appContext.grantUriPermission(
activeInfo.packageName,
item.uri,
Intent.FLAG_GRANT_READ_URI_PERMISSION,
)
}
val flags = InputConnectionCompat.INPUT_CONTENT_GRANT_READ_URI_PERMISSION
InputConnectionCompat.commitContent(ic, activeInfo.base, inputContentInfo, flags, null)
}
}
@@ -404,7 +394,7 @@ class EditorInstance(context: Context) : AbstractEditorInstance(context) {
if (text != null) {
clipboardManager.addNewPlaintext(text.toString())
} else {
appContext.showShortToast("Failed to retrieve selected text requested to cut: Eiter selection state is invalid or an error occurred within the input connection.")
appContext.showShortToastSync("Failed to retrieve selected text requested to cut: Eiter selection state is invalid or an error occurred within the input connection.")
}
return deleteBackwards()
}
@@ -422,7 +412,7 @@ class EditorInstance(context: Context) : AbstractEditorInstance(context) {
if (text != null) {
clipboardManager.addNewPlaintext(text.toString())
} else {
appContext.showShortToast("Failed to retrieve selected text requested to copy: Eiter selection state is invalid or an error occurred within the input connection.")
appContext.showShortToastSync("Failed to retrieve selected text requested to copy: Eiter selection state is invalid or an error occurred within the input connection.")
}
val activeSelection = activeContent.selection
return setSelection(activeSelection.end, activeSelection.end)
@@ -439,7 +429,7 @@ class EditorInstance(context: Context) : AbstractEditorInstance(context) {
phantomSpace.setInactive()
return commitClipboardItem(clipboardManager.primaryClip).also { result ->
if (!result) {
appContext.showShortToast("Failed to paste item.")
appContext.showShortToastSync("Failed to paste item.")
}
}
}

View File

@@ -21,7 +21,7 @@ import android.view.ViewConfiguration
import androidx.collection.SparseArrayCompat
import androidx.collection.isNotEmpty
import androidx.collection.set
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.ime.keyboard.KeyData
import dev.patrickgold.florisboard.ime.text.gestures.SwipeAction
import dev.patrickgold.florisboard.ime.text.key.KeyCode
@@ -48,7 +48,7 @@ class InputEventDispatcher private constructor(private val repeatableKeyCodes: I
fun new(repeatableKeyCodes: IntArray = intArrayOf()) = InputEventDispatcher(repeatableKeyCodes.clone())
}
private val prefs by florisPreferenceModel()
private val prefs by FlorisPreferenceStore
private val scope = CoroutineScope(Dispatchers.Default + SupervisorJob())
private val pressedKeys = guardedByLock { SparseArrayCompat<PressedKeyInfo>() }

View File

@@ -21,7 +21,7 @@ import android.media.AudioManager
import android.provider.Settings
import android.view.HapticFeedbackConstants
import androidx.compose.runtime.staticCompositionLocalOf
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.ime.keyboard.KeyData
import dev.patrickgold.florisboard.ime.text.key.KeyCode
import dev.patrickgold.florisboard.ime.text.keyboard.TextKeyData
@@ -46,7 +46,7 @@ class InputFeedbackController private constructor(private val ims: InputMethodSe
fun new(ims: InputMethodService) = InputFeedbackController(ims)
}
private val prefs by florisPreferenceModel()
private val prefs by FlorisPreferenceStore
private val audioManager = ims.systemServiceOrNull(AudioManager::class)
private val vibrator = ims.systemVibratorOrNull()

View File

@@ -43,7 +43,7 @@ enum class InputShiftState(val value: Int) {
fun fromInt(int: Int) = entries.firstOrNull { it.value == int } ?: UNSHIFTED
}
fun attrName() = name.lowercase()
override fun toString() = name.lowercase()
fun toInt() = value
}

View File

@@ -36,8 +36,7 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.core.view.WindowInsetsCompat
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.ime.onehanded.OneHandedMode
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.ime.smartbar.ExtendedActionsPlacement
import dev.patrickgold.florisboard.ime.smartbar.SmartbarLayout
import dev.patrickgold.florisboard.ime.text.keyboard.TextKeyboard
@@ -80,7 +79,7 @@ object FlorisImeSizing {
@Composable
fun smartbarUiHeight(): Dp {
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val smartbarEnabled by prefs.smartbar.enabled.observeAsState()
val smartbarLayout by prefs.smartbar.layout.observeAsState()
val extendedActionsExpanded by prefs.smartbar.extendedActionsExpanded.observeAsState()
@@ -113,7 +112,7 @@ object FlorisImeSizing {
@Composable
fun ProvideKeyboardRowBaseHeight(content: @Composable () -> Unit) {
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val resources = LocalContext.current.resources
val configuration = LocalConfiguration.current

View File

@@ -26,7 +26,7 @@ import androidx.compose.runtime.setValue
import androidx.lifecycle.MutableLiveData
import dev.patrickgold.florisboard.FlorisImeService
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.appContext
import dev.patrickgold.florisboard.clipboardManager
import dev.patrickgold.florisboard.editorInstance
@@ -74,15 +74,18 @@ import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import org.florisboard.lib.android.AndroidKeyguardManager
import org.florisboard.lib.android.showLongToast
import org.florisboard.lib.android.showLongToastSync
import org.florisboard.lib.android.showShortToast
import org.florisboard.lib.android.showShortToastSync
import org.florisboard.lib.android.systemService
import org.florisboard.lib.kotlin.collectIn
import org.florisboard.lib.kotlin.collectLatestIn
import java.util.concurrent.atomic.AtomicInteger
private val DoubleSpacePeriodMatcher = """([^.!?‽\s]\s)""".toRegex()
class KeyboardManager(context: Context) : InputKeyEventReceiver {
private val prefs by florisPreferenceModel()
private val prefs by FlorisPreferenceStore
private val appContext by context.appContext()
private val clipboardManager by context.clipboardManager()
private val editorInstance by context.editorInstance()
@@ -100,7 +103,7 @@ class KeyboardManager(context: Context) : InputKeyEventReceiver {
private var lastToastReference = WeakReference<Toast>(null)
private val activeEvaluatorGuard = Mutex(locked = false)
private var activeEvaluatorVersion: Int = 1
private var activeEvaluatorVersion = AtomicInteger(0)
private val _activeEvaluator = MutableStateFlow<ComputingEvaluator>(DefaultComputingEvaluator)
val activeEvaluator get() = _activeEvaluator.asStateFlow()
private val _activeSmartbarEvaluator = MutableStateFlow<ComputingEvaluator>(DefaultComputingEvaluator)
@@ -128,21 +131,21 @@ class KeyboardManager(context: Context) : InputKeyEventReceiver {
keyboardCache.clear()
}
}
prefs.keyboard.numberRow.observeForever {
prefs.keyboard.numberRow.asFlow().collectLatestIn(scope) {
updateActiveEvaluators {
keyboardCache.clear(KeyboardMode.CHARACTERS)
}
}
prefs.keyboard.hintedNumberRowEnabled.observeForever {
prefs.keyboard.hintedNumberRowEnabled.asFlow().collectLatestIn(scope) {
updateActiveEvaluators()
}
prefs.keyboard.hintedSymbolsEnabled.observeForever {
prefs.keyboard.hintedSymbolsEnabled.asFlow().collectLatestIn(scope) {
updateActiveEvaluators()
}
prefs.keyboard.utilityKeyEnabled.observeForever {
prefs.keyboard.utilityKeyEnabled.asFlow().collectLatestIn(scope) {
updateActiveEvaluators()
}
prefs.keyboard.utilityKeyAction.observeForever {
prefs.keyboard.utilityKeyAction.asFlow().collectLatestIn(scope) {
updateActiveEvaluators()
}
activeState.collectLatestIn(scope) {
@@ -163,10 +166,10 @@ class KeyboardManager(context: Context) : InputKeyEventReceiver {
editorInstance.activeContentFlow.collectIn(scope) { content ->
resetSuggestions(content)
}
prefs.devtools.enabled.observeForever {
prefs.devtools.enabled.asFlow().collectLatestIn(scope) {
reevaluateDebugFlags()
}
prefs.devtools.showDragAndDropHelpers.observeForever {
prefs.devtools.showDragAndDropHelpers.asFlow().collectLatestIn(scope) {
reevaluateDebugFlags()
}
}
@@ -191,7 +194,7 @@ class KeyboardManager(context: Context) : InputKeyEventReceiver {
).await()
}
val computingEvaluator = ComputingEvaluatorImpl(
version = activeEvaluatorVersion++,
version = activeEvaluatorVersion.getAndAdd(1),
keyboard = computedKeyboard,
editorInfo = editorInfo,
state = state,
@@ -236,7 +239,7 @@ class KeyboardManager(context: Context) : InputKeyEventReceiver {
return subtypeManager.subtypes.size > 1
}
fun toggleOneHandedMode() {
suspend fun toggleOneHandedMode() {
prefs.keyboard.oneHandedModeEnabled.set(!prefs.keyboard.oneHandedModeEnabled.get())
}
@@ -579,7 +582,7 @@ class KeyboardManager(context: Context) : InputKeyEventReceiver {
/**
* Handles a [KeyCode.TOGGLE_INCOGNITO_MODE] event.
*/
private fun handleToggleIncognitoMode() {
private suspend fun handleToggleIncognitoMode() {
prefs.suggestion.forceIncognitoModeFromDynamic.set(!prefs.suggestion.forceIncognitoModeFromDynamic.get())
val newState = !activeState.isIncognitoMode
activeState.isIncognitoMode = newState
@@ -605,7 +608,7 @@ class KeyboardManager(context: Context) : InputKeyEventReceiver {
private fun handleToggleAutocorrect() {
lastToastReference.get()?.cancel()
lastToastReference = WeakReference(
appContext.showLongToast("Autocorrect toggle is a placeholder and not yet implemented")
appContext.showLongToastSync("Autocorrect toggle is a placeholder and not yet implemented")
)
}
@@ -715,14 +718,14 @@ class KeyboardManager(context: Context) : InputKeyEventReceiver {
clipboardManager.primaryClip?.let { clipboardManager.deleteClip(it) }
}
clipboardManager.updatePrimaryClip(null)
appContext.showShortToast(R.string.clipboard__cleared_primary_clip)
appContext.showShortToastSync(R.string.clipboard__cleared_primary_clip)
}
KeyCode.TOGGLE_COMPACT_LAYOUT -> toggleOneHandedMode()
KeyCode.COMPACT_LAYOUT_TO_LEFT -> {
KeyCode.TOGGLE_COMPACT_LAYOUT -> scope.launch { toggleOneHandedMode() }
KeyCode.COMPACT_LAYOUT_TO_LEFT -> scope.launch {
prefs.keyboard.oneHandedMode.set(OneHandedMode.START)
toggleOneHandedMode()
}
KeyCode.COMPACT_LAYOUT_TO_RIGHT -> {
KeyCode.COMPACT_LAYOUT_TO_RIGHT -> scope.launch {
prefs.keyboard.oneHandedMode.set(OneHandedMode.END)
toggleOneHandedMode()
}
@@ -752,7 +755,7 @@ class KeyboardManager(context: Context) : InputKeyEventReceiver {
}
KeyCode.SYSTEM_PREV_INPUT_METHOD -> FlorisImeService.switchToPrevInputMethod()
KeyCode.SYSTEM_NEXT_INPUT_METHOD -> FlorisImeService.switchToNextInputMethod()
KeyCode.TOGGLE_SMARTBAR_VISIBILITY -> {
KeyCode.TOGGLE_SMARTBAR_VISIBILITY -> scope.launch {
prefs.smartbar.enabled.let { it.set(!it.get()) }
}
KeyCode.TOGGLE_ACTIONS_OVERFLOW -> {
@@ -761,7 +764,7 @@ class KeyboardManager(context: Context) : InputKeyEventReceiver {
KeyCode.TOGGLE_ACTIONS_EDITOR -> {
activeState.isActionsEditorVisible = !activeState.isActionsEditorVisible
}
KeyCode.TOGGLE_INCOGNITO_MODE -> handleToggleIncognitoMode()
KeyCode.TOGGLE_INCOGNITO_MODE -> scope.launch { handleToggleIncognitoMode() }
KeyCode.TOGGLE_AUTOCORRECT -> handleToggleAutocorrect()
KeyCode.UNDO -> editorInstance.performUndo()
KeyCode.VIEW_CHARACTERS -> activeState.keyboardMode = KeyboardMode.CHARACTERS
@@ -1023,7 +1026,7 @@ class KeyboardManager(context: Context) : InputKeyEventReceiver {
fun asSmartbarQuickActionsEvaluator(): ComputingEvaluatorImpl {
return ComputingEvaluatorImpl(
version = activeEvaluatorVersion,
version = version,
keyboard = SmartbarQuickActionsKeyboard,
editorInfo = editorInfo,
state = state,

View File

@@ -19,6 +19,7 @@ package dev.patrickgold.florisboard.ime.keyboard
enum class KeyboardMode(val value: Int) {
UNSPECIFIED(-1),
CHARACTERS(0),
@Deprecated(message = "TODO: remove")
EDITING(1),
SYMBOLS(2),
SYMBOLS2(3),
@@ -26,7 +27,9 @@ enum class KeyboardMode(val value: Int) {
NUMERIC_ADVANCED(5),
PHONE(6),
PHONE2(7),
@Deprecated(message = "TODO: remove")
SMARTBAR_CLIPBOARD_CURSOR_ROW(8),
@Deprecated(message = "TODO: remove")
SMARTBAR_NUMBER_ROW(9),
SMARTBAR_QUICK_ACTIONS(10);
@@ -34,7 +37,7 @@ enum class KeyboardMode(val value: Int) {
fun fromInt(int: Int) = entries.firstOrNull { it.value == int } ?: CHARACTERS
}
fun attrName() = name.lowercase()
override fun toString() = name.lowercase()
fun toInt() = value
}

View File

@@ -17,7 +17,7 @@
package dev.patrickgold.florisboard.ime.keyboard
import android.content.Context
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.appContext
import dev.patrickgold.florisboard.extensionManager
import dev.patrickgold.florisboard.ime.core.Subtype
@@ -78,7 +78,7 @@ data class DebugLayoutComputationResult(
* Class which manages layout loading and caching.
*/
class LayoutManager(context: Context) {
private val prefs by florisPreferenceModel()
private val prefs by FlorisPreferenceStore
private val appContext by context.appContext()
private val extensionManager by context.extensionManager()
private val keyboardManager by context.keyboardManager()

View File

@@ -16,13 +16,12 @@
package dev.patrickgold.florisboard.ime.media.emoji
import dev.patrickgold.florisboard.app.AppPrefs
import dev.patrickgold.florisboard.app.FlorisPreferenceModel
import dev.patrickgold.florisboard.lib.devtools.flogError
import dev.patrickgold.jetpref.datastore.model.PreferenceSerializer
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlinx.serialization.Serializable
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
@Serializable
@@ -76,7 +75,7 @@ data class EmojiHistory(
object EmojiHistoryHelper {
private var emojiGuard = Mutex(locked = false)
suspend fun markEmojiUsed(prefs: AppPrefs, emoji: Emoji) = emojiGuard.withLock {
suspend fun markEmojiUsed(prefs: FlorisPreferenceModel, emoji: Emoji): Unit = emojiGuard.withLock {
if (!prefs.emoji.historyEnabled.get()) {
return
}
@@ -121,7 +120,7 @@ object EmojiHistoryHelper {
)
}
suspend fun pinEmoji(prefs: AppPrefs, emoji: Emoji) = emojiGuard.withLock {
suspend fun pinEmoji(prefs: FlorisPreferenceModel, emoji: Emoji): Unit = emojiGuard.withLock {
if (!prefs.emoji.historyEnabled.get()) {
return
}
@@ -138,7 +137,7 @@ object EmojiHistoryHelper {
prefs.emoji.historyData.set(dataMut.build())
}
suspend fun unpinEmoji(prefs: AppPrefs, emoji: Emoji) = emojiGuard.withLock {
suspend fun unpinEmoji(prefs: FlorisPreferenceModel, emoji: Emoji): Unit = emojiGuard.withLock {
if (!prefs.emoji.historyEnabled.get()) {
return
}
@@ -155,7 +154,7 @@ object EmojiHistoryHelper {
prefs.emoji.historyData.set(dataMut.build())
}
suspend fun moveEmoji(prefs: AppPrefs, emoji: Emoji, offset: Int) = emojiGuard.withLock {
suspend fun moveEmoji(prefs: FlorisPreferenceModel, emoji: Emoji, offset: Int): Unit = emojiGuard.withLock {
if (!prefs.emoji.historyEnabled.get() || offset == 0) {
return
}
@@ -175,7 +174,7 @@ object EmojiHistoryHelper {
prefs.emoji.historyData.set(dataMut.build())
}
suspend fun removeEmoji(prefs: AppPrefs, emoji: Emoji) = emojiGuard.withLock {
suspend fun removeEmoji(prefs: FlorisPreferenceModel, emoji: Emoji): Unit = emojiGuard.withLock {
if (!prefs.emoji.historyEnabled.get()) {
return
}
@@ -195,7 +194,7 @@ object EmojiHistoryHelper {
prefs.emoji.historyData.set(dataMut.build())
}
suspend fun deleteHistory(prefs: AppPrefs) = emojiGuard.withLock {
suspend fun deleteHistory(prefs: FlorisPreferenceModel): Unit = emojiGuard.withLock {
if (!prefs.emoji.historyEnabled.get()) {
return
}
@@ -203,7 +202,7 @@ object EmojiHistoryHelper {
prefs.emoji.historyData.set(EmojiHistory(pinned = dataMut.pinned, listOf()))
}
suspend fun deletePinned(prefs: AppPrefs) = emojiGuard.withLock {
suspend fun deletePinned(prefs: FlorisPreferenceModel): Unit = emojiGuard.withLock {
if (!prefs.emoji.historyEnabled.get()) {
return
}

View File

@@ -25,7 +25,6 @@ import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
@@ -46,8 +45,6 @@ import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
import androidx.compose.material.icons.outlined.Delete
import androidx.compose.material.icons.outlined.PushPin
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.Tab
import androidx.compose.material3.TabRow
import androidx.compose.material3.TabRowDefaults
@@ -83,7 +80,7 @@ import androidx.compose.ui.window.Popup
import androidx.emoji2.text.EmojiCompat
import androidx.emoji2.widget.EmojiTextView
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.editorInstance
import dev.patrickgold.florisboard.ime.input.LocalInputFeedbackController
import dev.patrickgold.florisboard.ime.keyboard.FlorisImeSizing
@@ -133,7 +130,7 @@ fun EmojiPaletteView(
fullEmojiMappings: EmojiData,
modifier: Modifier = Modifier,
) {
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val context = LocalContext.current
val editorInstance by context.editorInstance()
val keyboardManager by context.keyboardManager()
@@ -497,7 +494,7 @@ private fun EmojiHistoryPopup(
onHistoryAction: () -> Unit,
onDismiss: () -> Unit,
) {
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val scope = rememberCoroutineScope()
val emojiKeyHeight = FlorisImeSizing.smartbarHeight
val context = LocalContext.current

View File

@@ -20,7 +20,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.util.stream.Collectors
import android.content.Context
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.ime.core.Subtype
import dev.patrickgold.florisboard.ime.editor.EditorContent
import dev.patrickgold.florisboard.ime.nlp.EmojiSuggestionCandidate
@@ -41,7 +41,7 @@ import io.github.reactivecircus.cache4k.Cache
class EmojiSuggestionProvider(private val context: Context) : SuggestionProvider {
override val providerId = "org.florisboard.nlp.providers.emoji"
private val prefs by florisPreferenceModel()
private val prefs by FlorisPreferenceStore
private val lettersRegex = "^[A-Za-z]*$".toRegex()
private val cachedEmojiMappings = Cache.Builder().build<FlorisLocale, EmojiDataBySkinTone>()

View File

@@ -20,7 +20,7 @@ import android.content.Context
import android.os.SystemClock
import android.util.LruCache
import androidx.lifecycle.MutableLiveData
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.clipboardManager
import dev.patrickgold.florisboard.editorInstance
import dev.patrickgold.florisboard.ime.clipboard.provider.ClipboardItem
@@ -43,8 +43,8 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import org.florisboard.lib.kotlin.collectLatestIn
import org.florisboard.lib.kotlin.guardedByLock
import org.florisboard.lib.kotlin.collectLatestIn
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicInteger
import kotlin.properties.Delegates
@@ -54,7 +54,7 @@ private const val BLANK_STR_PATTERN = "^\\s*$"
class NlpManager(context: Context) {
private val blankStrRegex = Regex(BLANK_STR_PATTERN)
private val prefs by florisPreferenceModel()
private val prefs by FlorisPreferenceStore
private val clipboardManager by context.clipboardManager()
private val editorInstance by context.editorInstance()
private val keyboardManager by context.keyboardManager()
@@ -93,13 +93,13 @@ class NlpManager(context: Context) {
clipboardManager.primaryClipFlow.collectLatestIn(scope) {
assembleCandidates()
}
prefs.suggestion.enabled.observeForever {
prefs.suggestion.enabled.asFlow().collectLatestIn(scope) {
assembleCandidates()
}
prefs.clipboard.suggestionEnabled.observeForever {
prefs.clipboard.suggestionEnabled.asFlow().collectLatestIn(scope) {
assembleCandidates()
}
prefs.emoji.suggestionEnabled.observeForever {
prefs.emoji.suggestionEnabled.asFlow().collectLatestIn(scope) {
assembleCandidates()
}
subtypeManager.activeSubtypeFlow.collectLatestIn(scope) { subtype ->
@@ -317,8 +317,10 @@ class NlpManager(context: Context) {
}*/
val isSelection = editorInstance.activeContent.selection.isSelectionMode
val isExpanded = list1.isNullOrEmpty() && list2.isNullOrEmpty() || isSelection
prefs.smartbar.sharedActionsExpandWithAnimation.set(false)
prefs.smartbar.sharedActionsExpanded.set(isExpanded)
scope.launch {
prefs.smartbar.sharedActionsExpandWithAnimation.set(false)
prefs.smartbar.sharedActionsExpanded.set(isExpanded)
}
}
fun addToDebugOverlay(word: String, info: SpellingResult) {

View File

@@ -26,14 +26,16 @@ import androidx.compose.material.icons.automirrored.filled.KeyboardArrowLeft
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
import androidx.compose.material.icons.filled.ZoomOutMap
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.ime.input.LocalInputFeedbackController
import dev.patrickgold.florisboard.ime.keyboard.FlorisImeSizing
import dev.patrickgold.florisboard.ime.theme.FlorisImeUi
import dev.patrickgold.florisboard.lib.compose.stringRes
import kotlinx.coroutines.launch
import org.florisboard.lib.snygg.ui.SnyggColumn
import org.florisboard.lib.snygg.ui.SnyggIcon
import org.florisboard.lib.snygg.ui.SnyggIconButton
@@ -44,7 +46,8 @@ fun RowScope.OneHandedPanel(
panelSide: OneHandedMode,
weight: Float,
) {
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val scope = rememberCoroutineScope()
val inputFeedbackController = LocalInputFeedbackController.current
SnyggColumn(
@@ -58,8 +61,10 @@ fun RowScope.OneHandedPanel(
SnyggIconButton(
FlorisImeUi.OneHandedPanelButton.elementName,
onClick = {
inputFeedbackController.keyPress()
prefs.keyboard.oneHandedModeEnabled.set(false)
scope.launch {
inputFeedbackController.keyPress()
prefs.keyboard.oneHandedModeEnabled.set(false)
}
},
modifier = Modifier
.fillMaxWidth()
@@ -74,8 +79,10 @@ fun RowScope.OneHandedPanel(
SnyggIconButton(
FlorisImeUi.OneHandedPanelButton.elementName,
onClick = {
inputFeedbackController.keyPress()
prefs.keyboard.oneHandedMode.set(panelSide)
scope.launch {
inputFeedbackController.keyPress()
prefs.keyboard.oneHandedMode.set(panelSide)
}
},
modifier = Modifier
.weight(1f)

View File

@@ -17,7 +17,6 @@
package dev.patrickgold.florisboard.ime.popup
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.requiredHeight
@@ -29,8 +28,10 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.zIndex
import dev.patrickgold.florisboard.ime.keyboard.Key
import dev.patrickgold.florisboard.ime.theme.FlorisImeUi
import org.florisboard.lib.snygg.SnyggQueryAttributes
import org.florisboard.lib.snygg.SnyggSelector
import org.florisboard.lib.snygg.ui.SnyggBox
import org.florisboard.lib.snygg.ui.SnyggColumn
@@ -41,11 +42,13 @@ import org.florisboard.lib.snygg.ui.SnyggText
@Composable
fun PopupBaseBox(
modifier: Modifier = Modifier,
attributes: SnyggQueryAttributes,
key: Key,
shouldIndicateExtendedPopups: Boolean,
): Unit = with(LocalDensity.current) {
SnyggBox(
elementName = FlorisImeUi.KeyPopupBox.elementName,
attributes = attributes,
modifier = modifier,
) {
key.label?.let { label ->
@@ -56,7 +59,7 @@ fun PopupBaseBox(
.align(Alignment.TopCenter),
) {
SnyggText(
modifier = Modifier.align(Alignment.Center),
modifier = Modifier.align(Alignment.Center).zIndex(100f),
text = label,
)
}
@@ -64,6 +67,7 @@ fun PopupBaseBox(
if (shouldIndicateExtendedPopups) {
SnyggIcon(
elementName = FlorisImeUi.KeyPopupExtendedIndicator.elementName,
attributes = attributes,
modifier = Modifier.align(Alignment.CenterEnd),
imageVector = Icons.Default.MoreHoriz,
)
@@ -74,13 +78,14 @@ fun PopupBaseBox(
@Composable
fun PopupExtBox(
modifier: Modifier = Modifier,
attributes: SnyggQueryAttributes,
elements: List<List<PopupUiController.Element>>,
elemArrangement: Arrangement.Horizontal,
elemWidth: Dp,
elemHeight: Dp,
activeElementIndex: Int,
): Unit = with(LocalDensity.current) {
SnyggColumn(FlorisImeUi.KeyPopupBox.elementName, modifier = modifier) {
SnyggColumn(FlorisImeUi.KeyPopupBox.elementName, attributes, modifier = modifier) {
for (row in elements.asReversed()) {
SnyggRow(
modifier = Modifier
@@ -96,6 +101,7 @@ fun PopupExtBox(
}
SnyggBox(
elementName = FlorisImeUi.KeyPopupElement.elementName,
attributes = attributes,
selector = selector,
modifier = Modifier.size(elemWidth, elemHeight),
) {

View File

@@ -31,6 +31,7 @@ import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.zIndex
import dev.patrickgold.florisboard.ime.keyboard.ComputingEvaluator
import dev.patrickgold.florisboard.ime.keyboard.DefaultComputingEvaluator
import dev.patrickgold.florisboard.ime.keyboard.Key
@@ -38,10 +39,12 @@ import dev.patrickgold.florisboard.ime.keyboard.KeyData
import dev.patrickgold.florisboard.ime.keyboard.computeImageVector
import dev.patrickgold.florisboard.ime.keyboard.computeLabel
import dev.patrickgold.florisboard.ime.media.emoji.EmojiSet
import dev.patrickgold.florisboard.ime.smartbar.Temp
import dev.patrickgold.florisboard.ime.text.key.KeyCode
import dev.patrickgold.florisboard.ime.text.key.KeyHintConfiguration
import dev.patrickgold.florisboard.ime.text.keyboard.TextKey
import dev.patrickgold.florisboard.ime.text.keyboard.TextKeyData
import dev.patrickgold.florisboard.ime.theme.FlorisImeUi
import dev.patrickgold.florisboard.lib.FlorisRect
import dev.patrickgold.florisboard.lib.toIntOffset
@@ -81,7 +84,6 @@ class PopupUiController(
private var activeElementIndex by mutableIntStateOf(-1)
var evaluator: ComputingEvaluator = DefaultComputingEvaluator
var fontSizeMultiplier: Float = 1.0f
var keyHintConfiguration: KeyHintConfiguration = KeyHintConfiguration.HINTS_DISABLED
/** Is true if the preview popup is visible to the user, else false */
@@ -448,11 +450,17 @@ class PopupUiController(
@Composable
fun RenderPopups(): Unit = with(LocalDensity.current) {
val attributes = mapOf(
FlorisImeUi.Attr.Mode to evaluator.keyboard.mode.toString(),
FlorisImeUi.Attr.ShiftState to evaluator.state.inputShiftState.toString(),
)
Temp = !(baseRenderInfo != null || extRenderInfo != null)
baseRenderInfo?.let { renderInfo ->
PopupBaseBox(
modifier = Modifier
.requiredSize(renderInfo.bounds.size.toDpSize())
.absoluteOffset { renderInfo.bounds.topLeft.toIntOffset() },
.absoluteOffset { renderInfo.bounds.topLeft.toIntOffset() }.zIndex(100f),
attributes = attributes,
key = renderInfo.key,
shouldIndicateExtendedPopups = renderInfo.shouldIndicateExtendedPopups && extRenderInfo == null,
)
@@ -465,6 +473,7 @@ class PopupUiController(
modifier = Modifier
.requiredSize(renderInfo.bounds.size.toDpSize())
.absoluteOffset { renderInfo.bounds.topLeft.toIntOffset() },
attributes = attributes,
elements = renderInfo.elements,
elemArrangement = if (renderInfo.anchorLeft) {
Arrangement.Start

View File

@@ -20,7 +20,6 @@ import androidx.compose.foundation.gestures.awaitEachGesture
import androidx.compose.foundation.gestures.awaitFirstDown
import androidx.compose.foundation.gestures.waitForUpOrCancellation
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.width
@@ -40,7 +39,7 @@ import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.dp
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.ime.nlp.ClipboardSuggestionCandidate
import dev.patrickgold.florisboard.ime.nlp.SuggestionCandidate
import dev.patrickgold.florisboard.ime.theme.FlorisImeUi
@@ -51,6 +50,7 @@ import dev.patrickgold.florisboard.nlpManager
import dev.patrickgold.florisboard.subtypeManager
import dev.patrickgold.jetpref.datastore.model.observeAsState
import org.florisboard.lib.snygg.SnyggSelector
import org.florisboard.lib.snygg.ui.SnyggBox
import org.florisboard.lib.snygg.ui.SnyggColumn
import org.florisboard.lib.snygg.ui.SnyggIcon
import org.florisboard.lib.snygg.ui.SnyggRow
@@ -61,7 +61,7 @@ val CandidatesRowScrollbarHeight = 2.dp
@Composable
fun CandidatesRow(modifier: Modifier = Modifier) {
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val context = LocalContext.current
val keyboardManager by context.keyboardManager()
val nlpManager by context.nlpManager()
@@ -152,10 +152,13 @@ private fun CandidateItem(
} else {
FlorisImeUi.SmartbarCandidateWord
}.elementName
val attributes = mapOf("auto-commit" to if (candidate.isEligibleForAutoCommit) 1 else 0)
val selector = if (isPressed) SnyggSelector.PRESSED else SnyggSelector.NONE
SnyggRow(
elementName = elementName,
selector = if (isPressed) SnyggSelector.PRESSED else SnyggSelector.NONE,
attributes = attributes,
selector = selector,
modifier = modifier
.pointerInput(Unit) {
awaitEachGesture {
@@ -184,7 +187,13 @@ private fun CandidateItem(
verticalAlignment = Alignment.CenterVertically,
) {
if (candidate.icon != null) {
SnyggIcon(imageVector = candidate.icon!!)
SnyggBox(
elementName = "$elementName-icon",
attributes = attributes,
selector = selector,
) {
SnyggIcon(imageVector = candidate.icon!!)
}
}
SnyggColumn(
modifier = if (displayMode == CandidatesDisplayMode.CLASSIC) Modifier.weight(1f) else Modifier,
@@ -192,14 +201,16 @@ private fun CandidateItem(
horizontalAlignment = Alignment.CenterHorizontally,
) {
SnyggText(
elementName = null,
attributes = mapOf("auto-commit" to if (candidate.isEligibleForAutoCommit) 1 else 0),
elementName = "$elementName-text",
attributes = attributes,
selector = selector,
text = candidate.text.toString(),
)
if (candidate.secondaryText != null) {
SnyggText(
elementName = null,
attributes = mapOf("auto-commit" to if (candidate.isEligibleForAutoCommit) 1 else 0),
elementName = "$elementName-secondary-text",
attributes = attributes,
selector = selector,
text = candidate.secondaryText!!.toString(),
)
}

View File

@@ -16,8 +16,11 @@
package dev.patrickgold.florisboard.ime.smartbar
import android.graphics.PixelFormat
import android.os.Build
import android.view.SurfaceView
import androidx.annotation.RequiresApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.rememberScrollState
@@ -32,16 +35,18 @@ import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.layout.positionInParent
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.viewinterop.AndroidView
import androidx.core.view.forEach
import dev.patrickgold.florisboard.ime.nlp.NlpInlineAutofillSuggestion
import dev.patrickgold.florisboard.ime.theme.FlorisImeUi
import dev.patrickgold.florisboard.lib.compose.florisHorizontalScroll
import dev.patrickgold.florisboard.lib.toIntOffset
import org.florisboard.lib.snygg.SnyggPropertySet
import org.florisboard.lib.snygg.SnyggSinglePropertySet
import org.florisboard.lib.snygg.ui.rememberSnyggThemeQuery
var CachedInlineSuggestionsChipStyleSet: SnyggSinglePropertySet? = null
var Temp: Boolean = false
@Composable
fun InlineSuggestionsStyleCache() {
val chipStyleSet = rememberSnyggThemeQuery(FlorisImeUi.InlineAutofillChip.elementName)
@@ -59,13 +64,16 @@ fun InlineSuggestionsUi(
val scrollState = rememberScrollState()
val almostEmptyRect = remember { android.graphics.Rect(0, 0, 1, 1) }
val backgroundColor = rememberSnyggThemeQuery(FlorisImeUi.SmartbarCandidatesRow.elementName).background()
Row(
modifier
.fillMaxSize()
.florisHorizontalScroll(
state = scrollState,
scrollbarHeight = CandidatesRowScrollbarHeight,
),
)
.background(backgroundColor),
) {
val xMin = scrollState.value
val xMax = scrollState.value + scrollState.viewportSize
@@ -73,6 +81,16 @@ fun InlineSuggestionsUi(
if (inlineSuggestion.view == null) {
continue
}
//inlineSuggestion.view.background = ColorDrawable(backgroundColor.toArgb())
inlineSuggestion.view.forEach {
with (it as SurfaceView) {
//this.setBackgroundColor(backgroundColor.toArgb())
setZOrderOnTop(false)
holder.setFormat(PixelFormat.OPAQUE)
}
}
var chipPos by remember { mutableStateOf(IntOffset.Zero) }
AndroidView(
modifier = Modifier.onGloballyPositioned { chipPos = it.positionInParent().toIntOffset() },

View File

@@ -24,7 +24,6 @@ import androidx.compose.animation.core.tween
import androidx.compose.animation.core.updateTransition
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.absoluteOffset
@@ -43,6 +42,7 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
@@ -52,7 +52,7 @@ import androidx.compose.ui.graphics.isUnspecified
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import dev.patrickgold.florisboard.R
import dev.patrickgold.florisboard.app.florisPreferenceModel
import dev.patrickgold.florisboard.app.FlorisPreferenceStore
import dev.patrickgold.florisboard.ime.keyboard.FlorisImeSizing
import dev.patrickgold.florisboard.ime.nlp.NlpInlineAutofill
import dev.patrickgold.florisboard.ime.smartbar.quickaction.QuickActionButton
@@ -65,16 +65,19 @@ import dev.patrickgold.florisboard.lib.compose.verticalTween
import dev.patrickgold.florisboard.nlpManager
import dev.patrickgold.jetpref.datastore.model.observeAsState
import dev.patrickgold.jetpref.datastore.ui.vectorResource
import kotlinx.coroutines.launch
import org.florisboard.lib.android.AndroidVersion
import org.florisboard.lib.snygg.ui.SnyggBox
import org.florisboard.lib.snygg.ui.SnyggColumn
import org.florisboard.lib.snygg.ui.SnyggIcon
import org.florisboard.lib.snygg.ui.SnyggIconButton
import org.florisboard.lib.snygg.ui.SnyggRow
import org.florisboard.lib.snygg.ui.rememberSnyggThemeQuery
private const val AnimationDuration = 200
const val AnimationDuration = 200
private val VerticalEnterTransition = EnterTransition.verticalTween(AnimationDuration)
private val VerticalExitTransition = ExitTransition.verticalTween(AnimationDuration)
val VerticalEnterTransition = EnterTransition.verticalTween(AnimationDuration)
val VerticalExitTransition = ExitTransition.verticalTween(AnimationDuration)
private val HorizontalEnterTransition = EnterTransition.horizontalTween(AnimationDuration)
private val HorizontalExitTransition = ExitTransition.horizontalTween(AnimationDuration)
@@ -87,7 +90,7 @@ private val NoAnimationTween = tween<Float>(0)
@Composable
fun Smartbar() {
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val smartbarEnabled by prefs.smartbar.enabled.observeAsState()
val extendedActionsPlacement by prefs.smartbar.extendedActionsPlacement.observeAsState()
@@ -98,24 +101,25 @@ fun Smartbar() {
) {
when (extendedActionsPlacement) {
ExtendedActionsPlacement.ABOVE_CANDIDATES -> {
Column {
SnyggColumn(FlorisImeUi.Smartbar.elementName) {
SmartbarSecondaryRow()
SmartbarMainRow()
}
}
ExtendedActionsPlacement.BELOW_CANDIDATES -> {
Column {
SnyggColumn(FlorisImeUi.Smartbar.elementName) {
SmartbarMainRow()
SmartbarSecondaryRow()
}
}
ExtendedActionsPlacement.OVERLAY_APP_UI -> {
Box(
SnyggBox(FlorisImeUi.Smartbar.elementName,
modifier = Modifier
.fillMaxWidth()
.height(FlorisImeSizing.smartbarHeight),
allowClip = false,
) {
Box(
modifier = Modifier
@@ -135,10 +139,12 @@ fun Smartbar() {
@Composable
private fun SmartbarMainRow(modifier: Modifier = Modifier) {
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val context = LocalContext.current
val keyboardManager by context.keyboardManager()
val activeEvaluator by keyboardManager.activeEvaluator.collectAsState()
val nlpManager by context.nlpManager()
val scope = rememberCoroutineScope()
val inlineSuggestions by NlpInlineAutofill.suggestions.collectAsState()
LaunchedEffect(inlineSuggestions) {
@@ -161,7 +167,9 @@ private fun SmartbarMainRow(modifier: Modifier = Modifier) {
if (/* was */ sharedActionsExpanded) {
keyboardManager.activeState.isActionsOverflowVisible = false
}
prefs.smartbar.sharedActionsExpanded.set(!sharedActionsExpanded)
scope.launch {
prefs.smartbar.sharedActionsExpanded.set(!sharedActionsExpanded)
}
},
modifier = Modifier.sizeIn(maxHeight = FlorisImeSizing.smartbarHeight).aspectRatio(1f)
) {
@@ -241,8 +249,11 @@ private fun SmartbarMainRow(modifier: Modifier = Modifier) {
if (/* was */ extendedActionsExpanded) {
keyboardManager.activeState.isActionsOverflowVisible = false
}
prefs.smartbar.extendedActionsExpanded.set(!extendedActionsExpanded)
scope.launch {
prefs.smartbar.extendedActionsExpanded.set(!extendedActionsExpanded)
}
},
modifier = Modifier.sizeIn(maxHeight = FlorisImeSizing.smartbarHeight).aspectRatio(1f)
) {
val transition = updateTransition(extendedActionsExpanded, label = "smartbarSecondaryRowToggleBtn")
val alpha by transition.animateFloat(label = "alpha") { if (it) 1f else 0f }
@@ -300,12 +311,13 @@ private fun SmartbarMainRow(modifier: Modifier = Modifier) {
SideEffect {
if (!shouldAnimate) {
prefs.smartbar.sharedActionsExpandWithAnimation.set(true)
scope.launch {
prefs.smartbar.sharedActionsExpandWithAnimation.set(true)
}
}
}
SnyggRow(
FlorisImeUi.Smartbar.elementName,
modifier = modifier
.fillMaxWidth()
.height(FlorisImeSizing.smartbarHeight),
@@ -356,7 +368,7 @@ private fun SmartbarMainRow(modifier: Modifier = Modifier) {
@Composable
private fun SmartbarSecondaryRow(modifier: Modifier = Modifier) {
val prefs by florisPreferenceModel()
val prefs by FlorisPreferenceStore
val smartbarLayout by prefs.smartbar.layout.observeAsState()
val secondaryRowStyle = rememberSnyggThemeQuery(FlorisImeUi.SmartbarExtendedActionsRow.elementName)
val windowStyle = rememberSnyggThemeQuery(FlorisImeUi.Window.elementName)

Some files were not shown because too many files have changed in this diff Show More