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 Jul 14, 2024
2 parents 27f1781 + c0c11d7 commit 5bc1b2d
Show file tree
Hide file tree
Showing 231 changed files with 3,945 additions and 1,545 deletions.
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ tl;dr:
* a single issue per topic
* reduce screenshot size

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

**Describe the bug**

Expand Down
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ tl;dr:
* a single issue per topic
* reduce screenshot size

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

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

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ tl;dr:
* a single issue per topic
* reduce screenshot size

<!-- please remove above text before submitting -->
<!-- please remove above text before submitting, and choose a meaningful title for your issue -->
16 changes: 0 additions & 16 deletions .github/ISSUE_TEMPLATE/spell_checker.md

This file was deleted.

6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
See the contributing readme for more detailed guideline: https://github.com/Helium314/HeliBoard/blob/main/CONTRIBUTING.md
See the contributing readme for more detailed guideline, please understand and accept them: 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
* describe it properly
* re-use existing mechanisms / code
* low performance impact
* make it a draft if you still want to work on it
* don't do translation PRs
* no translations or dictionaries

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)
<!-- (please remove the text above before submitting the PR) -->
4 changes: 2 additions & 2 deletions .github/workflows/build-test-auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
# - 'app/**'
pull_request:
paths:
- 'app/**'
- 'app/src/main/java**'
workflow_dispatch:

jobs:
Expand All @@ -33,7 +33,7 @@ jobs:
run: chmod +x gradlew

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

- name: Archive reports for failed job
uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ app/build
app/release
app/.cxx
fastlane/Appfile
tools/*.txt
15 changes: 7 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ 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.
- **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, so we can discuss how changes are best implemented.
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 only about a single thing**. Mixing unrelated or semi-related 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.
- **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. Therefore the changes should be as described, not more and not less.
- **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)
(and 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
Expand All @@ -30,10 +30,9 @@ See [layouts.md](layouts.md#adding-new-layouts--languages) for how to add new la

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.

# Dictionaries
No new dictionaries will be added to this app. Please submit dictionaries and the wordlist to the [dictionaries repository](https://codeberg.org/Helium314/aosp-dictionaries)
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Does not use internet permission, and thus is 100% offline.
- [Contributing](#contributing-)
* [Reporting Issues](#reporting-issues)
* [Translations](#translations)
* [Dictionary Creation](#dictionary-creation)
* [To Community Creation](#to-community)
* [Code Contribution](CONTRIBUTING.md)
- [To-do](#to-do)
- [License](#license)
Expand All @@ -34,6 +34,7 @@ Does not use internet permission, and thus is 100% offline.
<li>can follow dynamic colors for Android 12+</li>
</ul>
<li>Customize keyboard <a href="https://github.com/Helium314/HeliBoard/blob/main/layouts.md">layouts</a> (only available when disabling <i>use system languages</i>)</li>
<li>Customize special layouts, like symbols, number, or functional key layout</li>
<li>Multilingual typing</li>
<li>Glide typing (<i>only with closed source library</i> ☹️)</li>
<ul>
Expand All @@ -44,7 +45,7 @@ Does not use internet permission, and thus is 100% offline.
<li>One-handed mode</li>
<li>Split keyboard (only available if the screen is large enough)</li>
<li>Number pad</li>
<li>Backup and restore your learned word / history data</li>
<li>Backup and restore your settings and learned word / history data</li>
</ul>

## FAQ / Common Issues
Expand All @@ -69,7 +70,7 @@ Does not use internet permission, and thus is 100% offline.

## Hidden Functionality
Features that may go unnoticed, and further potentially useful information
* 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-pressing toolbar keys results in additional functionality: clipboard -> paste, move left/right -> word left/right, move up/down -> page up/down, word left/right -> line start/end, page up/down -> page start/end, copy -> cut, 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 All @@ -83,6 +84,7 @@ Features that may go unnoticed, and further potentially useful information
* Select text and press shift to switch between uppercase, lowercase and capitalize words
* You can add dictionaries by opening the file
* This only works with _content-uris_ and not with _file-uris_, meaning that it may not work with some file explorers.
* Not really a feature, but you can restart the keyboard by going to the settings and swiping it away from recents
* _Debug mode / debug APK_
* Long-press a suggestion in the suggestion strip twice to show the source dictionary.
* When using debug APK, you can find _Debug Settings_ within the _Advanced Preferences_, though the usefulness is limited except for dumping dictionaries into the log.
Expand Down Expand Up @@ -111,9 +113,17 @@ If you're interested, you can read the following useful text about effective bug
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.

## Dictionary Creation
There will not be any further dictionaries bundled in this app. However, you can add dictionaries to the [dictionaries repository](https://codeberg.org/Helium314/aosp-dictionaries).
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.
## To Community
You can share your themes, layouts and dictionaries with other people:
* Themes can be saved and loaded using the menu on top-right in the _adjust colors_ screen
* Custom keyboard layouts are text files whose content you can edit, copy and share
* this applies to main keyboard layouts and to special layouts adjustable in advanced settings
* see [layouts.md](layouts.md) for details
* Creating dictionaries is a little more work
* first 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
* the you need to compile the dictionary using [external tools](https://github.com/remi0s/aosp-dictionary-tools)
* the resulting file (and ideally the wordlist too) can be shared with other users
* note that there will not be any further dictionaries added to this app, but you can add dictionaries to the [dictionaries repository](https://codeberg.org/Helium314/aosp-dictionaries)

## Code Contribution
See [Contribution Guidelines](CONTRIBUTING.md)
Expand All @@ -131,8 +141,6 @@ __Planned features and improvements:__
* 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)
* Customizable currency keys
* Ability to export/import (share) custom colors
* 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)
Expand Down
21 changes: 12 additions & 9 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 2001
versionName '2.0-alpha1'
versionCode 2100
versionName '2.1'
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
Expand All @@ -21,14 +21,14 @@ android {
buildTypes {
release {
minifyEnabled true
shrinkResources true
shrinkResources false
debuggable false
jniDebuggable false
renderscriptDebuggable false
}
nouserlib { // same as release, but does not allow the user to provide a library
minifyEnabled true
shrinkResources true
shrinkResources false
debuggable false
jniDebuggable false
renderscriptDebuggable false
Expand All @@ -38,6 +38,10 @@ android {
jniDebuggable false
applicationIdSuffix ".debug"
}
runTests { // build variant for running tests on CI that skips tests known to fail
minifyEnabled true
jniDebuggable false
}
archivesBaseName = "HeliBoard_" + defaultConfig.versionName
}

Expand All @@ -52,9 +56,6 @@ android {
}
}

lintOptions {
abortOnError true
}

ndkVersion '26.2.11394342'

Expand Down Expand Up @@ -87,20 +88,22 @@ android {
}

namespace "helium314.keyboard.latin"
lint {
abortOnError true
}
}

dependencies {
// androidx
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
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'
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/assets/dictionaries_in_dict_repo.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ main,ar,
main,hy,
main,as,
main,bn,
main,eu,
main,be,
main,bg,
main,ca,
Expand Down Expand Up @@ -79,6 +80,7 @@ main,he,exp
main,id,exp
main,it,exp
main,kab,exp
main,kk,exp
addon,ml_ZZ,exp
main,pms,exp
main,ru,exp
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/assets/layouts/esperanto.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ŝ
ĝ
ŝ q
ĝ w
e
r
t
ŭ
ŭ y
u
i
o
Expand All @@ -21,9 +21,9 @@ l
ĵ

z
ĉ
ĉ x
c
v
v w
b
n
m
8 changes: 4 additions & 4 deletions app/src/main/assets/layouts/functional_keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"email": { "label": "@", "groupId": 1, "type": "function" },
"uri": { "label": "/", "groupId": 1, "type": "function" }
},
{ "label": "language_switch" },
{ "label": "emoji" },
{ "label": "numpad" },
{ "$": "keyboard_state_selector", "languageKeyEnabled": { "$": "keyboard_state_selector", "alphabet": { "label": "language_switch" }}},
{ "$": "keyboard_state_selector", "emojiKeyEnabled": { "$": "keyboard_state_selector", "alphabet": { "label": "emoji" }}},
{ "$": "keyboard_state_selector", "symbols": { "label": "numpad" }},
{ "label": "space" },
{ "label": "period" },
{ "label": "period", "labelFlags": 1073741824 },
{ "label": "action", "width": 0.15 }
]
]
6 changes: 3 additions & 3 deletions app/src/main/assets/layouts/functional_keys_tablet.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"email": { "label": "@", "groupId": 1, "type": "function" },
"uri": { "label": "/", "groupId": 1, "type": "function" }
},
{ "label": "language_switch" },
{ "label": "emoji" },
{ "label": "numpad" },
{ "$": "keyboard_state_selector", "languageKeyEnabled": { "$": "keyboard_state_selector", "alphabet": { "label": "language_switch" }}},
{ "$": "keyboard_state_selector", "emojiKeyEnabled": { "$": "keyboard_state_selector", "alphabet": { "label": "emoji" }}},
{ "$": "keyboard_state_selector", "symbols": { "label": "numpad" }},
{ "label": "space" },
{ "label": "period" },
{ "$": "variation_selector",
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/assets/layouts/numpad.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
[
{ "label": "alpha" },
{ "label": "comma", "width": 0.1 },
{ "label": "symbol", "type": "character", "width": 0.12 },
{ "label": "symbol", "width": 0.12 },
{ "label": "0", "type": "numeric" },
{ "label": "=", "width": 0.12, "popup": { "relevant": [ { "label": ""}, { "label": ""} ] } },
{ "label": "=", "type": "function", "width": 0.12, "popup": { "relevant": [ { "label": ""}, { "label": ""} ] } },
{ "label": "period", "width": 0.1 },
{ "label": "action" }
]
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/assets/layouts/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
$$$
_ % ‰
&
- – — ·
+ ±
( < { [
) > } ]
- – — ·
+ ±
( < { [
) > } ]
/

* † ‡ ★
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/layouts/symbols_shifted.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $$$3
$$$4
^ ↑ ↓ ← →
° ′ ″
= ≠ ≈ ∞
= ≠ ≈ ∞
{
}

Expand Down
Loading

0 comments on commit 5bc1b2d

Please sign in to comment.