Skip to content

Commit

Permalink
Merge branch 'main' into clipboard-images
Browse files Browse the repository at this point in the history
  • Loading branch information
codokie authored May 31, 2024
2 parents 0c50972 + e357f84 commit ddd3043
Show file tree
Hide file tree
Showing 221 changed files with 4,484 additions and 2,929 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ tl;dr:
* a single issue per topic
* reduce screenshot size

<!-- issue template below -->
<!-- issue template below, please remove above text before submitting (and the template too if you think it's a good idea) -->

**Describe the bug**

**To Reproduce**
If possible, provide all the necessary steps to reproduce your problem.
If possible, provide all the necessary steps to reproduce your problem, including the involved apps or settings if relevant.

**Expected behavior**
If it's not obvious (e.g. not crash), describe how you think the app should behave.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tl;dr:
* a single issue per topic
* reduce screenshot size

<!-- issue template below -->
<!-- issue template below, please remove above text before submitting (and the template too if you think it's a good idea) -->

**Is your feature request related to a problem? Please describe.**

Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ tl;dr:
* search for duplicates, also in closed issues
* a single issue per topic
* reduce screenshot size

<!-- please remove above text before submitting -->
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/spell_checker.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ tl;dr:

Make sure you actually enabled HeliBoard spell checker. Usually it can be found in System Settings -> System -> Languages -> Advanced -> Spell Checker, but this may depend on Android version.
Note that the menu when tapping a word underlined in red is coming form the Android system and is not under control of HeliBoard.

<!-- please remove above text before submitting -->
4 changes: 3 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
See the contributing section in the readme for more detailed guideline: https://github.com/Helium314/HeliBoard?tab=readme-ov-file#guidelines
See the contributing readme for more detailed guideline: https://github.com/Helium314/HeliBoard/blob/main/CONTRIBUTING.md
tl;dr (you should still read the full list though):
* make sure it's wanted
* a single thing only
Expand All @@ -12,3 +12,5 @@ Further
* When the PR contains "fixes" <issue number>, the related issue will be linked and automatically closed if the PR is merged (also works for other words like "fix", "resolve", "resolves", "closes", ...)
* If you add a keyboard layout, make sure you have read https://github.com/Helium314/HeliBoard/blob/main/layouts.md#adding-new-layouts--languages
* Please avoid force-pushing when doing changes. This way it's not possible which parts have changed since the previous state.

(please remove the template text before submitting the PR)
11 changes: 6 additions & 5 deletions .github/workflows/build-test-auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ name: Test build
# builds only for a single abi and does not produce an APK

on:
push:
# disabled on push: when I push to non-main, I do a PR anyway
# push:
# don't run on main. I noticed I often don't push commits to avoid unnecessary workflow runs
branches-ignore: [ main ]
paths:
- 'app/**'
# branches-ignore: [ main ]
# paths:
# - 'app/**'
pull_request:
paths:
- 'app/**'
Expand All @@ -32,7 +33,7 @@ jobs:
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew assembleDebug
run: ./gradlew -Pandroid.injected.build.abi=arm64-v8a assembleDebug

- name: Archive reports for failed job
uses: actions/upload-artifact@v4
Expand Down
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Getting Started

HeliBoard project is based on Gradle and Android Gradle Plugin. To get started, you can install [Android Studio](https://developer.android.com/studio), and import project 'from Version Control / Git / Github' by providing this git repository [URL](https://github.com/Helium314/HeliBoard) (or git SSH [URL]([email protected]:Helium314/heliboard.git)).
Of course you can also use any other compatible IDE, or work with text editor and command line.

Once everything is up correctly, you're ready to go!

# Guidelines

HeliBoard is a complex application, when contributing, you must take a step back and make sure your contribution:
- **Is actually wanted**. Best check related open issues before you start working on a PR. Issues with "PR" and "contributor needed" labels are accepted, but still it would be good if you announced that you are working on it.
If there is no issue related to your intended contribution, it's a good idea to open a new one to avoid disappointment of the contribution not being accepted. For small changes or fixing obvious bugs this step is not necessary.
- **Is only about a single thing**. Mixing unrelated contributions into a single PR is hard to review and can get messy.
- **Is finished or a draft**. When you keep changing the PR without reviewer's feedback, any attempt to review it is doomed and a waste of time. Better mark it as a draft in this case.
- **Has a proper description**. What your contribution does is usually less obvious to reviewers than for yourself. A good description helps _a lot_ for understanding what is going on, and for separating wanted from unintended changes in behavior.
- **Uses already in-place mechanism and take advantage of them**. In other terms, does not reinvent the wheel or uses shortcuts that could alter the consistency of the existing code. The contribution should only add as little complexity as necessary, the code is overly complicated already 😶.
- **Has a low footprint**. Some parts of the code are executed very frequently, and the keyboard should stay responsive even on older devices.
- **Does not bring any non-free code or proprietary binary blobs**. This also applies to code/binaries with unknown licenses. Make sure you do not introduce any closed-source library from Google.
If your contribution contains code that is not your own, provide a link to the source.
- **Complies with the user privacy principle HeliBoard follows**.

(and please leave dependency upgrades to the maintainers, unless it's an actual security issue)
In addition to previous elements, HeliBoard must stick to [F-Droid inclusion guidelines](https://f-droid.org/docs/Inclusion_Policy/).

# Adding Layouts

See [layouts.md](layouts.md#adding-new-layouts--languages) for how to add new layouts to the app.

# Update Emojis

See make-emoji-keys tool [README](tools/make-emoji-keys/README.md).

# Update List of Existing Dictionaries

See make-dict-list tool [README](tools/make-dict-list/README.md).

# Translations
Translations can be added using [Weblate](https://translate.codeberg.org/projects/heliboard/). You will need an account to update translations and add languages. Add the language you want to translate to in Languages -> Manage translated languages in the top menu bar.
Updating translations in a PR will not be accepted, as it may cause conflicts with Weblate translations.
60 changes: 11 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Does not use internet permission, and thus is 100% offline.
* [Hidden Functionality](#hidden-functionality)
- [Contributing](#contributing-)
* [Reporting Issues](#reporting-issues)
* [Translation](#translation)
* [Translations](#translations)
* [Dictionary Creation](#dictionary-creation)
* [Code Contribution](#code-contribution)
* [Code Contribution](CONTRIBUTING.md)
- [To-do](#to-do)
- [License](#license)
- [Credits](#credits)
Expand All @@ -38,7 +38,7 @@ Does not use internet permission, and thus is 100% offline.
<li>Glide typing (<i>only with closed source library</i> ☹️)</li>
<ul>
<li>library not included in the app, as there is no compatible open source library available</li>
<li>can be extracted from GApps packages ("<i>swypelibs</i>"), or downloaded <a href="https://github.com/erkserkserks/openboard/tree/46fdf2b550035ca69299ce312fa158e7ade36967/app/src/main/jniLibs">here</a></li>
<li>can be extracted from GApps packages ("<i>swypelibs</i>"), or downloaded <a href="https://github.com/erkserkserks/openboard/tree/46fdf2b550035ca69299ce312fa158e7ade36967/app/src/main/jniLibs">here</a> (click on the file and then "raw" or the tiny download button)</li>
</ul>
<li>Clipboard history</li>
<li>One-handed mode</li>
Expand Down Expand Up @@ -66,13 +66,10 @@ Does not use internet permission, and thus is 100% offline.
The app checks the SHA256 checksum of the library and warns the user if it doesn't match with known library versions. A mismatch indicates the library was modified, but may also occur if the user intentionally provides a different library than expected (e.g. a self-built variant).
Note that if the the app is installed as a system app, both versions have access to the system glide typing library (if it is installed).
* __App crashing when using as system app__: This happens if you do not install the app, but just copy the APK. Then the app's own library is not extracted from the APK, and not accessible to the app. You will need tp either install the app over itself, or provide a library.
* (_to be expanded_...)

## Hidden Functionality
Features that may go unnoticed, and further potentially useful information
* Long-pressing pinned toolbar keys results in additional functionality
* clipboard -> paste, move left/right -> move full left/right, move up/down -> page up/down, copy -> copy all, select word -> select all, undo <-> redo,
* Long-pressing keys in the suggestion strip toolbar pins them to the suggestion strip.
* Long-pressing toolbar keys results in additional functionality: clipboard -> paste, move left/right -> move full left/right, move up/down -> page up/down, copy -> copy all, select word -> select all, undo <-> redo
* Long-press the Comma-key to access Clipboard View, Emoji View, One-handed Mode, Settings, or Switch Language:
* Emoji View and Language Switch will disappear if you have the corresponding key enabled;
* For some layouts it\'s not the Comma-key, but the key at the same position (e.g. it\'s `q` for Dvorak layout).
Expand Down Expand Up @@ -110,7 +107,7 @@ Note that issues that that ignore part of the issue template will likely get tre

If you're interested, you can read the following useful text about effective bug reporting (a bit longer read): https://www.chiark.greenend.org.uk/~sgtatham/bugs.html

## Translation
## Translations
Translations can be added using [Weblate](https://translate.codeberg.org/projects/heliboard/). You will need an account to update translations and add languages. Add the language you want to translate to in Languages -> Manage translated languages in the top menu bar.
Updating translations in a PR will not be accepted, as it may cause conflicts with Weblate translations.

Expand All @@ -119,52 +116,18 @@ There will not be any further dictionaries bundled in this app. However, you can
To create or update a dictionary for your language, you can use [this tool](https://github.com/remi0s/aosp-dictionary-tools). You will need a wordlist, as described [here](https://codeberg.org/Helium314/aosp-dictionaries/src/branch/main/wordlists/sample.combined) and in the repository readme.

## Code Contribution

### Getting Started

HeliBoard project is based on Gradle and Android Gradle Plugin. To get started, you can install [Android Studio](https://developer.android.com/studio), and import project 'from Version Control / Git / Github' by providing this git repository [URL](https://github.com/Helium314/HeliBoard) (or git SSH [URL]([email protected]:Helium314/heliboard.git)).
Of course you can also use any other compatible IDE, or work with text editor and command line.

Once everything is up correctly, you're ready to go!

### Guidelines

HeliBoard is a complex application, when contributing, you must take a step back and make sure your contribution:
- **Is actually wanted**. Best check related open issues before you start working on a PR. Issues with "PR" and "contributor needed" labels are accepted, but still it would be good if you announced that you are working on it.
If there is no issue related to your intended contribution, it's a good idea to open a new one to avoid disappointment of the contribution not being accepted. For small changes or fixing obvious bugs this step is not necessary.
- **Is only about a single thing**. Mixing unrelated contributions into a single PR is hard to review and can get messy.
- **Is finished or a draft**. When you keep changing the PR without reviewer's feedback, any attempt to review it is doomed and a waste of time. Better mark it as a draft in this case.
- **Has a proper description**. What your contribution does is usually less obvious to reviewers than for yourself. A good description helps _a lot_ for understanding what is going on, and for separating wanted from unintended changes in behavior.
- **Uses already in-place mechanism and take advantage of them**. In other terms, does not reinvent the wheel or uses shortcuts that could alter the consistency of the existing code.
- **Has a low footprint**. Some parts of the code are executed very frequently, and the keyboard should stay responsive even on older devices.
- **Does not bring any non-free code or proprietary binary blobs**. This also applies to code/binaries with unknown licenses. Make sure you do not introduce any closed-source library from Google.
If your contribution contains code that is not your own, provide a link to the source.
- **Complies with the user privacy principle HeliBoard follows**.

In addition to previous elements, HeliBoard must stick to [F-Droid inclusion guidelines](https://f-droid.org/docs/Inclusion_Policy/).

### Adding Layouts

See [layouts.md](layouts.md#adding-new-layouts--languages) for how to add new layouts to the app.

### Update Emojis

See make-emoji-keys tool [README](tools/make-emoji-keys/README.md).

### Update List of Existing Dictionaries

See make-dict-list tool [README](tools/make-dict-list/README.md).
See [Contribution Guidelines](CONTRIBUTING.md)

# To-do
__Planned features and improvements:__
* Customizable functional key layout
* Will likely result in having the same functional key layout for alphabet and symbols layouts
* Support for _alt_, _ctrl_, _meta_ and _fn_ (#479)
* Improve support for modifier keys (_alt_, _ctrl_, _meta_ and _fn_), some ideas:
* keep modifier keys on with long press
* keep modifier keys on until the next key press
* use sliding input
* Less complicated addition of new keyboard languages (e.g. #519)
* Additional and customizable key swipe functionality
* Some functionality will not be possible when using glide typing
* Ability to enter all emojis independent of Android version (optional, #297)
* (limited) support for customizing _all_ internally used colors
* Add and enable emoji dictionaries by default (if available for language)
* Clearer / more intuitive arrangement of settings
* Maybe hide some less used settings by default (similar to color customization)
Expand All @@ -173,13 +136,12 @@ __Planned features and improvements:__
* Make use of the `.com` key in URL fields (currently only available for tablets)
* With language-dependent TLDs
* Internal cleanup (a lot of over-complicated and convoluted code)
* optionally move toolbar key pinning to a setting, so long press actions on unpinned toolbar keys are available
* [Bug fixes](https://github.com/Helium314/HeliBoard/issues?q=is%3Aissue+is%3Aopen+label%3Abug)

__What will _not_ be added:__
* Material 3 (not worth adding 1.5 MB to app size)
* Dictionaries for more languages (you can still download them)
* Anything that requires additional permissions
* Anything that requires additional permissions, unless there is a very good reason

# License

Expand Down
16 changes: 12 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "helium314.keyboard"
minSdkVersion 21
targetSdkVersion 34
versionCode 1004
versionName '1.3'
versionCode 2001
versionName '2.0-alpha1'
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
Expand Down Expand Up @@ -90,14 +90,22 @@ android {
}

dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
// androidx
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.preference:preference:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.autofill:autofill:1.1.0'

// kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3"
// when kotlin-serialization is enabled, Android Studio stops complaining about "Unresolved reference: serializer", but the build fails
// implementation "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"

// color picker for user-defined colors
implementation 'com.github.martin-stone:hsv-alpha-color-picker-android:3.1.0'
implementation 'androidx.autofill:autofill:1.1.0'

// test
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.11.0'
testImplementation 'org.mockito:mockito-inline:5.2.0'
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/assets/dictionaries_in_dict_repo.csv
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ main,te,
main,tok,
main,tcy,
main,tr,
emoji,uk,
main,uk,
main,ur,
main,af,exp
main,ar,exp
main,bn,exp
main,bn_BD,exp
main,bn,exp
main,bg,exp
main,cs,exp
main,en_GB,exp
Expand All @@ -74,10 +75,12 @@ symbols,fr,exp
main,fr,exp
main,de_AT,exp
main,de,exp
main,he,exp
main,id,exp
main,it,exp
main,kab,exp
addon,ml_ZZ,exp
main,pms,exp
main,ru,exp
main,sk,exp
main,es,exp
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/layouts/azerty.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{ "label": "j" },
{ "label": "k" },
{ "label": "l" },
{ "label": "m", "popup": { "main": { "label": "/" } } }
{ "label": "m" }
],
[
{ "label": "w" },
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/layouts/bepo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ t
s
r
n
m /
m

y
x
Expand Down
21 changes: 21 additions & 0 deletions app/src/main/assets/layouts/functional_keys.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[
[
{ "label": "shift", "width": 0.15 },
{ "type": "placeholder" },
{ "label": "delete", "width": 0.15 }
],
[
{ "label": "symbol_alpha", "width": 0.15 },
{ "$": "variation_selector",
"default": { "label": "comma" },
"email": { "label": "@", "groupId": 1, "type": "function" },
"uri": { "label": "/", "groupId": 1, "type": "function" }
},
{ "label": "language_switch" },
{ "label": "emoji" },
{ "label": "numpad" },
{ "label": "space" },
{ "label": "period" },
{ "label": "action", "width": 0.15 }
]
]
36 changes: 36 additions & 0 deletions app/src/main/assets/layouts/functional_keys_tablet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[
[
{ "type": "placeholder" },
{ "label": "delete", "width": 0.1 }
],
[
{ "type": "placeholder" }
],
[
{ "type": "placeholder" },
{ "label": "action", "width": 0.1 }
],
[
{ "label": "shift", "width": 0.1 },
{ "type": "placeholder" },
{ "label": "shift" }
],
[
{ "label": "symbol_alpha" },
{ "$": "variation_selector",
"default": { "label": "comma" },
"email": { "label": "@", "groupId": 1, "type": "function" },
"uri": { "label": "/", "groupId": 1, "type": "function" }
},
{ "label": "language_switch" },
{ "label": "emoji" },
{ "label": "numpad" },
{ "label": "space" },
{ "label": "period" },
{ "$": "variation_selector",
"default": { "label": "emoji" },
"email": { "label": "com" },
"uri": { "label": "com" }
}
]
]
2 changes: 1 addition & 1 deletion app/src/main/assets/layouts/halmak.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ t
a
e
o
i /
i

m
v
Expand Down
Loading

0 comments on commit ddd3043

Please sign in to comment.