diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index a6b108ad..3b2cc951 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -129,4 +129,5 @@ jobs: adb shell pm list packages >/dev/null sleep 10 adb shell getprop sys.boot_completed - ./gradlew connectedCoreDebugAndroidTest --stacktrace + ./gradlew connectedConjugateDebugAndroidTest --stacktrace + ./gradlew connectedKeyboardsDebugAndroidTest --stacktrace diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f31a949..a99047de 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -115,7 +115,9 @@ git remote add upstream https://github.com/scribe-org/Scribe-Android.git 3. Open the Scribe-Android directory in Android Studio -4. In order to [run Scribe on an emulator](https://developer.android.com/studio/run/emulator): +4. The application has 2 build variants more of which could be read at [here](#build-variants) + +5. In order to [run Scribe on an emulator](https://developer.android.com/studio/run/emulator): - In the top bar find and select the "Device Manager" option - [Create a device](https://developer.android.com/studio/run/managing-avds) and select it once it's been made @@ -133,6 +135,17 @@ git remote add upstream https://github.com/scribe-org/Scribe-Android.git > [!NOTE] > Feel free to contact the team in the [Android room on Matrix](https://matrix.to/#/#ScribeAndroid:matrix.org) if you're having problems getting your environment setup! + +## Build Variant Selection [`⇧`](#contents) + +The project includes **two build variants**, each corresponding to a different application. + +Build variants can be selected from **Build → Select Build Variant** in Android Studio: + +- **`conjugateDebug`** → Conjugate app +- **`keyboardDebug`** → Keyboard app + + ## Pre-commit Hooks [`⇧`](#contents) Scribe-Android uses pre-commit hooks to maintain a clean and consistent codebase. These hooks help automatically check for issues such as formatting, trailing whitespace, and linting errors. Here's how to set up pre-commit for Scribe-Android: diff --git a/README.md b/README.md index eed6597e..962429fc 100644 --- a/README.md +++ b/README.md @@ -190,9 +190,28 @@ pre-commit install # install pre-commit hooks # App Setup [`⇧`](#contents) +### Codebase Overview +The Scribe-Android codebase consists of two separate applications + +- Keyboard Application — the actual Scribe language keyboard (IME) + +- Conjugate Application — a application for verb conjugations. + +Each application is built and run independently using Android Studio build variants. + +To select a built variant + +1. Open the project in Android Studio +2. Navigate to Build → Select Build Variant +3. Choose the required variant: + * **KeyboardDebug** — Scribe keyboard application (IME) + * **ConjugateDebug** — Scribe Conjugate application + > [!NOTE] > Currently Scribe-Android does not work as a floating keyboard. +The Default variant would be `keyboardDebug` + Users access Scribe language keyboards through the following: - Open the app and press **`Enable Keyboard`** @@ -200,6 +219,7 @@ Users access Scribe language keyboards through the following: - Choose from the available Scribe language keyboards - When typing press 🌐 or the keyboard button to select keyboards + # Supported Languages [`⇧`](#contents) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 81b5e876..b3e548f4 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -46,6 +46,27 @@ android { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } + + productFlavors { + create("keyboards") { + applicationIdSuffix = ".keyboards" + isDefault = true + resValue( + "string", + "app_launcher_name", + "Scribe" + ) + } + create("conjugate") { + applicationIdSuffix = ".conjugate" + resValue( + "string", + "app_launcher_name", + "Conjugate" + ) + } + } + packaging { resources { pickFirsts.add("META-INF/LICENSE*") @@ -114,10 +135,7 @@ android { } flavorDimensions.add("variants") - productFlavors { - create("core") - create("fdroid") - } + sourceSets { getByName("main").java.srcDirs("src/main/kotlin") diff --git a/app/src/conjugate/ic_launcher-playstore.png b/app/src/conjugate/ic_launcher-playstore.png new file mode 100644 index 00000000..06fc5b22 Binary files /dev/null and b/app/src/conjugate/ic_launcher-playstore.png differ diff --git a/app/src/conjugate/java/be/scri/activities/MainActivity.kt b/app/src/conjugate/java/be/scri/activities/MainActivity.kt new file mode 100644 index 00000000..d8aa98f8 --- /dev/null +++ b/app/src/conjugate/java/be/scri/activities/MainActivity.kt @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +@file:Suppress("ktlint:standard:kdoc") +/** + * Implements the main activity with a custom action bar, ViewPager navigation, and dynamic UI adjustments. + */ + +package be.scri.activities + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import be.scri.ui.screens.SampleScreen + +/** + * The main entry point of the app. + * Initializes theme settings, navigation, and sets up the main UI using Jetpack Compose. + */ +class MainActivity : ComponentActivity() { + /** + * Initializes the app on launch. Sets the theme based on user preferences, sets up edge-to-edge + * layout, and builds the UI using Compose. + */ + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + setContent { + SampleScreen() + } + } +} diff --git a/app/src/conjugate/java/be/scri/ui/screens/SampleScreen.kt b/app/src/conjugate/java/be/scri/ui/screens/SampleScreen.kt new file mode 100644 index 00000000..08dfa9a7 --- /dev/null +++ b/app/src/conjugate/java/be/scri/ui/screens/SampleScreen.kt @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +package be.scri.ui.screens + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier + +@Composable +fun SampleScreen(modifier: Modifier = Modifier) { + MaterialTheme { + Box( + modifier = modifier.fillMaxSize(), + contentAlignment = Alignment.Center, + ) { + Text( + text = "Conjugate App", + style = MaterialTheme.typography.bodyLarge, + ) + } + } +} diff --git a/app/src/conjugate/res/drawable/ic_launcher_background.xml b/app/src/conjugate/res/drawable/ic_launcher_background.xml new file mode 100644 index 00000000..ca3826a4 --- /dev/null +++ b/app/src/conjugate/res/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/conjugate/res/drawable/ic_launcher_foreground.xml b/app/src/conjugate/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 00000000..0520adc1 --- /dev/null +++ b/app/src/conjugate/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/app/src/conjugate/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/conjugate/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000..bbd3e021 --- /dev/null +++ b/app/src/conjugate/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/conjugate/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/conjugate/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..bbd3e021 --- /dev/null +++ b/app/src/conjugate/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/conjugate/res/mipmap-hdpi/ic_launcher.webp b/app/src/conjugate/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 00000000..2a1b5c9d Binary files /dev/null and b/app/src/conjugate/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/app/src/conjugate/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/conjugate/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 00000000..0fa18337 Binary files /dev/null and b/app/src/conjugate/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/app/src/conjugate/res/mipmap-mdpi/ic_launcher.webp b/app/src/conjugate/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 00000000..e5ca338e Binary files /dev/null and b/app/src/conjugate/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/app/src/conjugate/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/conjugate/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 00000000..8157d818 Binary files /dev/null and b/app/src/conjugate/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/app/src/conjugate/res/mipmap-xhdpi/ic_launcher.webp b/app/src/conjugate/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 00000000..1a6729bc Binary files /dev/null and b/app/src/conjugate/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/app/src/conjugate/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/conjugate/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..c674c6a2 Binary files /dev/null and b/app/src/conjugate/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/app/src/conjugate/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/conjugate/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 00000000..576eb1fb Binary files /dev/null and b/app/src/conjugate/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/app/src/conjugate/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/conjugate/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..0b0da68b Binary files /dev/null and b/app/src/conjugate/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/app/src/conjugate/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/conjugate/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 00000000..820132e4 Binary files /dev/null and b/app/src/conjugate/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/app/src/conjugate/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/conjugate/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..cbbc8b9c Binary files /dev/null and b/app/src/conjugate/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/app/src/debug/res/values/strings.xml b/app/src/debug/res/values/strings.xml deleted file mode 100644 index 045e125f..00000000 --- a/app/src/debug/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/app/src/keyboards/ic_launcher-playstore.png b/app/src/keyboards/ic_launcher-playstore.png new file mode 100644 index 00000000..cd344839 Binary files /dev/null and b/app/src/keyboards/ic_launcher-playstore.png differ diff --git a/app/src/main/java/be/scri/activities/MainActivity.kt b/app/src/keyboards/java/be/scri/activities/MainActivity.kt similarity index 100% rename from app/src/main/java/be/scri/activities/MainActivity.kt rename to app/src/keyboards/java/be/scri/activities/MainActivity.kt diff --git a/app/src/keyboards/res/drawable/ic_launcher_background.xml b/app/src/keyboards/res/drawable/ic_launcher_background.xml new file mode 100644 index 00000000..ca3826a4 --- /dev/null +++ b/app/src/keyboards/res/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/keyboards/res/drawable/ic_launcher_foreground.xml b/app/src/keyboards/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 00000000..418d0acf --- /dev/null +++ b/app/src/keyboards/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + diff --git a/app/src/keyboards/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/keyboards/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000..bbd3e021 --- /dev/null +++ b/app/src/keyboards/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/keyboards/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/keyboards/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..bbd3e021 --- /dev/null +++ b/app/src/keyboards/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/keyboards/res/mipmap-hdpi/ic_launcher.webp b/app/src/keyboards/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 00000000..c9429503 Binary files /dev/null and b/app/src/keyboards/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/app/src/keyboards/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/keyboards/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 00000000..b0fbb779 Binary files /dev/null and b/app/src/keyboards/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/app/src/keyboards/res/mipmap-mdpi/ic_launcher.webp b/app/src/keyboards/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 00000000..6f116e78 Binary files /dev/null and b/app/src/keyboards/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/app/src/keyboards/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/keyboards/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 00000000..797aff04 Binary files /dev/null and b/app/src/keyboards/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/app/src/keyboards/res/mipmap-xhdpi/ic_launcher.webp b/app/src/keyboards/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 00000000..bee2dea0 Binary files /dev/null and b/app/src/keyboards/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/app/src/keyboards/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/keyboards/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..58019dcd Binary files /dev/null and b/app/src/keyboards/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/app/src/keyboards/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/keyboards/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 00000000..d0ec009f Binary files /dev/null and b/app/src/keyboards/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/app/src/keyboards/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/keyboards/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..98a301ef Binary files /dev/null and b/app/src/keyboards/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/app/src/keyboards/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/keyboards/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 00000000..effdd5e7 Binary files /dev/null and b/app/src/keyboards/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/app/src/keyboards/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/keyboards/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..65ddff77 Binary files /dev/null and b/app/src/keyboards/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png deleted file mode 100644 index 325d3e4c..00000000 Binary files a/app/src/main/ic_launcher-playstore.png and /dev/null differ diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 4ae7d123..00000000 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_background.png b/app/src/main/res/mipmap-hdpi/ic_launcher_background.png deleted file mode 100644 index 51ac5792..00000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_background.png and /dev/null differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png deleted file mode 100644 index 89e1d4f4..00000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_background.png b/app/src/main/res/mipmap-mdpi/ic_launcher_background.png deleted file mode 100644 index b62082ea..00000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_background.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png deleted file mode 100644 index 1f923e2b..00000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png deleted file mode 100644 index 094202b3..00000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png deleted file mode 100644 index 898f420c..00000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png deleted file mode 100644 index d8f7888c..00000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png deleted file mode 100644 index da80a879..00000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png deleted file mode 100644 index a47db345..00000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 2009579a..00000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/values-de/string.xml b/app/src/main/res/values-de/string.xml index d6c1a225..c06b088b 100644 --- a/app/src/main/res/values-de/string.xml +++ b/app/src/main/res/values-de/string.xml @@ -3,6 +3,7 @@ Über Scribe Android-Änderungsprotokoll Verfügbare Daten + Blog-Beiträge Änderungsprotokoll Datenserver iOS-Änderungsprotokoll @@ -17,6 +18,7 @@ Deutsch Indonesisch Italienisch + Norwegisch Portugiesisch Russisch Spanisch diff --git a/build.gradle.kts b/build.gradle.kts index 8dcd4fa6..6e9b2aea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,7 +13,7 @@ buildscript { dependencies { classpath("io.nlopez.compose.rules:ktlint:0.4.17") - classpath("com.android.tools.build:gradle:8.7.0") + classpath("com.android.tools.build:gradle:8.13.2") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0") classpath("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.8") classpath("org.jlleitschuh.gradle:ktlint-gradle:12.1.1") diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0d8f4d4e..b94a71a3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue Jan 04 09:48:27 CET 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME