diff --git a/.editorconfig b/.editorconfig index 45db7af9a4..a55befd7a9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,6 +4,6 @@ ktlint_function_naming_ignore_when_annotated_with = Composable ktlint_ignore_back_ticked_identifier = true ktlint_code_style = intellij_idea # Use IntelliJ style because it has trailing commas -[app/src/main/java/io/github/sds100/keymapper/util/ui/compose/icons/*.{kt,kts}] +[base/src/main/java/io/github/sds100/keymapper/base/utils/ui/compose/icons/*.{kt,kts}] ktlint_standard_property-naming = disabled ktlint_standard_backing-property-naming = disabled \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 25b2b65b93..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug, needs triage -assignees: sds100 - ---- - -**Developer TODO (don't remove)** -- [ ] update documentation - -**Describe the bug** -A clear and concise description of what the bug is. - -**Attach bug report** -https://docs.keymapper.club/report-issues - -**To Reproduce** -Steps to reproduce the behavior: - -**Key maps** -Upload a backup of your keymaps. [Follow the guide here](https://docs.keymapper.club/user-guide/backup-restore) - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Device and app info** - - Device: - - Android version (include HyperOS, OneUI version as well): - - Key Mapper version: diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000..b08635993b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,79 @@ +name: Bug report +description: Use this template if there is a technical fault in the app +labels: ["bug", "needs triage"] +assignees: + - sds100 + +body: + - type: checkboxes + id: screening + attributes: + label: Have you checked if an issue already exists for this bug? + description: Please search to see if someone has already reported this bug. If they have, you can speed up fixing the bug by commenting on that issue. + options: + - label: Nobody else has reported this bug before + required: true + + - type: checkboxes + id: restart + attributes: + label: Have you tried restarting your device? + description: This can occasionally be necessary. + options: + - label: I have tried restarting my device and that did not help + required: false + + - type: textarea + id: unexpected_behaviour + attributes: + label: What happened that you did not expect? + description: | + What behaviour were you experiencing that you think is a bug (not intended) + **It will help if you upload your key maps or logs** + placeholder: I was doing X, and then Y happened that I did not expect. + + - type: textarea + id: expected_behaviour + attributes: + label: What did you expect to happen? + description: If the app was working properly, what would have happened instead? + placeholder: When I pressed X, I should have seen Y + + - type: textarea + id: how_to_reproduce + attributes: + label: What would the developer need to do to reproduce the bug? + description: Imagine the developer has the same device as you, and has just installed the app. What steps should they follow to see the same unexpected behaviour? + placeholder: | + 1. Make a key map with volume up trigger + 2. Add the flashlight action + 3. Save the key map and close the app + 4. Press the volume up trigger + 5. See error message + + - type: input + id: version + attributes: + label: App version + description: You can find the app version on the About page + placeholder: 3.2.1 999 + validations: + required: true + + - type: input + id: device + attributes: + label: Device model and manufacturer + description: What model is your device? Be as specific as you can + placeholder: Xiaomi, Samsung Galaxy, etc. + validations: + required: true + + - type: checkboxes + id: extras + attributes: + label: Extra info + description: It would help us even more if you could check the boxes that apply to you. + options: + - label: My device is rooted + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..165131bc55 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Need help using the app? + url: http://keymapper.club?utm_source=issue_template_chooser + about: Join the Discord server and let us help you \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000000..e6a029cffb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,51 @@ +name: Feature request +description: Use this template if you have an idea for a new feature to be added to the app +labels: ["enhancement", "needs triage"] +assignees: + - sds100 + +body: + - type: checkboxes + id: screening + attributes: + label: Have you checked if an issue already exists for this feature request? + description: Please search to see if someone has already requested this feature. If they have, you can speed up implementing the feature by commenting on that issue. + options: + - label: Nobody else has requested this feature before + required: true + + - type: textarea + id: enhancement + attributes: + label: What feature would you like added? + description: | + Please explain the feature in as much detail as you can to help us imagine what you are looking for. Imagine how someone might use the feature, who would it benefit? + validations: + required: true + + - type: input + id: version + attributes: + label: App version + description: You can find the app version on the About page + placeholder: 3.2.1 999 + validations: + required: false + + - type: input + id: device + attributes: + label: Device model and manufacturer + description: What model is your device? Be as specific as you can + placeholder: Xiaomi, Samsung Galaxy, etc. + validations: + required: false + + - type: checkboxes + id: extras + attributes: + label: Extra info + description: It would help us even more if you could check the boxes that apply to you. + options: + - label: My device is rooted + required: false diff --git a/.github/ISSUE_TEMPLATE/new-feature.md b/.github/ISSUE_TEMPLATE/new-feature.md deleted file mode 100644 index 677a2e1159..0000000000 --- a/.github/ISSUE_TEMPLATE/new-feature.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: New Feature -about: Add a new feature or enhancement to the app. -title: '' -labels: enhancement, needs triage -assignees: sds100 - ---- - -**Developer TODO (don't remove)** -- [ ] update documentation diff --git a/.github/ISSUE_TEMPLATE/ux_issue.yml b/.github/ISSUE_TEMPLATE/ux_issue.yml new file mode 100644 index 0000000000..63a0ec8d7b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/ux_issue.yml @@ -0,0 +1,54 @@ +name: User experience complaint +description: Use this template if you found the app hard to use or confusing +labels: ["user experience", "needs triage"] +assignees: + - jambl3r + +body: + - type: checkboxes + id: screening + attributes: + label: Have you checked if an issue already exists for this problem? + description: Please search to see if someone has already reported this problem. If they have, you can speed up improving the app by commenting on that issue. + options: + - label: Nobody else has reported this problem before + required: true + + - type: textarea + id: complaint + attributes: + label: What problem did you face using the app? + description: If something was confusing or difficult, please explain in as much detail as you can what you found difficult. + + - type: textarea + id: improvements + attributes: + label: What do you think would make the experience easier for you? + description: Feel free to share your ideas, you can use examples of good experiences elsewhere in the app or in other apps or your every day life. + + - type: input + id: version + attributes: + label: App version + description: You can find the app version on the About page + placeholder: 3.2.1 999 + validations: + required: true + + - type: input + id: device + attributes: + label: Device model and manufacturer + description: What model is your device? Be as specific as you can + placeholder: Xiaomi, Samsung Galaxy, etc. + validations: + required: true + + - type: checkboxes + id: extras + attributes: + label: Extra info + description: It would help us even more if you could check the boxes that apply to you. + options: + - label: My device is rooted + required: false diff --git a/.github/workflows/approve-translations.yml b/.github/workflows/approve-translations.yml new file mode 100644 index 0000000000..027ece94d8 --- /dev/null +++ b/.github/workflows/approve-translations.yml @@ -0,0 +1,69 @@ +name: Auto Approve Crowdin Translations + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + approve-translations: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Install Crowdin CLI + run: | + npm install -g @crowdin/cli@3 + + - name: Approve top-voted translations for all languages + env: + CROWDIN_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + run: | + set -e + + if [ -z "$CROWDIN_TOKEN" ] || [ -z "$CROWDIN_PROJECT_ID" ]; then + echo "Crowdin token or project id is missing!" + exit 1 + fi + + echo "Start automatic approval Crowdin Translation..." + + language_ids=$(crowdin api list-languages --project-id=$CROWDIN_PROJECT_ID --plain | jq -r '.data[].data.id' || true) + if [ -z "$language_ids" ]; then + echo "No language ids found, check Crowdin project or CLI output." + exit 1 + fi + + string_ids=$(crowdin api list-strings --project-id=$CROWDIN_PROJECT_ID --plain | jq -r '.data[].data.id' || true) + if [ -z "$string_ids" ]; then + echo "No string ids found, check Crowdin project or CLI output." + exit 1 + fi + + for lang in $language_ids; do + echo "Processing language $lang" + + translations=$(crowdin api list-string-translations --project-id=$CROWDIN_PROJECT_ID --language-id=$lang --plain) + + for sid in $string_ids; do + best=$(echo "$translations" | jq -r " + .data[] + | .data + | select(.stringId == \"$sid\" and .votes > 0) + | {\"id\": .id, \"votes\": .votes} + " | jq -s 'sort_by(-.votes) | .[0] | .id') + + if [ -n "$best" ] && [ "$best" != "null" ]; then + echo " → Approved translation $best for string $sid" + crowdin api edit-translation \ + --project-id=$CROWDIN_PROJECT_ID \ + --translation-id=$best \ + --approved=true + fi + done + done \ No newline at end of file diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index b0a1c1f356..a2027703b1 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -21,7 +21,7 @@ jobs: uses: android-actions/setup-android@v2 - name: Unit tests - run: bash ./gradlew testFreeDebugUnitTest + run: bash ./gradlew testDebugUnitTest style: name: Code style check @@ -96,10 +96,10 @@ jobs: run: bundle exec fastlane testing - name: set apk name env - run: echo "APK_NAME=$(basename app/build/outputs/apk/free/ci/*.apk .apk)" >> $GITHUB_ENV + run: echo "APK_NAME=$(basename app/build/outputs/apk/ci/*.apk .apk)" >> $GITHUB_ENV - name: Upload APK uses: actions/upload-artifact@v4 with: name: ${{ env.APK_NAME }} - path: app/build/outputs/apk/free/ci/${{ env.APK_NAME }}.apk + path: app/build/outputs/apk/ci/${{ env.APK_NAME }}.apk diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 7bef735539..b86ad1b439 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -27,7 +27,7 @@ jobs: uses: android-actions/setup-android@v2 - name: Unit tests - run: bash ./gradlew testFreeDebugUnitTest + run: bash ./gradlew testDebugUnitTest style: name: Code style check @@ -114,13 +114,13 @@ jobs: run: bundle exec fastlane testing - name: set apk name env - run: echo "APK_NAME=$(basename app/build/outputs/apk/free/ci/*.apk .apk)" >> $GITHUB_ENV + run: echo "APK_NAME=$(basename app/build/outputs/apk/ci/*.apk .apk)" >> $GITHUB_ENV - name: Upload APK uses: actions/upload-artifact@v4 with: name: ${{ env.APK_NAME }} - path: app/build/outputs/apk/free/ci/${{ env.APK_NAME }}.apk + path: app/build/outputs/apk/ci/${{ env.APK_NAME }}.apk - name: Upload to Discord uses: sinshutu/upload-to-discord@v2.0.0 @@ -128,7 +128,7 @@ jobs: env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} with: - args: app/build/outputs/apk/free/ci/${{ env.APK_NAME }}.apk + args: app/build/outputs/apk/ci/${{ env.APK_NAME }}.apk - name: Report build status to Discord uses: sarisia/actions-status-discord@v1 diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000000..74b4435ffe --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +KeyMapperFoss \ No newline at end of file diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml new file mode 100644 index 0000000000..fd844d9451 --- /dev/null +++ b/.idea/material_theme_project_new.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/.idea/navEditor.xml b/.idea/navEditor.xml new file mode 100644 index 0000000000..7dbf723192 --- /dev/null +++ b/.idea/navEditor.xml @@ -0,0 +1,257 @@ + + + + + + \ No newline at end of file diff --git a/.run/instrumentation-tests.run.xml b/.run/instrumentation-tests.run.xml deleted file mode 100644 index 57995ce1b4..0000000000 --- a/.run/instrumentation-tests.run.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.run/unit-tests.run.xml b/.run/unit-tests.run.xml deleted file mode 100644 index 880d3c46f6..0000000000 --- a/.run/unit-tests.run.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - -