From 6b716afb621b88f272c72182e53a55aed10aa63d Mon Sep 17 00:00:00 2001 From: Clara Dautermann Date: Mon, 12 May 2025 21:58:53 +0200 Subject: [PATCH 1/7] compose setup --- DBTApp/.gitignore | 173 ------------------ DBTApp/.idea/.gitignore | 3 - DBTApp/.idea/.name | 1 - DBTApp/.idea/codeStyles/Project.xml | 123 ------------- DBTApp/.idea/codeStyles/codeStyleConfig.xml | 5 - DBTApp/.idea/deploymentTargetSelector.xml | 6 - DBTApp/.idea/gradle.xml | 1 - DBTApp/app/build.gradle.kts | 18 +- .../ExampleInstrumentedTest.kt | 4 +- DBTApp/app/src/main/AndroidManifest.xml | 14 +- .../dbt/activities/FavouritesFragment.kt | 60 ------ .../de/cdaut/dbt/activities/HomeActivity.kt | 65 ------- .../de/cdaut/dbt/activities/HomeFragment.kt | 34 ---- .../cdaut/dbt/activities/SkillListFragment.kt | 60 ------ .../dbt/activities/SkillsChainsFragment.kt | 60 ------ .../cdaut/dbt/activities/TrackingFragment.kt | 60 ------ .../res/drawable/baseline_menu_book_24.xml | 11 -- .../src/main/res/drawable/emergency_24px.xml | 10 - .../app/src/main/res/drawable/home_24px.xml | 10 - .../drawable/outline_calendar_month_24.xml | 5 - .../app/src/main/res/drawable/sort_24px.xml | 11 -- .../app/src/main/res/drawable/star_24px.xml | 10 - .../app/src/main/res/layout/activity_home.xml | 12 -- .../app/src/main/res/layout/content_home.xml | 47 ----- .../main/res/layout/fragment_favourites.xml | 20 -- .../app/src/main/res/layout/fragment_home.xml | 20 -- .../main/res/layout/fragment_skill_list.xml | 20 -- .../res/layout/fragment_skills_chains.xml | 20 -- .../src/main/res/layout/fragment_tracking.xml | 20 -- .../app/src/main/res/menu/bottom_navbar.xml | 24 --- .../app/src/main/res/navigation/nav_graph.xml | 13 -- .../src/main/res/values-de-rDE/strings.xml | 12 -- .../app/src/main/res/values-land/dimens.xml | 3 - .../app/src/main/res/values-night/themes.xml | 7 +- DBTApp/app/src/main/res/values-v23/themes.xml | 8 - .../src/main/res/values-w1240dp/dimens.xml | 3 - .../app/src/main/res/values-w600dp/dimens.xml | 3 - DBTApp/app/src/main/res/values/dimens.xml | 3 - DBTApp/app/src/main/res/values/strings.xml | 12 +- DBTApp/app/src/main/res/values/themes.xml | 7 +- .../cdaut/{dbt => dbtapp}/ExampleUnitTest.kt | 2 +- DBTApp/gradle/libs.versions.toml | 29 +-- .../gradle/wrapper/gradle-wrapper.properties | 2 +- DBTApp/settings.gradle.kts | 3 +- 44 files changed, 21 insertions(+), 1013 deletions(-) delete mode 100644 DBTApp/.idea/.gitignore delete mode 100644 DBTApp/.idea/.name delete mode 100644 DBTApp/.idea/codeStyles/Project.xml delete mode 100644 DBTApp/.idea/codeStyles/codeStyleConfig.xml rename DBTApp/app/src/androidTest/java/de/cdaut/{dbt => dbtapp}/ExampleInstrumentedTest.kt (86%) delete mode 100644 DBTApp/app/src/main/java/de/cdaut/dbt/activities/FavouritesFragment.kt delete mode 100644 DBTApp/app/src/main/java/de/cdaut/dbt/activities/HomeActivity.kt delete mode 100644 DBTApp/app/src/main/java/de/cdaut/dbt/activities/HomeFragment.kt delete mode 100644 DBTApp/app/src/main/java/de/cdaut/dbt/activities/SkillListFragment.kt delete mode 100644 DBTApp/app/src/main/java/de/cdaut/dbt/activities/SkillsChainsFragment.kt delete mode 100644 DBTApp/app/src/main/java/de/cdaut/dbt/activities/TrackingFragment.kt delete mode 100644 DBTApp/app/src/main/res/drawable/baseline_menu_book_24.xml delete mode 100644 DBTApp/app/src/main/res/drawable/emergency_24px.xml delete mode 100644 DBTApp/app/src/main/res/drawable/home_24px.xml delete mode 100644 DBTApp/app/src/main/res/drawable/outline_calendar_month_24.xml delete mode 100644 DBTApp/app/src/main/res/drawable/sort_24px.xml delete mode 100644 DBTApp/app/src/main/res/drawable/star_24px.xml delete mode 100644 DBTApp/app/src/main/res/layout/activity_home.xml delete mode 100644 DBTApp/app/src/main/res/layout/content_home.xml delete mode 100644 DBTApp/app/src/main/res/layout/fragment_favourites.xml delete mode 100644 DBTApp/app/src/main/res/layout/fragment_home.xml delete mode 100644 DBTApp/app/src/main/res/layout/fragment_skill_list.xml delete mode 100644 DBTApp/app/src/main/res/layout/fragment_skills_chains.xml delete mode 100644 DBTApp/app/src/main/res/layout/fragment_tracking.xml delete mode 100644 DBTApp/app/src/main/res/menu/bottom_navbar.xml delete mode 100644 DBTApp/app/src/main/res/navigation/nav_graph.xml delete mode 100644 DBTApp/app/src/main/res/values-de-rDE/strings.xml delete mode 100644 DBTApp/app/src/main/res/values-land/dimens.xml delete mode 100644 DBTApp/app/src/main/res/values-v23/themes.xml delete mode 100644 DBTApp/app/src/main/res/values-w1240dp/dimens.xml delete mode 100644 DBTApp/app/src/main/res/values-w600dp/dimens.xml delete mode 100644 DBTApp/app/src/main/res/values/dimens.xml rename DBTApp/app/src/test/java/de/cdaut/{dbt => dbtapp}/ExampleUnitTest.kt (92%) diff --git a/DBTApp/.gitignore b/DBTApp/.gitignore index cecb4de..aa724b7 100644 --- a/DBTApp/.gitignore +++ b/DBTApp/.gitignore @@ -1,5 +1,3 @@ -# Android studio - *.iml .gradle /local.properties @@ -15,174 +13,3 @@ .externalNativeBuild .cxx local.properties - -# Android - -# Created by https://www.toptal.com/developers/gitignore/api/android,androidstudio -# Edit at https://www.toptal.com/developers/gitignore?templates=android,androidstudio - -### Android ### -# Gradle files -.gradle/ -build/ - -# Local configuration file (sdk path, etc) -local.properties - -# Log/OS Files -*.log - -# Android Studio generated files and folders -captures/ -.externalNativeBuild/ -.cxx/ -*.apk -output.json - -# IntelliJ -*.iml -.idea/ -misc.xml -deploymentTargetDropDown.xml -render.experimental.xml - -# Keystore files -*.jks -*.keystore - -# Google Services (e.g. APIs or Firebase) -google-services.json - -# Android Profiling -*.hprof - -### Android Patch ### -gen-external-apklibs - -# Replacement of .externalNativeBuild directories introduced -# with Android Studio 3.5. - -### AndroidStudio ### -# Covers files to be ignored for android development using Android Studio. - -# Built application files -*.ap_ -*.aab - -# Files for the ART/Dalvik VM -*.dex - -# Java class files -*.class - -# Generated files -bin/ -gen/ -out/ - -# Gradle files -.gradle - -# Signing files -.signing/ - -# Local configuration file (sdk path, etc) - -# Proguard folder generated by Eclipse -proguard/ - -# Log Files - -# Android Studio -/*/build/ -/*/local.properties -/*/out -/*/*/build -/*/*/production -.navigation/ -*.ipr -*~ -*.swp - -# Keystore files - -# Google Services (e.g. APIs or Firebase) -# google-services.json - -# Android Patch - -# External native build folder generated in Android Studio 2.2 and later -.externalNativeBuild - -# NDK -obj/ - -# IntelliJ IDEA -*.iws -/out/ - -# User-specific configurations -.idea/caches/ -.idea/libraries/ -.idea/shelf/ -.idea/workspace.xml -.idea/tasks.xml -.idea/.name -.idea/compiler.xml -.idea/copyright/profiles_settings.xml -.idea/encodings.xml -.idea/misc.xml -.idea/modules.xml -.idea/scopes/scope_settings.xml -.idea/dictionaries -.idea/vcs.xml -.idea/jsLibraryMappings.xml -.idea/datasources.xml -.idea/dataSources.ids -.idea/sqlDataSources.xml -.idea/dynamic.xml -.idea/uiDesigner.xml -.idea/assetWizardSettings.xml -.idea/gradle.xml -.idea/jarRepositories.xml -.idea/navEditor.xml - -# Legacy Eclipse project files -.classpath -.project -.cproject -.settings/ - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.war -*.ear - -# virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml) -hs_err_pid* - -## Plugin-specific files: - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Mongo Explorer plugin -.idea/mongoSettings.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -### AndroidStudio Patch ### - -!/gradle/wrapper/gradle-wrapper.jar - -# End of https://www.toptal.com/developers/gitignore/api/android,androidstudio - diff --git a/DBTApp/.idea/.gitignore b/DBTApp/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/DBTApp/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/DBTApp/.idea/.name b/DBTApp/.idea/.name deleted file mode 100644 index 8cb8797..0000000 --- a/DBTApp/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -DBT App \ No newline at end of file diff --git a/DBTApp/.idea/codeStyles/Project.xml b/DBTApp/.idea/codeStyles/Project.xml deleted file mode 100644 index 7643783..0000000 --- a/DBTApp/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/DBTApp/.idea/codeStyles/codeStyleConfig.xml b/DBTApp/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 79ee123..0000000 --- a/DBTApp/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/DBTApp/.idea/deploymentTargetSelector.xml b/DBTApp/.idea/deploymentTargetSelector.xml index 02663a9..b268ef3 100644 --- a/DBTApp/.idea/deploymentTargetSelector.xml +++ b/DBTApp/.idea/deploymentTargetSelector.xml @@ -5,12 +5,6 @@ - - - - \ No newline at end of file diff --git a/DBTApp/.idea/gradle.xml b/DBTApp/.idea/gradle.xml index 639c779..97f0a8e 100644 --- a/DBTApp/.idea/gradle.xml +++ b/DBTApp/.idea/gradle.xml @@ -1,6 +1,5 @@ - \ No newline at end of file diff --git a/DBTApp/.idea/gradle.xml b/DBTApp/.idea/gradle.xml index 97f0a8e..639c779 100644 --- a/DBTApp/.idea/gradle.xml +++ b/DBTApp/.idea/gradle.xml @@ -1,5 +1,6 @@ + \ No newline at end of file diff --git a/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/SkillsList.kt b/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/SkillsList.kt new file mode 100644 index 0000000..7b22db9 --- /dev/null +++ b/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/SkillsList.kt @@ -0,0 +1,73 @@ +package de.cdaut.dbtapp.components + +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.interaction.Interaction +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.IntrinsicSize +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Star +import androidx.compose.material.icons.outlined.Star +import androidx.compose.material.icons.outlined.StarOutline +import androidx.compose.material3.Button +import androidx.compose.material3.Icon +import androidx.compose.material3.Text +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.stringResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import de.cdaut.dbtapp.R + +@Preview +@Composable +private fun SingleSkillCard() { + var selected by remember { + mutableStateOf(false) + } + Row( + modifier = Modifier + .fillMaxWidth() + .height(IntrinsicSize.Min) + .background(Color.LightGray) + .padding(10.dp), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + Column( + modifier = Modifier + .fillMaxHeight() + .padding(6.dp), + verticalArrangement = Arrangement.SpaceBetween, + + ) { + Text("Titel") + Text("Beschreibung") + } + + Icon( + modifier = Modifier + .padding(10.dp) + .clickable(onClick = { + selected = !selected + }), + imageVector = if (selected) Icons.Outlined.Star else Icons.Outlined.StarOutline, + contentDescription = stringResource(R.string.desc_btn_fav), + tint = if (selected) Color.Yellow else Color.Black + ) + + } +} \ No newline at end of file diff --git a/DBTApp/app/src/main/res/values-de/strings.xml b/DBTApp/app/src/main/res/values-de/strings.xml index 6c2bae3..e45a695 100644 --- a/DBTApp/app/src/main/res/values-de/strings.xml +++ b/DBTApp/app/src/main/res/values-de/strings.xml @@ -7,4 +7,5 @@ Favoriten Skillsketten Notfallknopf + Favorisieren Button \ No newline at end of file diff --git a/DBTApp/app/src/main/res/values/strings.xml b/DBTApp/app/src/main/res/values/strings.xml index 1f3ac30..51849cb 100644 --- a/DBTApp/app/src/main/res/values/strings.xml +++ b/DBTApp/app/src/main/res/values/strings.xml @@ -6,4 +6,5 @@ Favourites Skills Chains Emergency Button + Favourte Button \ No newline at end of file -- 2.51.0 From 17a963448c724a76fc9cfc7f8ecc713ec3bbd978 Mon Sep 17 00:00:00 2001 From: Clara Dautermann Date: Tue, 13 May 2025 19:38:33 +0200 Subject: [PATCH 6/7] Skills cards --- DBTApp/.idea/deploymentTargetSelector.xml | 3 ++ .../de/cdaut/dbtapp/components/SkillsList.kt | 36 +++++++++++++-- .../java/de/cdaut/dbtapp/components/Texts.kt | 44 +++++++++++++++++++ .../main/java/de/cdaut/dbtapp/model/Skill.kt | 20 +++++++++ 4 files changed, 99 insertions(+), 4 deletions(-) create mode 100644 DBTApp/app/src/main/java/de/cdaut/dbtapp/components/Texts.kt create mode 100644 DBTApp/app/src/main/java/de/cdaut/dbtapp/model/Skill.kt diff --git a/DBTApp/.idea/deploymentTargetSelector.xml b/DBTApp/.idea/deploymentTargetSelector.xml index b1b736d..2ea36bc 100644 --- a/DBTApp/.idea/deploymentTargetSelector.xml +++ b/DBTApp/.idea/deploymentTargetSelector.xml @@ -14,6 +14,9 @@ + + \ No newline at end of file diff --git a/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/SkillsList.kt b/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/SkillsList.kt index 7b22db9..7d51c4e 100644 --- a/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/SkillsList.kt +++ b/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/SkillsList.kt @@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.IntrinsicSize import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height @@ -30,11 +31,37 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.em import de.cdaut.dbtapp.R +import de.cdaut.dbtapp.model.Skill @Preview @Composable -private fun SingleSkillCard() { +private fun SkillsCategoryCardPrev() { + SkillsCategoryCard(Skill.mockSkills()) +} + +@Composable +fun SkillsCategoryCard(skills: List) { + Column { + skills.forEach { skill -> + SingleSkillCard(skill.title, skill.description) + Spacer(modifier = Modifier.height(2.dp)) + } + } +} + +@Preview +@Composable +private fun SingleSkillsCardPreview() { + SingleSkillCard( + "5-4-3-2-1", + "Hier kurz beschreiben wie die Übung funktioniert. Ggf. mehrere Zeilen aber nicht super lang" + ) +} + +@Composable +private fun SingleSkillCard(title: String, description: String) { var selected by remember { mutableStateOf(false) } @@ -50,12 +77,13 @@ private fun SingleSkillCard() { Column( modifier = Modifier .fillMaxHeight() - .padding(6.dp), + .fillMaxWidth(fraction = 0.8f), verticalArrangement = Arrangement.SpaceBetween, ) { - Text("Titel") - Text("Beschreibung") + TitleText(title) + Spacer(modifier = Modifier.height(10.dp)) + DescriptionText(description) } Icon( diff --git a/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/Texts.kt b/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/Texts.kt new file mode 100644 index 0000000..82d3988 --- /dev/null +++ b/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/Texts.kt @@ -0,0 +1,44 @@ +package de.cdaut.dbtapp.components + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.TextUnit +import androidx.compose.ui.unit.sp + +@Preview +@Composable +private fun PreviewTexts() { + Column( + modifier = Modifier.background(Color.White) + ) { + TitleText("Test Hallo :3") + DescriptionText("lorem ipsum dolor sid amnet consequetur blabla yada yada") + } +} + +@Composable +fun TitleText(content: String, modifier: Modifier = Modifier) { + Text( + text = content, + modifier = modifier, + fontSize = 20.sp, + fontWeight = FontWeight.Bold + ) +} + +@Composable +fun DescriptionText(content: String, modifier: Modifier = Modifier) { + Text( + text = content, + modifier = modifier, + fontSize = 17.sp, + fontWeight = FontWeight.Light + ) +} \ No newline at end of file diff --git a/DBTApp/app/src/main/java/de/cdaut/dbtapp/model/Skill.kt b/DBTApp/app/src/main/java/de/cdaut/dbtapp/model/Skill.kt new file mode 100644 index 0000000..7fd2416 --- /dev/null +++ b/DBTApp/app/src/main/java/de/cdaut/dbtapp/model/Skill.kt @@ -0,0 +1,20 @@ +package de.cdaut.dbtapp.model + +class Skill(val title: String, val description: String) { + + + companion object { + fun mockSkills(): List { + return listOf( + Skill( + title = "Test Hallo :3", + description = "lorem ipsum dolor sid amnet consequetur blabla yada yada" + ), + Skill( + title = "5-4-3-2-1", + description = "Hier kurz beschreiben wie die Übung funktioniert. Ggf. mehrere Zeilen aber nicht super lang" + ) + ) + } + } +} \ No newline at end of file -- 2.51.0 From c1964589fa5c053a02778e1ab15f25898c8bf652 Mon Sep 17 00:00:00 2001 From: Clara Dautermann Date: Tue, 13 May 2025 21:29:29 +0200 Subject: [PATCH 7/7] UI for Skills List --- DBTApp/.idea/deploymentTargetSelector.xml | 3 ++ .../main/java/de/cdaut/dbtapp/MainActivity.kt | 3 +- .../de/cdaut/dbtapp/components/SkillsList.kt | 42 ++++++++++++++++--- .../main/java/de/cdaut/dbtapp/model/Skill.kt | 4 ++ .../de/cdaut/dbtapp/model/SkillCategory.kt | 14 +++++++ 5 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 DBTApp/app/src/main/java/de/cdaut/dbtapp/model/SkillCategory.kt diff --git a/DBTApp/.idea/deploymentTargetSelector.xml b/DBTApp/.idea/deploymentTargetSelector.xml index 2ea36bc..2a7a811 100644 --- a/DBTApp/.idea/deploymentTargetSelector.xml +++ b/DBTApp/.idea/deploymentTargetSelector.xml @@ -17,6 +17,9 @@ + + \ No newline at end of file diff --git a/DBTApp/app/src/main/java/de/cdaut/dbtapp/MainActivity.kt b/DBTApp/app/src/main/java/de/cdaut/dbtapp/MainActivity.kt index 227b740..8e03061 100644 --- a/DBTApp/app/src/main/java/de/cdaut/dbtapp/MainActivity.kt +++ b/DBTApp/app/src/main/java/de/cdaut/dbtapp/MainActivity.kt @@ -30,6 +30,7 @@ import androidx.navigation.compose.composable import androidx.navigation.compose.rememberNavController import com.google.android.material.floatingactionbutton.FloatingActionButton import de.cdaut.dbtapp.components.BottomNavigationBar +import de.cdaut.dbtapp.components.SkillsScreen import de.cdaut.dbtapp.navigation.Screens class MainActivity : ComponentActivity() { @@ -60,7 +61,7 @@ private fun MainContent() { Text("Tracking") } composable(Screens.Skillslist.route) { - Text("Skillslist") + SkillsScreen() } composable(Screens.Home.route) { Text("Home") diff --git a/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/SkillsList.kt b/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/SkillsList.kt index 7d51c4e..3f93d07 100644 --- a/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/SkillsList.kt +++ b/DBTApp/app/src/main/java/de/cdaut/dbtapp/components/SkillsList.kt @@ -1,7 +1,10 @@ package de.cdaut.dbtapp.components import androidx.compose.foundation.background +import androidx.compose.foundation.border import androidx.compose.foundation.clickable +import androidx.compose.foundation.gestures.ScrollableState +import androidx.compose.foundation.gestures.scrollable import androidx.compose.foundation.interaction.Interaction import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -13,11 +16,16 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Star import androidx.compose.material.icons.outlined.Star import androidx.compose.material.icons.outlined.StarOutline import androidx.compose.material3.Button +import androidx.compose.material3.Card import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -27,6 +35,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview @@ -34,19 +43,40 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.em import de.cdaut.dbtapp.R import de.cdaut.dbtapp.model.Skill +import de.cdaut.dbtapp.model.SkillCategory + +@Preview +@Composable +fun SkillsScreen() { + Column( + Modifier.verticalScroll(rememberScrollState()) + ) { + SkillCategory.entries.forEach { skillCategory -> + SkillsCategoryCard(skillCategory.skills, skillCategory.title) + Spacer(Modifier.height(5.dp)) + } + } +} @Preview @Composable private fun SkillsCategoryCardPrev() { - SkillsCategoryCard(Skill.mockSkills()) + SkillsCategoryCard(Skill.mockSkills(), "Skill") } @Composable -fun SkillsCategoryCard(skills: List) { - Column { +fun SkillsCategoryCard(skills: List, title: String) { + Card( + Modifier + .fillMaxWidth() + .padding(10.dp) + ) { + TitleText( + modifier = Modifier.padding(10.dp), + content = title + ) skills.forEach { skill -> SingleSkillCard(skill.title, skill.description) - Spacer(modifier = Modifier.height(2.dp)) } } } @@ -69,7 +99,9 @@ private fun SingleSkillCard(title: String, description: String) { modifier = Modifier .fillMaxWidth() .height(IntrinsicSize.Min) - .background(Color.LightGray) + .background(Color.Transparent) + .padding(10.dp) + .background(Color.White, shape = RoundedCornerShape(5.dp)) .padding(10.dp), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically diff --git a/DBTApp/app/src/main/java/de/cdaut/dbtapp/model/Skill.kt b/DBTApp/app/src/main/java/de/cdaut/dbtapp/model/Skill.kt index 7fd2416..612c86a 100644 --- a/DBTApp/app/src/main/java/de/cdaut/dbtapp/model/Skill.kt +++ b/DBTApp/app/src/main/java/de/cdaut/dbtapp/model/Skill.kt @@ -13,6 +13,10 @@ class Skill(val title: String, val description: String) { Skill( title = "5-4-3-2-1", description = "Hier kurz beschreiben wie die Übung funktioniert. Ggf. mehrere Zeilen aber nicht super lang" + ), + Skill( + title = "UwU UwU awawawa", + description = "Just arf a little like the good fopsgirl you are :3" ) ) } diff --git a/DBTApp/app/src/main/java/de/cdaut/dbtapp/model/SkillCategory.kt b/DBTApp/app/src/main/java/de/cdaut/dbtapp/model/SkillCategory.kt new file mode 100644 index 0000000..c09483a --- /dev/null +++ b/DBTApp/app/src/main/java/de/cdaut/dbtapp/model/SkillCategory.kt @@ -0,0 +1,14 @@ +package de.cdaut.dbtapp.model + +import androidx.compose.foundation.layout.Arrangement + +enum class SkillCategory(val title: String, val skills: List = Skill.mockSkills()) { + Mindfulness("Achtsamkeitsübungen"), + EmotionalRegulation("Emotionsregulation"), + MiddleWay("Mittelweg"), + StressTolerance("Stresstoleranz"), + SelfWorth("Selbstwert"), + Addiction("Sucht"), + Interpersonal("Zwischenmenschlich"); +} + -- 2.51.0