commit 1e27eecbf92962fa93ef22032fcc75e95a2876bf Author: SLINIcraftet204 Date: Sat Feb 8 13:37:26 2025 +0100 First Push includes TODO 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