commit 7f467a414ed7e89c044d1f89b83d8022e20eb49a Author: webfussel Date: Fri Aug 1 18:54:15 2025 +0200 INIT: initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..17d4f27 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +*.iml +.gradle +.kotlin +.idea +/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/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..6161d07 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,56 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.kotlin.compose) +} + +android { + namespace = "de.webfussel.soulecho" + compileSdk = 35 + + defaultConfig { + applicationId = "de.webfussel.soulecho" + minSdk = 33 + targetSdk = 35 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" + } + buildFeatures { + compose = true + } +} + +dependencies { + + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.lifecycle.runtime.ktx) + implementation(libs.androidx.activity.compose) + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.ui) + implementation(libs.androidx.ui.graphics) + implementation(libs.androidx.ui.tooling.preview) + implementation(libs.androidx.material3) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) + androidTestImplementation(platform(libs.androidx.compose.bom)) + androidTestImplementation(libs.androidx.ui.test.junit4) + debugImplementation(libs.androidx.ui.tooling) + debugImplementation(libs.androidx.ui.test.manifest) +} \ 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/webfussel/soulecho/ExampleInstrumentedTest.kt b/app/src/androidTest/java/de/webfussel/soulecho/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..bf17f70 --- /dev/null +++ b/app/src/androidTest/java/de/webfussel/soulecho/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package de.webfussel.soulecho + +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.webfussel.soulecho", 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..4940629 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/de/webfussel/soulecho/MainActivity.kt b/app/src/main/java/de/webfussel/soulecho/MainActivity.kt new file mode 100644 index 0000000..f2d1896 --- /dev/null +++ b/app/src/main/java/de/webfussel/soulecho/MainActivity.kt @@ -0,0 +1,49 @@ +package de.webfussel.soulecho + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.tooling.preview.Preview +import de.webfussel.soulecho.mood.MoodSection +import de.webfussel.soulecho.mood.PossibleMood +import de.webfussel.soulecho.navigation.Drawer +import de.webfussel.soulecho.ui.theme.SoulEchoTheme + +@Composable +fun SoulEchoApp() { + var currentMood by remember { + mutableStateOf(PossibleMood.HAPPY) + } + SoulEchoTheme (currentTheme = currentMood) { + Drawer ( + currentMood = currentMood, + ) { + MoodSection( + currentMood = currentMood, + onMoodChange = { currentMood = it } + ) + } + } +} + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContent { + SoulEchoApp() + } + } +} + +@Preview(showBackground = true) +@Composable +fun DefaultPreview() { + SoulEchoApp() +} \ No newline at end of file diff --git a/app/src/main/java/de/webfussel/soulecho/mood/Choice.kt b/app/src/main/java/de/webfussel/soulecho/mood/Choice.kt new file mode 100644 index 0000000..0729f74 --- /dev/null +++ b/app/src/main/java/de/webfussel/soulecho/mood/Choice.kt @@ -0,0 +1,120 @@ +package de.webfussel.soulecho.mood + +import android.inputmethodservice.Keyboard +import androidx.compose.foundation.border +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.lazy.grid.GridCells +import androidx.compose.foundation.lazy.grid.LazyVerticalGrid +import androidx.compose.foundation.lazy.grid.items +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.text.BasicTextField +import androidx.compose.material3.Card +import androidx.compose.material3.CardDefaults +import androidx.compose.material3.Icon +import androidx.compose.material3.Surface +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton +import androidx.compose.material3.TextField +import androidx.compose.material3.TextFieldDefaults +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.compose.ui.window.Dialog +import de.webfussel.soulecho.mood.Moods.getAllMoods +import de.webfussel.soulecho.ui.theme.getColorForMood + +@Composable +fun MoodChoice ( + onDismiss: () -> Unit = {}, + onConfirm: (PossibleMood) -> Unit = {}, +) { + var selectedMood by remember { mutableStateOf(PossibleMood.HAPPY) } + var info by remember { mutableStateOf("") } + + Dialog( + onDismissRequest = onDismiss, + ) { + Card ( + colors = CardDefaults.cardColors( + containerColor = Color.White, + ), + modifier = Modifier + .fillMaxWidth() + .padding(16.dp), + ) { + Text("Wie fühlst du dich gerade?", modifier = Modifier.padding(16.dp), color = Color.Black) + LazyVerticalGrid( + columns = GridCells.Fixed(4), + modifier = Modifier.padding(horizontal = 16.dp), + ) { + items(getAllMoods()) { + mood -> + val color = getColorForMood(mood.id) + Surface ( + color = if (mood.id == selectedMood) color.bg else Color.Transparent, + modifier = Modifier + .clickable { selectedMood = mood.id } + ) { + Column ( + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Icon( + painter = painterResource(mood.icon), + contentDescription = mood.label, + modifier = Modifier.padding(top = 16.dp, start = 16.dp, end = 16.dp, bottom = 0.dp), + tint = color.fg, + ) + Text( + text = mood.label, + color = color.fg, + fontSize = 8.sp, + ) + } + } + } + } + Text("Warum?", modifier = Modifier.padding(16.dp), color = Color.Black) + BasicTextField( + value = info, + onValueChange = { info = it }, + textStyle = TextStyle(color = Color.Black), + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 16.dp) + .border(width = 1.dp, color = Color.Gray, shape = RoundedCornerShape(4.dp)) + .padding(16.dp) + ) + Spacer(modifier = Modifier.height(16.dp)) + Row( + horizontalArrangement = Arrangement.End, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 16.dp), + ) { + TextButton(onClick = onDismiss) { + Text("Abbrechen", color = Color(0xFFAA0000)) + } + TextButton(onClick = { onConfirm(selectedMood) }) { + Text("Bestätigen", color = Color(0xFF007AFF)) + } + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/de/webfussel/soulecho/mood/Model.kt b/app/src/main/java/de/webfussel/soulecho/mood/Model.kt new file mode 100644 index 0000000..0446005 --- /dev/null +++ b/app/src/main/java/de/webfussel/soulecho/mood/Model.kt @@ -0,0 +1,102 @@ +package de.webfussel.soulecho.mood + +import androidx.annotation.DrawableRes +import de.webfussel.soulecho.R + +enum class PossibleMood { + HAPPY, + RELAXED, + CONTENT, + SAD, + ANGRY, + DISAPPOINTED, + EMPTY, + ANXIOUS, + NERVOUS, + PANIC +} + +data class Mood( + val label: String, + val id: PossibleMood, + @DrawableRes val icon: Int +) + +object Moods { + private val happy = Mood( + label = "Glücklich", + id = PossibleMood.HAPPY, + icon = R.drawable.face_smile + ) + + private val relaxed = Mood( + label = "Entspannt", + id = PossibleMood.RELAXED, + icon = R.drawable.face_relieved + ) + + private val content = Mood( + label = "Zufrieden", + id = PossibleMood.CONTENT, + icon = R.drawable.face_smile_relaxed + ) + + private val sad = Mood( + label = "Traurig", + id = PossibleMood.SAD, + icon = R.drawable.face_frown + ) + + private val angry = Mood( + label = "Wütend", + id = PossibleMood.ANGRY, + icon = R.drawable.face_pouting + ) + + private val disappointed = Mood( + label = "Enttäuscht", + id = PossibleMood.DISAPPOINTED, + icon = R.drawable.face_disappointed + ) + + private val empty = Mood( + label = "Leer", + id = PossibleMood.EMPTY, + icon = R.drawable.face_meh + ) + + private val anxious = Mood( + label = "Ängstlich", + id = PossibleMood.ANXIOUS, + icon = R.drawable.face_anxious_sweat + ) + + private val nervous = Mood( + label = "Nervös", + id = PossibleMood.NERVOUS, + icon = R.drawable.face_confounded + ) + + private val panic = Mood( + label = "Panisch", + id = PossibleMood.PANIC, + icon = R.drawable.face_scream + ) + + val moods: Map = mapOf( + PossibleMood.HAPPY to happy, + PossibleMood.RELAXED to relaxed, + PossibleMood.CONTENT to content, + PossibleMood.SAD to sad, + PossibleMood.ANGRY to angry, + PossibleMood.DISAPPOINTED to disappointed, + PossibleMood.EMPTY to empty, + PossibleMood.ANXIOUS to anxious, + PossibleMood.NERVOUS to nervous, + PossibleMood.PANIC to panic + ) + + fun getMoodById(id: PossibleMood): Mood = moods[id]!! + + fun getAllMoods(): List = moods.values.toList() +} diff --git a/app/src/main/java/de/webfussel/soulecho/mood/Section.kt b/app/src/main/java/de/webfussel/soulecho/mood/Section.kt new file mode 100644 index 0000000..18058db --- /dev/null +++ b/app/src/main/java/de/webfussel/soulecho/mood/Section.kt @@ -0,0 +1,81 @@ +package de.webfussel.soulecho.mood + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material3.FloatingActionButton +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.res.painterResource +import androidx.compose.material3.Text +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +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.webfussel.soulecho.mood.Moods.getMoodById +import de.webfussel.soulecho.R + +@Composable +fun MoodSection( + currentMood: PossibleMood = PossibleMood.HAPPY, + onMoodChange: (PossibleMood) -> Unit = {} +) { + var dialogOpen by remember { mutableStateOf(false) } + val theme = MaterialTheme.colorScheme + Box(modifier = Modifier.fillMaxSize()) { + Column( + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center, + modifier = Modifier.fillMaxSize() + ) { + val mood = getMoodById(currentMood) + Icon( + painter = painterResource(mood.icon), + contentDescription = "Mood", + modifier = Modifier + .size(240.dp) + ) + Spacer(modifier = Modifier.size(16.dp)) + Text(mood.label, fontWeight = FontWeight.Bold, fontSize = 32.sp) + Text("Läuft jetzt nativ") + } + FloatingActionButton( + containerColor = theme.primary, + onClick = { + dialogOpen = true + }, + modifier = Modifier + .align(Alignment.BottomEnd) + .size(100.dp) + .padding(24.dp), + + ) { + Icon( + painter = painterResource(R.drawable.face_smile_plus), + contentDescription = "Change Mood", + modifier = Modifier + .size(32.dp) + .padding(start = 4.dp) + ) + } + when { + dialogOpen -> MoodChoice( + onDismiss = { dialogOpen = false }, + onConfirm = { + dialogOpen = false + onMoodChange(it) + } + ) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/de/webfussel/soulecho/navigation/Drawer.kt b/app/src/main/java/de/webfussel/soulecho/navigation/Drawer.kt new file mode 100644 index 0000000..4e719a4 --- /dev/null +++ b/app/src/main/java/de/webfussel/soulecho/navigation/Drawer.kt @@ -0,0 +1,223 @@ +package de.webfussel.soulecho.navigation +import de.webfussel.soulecho.R + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Menu +import androidx.compose.material3.DrawerValue +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.ModalDrawerSheet +import androidx.compose.material3.ModalNavigationDrawer +import androidx.compose.material3.NavigationDrawerItem +import androidx.compose.material3.NavigationDrawerItemDefaults +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Surface +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.material3.rememberDrawerState +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberCoroutineScope +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.Shadow +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import de.webfussel.soulecho.mood.Moods.getMoodById +import de.webfussel.soulecho.mood.PossibleMood +import kotlinx.coroutines.launch + +@Composable +fun CustomNavigationDrawerItem( + icon: @Composable () -> Unit, + label: @Composable () -> Unit, + selected: Boolean, + onClick: () -> Unit, + modifier: Modifier = Modifier, + contentPadding: PaddingValues = PaddingValues(horizontal = 12.dp, vertical = 8.dp) +) { + Surface( + selected = selected, + onClick = onClick, + modifier = modifier.fillMaxWidth(), + color = if (selected) MaterialTheme.colorScheme.primary else Color.Transparent, + shape = RoundedCornerShape(12.dp) + ) { + Row( + modifier = Modifier.padding(contentPadding), + verticalAlignment = Alignment.CenterVertically + ) { + icon() + Spacer(modifier = Modifier.width(12.dp)) + label() + } + } +} + +@Composable +fun NavigationBlock ( + items : List, + currentNavigation: NavigationEntry, + onNavigationItemClicked: (NavigationEntry) -> Unit = {}, + currentMood: PossibleMood = PossibleMood.HAPPY, +) { + val theme = MaterialTheme.colorScheme + + for (item in items) { + CustomNavigationDrawerItem( + icon = { + Icon( + painterResource( + if (item.id == "current") getMoodById(currentMood).icon else item.icon + ), + contentDescription = item.label, + modifier = Modifier.size(20.dp), + ) + }, + label = { Text(item.label) }, + selected = item == currentNavigation, + onClick = { onNavigationItemClicked(item) }, + modifier = Modifier.padding(horizontal = 16.dp), + ) + } +} + +@Composable +fun DrawerTop() { + Box ( + modifier = Modifier + .fillMaxWidth() + .height(160.dp) + ){ + Image( + painterResource(R.drawable.nav_header_image), + contentDescription = "Logo", + contentScale = androidx.compose.ui.layout.ContentScale.Crop, + modifier = Modifier.fillMaxWidth() + ) + Text( + text = "Soul Echo", + modifier = Modifier + .align(Alignment.BottomStart) + .padding(bottom = 16.dp, start = 16.dp), + style = TextStyle( + fontSize = 24.sp, + shadow = Shadow( + color = Color.Black, + offset = Offset(2f, 5f), + blurRadius = 2f, + ) + ), + color = Color.White, + ) + } +} + +@Composable +fun DrawerContent ( + currentMood: PossibleMood = PossibleMood.HAPPY, +) { + var currentNavigation by remember { + mutableStateOf(Navigation.getTopNavigation()[0]) + } + + ModalDrawerSheet( + modifier = Modifier.width(224.dp) + ) { + Column { + DrawerTop() + Spacer(Modifier.height(12.dp)) + + NavigationBlock( + items = Navigation.getTopNavigation(), + currentNavigation = currentNavigation, + onNavigationItemClicked = { currentNavigation = it }, + currentMood = currentMood, + ) + Spacer(Modifier.weight(1f)) + NavigationBlock( + items = Navigation.getBottomNavigation(), + currentNavigation = currentNavigation, + onNavigationItemClicked = { currentNavigation = it }, + ) + } + } +} + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun Drawer ( + currentMood: PossibleMood = PossibleMood.HAPPY, + content: @Composable (PaddingValues) -> Unit +) { + val state = rememberDrawerState(initialValue = DrawerValue.Closed) + val scope = rememberCoroutineScope() + val theme = MaterialTheme.colorScheme + var currentPage by remember { mutableStateOf("Stimmung") } + + ModalNavigationDrawer( + drawerContent = { DrawerContent(currentMood = currentMood) }, + drawerState = state + ) { + Scaffold ( + topBar = { + TopAppBar( + title = { Text(currentPage) }, + colors = TopAppBarDefaults.topAppBarColors( + containerColor = theme.background, + titleContentColor = theme.primary, + ), + navigationIcon = { + IconButton(onClick = { scope.launch { + if (state.isClosed) state.open() else state.close() + } }) { + Icon( + painter = painterResource(R.drawable.bars_staggered), + contentDescription = "Menu" + ) + } + } + ) + } + ) { + innerPadding -> content(innerPadding) + } + } +} + +@Preview +@Composable +fun DrawerPreview() { + Drawer { + Text("Test", modifier = Modifier.padding(it)) + } +} + +@Preview +@Composable +fun DrawerContentPreview() { + DrawerContent() +} \ No newline at end of file diff --git a/app/src/main/java/de/webfussel/soulecho/navigation/Model.kt b/app/src/main/java/de/webfussel/soulecho/navigation/Model.kt new file mode 100644 index 0000000..0421153 --- /dev/null +++ b/app/src/main/java/de/webfussel/soulecho/navigation/Model.kt @@ -0,0 +1,54 @@ +package de.webfussel.soulecho.navigation + +import androidx.annotation.DrawableRes +import de.webfussel.soulecho.R + +data class NavigationEntry ( + val id: String, + val label: String, + @DrawableRes val icon: Int +) + +object Navigation { + private val home = NavigationEntry( + id = "current", + label = "Aktuell", + icon = R.drawable.face_smile, + ) + + private val history = NavigationEntry( + id = "history", + label = "Verlauf", + icon = R.drawable.clock_rotate_left, + ) + + private val year = NavigationEntry( + id = "year", + label = "Dein Jahr", + icon = R.drawable.calendar_days, + ) + + private val settings = NavigationEntry( + id = "settings", + label = "Einstellungen", + icon = R.drawable.gears, + ) + + private val updates = NavigationEntry( + id = "version", + label = "Version", + icon = R.drawable.gear_code, + ) + + private val imp = NavigationEntry( + id = "imp", + label = "Impressum", + icon = R.drawable.square_info, + ) + + val top = listOf(home, history, year) + val bottom = listOf(settings, updates, imp) + + fun getTopNavigation() = top + fun getBottomNavigation() = bottom +} \ No newline at end of file diff --git a/app/src/main/java/de/webfussel/soulecho/ui/theme/Color.kt b/app/src/main/java/de/webfussel/soulecho/ui/theme/Color.kt new file mode 100644 index 0000000..3e07c10 --- /dev/null +++ b/app/src/main/java/de/webfussel/soulecho/ui/theme/Color.kt @@ -0,0 +1,62 @@ +package de.webfussel.soulecho.ui.theme + +import androidx.compose.ui.graphics.Color +import de.webfussel.soulecho.mood.PossibleMood + +// Happy colors +val HappyFg = Color(0xFF007822) +val HappyBg = Color(0xFFEEFFF4) + +// Relaxed colors +val RelaxedFg = Color(0xFF0093C1) +val RelaxedBg = Color(0xFFE5F9FF) + +// Content colors +val ContentFg = Color(0xFF499009) +val ContentBg = Color(0xFFF1FAEA) + +// Sad colors +val SadFg = Color(0xFF001F88) +val SadBg = Color(0xFFECEFF7) + +// Angry colors +val AngryFg = Color(0xFF840B15) +val AngryBg = Color(0xFFFDE7E9) + +// Disappointed colors +val DisappointedFg = Color(0xFF8C0095) +val DisappointedBg = Color(0xFFFCE2FF) + +// Empty colors +val EmptyFg = Color(0xFF262626) +val EmptyBg = Color(0xFFF2F2F2) + +// Anxious colors +val AnxiousFg = Color(0xFFC35700) +val AnxiousBg = Color(0xFFFFEAE5) + +// Nervous colors +val NervousFg = Color(0xFFB6820F) +val NervousBg = Color(0xFFFFF7E5) + +// Panic colors +val PanicFg = Color(0xFF3F0D10) +val PanicBg = Color(0xFFF0E9EA) + +data class ColorScheme( + val fg : Color, + val bg : Color, +) + +fun getColorForMood(mood: PossibleMood) : ColorScheme = when (mood) { + PossibleMood.HAPPY -> ColorScheme(HappyFg, HappyBg) + PossibleMood.RELAXED -> ColorScheme(RelaxedFg, RelaxedBg) + PossibleMood.CONTENT -> ColorScheme(ContentFg, ContentBg) + PossibleMood.SAD -> ColorScheme(SadFg, SadBg) + PossibleMood.ANGRY -> ColorScheme(AngryFg, AngryBg) + PossibleMood.DISAPPOINTED -> ColorScheme(DisappointedFg, DisappointedBg) + PossibleMood.EMPTY -> ColorScheme(EmptyFg, EmptyBg) + PossibleMood.ANXIOUS -> ColorScheme(AnxiousFg, AnxiousBg) + PossibleMood.NERVOUS -> ColorScheme(NervousFg, NervousBg) + PossibleMood.PANIC -> ColorScheme(PanicFg, PanicBg) +} \ No newline at end of file diff --git a/app/src/main/java/de/webfussel/soulecho/ui/theme/Theme.kt b/app/src/main/java/de/webfussel/soulecho/ui/theme/Theme.kt new file mode 100644 index 0000000..d1b113b --- /dev/null +++ b/app/src/main/java/de/webfussel/soulecho/ui/theme/Theme.kt @@ -0,0 +1,64 @@ +package de.webfussel.soulecho.ui.theme + +import android.os.Build +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.dynamicDarkColorScheme +import androidx.compose.material3.dynamicLightColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.platform.LocalContext +import de.webfussel.soulecho.mood.PossibleMood + +// Base-Konfiguration für alle Themes +private val BaseColorConfig = object { + val onPrimary = Color.White +} + +// Hilfsfunktion zum Erstellen von ColorSchemes +private fun createEmotionColorScheme(fgColor: Color, bgColor: Color) = lightColorScheme( + primary = fgColor, + background = bgColor, + surface = bgColor, + onPrimary = BaseColorConfig.onPrimary, + onBackground = fgColor, + onSurface = fgColor, +) + + +private val HappyColorTheme = createEmotionColorScheme(HappyFg, HappyBg) +private val RelaxedColorTheme = createEmotionColorScheme(RelaxedFg, RelaxedBg) +private val ContentColorTheme = createEmotionColorScheme(ContentFg, ContentBg) +private val SadColorTheme = createEmotionColorScheme(SadFg, SadBg) +private val AngryColorTheme = createEmotionColorScheme(AngryFg, AngryBg) +private val DisappointedColorTheme = createEmotionColorScheme(DisappointedFg, DisappointedBg) +private val EmptyColorTheme = createEmotionColorScheme(EmptyFg, EmptyBg) +private val AnxiousColorTheme = createEmotionColorScheme(AnxiousFg, AnxiousBg) +private val NervousColorTheme = createEmotionColorScheme(NervousFg, NervousBg) +private val PanicColorTheme = createEmotionColorScheme(PanicFg, PanicBg) + +@Composable +fun SoulEchoTheme( + currentTheme: PossibleMood = PossibleMood.HAPPY, + content: @Composable () -> Unit +) { + val colorScheme = when (currentTheme) { + PossibleMood.HAPPY -> HappyColorTheme + PossibleMood.RELAXED -> RelaxedColorTheme + PossibleMood.CONTENT -> ContentColorTheme + PossibleMood.SAD -> SadColorTheme + PossibleMood.ANGRY -> AngryColorTheme + PossibleMood.DISAPPOINTED -> DisappointedColorTheme + PossibleMood.EMPTY -> EmptyColorTheme + PossibleMood.ANXIOUS -> AnxiousColorTheme + PossibleMood.NERVOUS -> NervousColorTheme + PossibleMood.PANIC -> PanicColorTheme + } + + MaterialTheme( + colorScheme = colorScheme, + typography = Typography, + content = content + ) +} \ No newline at end of file diff --git a/app/src/main/java/de/webfussel/soulecho/ui/theme/Type.kt b/app/src/main/java/de/webfussel/soulecho/ui/theme/Type.kt new file mode 100644 index 0000000..d673338 --- /dev/null +++ b/app/src/main/java/de/webfussel/soulecho/ui/theme/Type.kt @@ -0,0 +1,34 @@ +package de.webfussel.soulecho.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 + +// Set of Material typography styles to start with +val Typography = Typography( + bodyLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 16.sp, + lineHeight = 24.sp, + letterSpacing = 0.5.sp + ) + /* Other default text styles to override + titleLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 22.sp, + lineHeight = 28.sp, + letterSpacing = 0.sp + ), + labelSmall = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 11.sp, + lineHeight = 16.sp, + letterSpacing = 0.5.sp + ) + */ +) \ No newline at end of file diff --git a/app/src/main/res/drawable/bars_staggered.xml b/app/src/main/res/drawable/bars_staggered.xml new file mode 100644 index 0000000..e842729 --- /dev/null +++ b/app/src/main/res/drawable/bars_staggered.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/calendar_days.xml b/app/src/main/res/drawable/calendar_days.xml new file mode 100644 index 0000000..da29040 --- /dev/null +++ b/app/src/main/res/drawable/calendar_days.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/clock_rotate_left.xml b/app/src/main/res/drawable/clock_rotate_left.xml new file mode 100644 index 0000000..1124611 --- /dev/null +++ b/app/src/main/res/drawable/clock_rotate_left.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/face_anxious_sweat.xml b/app/src/main/res/drawable/face_anxious_sweat.xml new file mode 100644 index 0000000..57be584 --- /dev/null +++ b/app/src/main/res/drawable/face_anxious_sweat.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/face_confounded.xml b/app/src/main/res/drawable/face_confounded.xml new file mode 100644 index 0000000..5935700 --- /dev/null +++ b/app/src/main/res/drawable/face_confounded.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/face_disappointed.xml b/app/src/main/res/drawable/face_disappointed.xml new file mode 100644 index 0000000..3ae086a --- /dev/null +++ b/app/src/main/res/drawable/face_disappointed.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/face_dotted.xml b/app/src/main/res/drawable/face_dotted.xml new file mode 100644 index 0000000..24c3570 --- /dev/null +++ b/app/src/main/res/drawable/face_dotted.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/face_frown.xml b/app/src/main/res/drawable/face_frown.xml new file mode 100644 index 0000000..9067f96 --- /dev/null +++ b/app/src/main/res/drawable/face_frown.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/face_meh.xml b/app/src/main/res/drawable/face_meh.xml new file mode 100644 index 0000000..2fc84ef --- /dev/null +++ b/app/src/main/res/drawable/face_meh.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/face_pouting.xml b/app/src/main/res/drawable/face_pouting.xml new file mode 100644 index 0000000..5837af5 --- /dev/null +++ b/app/src/main/res/drawable/face_pouting.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/face_relieved.xml b/app/src/main/res/drawable/face_relieved.xml new file mode 100644 index 0000000..2a42e20 --- /dev/null +++ b/app/src/main/res/drawable/face_relieved.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/face_scream.xml b/app/src/main/res/drawable/face_scream.xml new file mode 100644 index 0000000..3a2beb4 --- /dev/null +++ b/app/src/main/res/drawable/face_scream.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/face_smile.xml b/app/src/main/res/drawable/face_smile.xml new file mode 100644 index 0000000..ad10318 --- /dev/null +++ b/app/src/main/res/drawable/face_smile.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/face_smile_plus.xml b/app/src/main/res/drawable/face_smile_plus.xml new file mode 100644 index 0000000..dbf9dbb --- /dev/null +++ b/app/src/main/res/drawable/face_smile_plus.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/face_smile_relaxed.xml b/app/src/main/res/drawable/face_smile_relaxed.xml new file mode 100644 index 0000000..93d5478 --- /dev/null +++ b/app/src/main/res/drawable/face_smile_relaxed.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/gear_code.xml b/app/src/main/res/drawable/gear_code.xml new file mode 100644 index 0000000..a809f09 --- /dev/null +++ b/app/src/main/res/drawable/gear_code.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/gears.xml b/app/src/main/res/drawable/gears.xml new file mode 100644 index 0000000..17aa734 --- /dev/null +++ b/app/src/main/res/drawable/gears.xml @@ -0,0 +1,7 @@ + + + + + + + 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..956b344 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..1ee1493 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/nav_header_image.jpg b/app/src/main/res/drawable/nav_header_image.jpg new file mode 100644 index 0000000..8cd89b6 Binary files /dev/null and b/app/src/main/res/drawable/nav_header_image.jpg differ diff --git a/app/src/main/res/drawable/square_info.xml b/app/src/main/res/drawable/square_info.xml new file mode 100644 index 0000000..4f32e92 --- /dev/null +++ b/app/src/main/res/drawable/square_info.xml @@ -0,0 +1,7 @@ + + + + + + + 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..50ec886 --- /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..50ec886 --- /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..c7d761b --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Soul Echo + \ 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..f640fda --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,4 @@ + + +