From 1e27eecbf92962fa93ef22032fcc75e95a2876bf Mon Sep 17 00:00:00 2001 From: SLINIcraftet204 Date: Sat, 8 Feb 2025 13:37:26 +0100 Subject: [PATCH] First Push includes TODO --- app/build.gradle.kts | 46 +++++ app/proguard-rules.pro | 21 +++ .../tttgames/oneko/ExampleInstrumentedTest.kt | 24 +++ app/src/main/AndroidManifest.xml | 16 ++ .../slini204/tttgames/oneko/MainActivity.kt | 85 +++++++++ .../slini204/tttgames/oneko/OverlayService.kt | 53 ++++++ .../slini204/tttgames/oneko/SetupActivity.kt | 14 ++ .../res/drawable/ic_launcher_background.xml | 170 ++++++++++++++++++ .../res/drawable/ic_launcher_foreground.xml | 30 ++++ app/src/main/res/drawable/ic_settings.xml | 10 ++ app/src/main/res/layout/activity_main.xml | 55 ++++++ app/src/main/res/layout/activity_setup.xml | 15 ++ app/src/main/res/menu/menu_main.xml | 9 + .../main/res/mipmap-anydpi/ic_launcher.xml | 6 + .../res/mipmap-anydpi/ic_launcher_round.xml | 6 + app/src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 0 -> 1404 bytes .../res/mipmap-hdpi/ic_launcher_round.webp | Bin 0 -> 2898 bytes app/src/main/res/mipmap-mdpi/ic_launcher.webp | Bin 0 -> 982 bytes .../res/mipmap-mdpi/ic_launcher_round.webp | Bin 0 -> 1772 bytes .../main/res/mipmap-xhdpi/ic_launcher.webp | Bin 0 -> 1900 bytes .../res/mipmap-xhdpi/ic_launcher_round.webp | Bin 0 -> 3918 bytes .../main/res/mipmap-xxhdpi/ic_launcher.webp | Bin 0 -> 2884 bytes .../res/mipmap-xxhdpi/ic_launcher_round.webp | Bin 0 -> 5914 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin 0 -> 3844 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin 0 -> 7778 bytes app/src/main/res/values-night/ids.xml | 10 ++ app/src/main/res/values-night/themes.xml | 16 ++ app/src/main/res/values/colors.xml | 10 ++ app/src/main/res/values/ids.xml | 10 ++ app/src/main/res/values/strings.xml | 3 + app/src/main/res/values/themes.xml | 16 ++ app/src/main/res/xml/backup_rules.xml | 13 ++ .../main/res/xml/data_extraction_rules.xml | 19 ++ .../tttgames/oneko/ExampleUnitTest.kt | 17 ++ build.gradle.kts | 5 + gradle.properties | 23 +++ gradle/libs.versions.toml | 22 +++ gradle/wrapper/gradle-wrapper.properties | 6 + settings.gradle.kts | 24 +++ 39 files changed, 754 insertions(+) create mode 100644 app/build.gradle.kts create mode 100644 app/proguard-rules.pro create mode 100644 app/src/androidTest/java/at/slini204/tttgames/oneko/ExampleInstrumentedTest.kt create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/java/at/slini204/tttgames/oneko/MainActivity.kt create mode 100644 app/src/main/java/at/slini204/tttgames/oneko/OverlayService.kt create mode 100644 app/src/main/java/at/slini204/tttgames/oneko/SetupActivity.kt create mode 100644 app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 app/src/main/res/drawable/ic_launcher_foreground.xml create mode 100644 app/src/main/res/drawable/ic_settings.xml create mode 100644 app/src/main/res/layout/activity_main.xml create mode 100644 app/src/main/res/layout/activity_setup.xml create mode 100644 app/src/main/res/menu/menu_main.xml create mode 100644 app/src/main/res/mipmap-anydpi/ic_launcher.xml create mode 100644 app/src/main/res/mipmap-anydpi/ic_launcher_round.xml create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/values-night/ids.xml create mode 100644 app/src/main/res/values-night/themes.xml create mode 100644 app/src/main/res/values/colors.xml create mode 100644 app/src/main/res/values/ids.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/themes.xml create mode 100644 app/src/main/res/xml/backup_rules.xml create mode 100644 app/src/main/res/xml/data_extraction_rules.xml create mode 100644 app/src/test/java/at/slini204/tttgames/oneko/ExampleUnitTest.kt create mode 100644 build.gradle.kts create mode 100644 gradle.properties create mode 100644 gradle/libs.versions.toml create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 settings.gradle.kts diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..72aa3e5 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,46 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) +} + +android { + namespace = "at.slini204.tttgames.oneko" + compileSdk = 35 + + defaultConfig { + applicationId = "at.slini204.tttgames.oneko" + minSdk = 30 + targetSdk = 35 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" + } +} + +dependencies { + + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) + implementation(libs.material) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -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 \ No newline at end of file diff --git a/app/src/androidTest/java/at/slini204/tttgames/oneko/ExampleInstrumentedTest.kt b/app/src/androidTest/java/at/slini204/tttgames/oneko/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..de9008d --- /dev/null +++ b/app/src/androidTest/java/at/slini204/tttgames/oneko/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package at.slini204.tttgames.oneko + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("at.slini204.tttgames.oneko", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..1378819 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/java/at/slini204/tttgames/oneko/MainActivity.kt b/app/src/main/java/at/slini204/tttgames/oneko/MainActivity.kt new file mode 100644 index 0000000..f099945 --- /dev/null +++ b/app/src/main/java/at/slini204/tttgames/oneko/MainActivity.kt @@ -0,0 +1,85 @@ +package at.slini204.tttgames.oneko + +import android.content.Intent +import android.os.Bundle +import android.provider.Settings +import android.text.Editable +import android.text.TextWatcher +import android.widget.Button +import android.widget.EditText +import android.widget.SeekBar +import android.widget.Toast +import androidx.appcompat.app.AppCompatActivity + +class MainActivity : AppCompatActivity() { + + private lateinit var commandInput: EditText + private lateinit var speedSlider: SeekBar + private lateinit var speedInput: EditText + private lateinit var startButton: Button + private var selectedAnimal: String = "cat" // Standard Companion + private val REQUEST_CODE_OVERLAY_PERMISSION = 1001 // Für Overlay-Berechtigung + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + + // Überprüfe, ob die Overlay-Berechtigung vorhanden ist + if (!Settings.canDrawOverlays(this)) { + val intent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION) + startActivityForResult(intent, REQUEST_CODE_OVERLAY_PERMISSION) + } + + commandInput = findViewById(R.id.commandInput) + speedSlider = findViewById(R.id.speedSlider) + speedInput = findViewById(R.id.speedInput) + startButton = findViewById(R.id.startButton) + + // Tierauswahl (Buttons) + findViewById