diff --git a/.gitignore b/.gitignore
index 79c113f..aa724b7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,45 +1,15 @@
-# Miscellaneous
-*.class
-*.log
-*.pyc
-*.swp
-.DS_Store
-.atom/
-.build/
-.buildlog/
-.history
-.svn/
-.swiftpm/
-migrate_working_dir/
-
-# IntelliJ related
*.iml
-*.ipr
-*.iws
-.idea/
-
-# The .vscode folder contains launch configuration and tasks you configure in
-# VS Code which you may wish to be included in version control, so this line
-# is commented out by default.
-#.vscode/
-
-# Flutter/Dart/Pub related
-**/doc/api/
-**/ios/Flutter/.last_build_id
-.dart_tool/
-.flutter-plugins
-.flutter-plugins-dependencies
-.pub-cache/
-.pub/
-/build/
-
-# Symbolication related
-app.*.symbols
-
-# Obfuscation related
-app.*.map.json
-
-# Android Studio will place build artifacts here
-/android/app/debug
-/android/app/profile
-/android/app/release
+.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/.metadata b/.metadata
deleted file mode 100644
index d77a4e0..0000000
--- a/.metadata
+++ /dev/null
@@ -1,45 +0,0 @@
-# This file tracks properties of this Flutter project.
-# Used by Flutter tool to assess capabilities and perform upgrades etc.
-#
-# This file should be version controlled and should not be manually edited.
-
-version:
- revision: "c23637390482d4cf9598c3ce3f2be31aa7332daf"
- channel: "stable"
-
-project_type: app
-
-# Tracks metadata for the flutter migrate command
-migration:
- platforms:
- - platform: root
- create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- - platform: android
- create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- - platform: ios
- create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- - platform: linux
- create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- - platform: macos
- create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- - platform: web
- create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- - platform: windows
- create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
- base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
-
- # User provided section
-
- # List of Local paths (relative to this file) that should be
- # ignored by the migrate tool.
- #
- # Files that are not part of the templates will be ignored by default.
- unmanaged_files:
- - 'lib/main.dart'
- - 'ios/Runner.xcodeproj/project.pbxproj'
diff --git a/Icon.jpeg b/Icon.jpeg
new file mode 100644
index 0000000..eb3f70d
Binary files /dev/null and b/Icon.jpeg differ
diff --git a/README.md b/README.md
deleted file mode 100644
index 0f553a3..0000000
--- a/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# kettlebell_tracker
-
-A new Flutter project.
-
-## Getting Started
-
-This project is a starting point for a Flutter application.
-
-A few resources to get you started if this is your first Flutter project:
-
-- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
-- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
-
-For help getting started with Flutter development, view the
-[online documentation](https://docs.flutter.dev/), which offers tutorials,
-samples, guidance on mobile development, and a full API reference.
diff --git a/analysis_options.yaml b/analysis_options.yaml
deleted file mode 100644
index 0d29021..0000000
--- a/analysis_options.yaml
+++ /dev/null
@@ -1,28 +0,0 @@
-# This file configures the analyzer, which statically analyzes Dart code to
-# check for errors, warnings, and lints.
-#
-# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
-# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
-# invoked from the command line by running `flutter analyze`.
-
-# The following line activates a set of recommended lints for Flutter apps,
-# packages, and plugins designed to encourage good coding practices.
-include: package:flutter_lints/flutter.yaml
-
-linter:
- # The lint rules applied to this project can be customized in the
- # section below to disable rules from the `package:flutter_lints/flutter.yaml`
- # included above or to enable additional rules. A list of all available lints
- # and their documentation is published at https://dart.dev/lints.
- #
- # Instead of disabling a lint rule for the entire project in the
- # section below, it can also be suppressed for a single line of code
- # or a specific dart file by using the `// ignore: name_of_lint` and
- # `// ignore_for_file: name_of_lint` syntax on the line or in the file
- # producing the lint.
- rules:
- # avoid_print: false # Uncomment to disable the `avoid_print` rule
- # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
-
-# Additional information about this file can be found at
-# https://dart.dev/guides/language/analysis-options
diff --git a/android/.gitignore b/android/.gitignore
deleted file mode 100644
index be3943c..0000000
--- a/android/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-gradle-wrapper.jar
-/.gradle
-/captures/
-/gradlew
-/gradlew.bat
-/local.properties
-GeneratedPluginRegistrant.java
-.cxx/
-
-# Remember to never publicly share your keystore.
-# See https://flutter.dev/to/reference-keystore
-key.properties
-**/*.keystore
-**/*.jks
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
deleted file mode 100644
index 2bd1da9..0000000
--- a/android/app/build.gradle.kts
+++ /dev/null
@@ -1,45 +0,0 @@
-plugins {
- id("com.android.application")
- id("kotlin-android")
- // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
- id("dev.flutter.flutter-gradle-plugin")
-}
-
-android {
- namespace = "com.example.kettlebell_tracker"
- compileSdk = flutter.compileSdkVersion
- // ndkVersion = flutter.ndkVersion
- ndkVersion = "27.0.12077973"
-
- compileOptions {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
- }
-
- kotlinOptions {
- jvmTarget = JavaVersion.VERSION_11.toString()
- }
-
- defaultConfig {
- // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId = "com.example.kettlebell_tracker"
- // You can update the following values to match your application needs.
- // For more information, see: https://flutter.dev/to/review-gradle-config.
- minSdk = flutter.minSdkVersion
- targetSdk = flutter.targetSdkVersion
- versionCode = flutter.versionCode
- versionName = flutter.versionName
- }
-
- buildTypes {
- release {
- // TODO: Add your own signing config for the release build.
- // Signing with the debug keys for now, so `flutter run --release` works.
- signingConfig = signingConfigs.getByName("debug")
- }
- }
-}
-
-flutter {
- source = "../.."
-}
diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml
deleted file mode 100644
index 399f698..0000000
--- a/android/app/src/debug/AndroidManifest.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
deleted file mode 100644
index f577157..0000000
--- a/android/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/app/src/main/kotlin/com/example/kettlebell_tracker/MainActivity.kt b/android/app/src/main/kotlin/com/example/kettlebell_tracker/MainActivity.kt
deleted file mode 100644
index a5c0748..0000000
--- a/android/app/src/main/kotlin/com/example/kettlebell_tracker/MainActivity.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.example.kettlebell_tracker
-
-import io.flutter.embedding.android.FlutterActivity
-
-class MainActivity : FlutterActivity()
diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml
deleted file mode 100644
index f74085f..0000000
--- a/android/app/src/main/res/drawable-v21/launch_background.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml
deleted file mode 100644
index 304732f..0000000
--- a/android/app/src/main/res/drawable/launch_background.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index db77bb4..0000000
Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index 17987b7..0000000
Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index 09d4391..0000000
Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index d5f1c8d..0000000
Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index 4d6372e..0000000
Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ
diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml
deleted file mode 100644
index 06952be..0000000
--- a/android/app/src/main/res/values-night/styles.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml
deleted file mode 100644
index cb1ef88..0000000
--- a/android/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml
deleted file mode 100644
index 399f698..0000000
--- a/android/app/src/profile/AndroidManifest.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
diff --git a/android/build.gradle.kts b/android/build.gradle.kts
deleted file mode 100644
index 89176ef..0000000
--- a/android/build.gradle.kts
+++ /dev/null
@@ -1,21 +0,0 @@
-allprojects {
- repositories {
- google()
- mavenCentral()
- }
-}
-
-val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
-rootProject.layout.buildDirectory.value(newBuildDir)
-
-subprojects {
- val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
- project.layout.buildDirectory.value(newSubprojectBuildDir)
-}
-subprojects {
- project.evaluationDependsOn(":app")
-}
-
-tasks.register("clean") {
- delete(rootProject.layout.buildDirectory)
-}
diff --git a/android/gradle.properties b/android/gradle.properties
deleted file mode 100644
index f018a61..0000000
--- a/android/gradle.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
-android.useAndroidX=true
-android.enableJetifier=true
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index afa1e8e..0000000
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts
deleted file mode 100644
index a439442..0000000
--- a/android/settings.gradle.kts
+++ /dev/null
@@ -1,25 +0,0 @@
-pluginManagement {
- val flutterSdkPath = run {
- val properties = java.util.Properties()
- file("local.properties").inputStream().use { properties.load(it) }
- val flutterSdkPath = properties.getProperty("flutter.sdk")
- require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
- flutterSdkPath
- }
-
- includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
-
- repositories {
- google()
- mavenCentral()
- gradlePluginPortal()
- }
-}
-
-plugins {
- id("dev.flutter.flutter-plugin-loader") version "1.0.0"
- id("com.android.application") version "8.7.0" apply false
- id("org.jetbrains.kotlin.android") version "1.8.22" apply false
-}
-
-include(":app")
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..ac4f03b
--- /dev/null
+++ b/app/build.gradle.kts
@@ -0,0 +1,205 @@
+//plugins {
+// id("com.android.application")
+// id("org.jetbrains.kotlin.android")
+// id("org.jetbrains.kotlin.plugin.compose")
+// id("kotlin-kapt")
+//}
+//
+//android {
+// namespace = "de.patani.kettlebelltracker"
+// compileSdk = 34
+//
+// defaultConfig {
+// applicationId = "de.patani.kettlebelltracker"
+// minSdk = 26
+// targetSdk = 34
+// versionCode = 1
+// versionName = "1.0"
+//
+// testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+// vectorDrawables {
+// useSupportLibrary = true
+// }
+// }
+//
+// buildTypes {
+// release {
+// isMinifyEnabled = false
+// proguardFiles(
+// getDefaultProguardFile("proguard-android-optimize.txt"),
+// "proguard-rules.pro"
+// )
+// }
+// }
+// compileOptions {
+// sourceCompatibility = JavaVersion.VERSION_1_8
+// targetCompatibility = JavaVersion.VERSION_1_8
+// }
+// kotlinOptions {
+// jvmTarget = "1.8"
+// }
+// buildFeatures {
+// compose = true
+// }
+// composeOptions {
+// kotlinCompilerExtensionVersion = "1.5.1"
+// }
+// packaging {
+// resources {
+// excludes += "/META-INF/{AL2.0,LGPL2.1}"
+// excludes += "org/intellij/lang/annotations/**"
+// }
+// }
+//}
+//
+//configurations {
+// all {
+// exclude(group = "com.intellij", module = "annotations")
+// }
+//}
+//
+//dependencies {
+// // Core
+// implementation("androidx.core:core-ktx:1.12.0")
+// implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
+// implementation("androidx.activity:activity-compose:1.8.2")
+//
+// // Compose
+// implementation(platform("androidx.compose:compose-bom:2023.08.00"))
+// implementation("androidx.compose.ui:ui")
+// implementation("androidx.compose.ui:ui-graphics")
+// implementation("androidx.compose.ui:ui-tooling-preview")
+// implementation("androidx.compose.material3:material3")
+// implementation("androidx.compose.material:material-icons-extended")
+//
+//
+// // Navigation
+// implementation("androidx.navigation:navigation-compose:2.7.6")
+//
+// // ViewModel
+// implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2")
+//
+// // Room (Database)
+// implementation("androidx.room:room-runtime:2.6.1")
+// implementation("androidx.room:room-ktx:2.6.1")
+// implementation(libs.androidx.room.common.jvm)
+// implementation(libs.androidx.room.compiler)
+// kapt("androidx.room:room-compiler:2.6.1")
+//
+// // DataStore (Settings)
+// implementation("androidx.datastore:datastore-preferences:1.0.0")
+//
+// // Retrofit (API)
+// implementation("com.squareup.retrofit2:retrofit:2.9.0")
+// implementation("com.squareup.retrofit2:converter-gson:2.9.0")
+//
+// // Hilt (Dependency Injection - Optional, but recommended)
+// // implementation("com.google.dagger:hilt-android:2.48")
+// // kapt("com.google.dagger:hilt-compiler:2.48")
+// // implementation("androidx.hilt:hilt-navigation-compose:1.1.0")
+//}
+plugins {
+ id("com.android.application")
+ id("org.jetbrains.kotlin.android")
+ id("org.jetbrains.kotlin.plugin.compose")
+ id("org.jetbrains.kotlin.kapt") // Wichtig: Hier auf 'org.jetbrains.kotlin.kapt' geändert
+}
+
+android {
+ namespace = "de.patani.kettlebelltracker"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "de.patani.kettlebelltracker"
+ minSdk = 26
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ vectorDrawables {
+ useSupportLibrary = true
+ }
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro"
+ )
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+ kotlinOptions {
+ jvmTarget = "1.8"
+ }
+ buildFeatures {
+ compose = true
+ }
+ composeOptions {
+ kotlinCompilerExtensionVersion = "1.5.1"
+ }
+ packaging {
+ resources {
+ excludes += "/META-INF/{AL2.0,LGPL2.1}"
+ excludes += "org/intellij/lang/annotations/**"
+ }
+ }
+}
+
+// Den 'configurations' Block entfernen, es sei denn, du benötigst ihn explizit für einen spezifischen Ausschluss.
+// Wenn du ihn absichtlich hinzugefügt hast, um ein bekanntes Problem zu lösen, kannst du ihn behalten.
+// Ansonsten kommentiere ihn aus oder entferne ihn:
+/*
+configurations {
+ all {
+ exclude(group = "com.intellij", module = "annotations")
+ }
+}
+*/
+
+dependencies {
+ // Core
+ implementation("androidx.core:core-ktx:1.12.0")
+ implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
+ implementation("androidx.activity:activity-compose:1.8.2")
+
+ // Compose
+ implementation(platform("androidx.compose:compose-bom:2023.08.00"))
+ implementation("androidx.compose.ui:ui")
+ implementation("androidx.compose.ui:ui-graphics")
+ implementation("androidx.compose.ui:ui-tooling-preview")
+ implementation("androidx.compose.material3:material3")
+ implementation("androidx.compose.material:material-icons-extended")
+
+ // Navigation
+ implementation("androidx.navigation:navigation-compose:2.7.6")
+
+ // ViewModel
+ implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2")
+
+ // Room (Database)
+ implementation("androidx.room:room-runtime:2.6.1")
+ implementation("androidx.room:room-ktx:2.6.1")
+ // Wichtig: Die folgenden Zeilen für den Room Compiler wurden entfernt/korrigiert!
+ // KEIN implementation("libs.androidx.room.common.jvm")
+ // KEIN implementation("libs.androidx.room.compiler")
+ kapt("androidx.room:room-compiler:2.6.1") // NUR diese Zeile für den Compiler!
+
+ // DataStore (Settings)
+ implementation("androidx.datastore:datastore-preferences:1.0.0")
+
+ // Retrofit (API)
+ implementation("com.squareup.retrofit2:retrofit:2.9.0")
+ implementation("com.squareup.retrofit2:converter-gson:2.9.0")
+
+ // Hilt (Dependency Injection - Optional, but recommended)
+ // implementation("com.google.dagger:hilt-android:2.48")
+ // kapt("com.google.dagger:hilt-compiler:2.48")
+ // implementation("androidx.hilt:hilt-navigation-compose:1.1.0")
+}
\ 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/de/patani/kettlebelltracker/ExampleInstrumentedTest.kt b/app/src/androidTest/java/de/patani/kettlebelltracker/ExampleInstrumentedTest.kt
new file mode 100644
index 0000000..4f6a8dd
--- /dev/null
+++ b/app/src/androidTest/java/de/patani/kettlebelltracker/ExampleInstrumentedTest.kt
@@ -0,0 +1,24 @@
+package de.patani.kettlebelltracker
+
+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.patani.kettlebelltracker", 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..f314948
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/de/patani/kettlebelltracker/MainActivity.kt b/app/src/main/java/de/patani/kettlebelltracker/MainActivity.kt
new file mode 100644
index 0000000..a6a7080
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/MainActivity.kt
@@ -0,0 +1,158 @@
+package de.patani.kettlebelltracker
+
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.*
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.ui.Modifier
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.ViewModelProvider
+import androidx.navigation.NavDestination.Companion.hierarchy
+import androidx.navigation.NavGraph.Companion.findStartDestination
+import androidx.navigation.compose.*
+import androidx.room.Room
+import de.patani.kettlebelltracker.data.datastore.SettingsDataStore
+import de.patani.kettlebelltracker.data.local.AppDatabase
+import de.patani.kettlebelltracker.repositories.ApiRepository
+import de.patani.kettlebelltracker.ui.navigation.Screen
+import de.patani.kettlebelltracker.ui.screens.*
+import de.patani.kettlebelltracker.ui.theme.KettlebellTrackerTheme
+import de.patani.kettlebelltracker.viewmodels.*
+import retrofit2.Retrofit
+import retrofit2.converter.gson.GsonConverterFactory
+import java.util.UUID
+import androidx.core.content.edit
+
+class MainActivity : ComponentActivity() {
+
+ private val db by lazy {
+ Room.databaseBuilder(applicationContext, AppDatabase::class.java, "kettlebell_tracker.db").build()
+ }
+ private val settingsDataStore by lazy { SettingsDataStore(applicationContext) }
+
+ private val apiService by lazy {
+ Retrofit.Builder()
+ .baseUrl("https://kb.patanix.de/")
+ .addConverterFactory(GsonConverterFactory.create())
+ .build()
+ .create(de.patani.kettlebelltracker.data.remote.ApiService::class.java)
+ }
+
+ private val apiRepository by lazy { ApiRepository(apiService) }
+
+ private val appUUID by lazy {
+ val prefs = getSharedPreferences("app_prefs", MODE_PRIVATE)
+ var uuid = prefs.getString("app_uuid", null)
+ if (uuid == null) {
+ uuid = UUID.randomUUID().toString()
+ prefs.edit { putString("app_uuid", uuid) }
+ }
+ uuid
+ }
+
+ private val trainingViewModel by lazy {
+ ViewModelProvider(this, createViewModelFactory(TrainingViewModel::class.java)).get(TrainingViewModel::class.java)
+ }
+
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContent {
+ KettlebellTrackerTheme {
+ App(createViewModelFactory = { modelClass -> createViewModelFactory(modelClass) })
+ }
+ }
+ }
+
+ @Suppress("UNCHECKED_CAST")
+ private fun createViewModelFactory(modelClass: Class): ViewModelProvider.Factory {
+ return object : ViewModelProvider.Factory {
+ override fun create(modelClass: Class): T {
+ return when {
+ modelClass.isAssignableFrom(TrainingViewModel::class.java) ->
+ TrainingViewModel(db.trainingSessionDao(), settingsDataStore, apiRepository,
+ appUUID
+ ) as T
+ modelClass.isAssignableFrom(HomeViewModel::class.java) ->
+ HomeViewModel(db.trainingSessionDao(), trainingViewModel) as T
+ modelClass.isAssignableFrom(HistoryViewModel::class.java) ->
+ HistoryViewModel(db.trainingSessionDao()) as T
+ modelClass.isAssignableFrom(SettingsViewModel::class.java) ->
+ SettingsViewModel(settingsDataStore) as T
+ else -> throw IllegalArgumentException("Unknown ViewModel class")
+ }
+ }
+ }
+ }
+}
+
+@Composable
+fun App(createViewModelFactory: (Class) -> ViewModelProvider.Factory) {
+ val navController = rememberNavController()
+ val screens = listOf(
+ Screen.Home,
+ Screen.Training,
+ Screen.History,
+ Screen.Settings
+ )
+
+ val sharedTrainingViewModel: TrainingViewModel =
+ androidx.lifecycle.viewmodel.compose.viewModel(factory = createViewModelFactory(TrainingViewModel::class.java))
+
+
+ Scaffold(
+ bottomBar = {
+ NavigationBar {
+ val navBackStackEntry by navController.currentBackStackEntryAsState()
+ val currentDestination = navBackStackEntry?.destination
+ screens.forEach { screen ->
+ NavigationBarItem(
+ icon = { Icon(screen.icon, contentDescription = null) },
+ label = { Text(screen.title) },
+ selected = currentDestination?.hierarchy?.any { it.route == screen.route } == true,
+ onClick = {
+ navController.navigate(screen.route) {
+ popUpTo(navController.graph.findStartDestination().id) {
+ saveState = true
+ }
+ launchSingleTop = true
+ restoreState = true
+ }
+ }
+ )
+ }
+ }
+ }
+ ) { innerPadding ->
+ NavHost(
+ navController,
+ startDestination = Screen.Home.route,
+ Modifier.padding(innerPadding)
+ ) {
+ composable(Screen.Home.route) {
+ val homeViewModel: HomeViewModel = androidx.lifecycle.viewmodel.compose.viewModel(factory = createViewModelFactory(HomeViewModel::class.java))
+ HomeScreen(
+ viewModel = homeViewModel,
+ onStartTrainingClicked = {
+ sharedTrainingViewModel.startTraining()
+ navController.navigate(Screen.Training.route)
+ }
+ )
+ }
+ composable(Screen.Training.route) {
+ TrainingScreen(viewModel = sharedTrainingViewModel)
+ }
+ composable(Screen.History.route) {
+ val historyViewModel: HistoryViewModel = androidx.lifecycle.viewmodel.compose.viewModel(factory = createViewModelFactory(HistoryViewModel::class.java))
+ HistoryScreen(viewModel = historyViewModel)
+ }
+ composable(Screen.Settings.route) {
+ val settingsViewModel: SettingsViewModel = androidx.lifecycle.viewmodel.compose.viewModel(factory = createViewModelFactory(SettingsViewModel::class.java))
+ SettingsScreen(viewModel = settingsViewModel)
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/data/datastore/SettingsDataStore.kt b/app/src/main/java/de/patani/kettlebelltracker/data/datastore/SettingsDataStore.kt
new file mode 100644
index 0000000..b6222ed
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/data/datastore/SettingsDataStore.kt
@@ -0,0 +1,54 @@
+package de.patani.kettlebelltracker.data.datastore
+
+import android.content.Context
+import androidx.datastore.core.DataStore
+import androidx.datastore.preferences.core.Preferences
+import androidx.datastore.preferences.core.doublePreferencesKey
+import androidx.datastore.preferences.core.edit
+import androidx.datastore.preferences.core.intPreferencesKey
+import androidx.datastore.preferences.core.stringPreferencesKey
+import androidx.datastore.preferences.preferencesDataStore
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.map
+
+val Context.dataStore: DataStore by preferencesDataStore(name = "settings")
+
+class SettingsDataStore(context: Context) {
+ private val dataStore = context.dataStore
+
+ companion object {
+ val TRAINING_TIME_MINUTES = intPreferencesKey("trainingTimeMinutes")
+ val WEIGHT_LEFT = doublePreferencesKey("weightLeft")
+ val WEIGHT_RIGHT = doublePreferencesKey("weightRight")
+ val GOAL_SETS = intPreferencesKey("goalSets")
+ val INITIAL_PROGRAM = stringPreferencesKey("initialProgram")
+ }
+
+ val settingsFlow: Flow = dataStore.data.map { preferences ->
+ Settings(
+ trainingTimeMinutes = preferences[TRAINING_TIME_MINUTES] ?: 20,
+ weightLeft = preferences[WEIGHT_LEFT] ?: 16.0,
+ weightRight = preferences[WEIGHT_RIGHT] ?: 16.0,
+ goalSets = preferences[GOAL_SETS] ?: 5,
+ initialProgram = preferences[INITIAL_PROGRAM] ?: "giant_1.0"
+ )
+ }
+
+ suspend fun saveSettings(settings: Settings) {
+ dataStore.edit { preferences ->
+ preferences[TRAINING_TIME_MINUTES] = settings.trainingTimeMinutes
+ preferences[WEIGHT_LEFT] = settings.weightLeft
+ preferences[WEIGHT_RIGHT] = settings.weightRight
+ preferences[GOAL_SETS] = settings.goalSets
+ preferences[INITIAL_PROGRAM] = settings.initialProgram
+ }
+ }
+}
+
+data class Settings(
+ val trainingTimeMinutes: Int,
+ val weightLeft: Double,
+ val weightRight: Double,
+ val goalSets: Int,
+ val initialProgram: String
+)
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/data/local/AppDatabase.kt b/app/src/main/java/de/patani/kettlebelltracker/data/local/AppDatabase.kt
new file mode 100644
index 0000000..087f901
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/data/local/AppDatabase.kt
@@ -0,0 +1,11 @@
+package de.patani.kettlebelltracker.data.local
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+import androidx.room.TypeConverters
+
+@Database(entities = [TrainingSession::class], version = 1, exportSchema = false)
+@TypeConverters(Converters::class)
+abstract class AppDatabase : RoomDatabase() {
+ abstract fun trainingSessionDao(): TrainingSessionDao
+}
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/data/local/Converters.kt b/app/src/main/java/de/patani/kettlebelltracker/data/local/Converters.kt
new file mode 100644
index 0000000..213a881
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/data/local/Converters.kt
@@ -0,0 +1,16 @@
+package de.patani.kettlebelltracker.data.local
+
+import androidx.room.TypeConverter
+import java.util.Date
+
+class Converters {
+ @TypeConverter
+ fun fromTimestamp(value: Long?): Date? {
+ return value?.let { Date(it) }
+ }
+
+ @TypeConverter
+ fun dateToTimestamp(date: Date?): Long? {
+ return date?.time
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/data/local/TrainingSession.kt b/app/src/main/java/de/patani/kettlebelltracker/data/local/TrainingSession.kt
new file mode 100644
index 0000000..ec91096
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/data/local/TrainingSession.kt
@@ -0,0 +1,19 @@
+package de.patani.kettlebelltracker.data.local
+
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+import java.util.Date
+
+@Entity(tableName = "training_session")
+data class TrainingSession(
+ @PrimaryKey(autoGenerate = true)
+ val id: Long = 0,
+ val date: Date,
+ val sets: Int,
+ val weightLeft: Double,
+ val weightRight: Double,
+ val repsPerSet: Int,
+ val duration: Long, // in seconds
+ val program: String,
+ val blockDay: Int
+)
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/data/local/TrainingSessionDao.kt b/app/src/main/java/de/patani/kettlebelltracker/data/local/TrainingSessionDao.kt
new file mode 100644
index 0000000..1772939
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/data/local/TrainingSessionDao.kt
@@ -0,0 +1,36 @@
+package de.patani.kettlebelltracker.data.local
+
+import androidx.room.Dao
+import androidx.room.Delete
+import androidx.room.Insert
+import androidx.room.OnConflictStrategy
+import androidx.room.Query
+import androidx.room.Update
+import kotlinx.coroutines.flow.Flow
+
+@Dao
+interface TrainingSessionDao {
+ @Query("SELECT * FROM training_session ORDER BY date DESC")
+ fun getAllSessions(): Flow>
+
+ @Query("SELECT * FROM training_session ORDER BY date DESC LIMIT 20")
+ fun getHistory(): Flow>
+
+ @Query("SELECT * FROM training_session ORDER BY date DESC LIMIT 1")
+ fun getLastSession(): Flow
+
+ @Query("SELECT COUNT(*) FROM training_session")
+ fun getTrainingCount(): Flow
+
+ @Insert(onConflict = OnConflictStrategy.REPLACE)
+ suspend fun insert(session: TrainingSession)
+
+ @Update
+ suspend fun update(session: TrainingSession)
+
+ @Delete
+ suspend fun delete(session: TrainingSession)
+
+ @Query("DELETE FROM training_session WHERE id = :sessionId")
+ suspend fun deleteById(sessionId: Long)
+}
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/data/remote/ApiService.kt b/app/src/main/java/de/patani/kettlebelltracker/data/remote/ApiService.kt
new file mode 100644
index 0000000..ff141cc
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/data/remote/ApiService.kt
@@ -0,0 +1,38 @@
+package de.patani.kettlebelltracker.data.remote
+
+import retrofit2.Response
+import retrofit2.http.Body
+import retrofit2.http.POST
+
+interface ApiService {
+ @POST("trainings")
+ suspend fun sendTrainingData(@Body payload: TrainingPayload): Response
+
+ @POST("trainings/recommend-rest")
+ suspend fun getRecommendedRest(@Body request: RestRecommendationRequest): Response>
+
+}
+
+data class RestRecommendationRequest(
+ val uuid: String,
+ val reps_per_set: Int,
+ val current_sets: Int
+)
+
+data class RestRecommendationResponse(
+ val recommended_rest_seconds: Int
+)
+
+data class ApiResponse(
+ val status: String,
+ val message: String?,
+ val data: T?
+)
+
+data class RestRecommendationData(
+ val recommended_rest: Int,
+ val expected_sets: Int,
+ val last_training_rest: Int?,
+ val last_training_sets: Int?,
+ val reasoning: String?
+)
diff --git a/app/src/main/java/de/patani/kettlebelltracker/data/remote/TrainingPayload.kt b/app/src/main/java/de/patani/kettlebelltracker/data/remote/TrainingPayload.kt
new file mode 100644
index 0000000..01ad4a1
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/data/remote/TrainingPayload.kt
@@ -0,0 +1,8 @@
+package de.patani.kettlebelltracker.data.remote
+
+data class TrainingPayload(
+ val reps: Int,
+ val rest: Double,
+ val sets: Int,
+ val uuid: String
+)
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/repositories/ApiRepository.kt b/app/src/main/java/de/patani/kettlebelltracker/repositories/ApiRepository.kt
new file mode 100644
index 0000000..d6f4768
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/repositories/ApiRepository.kt
@@ -0,0 +1,54 @@
+package de.patani.kettlebelltracker.repositories
+
+import android.util.Log
+import de.patani.kettlebelltracker.data.remote.TrainingPayload
+import de.patani.kettlebelltracker.data.remote.ApiService
+import de.patani.kettlebelltracker.data.remote.RestRecommendationData
+import de.patani.kettlebelltracker.data.remote.RestRecommendationRequest
+import de.patani.kettlebelltracker.data.remote.RestRecommendationResponse
+
+class ApiRepository(private val apiService: ApiService) {
+
+ suspend fun sendTrainingData(session: de.patani.kettlebelltracker.data.local.TrainingSession, uuid: String) {
+ try {
+ val rest = if (session.sets > 0) {
+ session.duration.toDouble() / session.sets.toDouble()
+ } else {
+ 0.0
+ }
+
+ val payload = TrainingPayload(
+ reps = session.repsPerSet,
+ rest = rest,
+ sets = session.sets,
+ uuid = uuid
+ )
+ val response = apiService.sendTrainingData(payload)
+ if (response.isSuccessful) {
+ Log.i("ApiRepository", "Training successfully sent to backend.")
+ } else {
+ Log.e("ApiRepository", "API Error: Unexpected status code: ${response.code()}")
+ }
+ } catch (e: Exception) {
+ Log.e("ApiRepository", "API Error: Failed to send training data", e)
+ }
+ }
+
+ suspend fun getRecommendedRest(uuid: String, repsPerSet: Int, currentSets: Int): RestRecommendationData? {
+ return try {
+ val request = RestRecommendationRequest(uuid, repsPerSet, currentSets)
+ val response = apiService.getRecommendedRest(request)
+ if (response.isSuccessful) {
+ Log.i("ApiRepository", "Got Rest Recommendation:")
+ val body = response.body()?.data
+ Log.i("ApiRepository", body.toString())
+ response.body()?.data
+ } else {
+ null
+ }
+ } catch (e: Exception) {
+ null
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/ui/navigation/Screen.kt b/app/src/main/java/de/patani/kettlebelltracker/ui/navigation/Screen.kt
new file mode 100644
index 0000000..b79bd02
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/ui/navigation/Screen.kt
@@ -0,0 +1,15 @@
+package de.patani.kettlebelltracker.ui.navigation
+
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.DateRange
+import androidx.compose.material.icons.filled.Home
+import androidx.compose.material.icons.filled.PlayArrow
+import androidx.compose.material.icons.filled.Settings
+import androidx.compose.ui.graphics.vector.ImageVector
+
+sealed class Screen(val route: String, val title: String, val icon: ImageVector) {
+ object Home : Screen("home", "Home", Icons.Default.Home)
+ object Training : Screen("training", "Training", Icons.Default.PlayArrow)
+ object History : Screen("history", "Historie", Icons.Default.DateRange)
+ object Settings : Screen("settings", "Einstellungen", Icons.Default.Settings)
+}
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/ui/screens/HistoryScreen.kt b/app/src/main/java/de/patani/kettlebelltracker/ui/screens/HistoryScreen.kt
new file mode 100644
index 0000000..ece7ac8
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/ui/screens/HistoryScreen.kt
@@ -0,0 +1,229 @@
+package de.patani.kettlebelltracker.ui.screens
+
+import androidx.compose.foundation.layout.*
+import androidx.compose.foundation.lazy.LazyColumn
+import androidx.compose.foundation.lazy.items
+import androidx.compose.foundation.text.KeyboardOptions
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Delete
+import androidx.compose.material3.*
+import androidx.compose.runtime.*
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.text.input.KeyboardType
+import androidx.compose.ui.unit.dp
+import de.patani.kettlebelltracker.viewmodels.HistoryViewModel
+import de.patani.kettlebelltracker.util.formatDate
+import de.patani.kettlebelltracker.util.formatDuration
+import de.patani.kettlebelltracker.data.local.TrainingSession
+import androidx.compose.ui.Alignment
+
+@Composable
+fun HistoryScreen(viewModel: HistoryViewModel) {
+ val history by viewModel.history.collectAsState()
+
+ if (history.isEmpty()) {
+ Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
+ Text("Noch keine Trainingsdaten vorhanden.")
+ }
+ } else {
+ LazyColumn(
+ modifier = Modifier.fillMaxSize(),
+ contentPadding = PaddingValues(16.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp)
+ ) {
+ item {
+ Row(Modifier.fillMaxWidth()) {
+ Text("Datum", modifier = Modifier.weight(1f))
+ Text("Sätze", modifier = Modifier.weight(0.5f))
+ Text("Dauer", modifier = Modifier.weight(0.7f))
+ Text("Reps", modifier = Modifier.weight(0.5f))
+ }
+ Divider(modifier = Modifier.padding(vertical = 8.dp))
+ }
+ items(history) { session ->
+ HistoryItem(
+ session = session,
+ onUpdate = viewModel::updateSession,
+ onDelete = viewModel::deleteSession
+ )
+ }
+ }
+ }
+}
+
+@OptIn(ExperimentalMaterial3Api::class)
+@Composable
+fun HistoryItem(session: TrainingSession, onUpdate: (TrainingSession) -> Unit, onDelete: (TrainingSession) -> Unit) {
+ var showDialog by remember { mutableStateOf(false) }
+
+ Card(onClick = { showDialog = true }, modifier = Modifier.fillMaxWidth()) {
+ Row(modifier = Modifier.padding(16.dp)) {
+ Text(text = session.date.formatDate(), modifier = Modifier.weight(1f))
+ Text(text = session.sets.toString(), modifier = Modifier.weight(0.5f))
+ Text(text = formatDuration(session.duration), modifier = Modifier.weight(0.7f))
+ Text(text = session.repsPerSet.toString(), modifier = Modifier.weight(0.5f))
+ }
+ }
+
+ if (showDialog) {
+ EditHistoryDialog(
+ session = session,
+ onDismiss = { showDialog = false },
+ onSave = { updatedSession ->
+ onUpdate(updatedSession)
+ showDialog = false
+ },
+ onDelete = {
+ onDelete(session)
+ showDialog = false
+ }
+ )
+ }
+}
+
+@Composable
+fun EditHistoryDialog(session: TrainingSession, onDismiss: () -> Unit, onSave: (TrainingSession) -> Unit, onDelete: () -> Unit) {
+ var editedSets by remember { mutableStateOf(session.sets.toString()) }
+ var editedRepsPerSet by remember { mutableStateOf(session.repsPerSet.toString()) }
+ var editedWeightLeft by remember { mutableStateOf(session.weightLeft.toString()) }
+ var editedWeightRight by remember { mutableStateOf(session.weightRight.toString()) }
+ var editedDurationMinutes by remember { mutableStateOf((session.duration / 60).toString()) }
+ var editedDurationSeconds by remember { mutableStateOf((session.duration % 60).toString()) }
+
+ AlertDialog(
+ onDismissRequest = onDismiss,
+ title = { Text("Eintrag bearbeiten") },
+ text = {
+ Column {
+ Text("Datum: ${session.date.formatDate()}", style = MaterialTheme.typography.bodyMedium)
+ Spacer(modifier = Modifier.height(8.dp))
+
+ OutlinedTextField(
+ value = editedSets,
+ onValueChange = { newValue ->
+ if (newValue.all { it.isDigit() } || newValue.isEmpty()) {
+ editedSets = newValue
+ }
+ },
+ label = { Text("Sätze") },
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp),
+ singleLine = true
+ )
+
+ OutlinedTextField(
+ value = editedRepsPerSet,
+ onValueChange = { newValue ->
+ if (newValue.all { it.isDigit() } || newValue.isEmpty()) {
+ editedRepsPerSet = newValue
+ }
+ },
+ label = { Text("Wiederholungen pro Satz") },
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp),
+ singleLine = true
+ )
+
+ OutlinedTextField(
+ value = editedWeightLeft,
+ onValueChange = { newValue ->
+ if (newValue.matches(Regex("^\\d*\\.?\\d*\$"))) {
+ editedWeightLeft = newValue
+ }
+ },
+ label = { Text("Gewicht Links (kg)") },
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp),
+ singleLine = true
+ )
+
+ OutlinedTextField(
+ value = editedWeightRight,
+ onValueChange = { newValue ->
+ if (newValue.matches(Regex("^\\d*\\.?\\d*\$"))) {
+ editedWeightRight = newValue
+ }
+ },
+ label = { Text("Gewicht Rechts (kg)") },
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp),
+ singleLine = true
+ )
+
+ Row(modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp), horizontalArrangement = Arrangement.SpaceBetween) {
+ OutlinedTextField(
+ value = editedDurationMinutes,
+ onValueChange = { newValue ->
+ if (newValue.all { it.isDigit() } || newValue.isEmpty()) {
+ editedDurationMinutes = newValue
+ }
+ },
+ label = { Text("Dauer (Min)") },
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.weight(1f).padding(end = 4.dp),
+ singleLine = true
+ )
+ OutlinedTextField(
+ value = editedDurationSeconds,
+ onValueChange = { newValue ->
+ if (newValue.all { it.isDigit() } || newValue.isEmpty()) {
+ editedDurationSeconds = newValue
+ }
+ },
+ label = { Text("Dauer (Sek)") },
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.weight(1f).padding(start = 4.dp),
+ singleLine = true
+ )
+ }
+ Text("Programm: ${session.program}", style = MaterialTheme.typography.bodySmall)
+ Text("Block Tag: ${session.blockDay}", style = MaterialTheme.typography.bodySmall)
+ }
+ },
+ confirmButton = {
+ Row(
+ modifier = Modifier.fillMaxWidth(),
+ horizontalArrangement = Arrangement.SpaceBetween,
+ verticalAlignment = Alignment.CenterVertically
+ ) {
+ Button(
+ onClick = onDelete,
+ colors = ButtonDefaults.buttonColors(containerColor = MaterialTheme.colorScheme.error),
+ modifier = Modifier.weight(1f).padding(end = 4.dp)
+ ) {
+ Icon(Icons.Default.Delete, contentDescription = "Löschen")
+ Spacer(Modifier.width(4.dp))
+ Text("Löschen")
+ }
+ Button(
+ onClick = {
+ val newSets = editedSets.toIntOrNull() ?: session.sets
+ val newRepsPerSet = editedRepsPerSet.toIntOrNull() ?: session.repsPerSet
+ val newWeightLeft = editedWeightLeft.toDoubleOrNull() ?: session.weightLeft
+ val newWeightRight = editedWeightRight.toDoubleOrNull() ?: session.weightRight
+ val newDurationMinutes = editedDurationMinutes.toLongOrNull() ?: 0L
+ val newDurationSeconds = editedDurationSeconds.toLongOrNull() ?: 0L
+ val newDuration = newDurationMinutes * 60 + newDurationSeconds
+
+ val updatedSession = session.copy(
+ sets = newSets,
+ repsPerSet = newRepsPerSet,
+ weightLeft = newWeightLeft,
+ weightRight = newWeightRight,
+ duration = newDuration
+ )
+ onSave(updatedSession)
+ },
+ modifier = Modifier.weight(1f).padding(start = 4.dp)
+ ) {
+ Text("Speichern")
+ }
+ }
+ },
+ dismissButton = {
+ Button(onClick = onDismiss) {
+ Text("Abbrechen")
+ }
+ }
+ )
+}
diff --git a/app/src/main/java/de/patani/kettlebelltracker/ui/screens/HomeScreen.kt b/app/src/main/java/de/patani/kettlebelltracker/ui/screens/HomeScreen.kt
new file mode 100644
index 0000000..56f6c3a
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/ui/screens/HomeScreen.kt
@@ -0,0 +1,85 @@
+package de.patani.kettlebelltracker.ui.screens
+
+import androidx.compose.foundation.layout.*
+import androidx.compose.material3.*
+import androidx.compose.runtime.*
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.text.style.TextAlign
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import de.patani.kettlebelltracker.viewmodels.HomeViewModel
+import de.patani.kettlebelltracker.util.formatDate
+import de.patani.kettlebelltracker.util.formatDuration
+import java.util.Calendar
+
+@Composable
+fun HomeScreen(
+ viewModel: HomeViewModel,
+ onStartTrainingClicked: () -> Unit
+) {
+ val state by viewModel.homeScreenState.collectAsState()
+
+ val isTrainedToday = remember(state.lastTrainingSession) {
+ val lastDate = state.lastTrainingSession?.date
+ if (lastDate == null) false
+ else {
+ val cal1 = Calendar.getInstance().apply { time = lastDate }
+ val cal2 = Calendar.getInstance()
+ cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) &&
+ cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR)
+ }
+ }
+
+ Column(
+ modifier = Modifier
+ .fillMaxSize()
+ .padding(16.dp),
+ horizontalAlignment = Alignment.CenterHorizontally,
+ verticalArrangement = Arrangement.SpaceAround
+ ) {
+ Text(
+ text = "Kettlebell Workout Tracker",
+ style = MaterialTheme.typography.headlineMedium,
+ textAlign = TextAlign.Center
+ )
+
+ Card(modifier = Modifier.fillMaxWidth()) {
+ Column(modifier = Modifier.fillMaxWidth().padding(16.dp), horizontalAlignment = Alignment.CenterHorizontally) {
+ Text("Nächstes Training", style = MaterialTheme.typography.titleLarge)
+ Spacer(modifier = Modifier.height(8.dp))
+ Text("${state.nextTrainingProgram} - Tag ${state.nextTrainingBlockDay}")
+ Spacer(modifier = Modifier.height(8.dp))
+ Text("Ziel: ${state.nextTrainingReps} Wiederholungen pro Satz")
+ Spacer(modifier = Modifier.height(16.dp))
+ Button(onClick = onStartTrainingClicked, enabled = !isTrainedToday) {
+ Text(if (isTrainedToday) "Heute bereits trainiert" else "Training starten")
+ }
+ }
+ }
+
+ Card(modifier = Modifier.fillMaxWidth()) {
+ Column(modifier = Modifier.fillMaxWidth().padding(16.dp)) {
+ Text("Letzte Leistung", style = MaterialTheme.typography.titleLarge, modifier = Modifier.align(Alignment.CenterHorizontally))
+ Spacer(modifier = Modifier.height(16.dp))
+ Row(
+ modifier = Modifier.fillMaxWidth(),
+ horizontalArrangement = Arrangement.SpaceAround
+ ) {
+ StatItem("Datum", state.lastTrainingSession?.date?.formatDate() ?: "–")
+ StatItem("Sätze", state.lastTrainingSession?.sets?.toString() ?: "–")
+ StatItem("Dauer", formatDuration(state.lastTrainingSession?.duration ?: 0))
+ StatItem("Gewicht", "${state.lastTrainingSession?.weightLeft ?: "–"}kg")
+ }
+ }
+ }
+ }
+}
+
+@Composable
+fun StatItem(label: String, value: String) {
+ Column(horizontalAlignment = Alignment.CenterHorizontally) {
+ Text(text = label, style = MaterialTheme.typography.labelMedium)
+ Text(text = value, style = MaterialTheme.typography.bodyLarge, fontSize = 18.sp)
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/ui/screens/SettingsScreen.kt b/app/src/main/java/de/patani/kettlebelltracker/ui/screens/SettingsScreen.kt
new file mode 100644
index 0000000..d85f717
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/ui/screens/SettingsScreen.kt
@@ -0,0 +1,84 @@
+package de.patani.kettlebelltracker.ui.screens
+
+import androidx.compose.foundation.layout.*
+import androidx.compose.foundation.text.KeyboardOptions
+import androidx.compose.material3.*
+import androidx.compose.runtime.*
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.text.input.KeyboardType
+import androidx.compose.ui.unit.dp
+import de.patani.kettlebelltracker.viewmodels.SettingsViewModel
+import kotlinx.coroutines.launch
+
+@Composable
+fun SettingsScreen(viewModel: SettingsViewModel) {
+ val settings by viewModel.settings.collectAsState()
+ val snackbarHostState = remember { SnackbarHostState() }
+ val scope = rememberCoroutineScope()
+
+ var time by remember(settings.trainingTimeMinutes) { mutableStateOf(settings.trainingTimeMinutes.toString()) }
+ var sets by remember(settings.goalSets) { mutableStateOf(settings.goalSets.toString()) }
+ var weightLeft by remember(settings.weightLeft) { mutableStateOf(settings.weightLeft.toString()) }
+ var weightRight by remember(settings.weightRight) { mutableStateOf(settings.weightRight.toString()) }
+
+ Scaffold(
+ snackbarHost = { SnackbarHost(snackbarHostState) }
+ ) { padding ->
+ Column(
+ modifier = Modifier
+ .fillMaxSize()
+ .padding(padding)
+ .padding(16.dp),
+ verticalArrangement = Arrangement.spacedBy(16.dp)
+ ) {
+ Text("Einstellungen", style = MaterialTheme.typography.headlineSmall)
+
+ OutlinedTextField(
+ value = time,
+ onValueChange = { time = it },
+ label = { Text("Trainingszeit (Minuten)") },
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.fillMaxWidth()
+ )
+ OutlinedTextField(
+ value = sets,
+ onValueChange = { sets = it },
+ label = { Text("Ziel-Sätze") },
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.fillMaxWidth()
+ )
+ OutlinedTextField(
+ value = weightLeft,
+ onValueChange = { weightLeft = it },
+ label = { Text("Gewicht Links (kg)") },
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Decimal),
+ modifier = Modifier.fillMaxWidth()
+ )
+ OutlinedTextField(
+ value = weightRight,
+ onValueChange = { weightRight = it },
+ label = { Text("Gewicht Rechts (kg)") },
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Decimal),
+ modifier = Modifier.fillMaxWidth()
+ )
+
+ Button(
+ onClick = {
+ val timeInt = time.toIntOrNull() ?: settings.trainingTimeMinutes
+ val setsInt = sets.toIntOrNull() ?: settings.goalSets
+ val weightL = weightLeft.toDoubleOrNull() ?: settings.weightLeft
+ val weightR = weightRight.toDoubleOrNull() ?: settings.weightRight
+
+ viewModel.saveSettings(timeInt, setsInt, weightL, weightR)
+
+ scope.launch {
+ snackbarHostState.showSnackbar("Einstellungen gespeichert!")
+ }
+ },
+ modifier = Modifier.fillMaxWidth()
+ ) {
+ Text("Speichern")
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/ui/screens/TrainingScreen.kt b/app/src/main/java/de/patani/kettlebelltracker/ui/screens/TrainingScreen.kt
new file mode 100644
index 0000000..0a76673
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/ui/screens/TrainingScreen.kt
@@ -0,0 +1,173 @@
+package de.patani.kettlebelltracker.ui.screens
+
+import androidx.compose.foundation.layout.*
+import androidx.compose.material3.*
+import androidx.compose.runtime.*
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import de.patani.kettlebelltracker.viewmodels.TrainingViewModel
+import de.patani.kettlebelltracker.util.formatDuration
+
+@Composable
+fun TrainingScreen(viewModel: TrainingViewModel) {
+ val trainingState by viewModel.trainingState.collectAsState()
+ val showFinishButton = trainingState.remainingSeconds <= 0 && trainingState.isTrainingRunning
+
+ Column(
+ modifier = Modifier
+ .fillMaxSize()
+ .padding(16.dp),
+ horizontalAlignment = Alignment.CenterHorizontally,
+ verticalArrangement = Arrangement.SpaceEvenly
+ ) {
+
+ if (trainingState.isRoundActive) {
+ RoundTimerCard(
+ timeRemaining = trainingState.currentRoundTime,
+ totalTime = trainingState.totalRoundTime,
+ )
+ }
+
+ if (trainingState.isRoundActive) {
+ Column(horizontalAlignment = Alignment.CenterHorizontally) {
+ Text("Verbleibende Zeit", style = MaterialTheme.typography.titleLarge)
+ Text(
+ text = formatDuration(trainingState.remainingSeconds.toLong()),
+ fontSize = 72.sp,
+ fontWeight = FontWeight.Bold,
+ color = if (trainingState.remainingSeconds <= 10)
+ MaterialTheme.colorScheme.error
+ else MaterialTheme.colorScheme.onSurface
+ )
+ }
+ }
+
+ Column(horizontalAlignment = Alignment.CenterHorizontally) {
+ Text("Sätze", style = MaterialTheme.typography.titleLarge)
+ Text(
+ text = "${trainingState.setsDone} / ${trainingState.goalSets}",
+ fontSize = 60.sp,
+ fontWeight = FontWeight.Bold,
+ color = MaterialTheme.colorScheme.tertiary
+ )
+ Text(
+ text = "${trainingState.repsPerSet} Wiederholungen",
+ fontSize = 24.sp,
+ color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.7f)
+ )
+ }
+
+ Column(
+ horizontalAlignment = Alignment.CenterHorizontally,
+ verticalArrangement = Arrangement.spacedBy(12.dp)
+ ) {
+ if (trainingState.isRoundActive) {
+ Button(
+ onClick = viewModel::completeSet,
+ enabled = trainingState.isTrainingRunning,
+ modifier = Modifier
+ .fillMaxWidth()
+ .height(60.dp)
+ ) {
+ Text("Satz abschließen", fontSize = 18.sp)
+ }
+ }
+
+ if (showFinishButton) {
+ Button(
+ onClick = viewModel::finishTraining,
+ colors = ButtonDefaults.buttonColors(
+ containerColor = MaterialTheme.colorScheme.error
+ ),
+ modifier = Modifier
+ .fillMaxWidth()
+ .height(50.dp)
+ ) {
+ Text("Training beenden & Speichern", fontSize = 16.sp)
+ }
+ }
+ }
+ }
+}
+
+@Composable
+fun RoundTimerCard(
+ timeRemaining: Int,
+ totalTime: Int
+) {
+ Card(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(8.dp),
+ colors = CardDefaults.cardColors(
+ containerColor = when {
+ timeRemaining <= 0 -> MaterialTheme.colorScheme.errorContainer
+ timeRemaining <= 10 -> MaterialTheme.colorScheme.tertiary.copy(alpha = 0.3f)
+ else -> MaterialTheme.colorScheme.primaryContainer
+ }
+ )
+ ) {
+ Column(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(20.dp),
+ horizontalAlignment = Alignment.CenterHorizontally
+ ) {
+ Text(
+ text = if (timeRemaining <= 0) "Zeit abgelaufen!" else "Rundenzeit",
+ style = MaterialTheme.typography.titleLarge,
+ color = when {
+ timeRemaining <= 0 -> MaterialTheme.colorScheme.error
+ else -> MaterialTheme.colorScheme.primary
+ }
+ )
+
+ Spacer(modifier = Modifier.height(16.dp))
+
+ Box(
+ modifier = Modifier.size(120.dp),
+ contentAlignment = Alignment.Center
+ ) {
+ val progress = if (totalTime > 0 && timeRemaining >= 0) {
+ (totalTime - timeRemaining).toFloat() / totalTime.toFloat()
+ } else if (timeRemaining < 0) 1f else 0f
+
+ CircularProgressIndicator(
+ progress = progress,
+ modifier = Modifier.fillMaxSize(),
+ strokeWidth = 8.dp,
+ color = when {
+ timeRemaining <= 0 -> MaterialTheme.colorScheme.error
+ timeRemaining <= 10 -> MaterialTheme.colorScheme.tertiary
+ else -> MaterialTheme.colorScheme.primary
+ }
+ )
+
+ Column(horizontalAlignment = Alignment.CenterHorizontally) {
+ Text(
+ text = if (timeRemaining >= 0) {
+ formatDuration(timeRemaining.toLong())
+ } else {
+ "+${formatDuration((-timeRemaining).toLong())}"
+ },
+ fontSize = 24.sp,
+ fontWeight = FontWeight.Bold,
+ color = when {
+ timeRemaining <= 0 -> MaterialTheme.colorScheme.error
+ timeRemaining <= 10 -> MaterialTheme.colorScheme.tertiary
+ else -> MaterialTheme.colorScheme.primary
+ }
+ )
+ Text(
+ text = if (timeRemaining <= 0) "überzogen" else "verbleibend",
+ fontSize = 12.sp,
+ color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.7f)
+ )
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/ui/theme/Color.kt b/app/src/main/java/de/patani/kettlebelltracker/ui/theme/Color.kt
new file mode 100644
index 0000000..dba3d63
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/ui/theme/Color.kt
@@ -0,0 +1,11 @@
+package de.patani.kettlebelltracker.ui.theme
+
+import androidx.compose.ui.graphics.Color
+
+val Purple80 = Color(0xFFD0BCFF)
+val PurpleGrey80 = Color(0xFFCCC2DC)
+val Pink80 = Color(0xFFEFB8C8)
+
+val Purple40 = Color(0xFF6650a4)
+val PurpleGrey40 = Color(0xFF625b71)
+val Pink40 = Color(0xFF7D5260)
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/ui/theme/Theme.kt b/app/src/main/java/de/patani/kettlebelltracker/ui/theme/Theme.kt
new file mode 100644
index 0000000..ad317fc
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/ui/theme/Theme.kt
@@ -0,0 +1,30 @@
+package de.patani.kettlebelltracker.ui.theme
+
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.darkColorScheme
+import androidx.compose.runtime.Composable
+
+import androidx.compose.ui.graphics.Color
+
+private val DarkColorScheme = darkColorScheme(
+ primary = Color(0xFF61AFEF), // Blue
+ secondary = Color(0xFFC678DD), // Purple
+ tertiary = Color(0xFF98C379), // Green
+ background = Color(0xFF282C34),
+ surface = Color(0xFF2C313A),
+ onPrimary = Color.Black,
+ onSecondary = Color.Black,
+ onTertiary = Color.Black,
+ onBackground = Color(0xFFABB2BF),
+ onSurface = Color(0xFFABB2BF),
+ error = Color(0xFFE06C75), // Red
+)
+
+@Composable
+fun KettlebellTrackerTheme(content: @Composable () -> Unit) {
+ MaterialTheme(
+ colorScheme = DarkColorScheme,
+ typography = Typography,
+ content = content
+ )
+}
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/ui/theme/Type.kt b/app/src/main/java/de/patani/kettlebelltracker/ui/theme/Type.kt
new file mode 100644
index 0000000..f6ed694
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/ui/theme/Type.kt
@@ -0,0 +1,17 @@
+package de.patani.kettlebelltracker.ui.theme
+
+import androidx.compose.material3.Typography
+import androidx.compose.ui.text.TextStyle
+import androidx.compose.ui.text.font.FontFamily
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.unit.sp
+
+val Typography = Typography(
+ bodyLarge = TextStyle(
+ fontFamily = FontFamily.Default,
+ fontWeight = FontWeight.Normal,
+ fontSize = 16.sp,
+ lineHeight = 24.sp,
+ letterSpacing = 0.5.sp
+ )
+)
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/util/formatDuration.kt b/app/src/main/java/de/patani/kettlebelltracker/util/formatDuration.kt
new file mode 100644
index 0000000..5bd9038
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/util/formatDuration.kt
@@ -0,0 +1,19 @@
+package de.patani.kettlebelltracker.util
+
+import android.annotation.SuppressLint
+import java.text.SimpleDateFormat
+import java.util.Date
+import java.util.Locale
+
+fun Date.formatDate(): String {
+ val formatter = SimpleDateFormat("dd.MM.yyyy", Locale.getDefault())
+ return formatter.format(this)
+}
+
+@SuppressLint("DefaultLocale")
+fun formatDuration(totalSeconds: Long): String {
+ if (totalSeconds < 0) return "00:00"
+ val minutes = totalSeconds / 60
+ val seconds = totalSeconds % 60
+ return String.format("%02d:%02d", minutes, seconds)
+}
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/viewmodels/HistoryViewModel.kt b/app/src/main/java/de/patani/kettlebelltracker/viewmodels/HistoryViewModel.kt
new file mode 100644
index 0000000..1827055
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/viewmodels/HistoryViewModel.kt
@@ -0,0 +1,24 @@
+package de.patani.kettlebelltracker.viewmodels
+
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.viewModelScope
+import de.patani.kettlebelltracker.data.datastore.SettingsDataStore
+import de.patani.kettlebelltracker.data.local.TrainingSessionDao
+import de.patani.kettlebelltracker.data.local.TrainingSession
+import kotlinx.coroutines.flow.SharingStarted
+import kotlinx.coroutines.flow.stateIn
+import kotlinx.coroutines.launch
+import java.util.Date
+
+class HistoryViewModel(private val dao: TrainingSessionDao) : ViewModel() {
+ val history = dao.getHistory()
+ .stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), emptyList())
+
+ fun updateSession(session: TrainingSession) = viewModelScope.launch {
+ dao.update(session)
+ }
+
+ fun deleteSession(session: TrainingSession) = viewModelScope.launch {
+ dao.delete(session)
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/viewmodels/HomeViewModel.kt b/app/src/main/java/de/patani/kettlebelltracker/viewmodels/HomeViewModel.kt
new file mode 100644
index 0000000..c662d01
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/viewmodels/HomeViewModel.kt
@@ -0,0 +1,33 @@
+package de.patani.kettlebelltracker.viewmodels
+
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.viewModelScope
+import de.patani.kettlebelltracker.data.local.TrainingSessionDao
+import kotlinx.coroutines.flow.SharingStarted
+import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.stateIn
+
+class HomeViewModel(
+ dao: TrainingSessionDao,
+ trainingViewModel: TrainingViewModel
+) : ViewModel() {
+
+ val lastSession = dao.getLastSession()
+ .stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), null)
+
+ val homeScreenState = combine(lastSession, trainingViewModel.trainingState) { last, trainingState ->
+ HomeScreenState(
+ lastTrainingSession = last,
+ nextTrainingProgram = trainingState.currentProgram,
+ nextTrainingBlockDay = trainingState.currentBlockDay,
+ nextTrainingReps = trainingState.currentReps
+ )
+ }.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), HomeScreenState())
+}
+
+data class HomeScreenState(
+ val lastTrainingSession: de.patani.kettlebelltracker.data.local.TrainingSession? = null,
+ val nextTrainingProgram: String = "",
+ val nextTrainingBlockDay: Int = 0,
+ val nextTrainingReps: Int = 0
+)
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/viewmodels/SettingsViewModel.kt b/app/src/main/java/de/patani/kettlebelltracker/viewmodels/SettingsViewModel.kt
new file mode 100644
index 0000000..0c61f5c
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/viewmodels/SettingsViewModel.kt
@@ -0,0 +1,31 @@
+package de.patani.kettlebelltracker.viewmodels
+
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.viewModelScope
+import de.patani.kettlebelltracker.data.datastore.Settings
+import de.patani.kettlebelltracker.data.datastore.SettingsDataStore
+import kotlinx.coroutines.flow.SharingStarted
+import kotlinx.coroutines.flow.stateIn
+import kotlinx.coroutines.launch
+
+class SettingsViewModel(private val settingsDataStore: SettingsDataStore) : ViewModel() {
+ val settings = settingsDataStore.settingsFlow
+ .stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), Settings(0,0.0,0.0,0,""))
+
+ fun saveSettings(
+ time: Int,
+ sets: Int,
+ weightLeft: Double,
+ weightRight: Double
+ ) = viewModelScope.launch {
+ val currentSettings = settings.value
+ settingsDataStore.saveSettings(
+ currentSettings.copy(
+ trainingTimeMinutes = time,
+ goalSets = sets,
+ weightLeft = weightLeft,
+ weightRight = weightRight
+ )
+ )
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/de/patani/kettlebelltracker/viewmodels/TrainingViewModel.kt b/app/src/main/java/de/patani/kettlebelltracker/viewmodels/TrainingViewModel.kt
new file mode 100644
index 0000000..51aaf2e
--- /dev/null
+++ b/app/src/main/java/de/patani/kettlebelltracker/viewmodels/TrainingViewModel.kt
@@ -0,0 +1,256 @@
+package de.patani.kettlebelltracker.viewmodels
+
+import android.media.AudioManager
+import android.media.ToneGenerator
+import android.util.Log
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.viewModelScope
+import de.patani.kettlebelltracker.data.local.TrainingSessionDao
+import de.patani.kettlebelltracker.data.datastore.SettingsDataStore
+import de.patani.kettlebelltracker.repositories.ApiRepository
+import kotlinx.coroutines.Job
+import kotlinx.coroutines.delay
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.asStateFlow
+import kotlinx.coroutines.flow.first
+import kotlinx.coroutines.flow.update
+import kotlinx.coroutines.launch
+import java.util.Date
+import kotlin.math.min
+
+data class TrainingState(
+ val isTrainingRunning: Boolean = false,
+ val remainingSeconds: Int = 0,
+ val initialDurationSeconds: Int = 0,
+ val setsDone: Int = 0,
+ val goalSets: Int = 5,
+ val repsPerSet: Int = 5,
+ val progress: Float = 0.0f,
+ val currentProgram: String = "clean_1.0",
+ val currentBlockDay: Int = 1,
+ val currentReps: Int = 5,
+ val totalTrainingDays: Int = 0,
+ val isRoundActive: Boolean = false,
+ val currentRoundTime: Int = 0,
+ val totalRoundTime: Int = 0
+)
+
+class TrainingViewModel(
+ private val dao: TrainingSessionDao,
+ private val settingsDataStore: SettingsDataStore,
+ private val apiRepository: ApiRepository,
+ private val appUUID: String
+) : ViewModel() {
+
+ private val _trainingState = MutableStateFlow(TrainingState())
+ val trainingState = _trainingState.asStateFlow()
+
+ private var timerJob: Job? = null
+ private var roundTimerJob: Job? = null
+
+ init {
+ viewModelScope.launch {
+ val trainingCount = dao.getTrainingCount().first()
+ val initialState = calculateStateByDayCount(trainingCount)
+ _trainingState.update {
+ it.copy(
+ totalTrainingDays = trainingCount,
+ currentProgram = initialState.program,
+ currentBlockDay = initialState.blockDay,
+ currentReps = initialState.reps,
+ repsPerSet = initialState.reps
+ )
+ }
+ }
+ }
+
+ private var recommendedRestSeconds: Int = 90
+
+ fun startTraining() {
+ if (_trainingState.value.isTrainingRunning) return
+
+ viewModelScope.launch {
+ val settings = settingsDataStore.settingsFlow.first()
+ val durationSeconds = settings.trainingTimeMinutes * 60
+
+ _trainingState.update {
+ it.copy(
+ isTrainingRunning = true,
+ initialDurationSeconds = durationSeconds,
+ remainingSeconds = durationSeconds,
+ goalSets = settings.goalSets,
+ setsDone = 0,
+ progress = 0.0f
+ )
+ }
+ val recommendation = apiRepository.getRecommendedRest(
+ uuid = appUUID,
+ repsPerSet = _trainingState.value.repsPerSet,
+ currentSets = 0 // ggf. 0 oder deinen Startwert
+ )
+ recommendedRestSeconds = recommendation?.recommended_rest ?: 90
+ Log.d("Training", "using rest time ${recommendedRestSeconds.toString()}")
+ startTimer()
+ startFirstRound()
+ }
+ }
+
+ private fun startTimer() {
+ timerJob?.cancel()
+ timerJob = viewModelScope.launch {
+ while (_trainingState.value.remainingSeconds > 0 && _trainingState.value.isTrainingRunning) {
+ delay(1000)
+ _trainingState.update { it.copy(remainingSeconds = it.remainingSeconds - 1) }
+ }
+ if (_trainingState.value.isTrainingRunning) {
+ finishTraining()
+ }
+ }
+ }
+
+ private fun startFirstRound() {
+ startRoundTimer(recommendedRestSeconds)
+ }
+
+ fun completeSet() {
+ if (!_trainingState.value.isTrainingRunning) return
+
+ val currentState = _trainingState.value
+ val newSetsDone = currentState.setsDone + 1
+ val newProgress = if (currentState.goalSets > 0) {
+ min(newSetsDone.toFloat() / currentState.goalSets.toFloat(), 1.0f)
+ } else 0.0f
+
+ _trainingState.update {
+ it.copy(
+ setsDone = newSetsDone,
+ progress = newProgress
+ )
+ }
+
+ stopRoundTimer()
+
+ startNextRound()
+ }
+
+ private fun startNextRound() {
+ startRoundTimer(recommendedRestSeconds)
+ }
+
+ private fun startRoundTimer(seconds: Int) {
+ roundTimerJob?.cancel()
+
+ _trainingState.update {
+ it.copy(
+ isRoundActive = true,
+ currentRoundTime = seconds,
+ totalRoundTime = seconds
+ )
+ }
+
+ roundTimerJob = viewModelScope.launch {
+ while (_trainingState.value.currentRoundTime > 0 && _trainingState.value.isRoundActive) {
+ delay(1000)
+ _trainingState.update {
+ it.copy(currentRoundTime = it.currentRoundTime - 1)
+ }
+ }
+
+ if (_trainingState.value.isRoundActive) {
+ playRoundCompleteSound()
+ }
+ }
+ }
+
+ private fun stopRoundTimer() {
+ roundTimerJob?.cancel()
+ _trainingState.update {
+ it.copy(
+ isRoundActive = false,
+ currentRoundTime = 0,
+ totalRoundTime = 0
+ )
+ }
+ }
+
+ private fun playRoundCompleteSound() {
+ viewModelScope.launch {
+ try {
+ val toneGenerator = ToneGenerator(AudioManager.STREAM_NOTIFICATION, 100)
+ toneGenerator.startTone(ToneGenerator.TONE_CDMA_ALERT_CALL_GUARD, 1000)
+ } catch (e: Exception) {
+ Log.e("TrainingViewModel", "Could not play sound", e)
+ }
+ }
+ }
+
+ fun finishTraining() {
+ timerJob?.cancel()
+ roundTimerJob?.cancel()
+ if (!_trainingState.value.isTrainingRunning) return
+
+ viewModelScope.launch {
+ val state = _trainingState.value
+ val settings = settingsDataStore.settingsFlow.first()
+
+ val session = de.patani.kettlebelltracker.data.local.TrainingSession(
+ date = Date(),
+ sets = state.setsDone,
+ weightLeft = settings.weightLeft,
+ weightRight = settings.weightRight,
+ repsPerSet = state.repsPerSet,
+ duration = (state.initialDurationSeconds - state.remainingSeconds).toLong(),
+ program = state.currentProgram,
+ blockDay = state.currentBlockDay
+ )
+
+ dao.insert(session)
+ Log.d("Training", "Sending Trainingsession to backend: $appUUID")
+ apiRepository.sendTrainingData(session, appUUID)
+ resetTraining()
+ }
+ }
+
+ private suspend fun resetTraining() {
+ val trainingCount = dao.getTrainingCount().first()
+ val nextState = calculateStateByDayCount(trainingCount)
+ _trainingState.value = TrainingState(
+ totalTrainingDays = trainingCount,
+ currentProgram = nextState.program,
+ currentBlockDay = nextState.blockDay,
+ currentReps = nextState.reps,
+ repsPerSet = nextState.reps
+ )
+ }
+
+ private fun calculateStateByDayCount(totalDays: Int): ProgramState {
+ if (totalDays <= 0) {
+ return ProgramState("clean_1.0", 1, 5)
+ }
+
+ val cycleIndex = (totalDays / 12) % 6
+ val programs = listOf("clean_1.0", "snatch_1.0", "clean_1.1", "snatch_1.1", "clean_1.2", "snatch_1.2")
+ val program = programs[cycleIndex]
+ val blockDay = (totalDays % 3) + 1
+
+ val repsMap = mapOf(
+ "clean_1.0" to listOf(5, 6, 4),
+ "clean_1.1" to listOf(6, 8, 7),
+ "clean_1.2" to listOf(7, 9, 8),
+ "snatch_1.0" to listOf(5, 6, 4),
+ "snatch_1.1" to listOf(6, 8, 7),
+ "snatch_1.2" to listOf(7, 9, 8)
+ )
+
+ val reps = repsMap[program]?.getOrNull(blockDay - 1) ?: 5
+ return ProgramState(program, blockDay, reps)
+ }
+
+ override fun onCleared() {
+ super.onCleared()
+ timerJob?.cancel()
+ roundTimerJob?.cancel()
+ }
+
+ data class ProgramState(val program: String, val blockDay: Int, val reps: Int)
+}
\ 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/mipmap-anydpi/ic_launcher.xml b/app/src/main/res/mipmap-anydpi/ic_launcher.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi/ic_launcher.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml
new file mode 100644
index 0000000..6f3b755
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi/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/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..f8c6127
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,10 @@
+
+
+ #FFBB86FC
+ #FF6200EE
+ #FF3700B3
+ #FF03DAC5
+ #FF018786
+ #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..d1aa070
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ kettlebelltracker
+
\ 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..9a13f97
--- /dev/null
+++ b/app/src/main/res/values/themes.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/backup_rules.xml b/app/src/main/res/xml/backup_rules.xml
new file mode 100644
index 0000000..4df9255
--- /dev/null
+++ b/app/src/main/res/xml/backup_rules.xml
@@ -0,0 +1,13 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/data_extraction_rules.xml b/app/src/main/res/xml/data_extraction_rules.xml
new file mode 100644
index 0000000..9ee9997
--- /dev/null
+++ b/app/src/main/res/xml/data_extraction_rules.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/test/java/de/patani/kettlebelltracker/ExampleUnitTest.kt b/app/src/test/java/de/patani/kettlebelltracker/ExampleUnitTest.kt
new file mode 100644
index 0000000..1a8aa6a
--- /dev/null
+++ b/app/src/test/java/de/patani/kettlebelltracker/ExampleUnitTest.kt
@@ -0,0 +1,17 @@
+package de.patani.kettlebelltracker
+
+import org.junit.Test
+
+import org.junit.Assert.*
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+class ExampleUnitTest {
+ @Test
+ fun addition_isCorrect() {
+ assertEquals(4, 2 + 2)
+ }
+}
\ No newline at end of file
diff --git a/assets/sound/notification.mp3 b/assets/sound/notification.mp3
deleted file mode 100644
index dd3fecb..0000000
Binary files a/assets/sound/notification.mp3 and /dev/null differ
diff --git a/assets/sounds/notification.mp3 b/assets/sounds/notification.mp3
deleted file mode 100644
index dd3fecb..0000000
Binary files a/assets/sounds/notification.mp3 and /dev/null differ
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000..952b930
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,6 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+plugins {
+ alias(libs.plugins.android.application) apply false
+ alias(libs.plugins.kotlin.android) apply false
+ alias(libs.plugins.kotlin.compose) apply false
+}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..20e2a01
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,23 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. For more details, visit
+# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app's APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Kotlin code style for this project: "official" or "obsolete":
+kotlin.code.style=official
+# Enables namespacing of each library's R class so that its R class includes only the
+# resources declared in the library itself and none from the library's dependencies,
+# thereby reducing the size of the R class for that library
+android.nonTransitiveRClass=true
\ No newline at end of file
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
new file mode 100644
index 0000000..27a3ee0
--- /dev/null
+++ b/gradle/libs.versions.toml
@@ -0,0 +1,36 @@
+[versions]
+agp = "8.11.1"
+kotlin = "2.0.21"
+coreKtx = "1.10.1"
+junit = "4.13.2"
+junitVersion = "1.1.5"
+espressoCore = "3.5.1"
+lifecycleRuntimeKtx = "2.6.1"
+activityCompose = "1.8.0"
+composeBom = "2024.09.00"
+roomCommonJvm = "2.7.2"
+roomCompiler = "2.7.2"
+
+[libraries]
+androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
+junit = { group = "junit", name = "junit", version.ref = "junit" }
+androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
+androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
+androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
+androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
+androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
+androidx-ui = { group = "androidx.compose.ui", name = "ui" }
+androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
+androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
+androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
+androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
+androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
+androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
+androidx-room-common-jvm = { group = "androidx.room", name = "room-common-jvm", version.ref = "roomCommonJvm" }
+androidx-room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "roomCompiler" }
+
+[plugins]
+android-application = { id = "com.android.application", version.ref = "agp" }
+kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
+kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
+
diff --git a/ios/.gitignore b/ios/.gitignore
deleted file mode 100644
index 7a7f987..0000000
--- a/ios/.gitignore
+++ /dev/null
@@ -1,34 +0,0 @@
-**/dgph
-*.mode1v3
-*.mode2v3
-*.moved-aside
-*.pbxuser
-*.perspectivev3
-**/*sync/
-.sconsign.dblite
-.tags*
-**/.vagrant/
-**/DerivedData/
-Icon?
-**/Pods/
-**/.symlinks/
-profile
-xcuserdata
-**/.generated/
-Flutter/App.framework
-Flutter/Flutter.framework
-Flutter/Flutter.podspec
-Flutter/Generated.xcconfig
-Flutter/ephemeral/
-Flutter/app.flx
-Flutter/app.zip
-Flutter/flutter_assets/
-Flutter/flutter_export_environment.sh
-ServiceDefinitions.json
-Runner/GeneratedPluginRegistrant.*
-
-# Exceptions to above rules.
-!default.mode1v3
-!default.mode2v3
-!default.pbxuser
-!default.perspectivev3
diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist
deleted file mode 100644
index 7c56964..0000000
--- a/ios/Flutter/AppFrameworkInfo.plist
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- en
- CFBundleExecutable
- App
- CFBundleIdentifier
- io.flutter.flutter.app
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- App
- CFBundlePackageType
- FMWK
- CFBundleShortVersionString
- 1.0
- CFBundleSignature
- ????
- CFBundleVersion
- 1.0
- MinimumOSVersion
- 12.0
-
-
diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig
deleted file mode 100644
index 592ceee..0000000
--- a/ios/Flutter/Debug.xcconfig
+++ /dev/null
@@ -1 +0,0 @@
-#include "Generated.xcconfig"
diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig
deleted file mode 100644
index 592ceee..0000000
--- a/ios/Flutter/Release.xcconfig
+++ /dev/null
@@ -1 +0,0 @@
-#include "Generated.xcconfig"
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
deleted file mode 100644
index b158c15..0000000
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,616 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 54;
- objects = {
-
-/* Begin PBXBuildFile section */
- 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
- 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
- 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
- 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
- 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
- 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
- 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 97C146E61CF9000F007C117D /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 97C146ED1CF9000F007C117D;
- remoteInfo = Runner;
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "";
- dstSubfolderSpec = 10;
- files = (
- );
- name = "Embed Frameworks";
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
- 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
- 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; };
- 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
- 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
- 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
- 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
- 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
- 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
- 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
- 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
- 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
- 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
- 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
- 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 97C146EB1CF9000F007C117D /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 331C8082294A63A400263BE5 /* RunnerTests */ = {
- isa = PBXGroup;
- children = (
- 331C807B294A618700263BE5 /* RunnerTests.swift */,
- );
- path = RunnerTests;
- sourceTree = "";
- };
- 9740EEB11CF90186004384FC /* Flutter */ = {
- isa = PBXGroup;
- children = (
- 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
- 9740EEB21CF90195004384FC /* Debug.xcconfig */,
- 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
- 9740EEB31CF90195004384FC /* Generated.xcconfig */,
- );
- name = Flutter;
- sourceTree = "";
- };
- 97C146E51CF9000F007C117D = {
- isa = PBXGroup;
- children = (
- 9740EEB11CF90186004384FC /* Flutter */,
- 97C146F01CF9000F007C117D /* Runner */,
- 97C146EF1CF9000F007C117D /* Products */,
- 331C8082294A63A400263BE5 /* RunnerTests */,
- );
- sourceTree = "";
- };
- 97C146EF1CF9000F007C117D /* Products */ = {
- isa = PBXGroup;
- children = (
- 97C146EE1CF9000F007C117D /* Runner.app */,
- 331C8081294A63A400263BE5 /* RunnerTests.xctest */,
- );
- name = Products;
- sourceTree = "";
- };
- 97C146F01CF9000F007C117D /* Runner */ = {
- isa = PBXGroup;
- children = (
- 97C146FA1CF9000F007C117D /* Main.storyboard */,
- 97C146FD1CF9000F007C117D /* Assets.xcassets */,
- 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
- 97C147021CF9000F007C117D /* Info.plist */,
- 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
- 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
- 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
- 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
- );
- path = Runner;
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 331C8080294A63A400263BE5 /* RunnerTests */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
- buildPhases = (
- 331C807D294A63A400263BE5 /* Sources */,
- 331C807F294A63A400263BE5 /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- 331C8086294A63A400263BE5 /* PBXTargetDependency */,
- );
- name = RunnerTests;
- productName = RunnerTests;
- productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
- productType = "com.apple.product-type.bundle.unit-test";
- };
- 97C146ED1CF9000F007C117D /* Runner */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
- buildPhases = (
- 9740EEB61CF901F6004384FC /* Run Script */,
- 97C146EA1CF9000F007C117D /* Sources */,
- 97C146EB1CF9000F007C117D /* Frameworks */,
- 97C146EC1CF9000F007C117D /* Resources */,
- 9705A1C41CF9048500538489 /* Embed Frameworks */,
- 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = Runner;
- productName = Runner;
- productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
- productType = "com.apple.product-type.application";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 97C146E61CF9000F007C117D /* Project object */ = {
- isa = PBXProject;
- attributes = {
- BuildIndependentTargetsInParallel = YES;
- LastUpgradeCheck = 1510;
- ORGANIZATIONNAME = "";
- TargetAttributes = {
- 331C8080294A63A400263BE5 = {
- CreatedOnToolsVersion = 14.0;
- TestTargetID = 97C146ED1CF9000F007C117D;
- };
- 97C146ED1CF9000F007C117D = {
- CreatedOnToolsVersion = 7.3.1;
- LastSwiftMigration = 1100;
- };
- };
- };
- buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
- compatibilityVersion = "Xcode 9.3";
- developmentRegion = en;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- Base,
- );
- mainGroup = 97C146E51CF9000F007C117D;
- productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 97C146ED1CF9000F007C117D /* Runner */,
- 331C8080294A63A400263BE5 /* RunnerTests */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 331C807F294A63A400263BE5 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 97C146EC1CF9000F007C117D /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
- 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
- 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
- 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
- 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
- isa = PBXShellScriptBuildPhase;
- alwaysOutOfDate = 1;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
- );
- name = "Thin Binary";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
- };
- 9740EEB61CF901F6004384FC /* Run Script */ = {
- isa = PBXShellScriptBuildPhase;
- alwaysOutOfDate = 1;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Run Script";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 331C807D294A63A400263BE5 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 97C146EA1CF9000F007C117D /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
- 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
- 331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 97C146ED1CF9000F007C117D /* Runner */;
- targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin PBXVariantGroup section */
- 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
- isa = PBXVariantGroup;
- children = (
- 97C146FB1CF9000F007C117D /* Base */,
- );
- name = Main.storyboard;
- sourceTree = "";
- };
- 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
- isa = PBXVariantGroup;
- children = (
- 97C147001CF9000F007C117D /* Base */,
- );
- name = LaunchScreen.storyboard;
- sourceTree = "";
- };
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
- 249021D3217E4FDB00AE95B9 /* Profile */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 12.0;
- MTL_ENABLE_DEBUG_INFO = NO;
- SDKROOT = iphoneos;
- SUPPORTED_PLATFORMS = iphoneos;
- TARGETED_DEVICE_FAMILY = "1,2";
- VALIDATE_PRODUCT = YES;
- };
- name = Profile;
- };
- 249021D4217E4FDB00AE95B9 /* Profile */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CLANG_ENABLE_MODULES = YES;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
- ENABLE_BITCODE = NO;
- INFOPLIST_FILE = Runner/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/Frameworks",
- );
- PRODUCT_BUNDLE_IDENTIFIER = com.example.kettlebellTracker;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
- SWIFT_VERSION = 5.0;
- VERSIONING_SYSTEM = "apple-generic";
- };
- name = Profile;
- };
- 331C8088294A63A400263BE5 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUNDLE_LOADER = "$(TEST_HOST)";
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1;
- GENERATE_INFOPLIST_FILE = YES;
- MARKETING_VERSION = 1.0;
- PRODUCT_BUNDLE_IDENTIFIER = com.example.kettlebellTracker.RunnerTests;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_VERSION = 5.0;
- TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
- };
- name = Debug;
- };
- 331C8089294A63A400263BE5 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUNDLE_LOADER = "$(TEST_HOST)";
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1;
- GENERATE_INFOPLIST_FILE = YES;
- MARKETING_VERSION = 1.0;
- PRODUCT_BUNDLE_IDENTIFIER = com.example.kettlebellTracker.RunnerTests;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_VERSION = 5.0;
- TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
- };
- name = Release;
- };
- 331C808A294A63A400263BE5 /* Profile */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUNDLE_LOADER = "$(TEST_HOST)";
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1;
- GENERATE_INFOPLIST_FILE = YES;
- MARKETING_VERSION = 1.0;
- PRODUCT_BUNDLE_IDENTIFIER = com.example.kettlebellTracker.RunnerTests;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_VERSION = 5.0;
- TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
- };
- name = Profile;
- };
- 97C147031CF9000F007C117D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = dwarf;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_TESTABILITY = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 12.0;
- MTL_ENABLE_DEBUG_INFO = YES;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = iphoneos;
- TARGETED_DEVICE_FAMILY = "1,2";
- };
- name = Debug;
- };
- 97C147041CF9000F007C117D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 12.0;
- MTL_ENABLE_DEBUG_INFO = NO;
- SDKROOT = iphoneos;
- SUPPORTED_PLATFORMS = iphoneos;
- SWIFT_COMPILATION_MODE = wholemodule;
- SWIFT_OPTIMIZATION_LEVEL = "-O";
- TARGETED_DEVICE_FAMILY = "1,2";
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- 97C147061CF9000F007C117D /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CLANG_ENABLE_MODULES = YES;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
- ENABLE_BITCODE = NO;
- INFOPLIST_FILE = Runner/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/Frameworks",
- );
- PRODUCT_BUNDLE_IDENTIFIER = com.example.kettlebellTracker;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_VERSION = 5.0;
- VERSIONING_SYSTEM = "apple-generic";
- };
- name = Debug;
- };
- 97C147071CF9000F007C117D /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CLANG_ENABLE_MODULES = YES;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
- ENABLE_BITCODE = NO;
- INFOPLIST_FILE = Runner/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/Frameworks",
- );
- PRODUCT_BUNDLE_IDENTIFIER = com.example.kettlebellTracker;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
- SWIFT_VERSION = 5.0;
- VERSIONING_SYSTEM = "apple-generic";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 331C8088294A63A400263BE5 /* Debug */,
- 331C8089294A63A400263BE5 /* Release */,
- 331C808A294A63A400263BE5 /* Profile */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 97C147031CF9000F007C117D /* Debug */,
- 97C147041CF9000F007C117D /* Release */,
- 249021D3217E4FDB00AE95B9 /* Profile */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 97C147061CF9000F007C117D /* Debug */,
- 97C147071CF9000F007C117D /* Release */,
- 249021D4217E4FDB00AE95B9 /* Profile */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 97C146E61CF9000F007C117D /* Project object */;
-}
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 919434a..0000000
--- a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d9810..0000000
--- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- IDEDidComputeMac32BitWarning
-
-
-
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
deleted file mode 100644
index f9b0d7c..0000000
--- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- PreviewsEnabled
-
-
-
diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
deleted file mode 100644
index 15cada4..0000000
--- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 1d526a1..0000000
--- a/ios/Runner.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d9810..0000000
--- a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- IDEDidComputeMac32BitWarning
-
-
-
diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
deleted file mode 100644
index f9b0d7c..0000000
--- a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- PreviewsEnabled
-
-
-
diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift
deleted file mode 100644
index 6266644..0000000
--- a/ios/Runner/AppDelegate.swift
+++ /dev/null
@@ -1,13 +0,0 @@
-import Flutter
-import UIKit
-
-@main
-@objc class AppDelegate: FlutterAppDelegate {
- override func application(
- _ application: UIApplication,
- didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
- ) -> Bool {
- GeneratedPluginRegistrant.register(with: self)
- return super.application(application, didFinishLaunchingWithOptions: launchOptions)
- }
-}
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100644
index d36b1fa..0000000
--- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ /dev/null
@@ -1,122 +0,0 @@
-{
- "images" : [
- {
- "size" : "20x20",
- "idiom" : "iphone",
- "filename" : "Icon-App-20x20@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "20x20",
- "idiom" : "iphone",
- "filename" : "Icon-App-20x20@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "Icon-App-29x29@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "Icon-App-29x29@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "Icon-App-29x29@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "40x40",
- "idiom" : "iphone",
- "filename" : "Icon-App-40x40@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "40x40",
- "idiom" : "iphone",
- "filename" : "Icon-App-40x40@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "60x60",
- "idiom" : "iphone",
- "filename" : "Icon-App-60x60@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "60x60",
- "idiom" : "iphone",
- "filename" : "Icon-App-60x60@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "Icon-App-20x20@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "Icon-App-20x20@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "Icon-App-29x29@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "Icon-App-29x29@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "Icon-App-40x40@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "Icon-App-40x40@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "Icon-App-76x76@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "Icon-App-76x76@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "83.5x83.5",
- "idiom" : "ipad",
- "filename" : "Icon-App-83.5x83.5@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "1024x1024",
- "idiom" : "ios-marketing",
- "filename" : "Icon-App-1024x1024@1x.png",
- "scale" : "1x"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
deleted file mode 100644
index dc9ada4..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
deleted file mode 100644
index 7353c41..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
deleted file mode 100644
index 797d452..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
deleted file mode 100644
index 6ed2d93..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
deleted file mode 100644
index 4cd7b00..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
deleted file mode 100644
index fe73094..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
deleted file mode 100644
index 321773c..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
deleted file mode 100644
index 797d452..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
deleted file mode 100644
index 502f463..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
deleted file mode 100644
index 0ec3034..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
deleted file mode 100644
index 0ec3034..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
deleted file mode 100644
index e9f5fea..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
deleted file mode 100644
index 84ac32a..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
deleted file mode 100644
index 8953cba..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
deleted file mode 100644
index 0467bf1..0000000
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
deleted file mode 100644
index 0bedcf2..0000000
--- a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "images" : [
- {
- "idiom" : "universal",
- "filename" : "LaunchImage.png",
- "scale" : "1x"
- },
- {
- "idiom" : "universal",
- "filename" : "LaunchImage@2x.png",
- "scale" : "2x"
- },
- {
- "idiom" : "universal",
- "filename" : "LaunchImage@3x.png",
- "scale" : "3x"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
deleted file mode 100644
index 9da19ea..0000000
Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
deleted file mode 100644
index 9da19ea..0000000
Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
deleted file mode 100644
index 9da19ea..0000000
Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
deleted file mode 100644
index 89c2725..0000000
--- a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Launch Screen Assets
-
-You can customize the launch screen with your own desired assets by replacing the image files in this directory.
-
-You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
\ No newline at end of file
diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard
deleted file mode 100644
index f2e259c..0000000
--- a/ios/Runner/Base.lproj/LaunchScreen.storyboard
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard
deleted file mode 100644
index f3c2851..0000000
--- a/ios/Runner/Base.lproj/Main.storyboard
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
deleted file mode 100644
index 18d3bb4..0000000
--- a/ios/Runner/Info.plist
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- $(DEVELOPMENT_LANGUAGE)
- CFBundleDisplayName
- Kettlebell Tracker
- CFBundleExecutable
- $(EXECUTABLE_NAME)
- CFBundleIdentifier
- $(PRODUCT_BUNDLE_IDENTIFIER)
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- kettlebell_tracker
- CFBundlePackageType
- APPL
- CFBundleShortVersionString
- $(FLUTTER_BUILD_NAME)
- CFBundleSignature
- ????
- CFBundleVersion
- $(FLUTTER_BUILD_NUMBER)
- LSRequiresIPhoneOS
-
- UILaunchStoryboardName
- LaunchScreen
- UIMainStoryboardFile
- Main
- UISupportedInterfaceOrientations
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- UISupportedInterfaceOrientations~ipad
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- CADisableMinimumFrameDurationOnPhone
-
- UIApplicationSupportsIndirectInputEvents
-
-
-
diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h
deleted file mode 100644
index 308a2a5..0000000
--- a/ios/Runner/Runner-Bridging-Header.h
+++ /dev/null
@@ -1 +0,0 @@
-#import "GeneratedPluginRegistrant.h"
diff --git a/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift
deleted file mode 100644
index 86a7c3b..0000000
--- a/ios/RunnerTests/RunnerTests.swift
+++ /dev/null
@@ -1,12 +0,0 @@
-import Flutter
-import UIKit
-import XCTest
-
-class RunnerTests: XCTestCase {
-
- func testExample() {
- // If you add code to the Runner application, consider adding tests here.
- // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
- }
-
-}
diff --git a/lib/main.dart b/lib/main.dart
deleted file mode 100644
index d4ab18b..0000000
--- a/lib/main.dart
+++ /dev/null
@@ -1,88 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:kettlebell_tracker/screens/home_screen.dart';
-import 'package:kettlebell_tracker/screens/settings_screen.dart';
-import 'package:kettlebell_tracker/screens/training_screen.dart';
-import 'package:kettlebell_tracker/screens/history_screen.dart';
-import 'package:kettlebell_tracker/theme/app_theme.dart';
-import 'package:sqflite_common_ffi/sqflite_ffi.dart';
-import 'dart:io';
-
-Future main() async {
- WidgetsFlutterBinding.ensureInitialized();
-
- if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
- sqfliteFfiInit();
- databaseFactory = databaseFactoryFfi;
- }
-
- runApp(
- const ProviderScope(child: MyApp()),
- );
-}
-
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
-
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- title: 'Giant Programm Tracker',
- theme: AppTheme.darkTheme,
- home: const MainScreen(),
- debugShowCheckedModeBanner: false,
- );
- }
-}
-
-class MainScreen extends ConsumerStatefulWidget {
- const MainScreen({super.key});
-
- @override
- ConsumerState createState() => _MainScreenState();
-}
-
-class _MainScreenState extends ConsumerState {
- int _selectedIndex = 0;
-
- static const List _widgetOptions = [
- HomeScreen(),
- SettingsScreen(),
- TrainingScreen(),
- HistoryScreen(),
- ];
-
- void _onItemTapped(int index) {
- setState(() {
- _selectedIndex = index;
- });
- }
-
- @override
- Widget build(BuildContext context) {
- final theme = Theme.of(context);
- return Scaffold(
- body: Center(child: _widgetOptions.elementAt(_selectedIndex)),
- bottomNavigationBar: BottomNavigationBar(
- items: const [
- BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
- BottomNavigationBarItem(
- icon: Icon(Icons.settings),
- label: 'Einstellungen',
- ),
- BottomNavigationBarItem(
- icon: Icon(Icons.sports_gymnastics),
- label: 'Training',
- ),
- BottomNavigationBarItem(icon: Icon(Icons.history), label: 'Historie'),
- ],
- currentIndex: _selectedIndex,
- onTap: _onItemTapped,
- type: BottomNavigationBarType.fixed, // Important for more than 3 items
- backgroundColor: theme.colorScheme.surface,
- selectedItemColor: theme.colorScheme.primary,
- unselectedItemColor: AppTheme.oneDarkTextWeak,
- ),
- );
- }
-}
diff --git a/lib/models/training_session.dart b/lib/models/training_session.dart
deleted file mode 100644
index b9c9595..0000000
--- a/lib/models/training_session.dart
+++ /dev/null
@@ -1,55 +0,0 @@
-class TrainingSession {
- final int? id;
- final DateTime date;
- final int sets;
- final double weightLeft;
- final double weightRight;
- final int repsPerSet;
- final int duration; // in seconds
- final String notes;
-
- TrainingSession({
- this.id,
- required this.date,
- required this.sets,
- required this.weightLeft,
- required this.weightRight,
- required this.repsPerSet,
- required this.duration,
- required this.notes,
- });
-
- // Convert a TrainingSession into a Map. The keys must correspond to the names of the
- // columns in the database.
- Map toMap() {
- return {
- 'id': id,
- 'date': date.toIso8601String(),
- 'sets': sets,
- 'weightLeft': weightLeft,
- 'weightRight': weightRight,
- 'repsPerSet': repsPerSet,
- 'duration': duration,
- 'notes': notes,
- };
- }
-
- // Implement fromMap
- factory TrainingSession.fromMap(Map map) {
- return TrainingSession(
- id: map['id'],
- date: DateTime.parse(map['date']),
- sets: map['sets'],
- weightLeft: map['weightLeft'],
- weightRight: map['weightRight'],
- repsPerSet: map['repsPerSet'],
- duration: map['duration'],
- notes: map['notes'],
- );
- }
-
- @override
- String toString() {
- return 'TrainingSession{id: $id, date: $date, sets: $sets, notes: $notes}';
- }
-}
diff --git a/lib/providers/settings_provider.dart b/lib/providers/settings_provider.dart
deleted file mode 100644
index 4cfb85f..0000000
--- a/lib/providers/settings_provider.dart
+++ /dev/null
@@ -1,51 +0,0 @@
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-
-class SettingsState {
- final int trainingTimeMinutes;
- final double weightLeft;
- final double weightRight;
- final int repsPerSet;
- final int goalSets;
- final String notes;
-
- SettingsState({
- this.trainingTimeMinutes = 20,
- this.weightLeft = 16.0,
- this.weightRight = 16.0,
- this.repsPerSet = 5,
- this.goalSets = 5,
- this.notes = "",
- });
-
- SettingsState copyWith({
- int? trainingTimeMinutes,
- double? weightLeft,
- double? weightRight,
- int? repsPerSet,
- int? goalSets,
- String? notes,
- }) {
- return SettingsState(
- trainingTimeMinutes: trainingTimeMinutes ?? this.trainingTimeMinutes,
- weightLeft: weightLeft ?? this.weightLeft,
- weightRight: weightRight ?? this.weightRight,
- repsPerSet: repsPerSet ?? this.repsPerSet,
- goalSets: goalSets ?? this.goalSets,
- notes: notes ?? this.notes,
- );
- }
-}
-
-class SettingsNotifier extends StateNotifier {
- SettingsNotifier() : super(SettingsState());
-
- void updateSettings(SettingsState newSettings) {
- state = newSettings;
- }
-}
-
-final settingsProvider = StateNotifierProvider(
- (ref) {
- return SettingsNotifier();
- },
-);
diff --git a/lib/providers/training_provider.dart b/lib/providers/training_provider.dart
deleted file mode 100644
index dc71e42..0000000
--- a/lib/providers/training_provider.dart
+++ /dev/null
@@ -1,132 +0,0 @@
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:kettlebell_tracker/models/training_session.dart';
-import 'package:kettlebell_tracker/services/api_service.dart';
-import 'package:kettlebell_tracker/services/database_helper.dart';
-import 'dart:async';
-
-// Training State
-class TrainingState {
- final bool isTrainingRunning;
- final int remainingSeconds;
- final int initialDurationSeconds;
- final int setsDone;
- final int goalSets;
- final int repsPerSet;
- final List setTimes;
- final double progress;
- final int secondsSinceLastSet;
- final DateTime? lastSetTimestamp;
-
- TrainingState({
- this.isTrainingRunning = false,
- this.remainingSeconds = 0,
- this.initialDurationSeconds = 0,
- this.setsDone = 0,
- this.goalSets = 5,
- this.repsPerSet = 5,
- this.setTimes = const [],
- this.progress = 0.0,
- this.secondsSinceLastSet = 0,
- this.lastSetTimestamp,
- });
-
- TrainingState copyWith({
- bool? isTrainingRunning,
- int? remainingSeconds,
- int? initialDurationSeconds,
- int? setsDone,
- int? goalSets,
- int? repsPerSet,
- List? setTimes,
- double? progress,
- int? secondsSinceLastSet,
- DateTime? lastSetTimestamp,
- bool clearLastSetTimestamp = false,
- }) {
- return TrainingState(
- isTrainingRunning: isTrainingRunning ?? this.isTrainingRunning,
- remainingSeconds: remainingSeconds ?? this.remainingSeconds,
- initialDurationSeconds:
- initialDurationSeconds ?? this.initialDurationSeconds,
- setsDone: setsDone ?? this.setsDone,
- goalSets: goalSets ?? this.goalSets,
- repsPerSet: repsPerSet ?? this.repsPerSet,
- setTimes: setTimes ?? this.setTimes,
- progress: progress ?? this.progress,
- secondsSinceLastSet: secondsSinceLastSet ?? this.secondsSinceLastSet,
- lastSetTimestamp: clearLastSetTimestamp
- ? null
- : lastSetTimestamp ?? this.lastSetTimestamp,
- );
- }
-}
-
-class TrainingNotifier extends StateNotifier {
- final Ref ref;
- TrainingNotifier(this.ref) : super(TrainingState());
-
- void startTraining(int minutes, int reps, int goal) {
- final duration = minutes * 60;
- state = TrainingState(
- isTrainingRunning: true,
- initialDurationSeconds: duration,
- remainingSeconds: duration,
- repsPerSet: reps,
- goalSets: goal,
- );
- }
-
- void tick() {
- if (state.remainingSeconds > 0) {
- state = state.copyWith(remainingSeconds: state.remainingSeconds - 1);
- }
- }
-
- void tickLastSetTimer() {
- if (state.isTrainingRunning && state.lastSetTimestamp != null) {
- state = state.copyWith(
- secondsSinceLastSet:
- DateTime.now().difference(state.lastSetTimestamp!).inSeconds,
- );
- }
- }
-
- void completeSet() {
- final newSetsDone = state.setsDone + 1;
- final newSetTimes = List.from(state.setTimes)
- ..add(DateTime.now());
- final newProgress = state.goalSets > 0 ? newSetsDone / state.goalSets : 0.0;
-
- state = state.copyWith(
- setsDone: newSetsDone,
- setTimes: newSetTimes,
- progress: newProgress > 1.0 ? 1.0 : newProgress,
- lastSetTimestamp: DateTime.now(),
- secondsSinceLastSet: 0,
- );
- }
-
- Future finishTraining(TrainingSession session) async {
- await DatabaseHelper().saveTraining(session);
- await sendTrainingToBackend(
- reps: session.repsPerSet,
- rest: session.duration / session.sets,
- sets: session.sets);
- ref.refresh(historyProvider);
- resetTraining();
- }
-
- void resetTraining() {
- state = TrainingState();
- }
-}
-
-final historyProvider = FutureProvider>((ref) async {
- return DatabaseHelper().getHistory();
-});
-
-final trainingProvider = StateNotifierProvider(
- (ref) {
- return TrainingNotifier(ref);
- },
-);
diff --git a/lib/screens/history_screen.dart b/lib/screens/history_screen.dart
deleted file mode 100644
index 4b2b3de..0000000
--- a/lib/screens/history_screen.dart
+++ /dev/null
@@ -1,120 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:kettlebell_tracker/models/training_session.dart';
-import 'package:kettlebell_tracker/providers/training_provider.dart';
-import 'package:kettlebell_tracker/theme/app_theme.dart';
-import 'package:kettlebell_tracker/widgets/custom_card.dart';
-import 'package:intl/intl.dart';
-
-class HistoryScreen extends ConsumerWidget {
- const HistoryScreen({super.key});
-
- String _formatDuration(int totalSeconds) {
- final duration = Duration(seconds: totalSeconds);
- final minutes = duration.inMinutes.remainder(60).toString().padLeft(2, '0');
- final seconds = duration.inSeconds.remainder(60).toString().padLeft(2, '0');
- return '$minutes:$seconds';
- }
-
- @override
- Widget build(BuildContext context, WidgetRef ref) {
- final historyAsyncValue = ref.watch(historyProvider);
-
- return Scaffold(
- appBar: AppBar(
- title: const Text('Trainingshistorie'),
- actions: [
- IconButton(
- icon: const Icon(Icons.refresh),
- onPressed: () => ref.refresh(historyProvider),
- ),
- ],
- ),
- body: historyAsyncValue.when(
- data: (history) {
- if (history.isEmpty) {
- return const Center(
- child: Text(
- 'Noch keine Trainingsdaten vorhanden.',
- style: TextStyle(color: AppTheme.oneDarkTextWeak, fontSize: 16),
- ),
- );
- }
- return ListView.builder(
- padding: const EdgeInsets.all(8.0),
- itemCount: history.length,
- itemBuilder: (context, index) {
- final session = history[index];
- return HistoryItemCard(
- session: session, formatDuration: _formatDuration);
- },
- );
- },
- loading: () => const Center(child: CircularProgressIndicator()),
- error: (err, stack) => Center(child: Text('Fehler beim Laden: $err')),
- ),
- );
- }
-}
-
-class HistoryItemCard extends StatelessWidget {
- const HistoryItemCard({
- super.key,
- required this.session,
- required this.formatDuration,
- });
-
- final TrainingSession session;
- final String Function(int) formatDuration;
-
- @override
- Widget build(BuildContext context) {
- final theme = Theme.of(context);
- return CustomCard(
- margin: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 8.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(DateFormat('dd.MM.yyyy HH:mm').format(session.date),
- style: theme.textTheme.titleMedium?.copyWith(
- color: AppTheme.oneDarkPrimary, fontWeight: FontWeight.bold)),
- const Divider(color: AppTheme.oneDarkTextWeak, height: 20),
- _buildInfoRow(Icons.repeat, 'Sätze: ${session.sets}'),
- _buildInfoRow(Icons.fitness_center,
- 'Kettlebells: ${session.weightLeft}kg / ${session.weightRight}kg'),
- _buildInfoRow(Icons.format_list_numbered,
- 'Reps pro Satz: ${session.repsPerSet}'),
- _buildInfoRow(
- Icons.timer, 'Dauer: ${formatDuration(session.duration)}'),
- if (session.notes.isNotEmpty) ...[
- const SizedBox(height: 8),
- _buildInfoRow(Icons.note, 'Notizen: ${session.notes}',
- isNote: true),
- ]
- ],
- ),
- );
- }
-
- Widget _buildInfoRow(IconData icon, String text, {bool isNote = false}) {
- return Padding(
- padding: const EdgeInsets.symmetric(vertical: 4.0),
- child: Row(
- children: [
- Icon(icon, size: 18, color: AppTheme.oneDarkTextWeak),
- const SizedBox(width: 8),
- Expanded(
- child: Text(
- text,
- style: TextStyle(
- fontSize: 15,
- color: isNote ? AppTheme.oneDarkTextWeak : AppTheme.oneDarkText,
- fontStyle: isNote ? FontStyle.italic : FontStyle.normal,
- ),
- ),
- ),
- ],
- ),
- );
- }
-}
diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart
deleted file mode 100644
index 2ad75ca..0000000
--- a/lib/screens/home_screen.dart
+++ /dev/null
@@ -1,55 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:kettlebell_tracker/theme/app_theme.dart';
-
-class HomeScreen extends StatelessWidget {
- const HomeScreen({super.key});
-
- @override
- Widget build(BuildContext context) {
- final theme = Theme.of(context);
- return Scaffold(
- appBar: AppBar(
- title: const Text('Giant Programm Tracker'),
- leading: const Icon(
- Icons.fitness_center,
- color: AppTheme.oneDarkPrimary,
- ),
- ),
- body: Center(
- child: SingleChildScrollView(
- padding: const EdgeInsets.all(24.0),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- const Text(
- "Willkommen beim Giant Programm Tracker!",
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: 24,
- fontWeight: FontWeight.bold,
- color: AppTheme.oneDarkPrimary,
- ),
- ),
- const SizedBox(height: 16),
- const Text(
- "Verwalte deine Kettlebell-Trainings effizient.",
- textAlign: TextAlign.center,
- style: TextStyle(fontSize: 16, color: AppTheme.oneDarkText),
- ),
- const SizedBox(height: 32),
- Icon(
- Icons.fitness_center,
- size: 150,
- color: AppTheme.oneDarkText.withOpacity(0.5),
- ),
- const SizedBox(height: 32),
- // The main navigation is the BottomNavigationBar now.
- // Buttons could be added here for quick access if desired.
- ],
- ),
- ),
- ),
- );
- }
-}
diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart
deleted file mode 100644
index 0b0ae67..0000000
--- a/lib/screens/settings_screen.dart
+++ /dev/null
@@ -1,178 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:kettlebell_tracker/providers/settings_provider.dart';
-import 'package:kettlebell_tracker/theme/app_theme.dart';
-import 'package:kettlebell_tracker/widgets/custom_card.dart';
-import 'package:kettlebell_tracker/widgets/custom_text_field.dart';
-
-class SettingsScreen extends ConsumerStatefulWidget {
- const SettingsScreen({super.key});
-
- @override
- ConsumerState createState() => _SettingsScreenState();
-}
-
-class _SettingsScreenState extends ConsumerState {
- final _formKey = GlobalKey();
-
- late TextEditingController _trainingTimeController;
- late TextEditingController _weightLeftController;
- late TextEditingController _weightRightController;
- late TextEditingController _repsController;
- late TextEditingController _goalSetsController;
- late TextEditingController _notesController;
-
- @override
- void initState() {
- super.initState();
- final settings = ref.read(settingsProvider);
- _trainingTimeController = TextEditingController(
- text: settings.trainingTimeMinutes.toString(),
- );
- _weightLeftController = TextEditingController(
- text: settings.weightLeft.toString(),
- );
- _weightRightController = TextEditingController(
- text: settings.weightRight.toString(),
- );
- _repsController = TextEditingController(
- text: settings.repsPerSet.toString(),
- );
- _goalSetsController = TextEditingController(
- text: settings.goalSets.toString(),
- );
- _notesController = TextEditingController(text: settings.notes);
- }
-
- @override
- void dispose() {
- _trainingTimeController.dispose();
- _weightLeftController.dispose();
- _weightRightController.dispose();
- _repsController.dispose();
- _goalSetsController.dispose();
- _notesController.dispose();
- super.dispose();
- }
-
- void _saveSettings() {
- if (_formKey.currentState!.validate()) {
- final newSettings = SettingsState(
- trainingTimeMinutes: int.parse(_trainingTimeController.text),
- weightLeft: double.parse(_weightLeftController.text),
- weightRight: double.parse(_weightRightController.text),
- repsPerSet: int.parse(_repsController.text),
- goalSets: int.parse(_goalSetsController.text),
- notes: _notesController.text,
- );
- ref.read(settingsProvider.notifier).updateSettings(newSettings);
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Einstellungen gespeichert!'),
- backgroundColor: AppTheme.oneDarkGreen,
- ),
- );
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Bitte korrigiere die Fehler.'),
- backgroundColor: AppTheme.oneDarkRed,
- ),
- );
- }
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(title: const Text('Einstellungen')),
- body: SingleChildScrollView(
- padding: const EdgeInsets.all(16.0),
- child: Form(
- key: _formKey,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- CustomCard(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- "Trainingsparameter",
- style: Theme.of(context).textTheme.titleLarge,
- ),
- const SizedBox(height: 20),
- CustomTextField(
- controller: _trainingTimeController,
- labelText: "Trainingszeit (Minuten)",
- icon: Icons.timer,
- keyboardType: TextInputType.number,
- ),
- const SizedBox(height: 16),
- CustomTextField(
- controller: _weightLeftController,
- labelText: "Linke Kettlebell (kg)",
- icon: Icons.fitness_center,
- keyboardType: TextInputType.number,
- ),
- const SizedBox(height: 16),
- CustomTextField(
- controller: _weightRightController,
- labelText: "Rechte Kettlebell (kg)",
- icon: Icons.fitness_center,
- keyboardType: TextInputType.number,
- ),
- const SizedBox(height: 16),
- CustomTextField(
- controller: _repsController,
- labelText: "Reps pro Satz",
- icon: Icons.repeat,
- keyboardType: TextInputType.number,
- ),
- const SizedBox(height: 16),
- CustomTextField(
- controller: _goalSetsController,
- labelText: "Ziel-Sätze",
- icon: Icons.flag,
- keyboardType: TextInputType.number,
- ),
- ],
- ),
- ),
- const SizedBox(height: 20),
- CustomCard(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- "Zusätzliche Notizen",
- style: Theme.of(context).textTheme.titleLarge,
- ),
- const SizedBox(height: 20),
- CustomTextField(
- controller: _notesController,
- labelText: "Notizen für nächstes Training",
- icon: Icons.note,
- maxLines: 4,
- ),
- ],
- ),
- ),
- const SizedBox(height: 24),
- ElevatedButton.icon(
- onPressed: _saveSettings,
- icon: const Icon(Icons.save),
- label: const Text('Einstellungen speichern'),
- style: ElevatedButton.styleFrom(
- backgroundColor: AppTheme.oneDarkPrimary,
- foregroundColor: Colors.white,
- padding: const EdgeInsets.symmetric(vertical: 16),
- ),
- ),
- ],
- ),
- ),
- ),
- );
- }
-}
diff --git a/lib/screens/training_screen.dart b/lib/screens/training_screen.dart
deleted file mode 100644
index 88dd8b4..0000000
--- a/lib/screens/training_screen.dart
+++ /dev/null
@@ -1,259 +0,0 @@
-import 'dart:async';
-import 'package:flutter/material.dart';
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:kettlebell_tracker/models/training_session.dart';
-import 'package:kettlebell_tracker/providers/settings_provider.dart';
-import 'package:kettlebell_tracker/providers/training_provider.dart';
-import 'package:kettlebell_tracker/theme/app_theme.dart';
-import 'package:kettlebell_tracker/widgets/custom_card.dart';
-import 'package:kettlebell_tracker/services/api_service.dart';
-import 'package:audioplayers/audioplayers.dart';
-import 'package:intl/intl.dart';
-
-class TrainingScreen extends ConsumerStatefulWidget {
- const TrainingScreen({super.key});
-
- @override
- ConsumerState createState() => _TrainingScreenState();
-}
-
-class _TrainingScreenState extends ConsumerState {
- Timer? _mainTimer;
- Timer? _lastSetTimer;
- final _audioPlayer = AudioPlayer();
-
- @override
- void dispose() {
- _stopTimer();
- _audioPlayer.dispose();
- super.dispose();
- }
-
- void _startTraining() {
- _audioPlayer.stop();
- final settings = ref.read(settingsProvider);
- ref.read(trainingProvider.notifier).startTraining(
- settings.trainingTimeMinutes,
- settings.repsPerSet,
- settings.goalSets,
- );
-
- _mainTimer = Timer.periodic(const Duration(seconds: 1), (timer) {
- final notifier = ref.read(trainingProvider.notifier);
- if (notifier.state.remainingSeconds > 0) {
- notifier.tick();
- } else {
- _stopTimer();
- _autoFinishTraining();
- }
- });
-
- _lastSetTimer = Timer.periodic(const Duration(seconds: 1), (timer) {
- ref.read(trainingProvider.notifier).tickLastSetTimer();
- });
- }
-
- void _stopTimer() {
- _mainTimer?.cancel();
- _lastSetTimer?.cancel();
- _mainTimer = null;
- _lastSetTimer = null;
- }
-
- void _completeSet() {
- ref.read(trainingProvider.notifier).completeSet();
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Satz gespeichert!'),
- backgroundColor: AppTheme.oneDarkGreen,
- duration: Duration(seconds: 1),
- ),
- );
- }
-
- void _finishTraining() {
- _stopTimer();
- _audioPlayer.stop();
- final state = ref.read(trainingProvider);
- final settings = ref.read(settingsProvider);
-
- final session = TrainingSession(
- date: DateTime.now(),
- sets: state.setsDone,
- weightLeft: settings.weightLeft,
- weightRight: settings.weightRight,
- repsPerSet: settings.repsPerSet,
- duration: state.initialDurationSeconds - state.remainingSeconds,
- notes: settings.notes,
- );
-
- ref.read(trainingProvider.notifier).finishTraining(session);
-
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Training gespeichert!'),
- backgroundColor: AppTheme.oneDarkPrimary,
- ),
- );
- }
-
- Future _autoFinishTraining() async {
- await _audioPlayer.play(AssetSource('sound/notification.mp3'));
-
- _finishTraining();
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text(
- 'Zeit abgelaufen! Training automatisch beendet und gespeichert.'),
- backgroundColor: AppTheme.oneDarkRed,
- duration: Duration(seconds: 4),
- ),
- );
- }
-
- String _formatDuration(int totalSeconds) {
- final duration = Duration(seconds: totalSeconds);
- final minutes = duration.inMinutes.remainder(60).toString().padLeft(2, '0');
- final seconds = duration.inSeconds.remainder(60).toString().padLeft(2, '0');
- return '$minutes:$seconds';
- }
-
- @override
- Widget build(BuildContext context) {
- final trainingState = ref.watch(trainingProvider);
- final settings = ref.watch(settingsProvider);
- final bool isTrainingRunning = trainingState.isTrainingRunning;
-
- return Scaffold(
- appBar: AppBar(title: const Text('Aktuelles Training')),
- body: SingleChildScrollView(
- padding: const EdgeInsets.all(16.0),
- child: Column(
- children: [
- CustomCard(
- child: Column(
- children: [
- Text(
- 'Verbleibende Zeit: ${_formatDuration(trainingState.remainingSeconds)}',
- style: const TextStyle(
- fontSize: 26,
- fontWeight: FontWeight.bold,
- color: AppTheme.oneDarkPrimary,
- ),
- ),
- const SizedBox(height: 12),
- Text(
- 'Sätze: ${trainingState.setsDone}',
- style: const TextStyle(
- fontSize: 24,
- color: AppTheme.oneDarkYellow,
- ),
- ),
- const SizedBox(height: 8),
- Text(
- 'Reps pro Satz: ${settings.repsPerSet}',
- style: const TextStyle(
- fontSize: 20,
- color: AppTheme.oneDarkAccent,
- ),
- ),
- const SizedBox(height: 12),
- Text(
- 'Zeit seit letztem Satz: ${_formatDuration(trainingState.secondsSinceLastSet)}',
- style: const TextStyle(
- fontSize: 18,
- color: AppTheme.oneDarkTextWeak,
- ),
- ),
- const SizedBox(height: 20),
- LinearProgressIndicator(
- value: trainingState.progress,
- minHeight: 10,
- borderRadius: BorderRadius.circular(5),
- ),
- const SizedBox(height: 8),
- Text(
- 'Fortschritt: ${(trainingState.progress * 100).toStringAsFixed(0)}%',
- style: const TextStyle(
- fontSize: 16,
- color: AppTheme.oneDarkText,
- ),
- ),
- ],
- ),
- ),
- const SizedBox(height: 20),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: [
- ElevatedButton.icon(
- onPressed: isTrainingRunning ? null : _startTraining,
- icon: const Icon(Icons.play_arrow),
- label: const Text('Start'),
- style: ElevatedButton.styleFrom(
- backgroundColor: AppTheme.oneDarkGreen,
- foregroundColor: AppTheme.oneDarkTextWeak,
- ),
- ),
- ElevatedButton.icon(
- onPressed: !isTrainingRunning ? null : _completeSet,
- icon: const Icon(Icons.check_circle),
- label: const Text('Satz'),
- style: ElevatedButton.styleFrom(
- backgroundColor: AppTheme.oneDarkPrimary,
- foregroundColor: AppTheme.oneDarkTextWeak,
- ),
- ),
- ElevatedButton.icon(
- onPressed: !isTrainingRunning ? null : _finishTraining,
- icon: const Icon(Icons.stop),
- label: const Text('Beenden'),
- style: ElevatedButton.styleFrom(
- backgroundColor: AppTheme.oneDarkRed,
- foregroundColor: AppTheme.oneDarkTextWeak,
- ),
- ),
- ],
- ),
- const SizedBox(height: 20),
- const Divider(),
- Text(
- "Satz-Historie",
- style: Theme.of(
- context,
- ).textTheme.titleLarge?.copyWith(color: AppTheme.oneDarkAccent),
- ),
- const SizedBox(height: 10),
- CustomCard(
- child: SizedBox(
- height: 150,
- child: trainingState.setTimes.isEmpty
- ? const Center(
- child: Text(
- "Noch keine Sätze in dieser Einheit.",
- style: TextStyle(color: AppTheme.oneDarkTextWeak),
- ),
- )
- : ListView.builder(
- itemCount: trainingState.setTimes.length,
- itemBuilder: (context, index) {
- final setTime = trainingState.setTimes[index];
- return Center(
- child: Text(
- '#${index + 1} um ${DateFormat.Hms().format(setTime)} (${settings.repsPerSet} Reps)',
- style: const TextStyle(
- fontSize: 16,
- color: AppTheme.oneDarkGreen,
- ),
- ),
- );
- },
- ),
- ),
- ),
- ],
- ),
- ),
- );
- }
-}
diff --git a/lib/services/api_service.dart b/lib/services/api_service.dart
deleted file mode 100644
index 63b47b6..0000000
--- a/lib/services/api_service.dart
+++ /dev/null
@@ -1,28 +0,0 @@
-import 'package:http/http.dart' as http;
-import 'dart:convert';
-
-import 'package:kettlebell_tracker/services/device_service.dart';
-
-Future sendTrainingToBackend({
- required int reps,
- required double rest,
- required int sets,
-}) async {
- final uuid = await DeviceIdService.getOrCreateUUID();
- final url = Uri.parse('http://192.169.178.43:8000/trainings/');
- final response = await http.post(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode({
- 'reps': reps,
- 'rest': rest,
- 'sets': sets,
- 'uuid': uuid,
- }),
- );
- if (response.statusCode == 200) {
- print('Training erfolgreich an Backend gesendet.');
- } else {
- print('Fehler beim Senden: ${response.body}');
- }
-}
diff --git a/lib/services/database_helper.dart b/lib/services/database_helper.dart
deleted file mode 100644
index a2f98e5..0000000
--- a/lib/services/database_helper.dart
+++ /dev/null
@@ -1,65 +0,0 @@
-import 'package:sqflite/sqflite.dart';
-import 'package:path/path.dart';
-import 'package:kettlebell_tracker/models/training_session.dart';
-
-class DatabaseHelper {
- static final DatabaseHelper _instance = DatabaseHelper._internal();
- factory DatabaseHelper() => _instance;
- DatabaseHelper._internal();
-
- static Database? _database;
-
- Future get database async {
- if (_database != null) return _database!;
- _database = await _initDb();
- return _database!;
- }
-
- // Initialize the database
- Future _initDb() async {
- final dbPath = await getDatabasesPath();
- final path = join(dbPath, 'giant_training.db');
-
- return await openDatabase(path, version: 1, onCreate: _onCreate);
- }
-
- // Create the database table
- void _onCreate(Database db, int version) async {
- await db.execute('''
- CREATE TABLE training (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- date TEXT NOT NULL,
- sets INTEGER,
- weightLeft REAL,
- weightRight REAL,
- repsPerSet INTEGER,
- duration INTEGER,
- notes TEXT
- )
- ''');
- }
-
- // Save a training session
- Future saveTraining(TrainingSession session) async {
- final db = await database;
- await db.insert(
- 'training',
- session.toMap(),
- conflictAlgorithm: ConflictAlgorithm.replace,
- );
- }
-
- // Get training history (last 20 entries)
- Future> getHistory() async {
- final db = await database;
- final List