Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions templates/Custom-Keyboard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# The bundle and its provenance record are generated by the publish workflow.
# Neither is ever committed — see templates/README.md, "Build provenance".
*.cgt
cgt-build.properties
83 changes: 83 additions & 0 deletions templates/Custom-Keyboard/CustomKeyboard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Built application files
*.apk
*.aar
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
/bin/
/gen/
/out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# Gradle files
.gradle/
/build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/

# Google Services (e.g. APIs or Firebase)
# google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# Version control
vcs.xml

# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
1 change: 1 addition & 0 deletions templates/Custom-Keyboard/CustomKeyboard/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
149 changes: 149 additions & 0 deletions templates/Custom-Keyboard/CustomKeyboard/app/build.gradle.kts.peb
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@

import java.util.Properties
import java.io.FileInputStream

plugins {
alias(libs.plugins.android.application)
}

val keystorePropsFile = rootProject.file("release.properties")
val keystoreProps = Properties()

if (keystorePropsFile.exists()) {
keystoreProps.load(FileInputStream(keystorePropsFile))
}

val hasValidSigningProps = keystorePropsFile.exists().also { exists ->
if (exists) {
FileInputStream(keystorePropsFile).use { keystoreProps.load(it) }
}
}.let {
listOf("storeFile", "storePassword",
"keyAlias", "keyPassword").all { key ->
keystoreProps[key] != null
}
}


android {
namespace = "${{PACKAGE_NAME}}"
compileSdk = ${{COMPILE_SDK}}

// disable linter
lint {
checkReleaseBuilds = false
}

signingConfigs {
if (hasValidSigningProps) {
create("release") {
storeFile = rootProject.file(keystoreProps["storeFile"] as String)
storePassword = keystoreProps["storePassword"] as String
keyAlias = keystoreProps["keyAlias"] as String
keyPassword = keystoreProps["keyPassword"] as String
}
}
}

defaultConfig {
applicationId = "${{PACKAGE_NAME}}"
minSdk = ${{MIN_SDK}}
targetSdk = ${{TARGET_SDK}}
versionCode = 1
versionName = "1.0"

vectorDrawables {
useSupportLibrary = true
}
}

compileOptions {
sourceCompatibility = ${{JAVA_SOURCE_COMPAT}}
targetCompatibility = ${{JAVA_TARGET_COMPAT}}
}

buildTypes {
release {
if (hasValidSigningProps) {
signingConfig = signingConfigs.getByName("release")
}
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}

buildFeatures {
viewBinding = true

}
packaging {
resources {
resources.excludes.add("/META-INF/{AL2.0,LGPL2.1}")
resources.excludes.add("META-INF/kotlinx_coroutines_core.version")

// The part below is only needed for compose builds.
// This packaging block is required to solve interdependency conflicts.
// They arise only when using local maven repo, so I suppose online repos have some way of solving such issues.

// Caused by: com.android.builder.merge.DuplicateRelativeFileException: 4 files found with path 'commonMain/default/linkdata/module' from inputs:
// - AndroidIDE\libs_source\gradle\localMvnRepository\androidx\collection\collection\1.4.2\collection-1.4.2.jar
// - AndroidIDE\libs_source\gradle\localMvnRepository\androidx\lifecycle\lifecycle-common\2.8.7\lifecycle-common-2.8.7.jar
// - AndroidIDE\libs_source\gradle\localMvnRepository\androidx\annotation\annotation\1.8.1\annotation-1.8.1.jar
// - AndroidIDE\libs_source\gradle\localMvnRepository\org\jetbrains\kotlinx\kotlinx-coroutines-core\1.7.3\kotlinx-coroutines-core-1.7.3.jar
// And some others.
resources.pickFirsts.add("nonJvmMain/default/linkdata/package_androidx/0_androidx.knm")
resources.pickFirsts.add("nonJvmMain/default/linkdata/root_package/0_.knm")
resources.pickFirsts.add("nonJvmMain/default/linkdata/module")

resources.pickFirsts.add("nativeMain/default/linkdata/root_package/0_.knm")
resources.pickFirsts.add("nativeMain/default/linkdata/module")

resources.pickFirsts.add("commonMain/default/linkdata/root_package/0_.knm")
resources.pickFirsts.add("commonMain/default/linkdata/module")
resources.pickFirsts.add("commonMain/default/linkdata/package_androidx/0_androidx.knm")

resources.pickFirsts.add("META-INF/kotlin-project-structure-metadata.json")

resources.merges.add("commonMain/default/manifest")
resources.merges.add("nonJvmMain/default/manifest")
resources.merges.add("nativeMain/default/manifest")
}
}

configurations.all {
resolutionStrategy {
// Force the use of Kotlin stdlib 1.9.22 for all modules
force("org.jetbrains.kotlin:kotlin-stdlib:${{KOTLIN_VERSION}}")
force("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${{KOTLIN_VERSION}}")
force("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${{KOTLIN_VERSION}}")

// Force specific AndroidX versions to avoid conflicts
force("androidx.collection:collection:1.4.2")
force("androidx.annotation:annotation:1.8.1")
force("androidx.core:core-ktx:1.8.0")
force("androidx.lifecycle:lifecycle-runtime-ktx:2.3.1")
force("androidx.collection:collection-ktx:1.4.2")
}
}
}

tasks.withType<JavaCompile> {
options.compilerArgs.add("-Xlint:deprecation")
}

kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget("${{JAVA_TARGET}}"))
}
}


dependencies {


implementation(libs.androidx.appcompat)
implementation(libs.androidx.constraintlayout)
implementation(libs.android.material)
implementation(libs.androidx.startup.runtime)
implementation(libs.androidx.interpolator)
}
21 changes: 21 additions & 0 deletions templates/Custom-Keyboard/CustomKeyboard/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>

<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name="MainActivity"
android:exported="true">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- The keyboard. Only the system may bind to it, through BIND_INPUT_METHOD. -->
<service
android:name="KeyboardService"
android:exported="true"
android:label="@string/app_name"
android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
<action
android:name="android.view.InputMethod" />
</intent-filter>
<meta-data
android:name="android.view.im"
android:resource="@xml/method" />
</service>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "English",
"shortName": "EN",
"locale": "en-US",
"autoCapitalize": true,
"layers": {
"main": [
["q", "w", {"output": "e", "popup": ["é", "è", "ê", "ë"]}, "r", "t", "y",
{"output": "u", "popup": ["ú", "ü", "û"]}, {"output": "i", "popup": ["í", "ï", "î"]},
{"output": "o", "popup": ["ó", "ö", "ô"]}, "p"],
[{"output": "a", "popup": ["á", "à", "â", "ä"]}, "s", "d", "f", "g", "h", "j", "k", "l"],
[{"type": "shift", "width": 1.5}, "z", "x", {"output": "c", "popup": ["ç"]}, "v", "b",
{"output": "n", "popup": ["ñ"]}, "m", {"type": "backspace", "width": 1.5}],
[{"type": "symbols", "width": 1.5}, {"type": "language"}, ",", {"type": "space", "width": 4},
{"output": ".", "popup": ["?", "!", "'", "\""]}, {"type": "enter", "width": 1.5}]
],
"symbols": [
["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"],
["@", "#", "$", "%", "&", "-", "+", "(", ")", "/"],
["*", "\"", "'", ":", ";", "!", "?", "_", {"type": "backspace", "width": 2}],
[{"type": "letters", "width": 1.5}, {"type": "language"}, ",", {"type": "space", "width": 4},
".", {"type": "enter", "width": 1.5}]
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "हिन्दी",
"shortName": "हि",
"locale": "hi-IN",
"layers": {
"main": [
["ा", "ि", "ी", {"output": "ु", "popup": ["ृ"]}, "ू", {"output": "े", "popup": ["ॅ"]}, "ै",
{"output": "ो", "popup": ["ॉ"]}, "ौ", {"output": "ं", "popup": ["ँ", "ः"]}, "्"],
[{"output": "क", "popup": ["क़", "क्ष"]}, {"output": "ख", "popup": ["ख़"]}, {"output": "ग", "popup": ["ग़"]},
"घ", "ङ", "च", "छ", {"output": "ज", "popup": ["ज़", "ज्ञ"]}, "झ", "ञ", "ट"],
["ठ", {"output": "ड", "popup": ["ड़"]}, {"output": "ढ", "popup": ["ढ़"]}, "ण", {"output": "त", "popup": ["त्र"]},
"थ", "द", "ध", "न", "प", {"output": "फ", "popup": ["फ़"]}],
[{"type": "shift"}, "ब", "भ", "म", "य", {"output": "र", "popup": ["ऋ"]}, "ल", "व",
{"output": "स", "popup": ["श", "ष", "श्र"]}, "ह", {"type": "backspace"}],
[{"type": "symbols", "width": 1.5}, {"type": "language", "width": 1.5}, {"type": "space", "width": 5},
{"output": "।", "popup": ["॥", ",", ".", "?"]}, {"type": "enter", "width": 2}]
],
"shift": [
["अ", "आ", "इ", "ई", "उ", "ऊ", "ए", "ऐ", "ओ", "औ", "ऋ"],
["क्ष", "त्र", "ज्ञ", "श्र", "श", "ष", "ऑ", "ॅ", "ॉ", "ँ", "ः"],
["क़", "ख़", "ग़", "ज़", "ड़", "ढ़", "फ़", "़", "ृ", "ॐ", "ऽ"],
[{"type": "shift"}, "।", "॥", ",", ".", "?", "!", "-", "'", {"type": "backspace"}],
[{"type": "symbols", "width": 1.5}, {"type": "language", "width": 1.5}, {"type": "space", "width": 5},
"।", {"type": "enter", "width": 2}]
],
"symbols": [
[{"output": "1", "popup": ["१"]}, {"output": "2", "popup": ["२"]}, {"output": "3", "popup": ["३"]},
{"output": "4", "popup": ["४"]}, {"output": "5", "popup": ["५"]}, {"output": "6", "popup": ["६"]},
{"output": "7", "popup": ["७"]}, {"output": "8", "popup": ["८"]}, {"output": "9", "popup": ["९"]},
{"output": "0", "popup": ["०"]}],
["@", "#", "₹", "%", "&", "-", "+", "(", ")", "/"],
["*", "\"", "'", ":", ";", "!", "?", "_", {"type": "backspace", "width": 2}],
[{"type": "letters", "label": "कखग", "width": 1.5}, {"type": "language"}, ",", {"type": "space", "width": 4},
"।", {"type": "enter", "width": 1.5}]
]
}
}
Loading
Loading