commit 0f5846950475e238f85c9e347f415bbc17d0d474 Author: Hans-Michael Gläß Date: Thu Jul 23 20:19:07 2026 +0200 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/AndroidProjectSystem.xml b/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..7643783 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,123 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..ca16a99 --- /dev/null +++ b/.idea/deploymentTargetSelector.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..cdbc250 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..a4f09e2 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..7bdef35 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,43 @@ +# AGENTS.md + +## Project + +Single-module Android app (Kotlin, XML layouts). Namespace: `de.hmg.mybudgetbook`. +minSdk 24, targetSdk 36, Java 11 source compat. + +## Build & Test Commands + +```bash +./gradlew assembleDebug # build debug APK +./gradlew testDebugUnitTest # unit tests +./gradlew connectedDebugAndroidTest # instrumented tests (device/emulator required) +./gradlew lint # lint check +``` + +No compose, no codegen, no custom Gradle tasks. Standard Android project — `./gradlew` is all you need. + +## Structure + +- `app/` — sole module, all source lives here +- Source: `app/src/main/java/de/hmg/mybudgetbook/` +- Resources: `app/src/main/res/` +- Dependencies managed via version catalog: `gradle/libs.versions.toml` + +## App Purpose (Domain Context) + +Personal household budget book ("Haushaltsbuch") for tracking income and expenses. + +Core concepts: +- **Konten** (accounts) — user-created, transactions belong to an account +- **Kategorien** (categories) — for both income and expenses +- **Transaktionen** — entries with amount, date, category, account; two flow types: + - **Einnahmen** (income) — increases account balance + - **Ausgaben** (expenses) — decreases account balance +- **Fixkosten** (fixed amounts) — recurring expenses bound to a category; alarm when category total exceeds the limit + +## Key Details + +- AGP 9.2.1, Gradle daemon JVM toolchain version 21 +- Configuration cache enabled (`org.gradle.configuration-cache=true`) +- Release build type has optimization disabled (proguard off) +- Edge-to-edge enabled in MainActivity; inset handling via `WindowInsetsCompat` diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..41eea92 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + alias(libs.plugins.android.application) +} + +android { + namespace = "de.hmg.mybudgetbook" + compileSdk { + version = release(36) { + minorApiLevel = 1 + } + } + + defaultConfig { + applicationId = "de.hmg.mybudgetbook" + minSdk = 24 + targetSdk = 36 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + optimization { + enable = false + } + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } +} + +dependencies { + implementation(libs.androidx.activity.ktx) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.constraintlayout) + implementation(libs.androidx.core.ktx) + implementation(libs.material) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.espresso.core) + androidTestImplementation(libs.androidx.junit) +} \ No newline at end of file diff --git a/app/src/androidTest/java/de/hmg/mybudgetbook/ExampleInstrumentedTest.kt b/app/src/androidTest/java/de/hmg/mybudgetbook/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..4f8287e --- /dev/null +++ b/app/src/androidTest/java/de/hmg/mybudgetbook/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package de.hmg.mybudgetbook + +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("de.hmg.mybudgetbook", 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..cbbebb4 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/de/hmg/mybudgetbook/Account.kt b/app/src/main/java/de/hmg/mybudgetbook/Account.kt new file mode 100644 index 0000000..8d6505b --- /dev/null +++ b/app/src/main/java/de/hmg/mybudgetbook/Account.kt @@ -0,0 +1,7 @@ +package de.hmg.mybudgetbook + +data class Account( + val id: Long, + val name: String, + val balance: Double = 0.0 +) diff --git a/app/src/main/java/de/hmg/mybudgetbook/AccountFactory.kt b/app/src/main/java/de/hmg/mybudgetbook/AccountFactory.kt new file mode 100644 index 0000000..f92a2c1 --- /dev/null +++ b/app/src/main/java/de/hmg/mybudgetbook/AccountFactory.kt @@ -0,0 +1,13 @@ +package de.hmg.mybudgetbook + +class AccountFactory { + private var nextId: Long = 1L + + fun create(name: String, initialBalance: Double = 0.0): Account { + return Account( + id = nextId++, + name = name, + balance = initialBalance + ) + } +} diff --git a/app/src/main/java/de/hmg/mybudgetbook/Category.kt b/app/src/main/java/de/hmg/mybudgetbook/Category.kt new file mode 100644 index 0000000..767cfed --- /dev/null +++ b/app/src/main/java/de/hmg/mybudgetbook/Category.kt @@ -0,0 +1,6 @@ +package de.hmg.mybudgetbook + +data class Category( + val id: Long, + val name: String +) diff --git a/app/src/main/java/de/hmg/mybudgetbook/CategoryFactory.kt b/app/src/main/java/de/hmg/mybudgetbook/CategoryFactory.kt new file mode 100644 index 0000000..ecf32d0 --- /dev/null +++ b/app/src/main/java/de/hmg/mybudgetbook/CategoryFactory.kt @@ -0,0 +1,12 @@ +package de.hmg.mybudgetbook + +class CategoryFactory { + private var nextId: Long = 1L + + fun create(name: String): Category { + return Category( + id = nextId++, + name = name + ) + } +} diff --git a/app/src/main/java/de/hmg/mybudgetbook/FixedCost.kt b/app/src/main/java/de/hmg/mybudgetbook/FixedCost.kt new file mode 100644 index 0000000..9e538af --- /dev/null +++ b/app/src/main/java/de/hmg/mybudgetbook/FixedCost.kt @@ -0,0 +1,9 @@ +package de.hmg.mybudgetbook + +data class FixedCost( + val id: Long, + val name: String, + val amount: Double, + val category: Category, + val interval: PaymentInterval +) diff --git a/app/src/main/java/de/hmg/mybudgetbook/FixedCostFactory.kt b/app/src/main/java/de/hmg/mybudgetbook/FixedCostFactory.kt new file mode 100644 index 0000000..a4cc0c9 --- /dev/null +++ b/app/src/main/java/de/hmg/mybudgetbook/FixedCostFactory.kt @@ -0,0 +1,20 @@ +package de.hmg.mybudgetbook + +class FixedCostFactory { + private var nextId: Long = 1L + + fun create( + name: String, + amount: Double, + category: Category, + interval: PaymentInterval + ): FixedCost { + return FixedCost( + id = nextId++, + name = name, + amount = amount, + category = category, + interval = interval + ) + } +} diff --git a/app/src/main/java/de/hmg/mybudgetbook/MainActivity.kt b/app/src/main/java/de/hmg/mybudgetbook/MainActivity.kt new file mode 100644 index 0000000..55ae384 --- /dev/null +++ b/app/src/main/java/de/hmg/mybudgetbook/MainActivity.kt @@ -0,0 +1,20 @@ +package de.hmg.mybudgetbook + +import android.os.Bundle +import androidx.activity.enableEdgeToEdge +import androidx.appcompat.app.AppCompatActivity +import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat + +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContentView(R.layout.activity_main) + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets -> + val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom) + insets + } + } +} \ No newline at end of file diff --git a/app/src/main/java/de/hmg/mybudgetbook/PaymentInterval.kt b/app/src/main/java/de/hmg/mybudgetbook/PaymentInterval.kt new file mode 100644 index 0000000..86aeda4 --- /dev/null +++ b/app/src/main/java/de/hmg/mybudgetbook/PaymentInterval.kt @@ -0,0 +1,9 @@ +package de.hmg.mybudgetbook + +enum class PaymentInterval { + WEEKLY, + MONTHLY, + QUARTERLY, + SEMI_ANNUALLY, + ANNUALLY +} diff --git a/app/src/main/keepRules/rules.keep b/app/src/main/keepRules/rules.keep new file mode 100644 index 0000000..d7e081a --- /dev/null +++ b/app/src/main/keepRules/rules.keep @@ -0,0 +1,12 @@ +# Add project specific R8 rules here. +# AGP will combine all keep rule files in src/main/keepRules to pass to R8 +# +# For more details, see +# https://d.android.com/r/tools/r8/keep-rules + +# 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 *; +#} \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..86a5d97 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..19b353f --- /dev/null +++ b/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ + + + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..e8ef77e --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + MyBudgetBook + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..3de05a9 --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ + + + + +