Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set habit titles to one word making habit cards on onboarding same si… #34

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
applicationId = "com.githukudenis.intimo"
minSdk = 26
targetSdk = 34
versionCode = 2
versionName = "1.1"
versionCode = 3
versionName = "1.1.2"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand All @@ -34,6 +34,7 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("debug")
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.githukudenis.intimo.core.model.DefaultHabit
import com.githukudenis.intimo.core.model.DurationType
import com.githukudenis.intimo.core.model.HabitData
import com.githukudenis.intimo.core.model.HabitFrequency
import com.githukudenis.intimo.core.model.HabitType
import com.githukudenis.intimo.core.model.RunningHabit
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
Expand Down Expand Up @@ -58,81 +57,83 @@ class IntimoHabitsDataSource @Inject constructor(
}

fun provideDefaultHabits(): Flow<List<DefaultHabit>> = flow {
emit(listOf(
DefaultHabit(
icon = "\uD83D\uDCDA",
habitName = "Read a book",
startTime = generateHabitTime(hour = 20),
duration = generateDuration(1, DurationType.HOUR),
durationType = DurationType.HOUR,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
),
DefaultHabit(
icon = "\uD83E\uDDD8",
habitName = "Meditate",
startTime = generateHabitTime(7),
duration = generateDuration(15, DurationType.MINUTE),
durationType = DurationType.MINUTE,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
),
DefaultHabit(
icon = "\uD83E\uDEA5",
habitName = "Flossing",
startTime = generateHabitTime(hour = 20, minute = 45),
duration = generateDuration(3, DurationType.MINUTE),
durationType = DurationType.MINUTE,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
),
DefaultHabit(
icon = "✍️",
habitName = "Journal your thoughts",
startTime = generateHabitTime(19),
duration = generateDuration(30, DurationType.MINUTE),
durationType = DurationType.MINUTE,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()

),
DefaultHabit(
icon = "\uD83C\uDFC3",
habitName = "Go for a run",
startTime = generateHabitTime(6),
duration = generateDuration(1, DurationType.HOUR),
durationType = DurationType.HOUR,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
),
DefaultHabit(
icon = "\uD83E\uDD14",
habitName = "Reflect",
startTime = generateHabitTime(14),
duration = generateDuration(15, DurationType.MINUTE),
durationType = DurationType.MINUTE,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
),
DefaultHabit(
icon = "\uD83D\uDE34",
startTime = generateHabitTime(hour = 13, minute = 40),
duration = generateDuration(20, DurationType.MINUTE),
habitName = "Take a nap",
durationType = DurationType.MINUTE,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
),
DefaultHabit(
icon = "\uD83E\uDD38",
habitName = "Stretch",
startTime = generateHabitTime(11),
duration = generateDuration(10, DurationType.MINUTE),
durationType = DurationType.MINUTE,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
emit(
listOf(
DefaultHabit(
icon = "\uD83D\uDCDA",
habitName = "Read",
startTime = generateHabitTime(hour = 20),
duration = generateDuration(1, DurationType.HOUR),
durationType = DurationType.HOUR,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
),
DefaultHabit(
icon = "\uD83E\uDDD8",
habitName = "Meditate",
startTime = generateHabitTime(7),
duration = generateDuration(15, DurationType.MINUTE),
durationType = DurationType.MINUTE,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
),
DefaultHabit(
icon = "\uD83E\uDEA5",
habitName = "Floss",
startTime = generateHabitTime(hour = 20, minute = 45),
duration = generateDuration(3, DurationType.MINUTE),
durationType = DurationType.MINUTE,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
),
DefaultHabit(
icon = "✍️",
habitName = "Journal",
startTime = generateHabitTime(19),
duration = generateDuration(30, DurationType.MINUTE),
durationType = DurationType.MINUTE,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()

),
DefaultHabit(
icon = "\uD83C\uDFC3",
habitName = "Run",
startTime = generateHabitTime(6),
duration = generateDuration(1, DurationType.HOUR),
durationType = DurationType.HOUR,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
),
DefaultHabit(
icon = "\uD83E\uDD14",
habitName = "Reflect",
startTime = generateHabitTime(14),
duration = generateDuration(15, DurationType.MINUTE),
durationType = DurationType.MINUTE,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
),
DefaultHabit(
icon = "\uD83D\uDE34",
startTime = generateHabitTime(hour = 13, minute = 40),
duration = generateDuration(20, DurationType.MINUTE),
habitName = "Nap",
durationType = DurationType.MINUTE,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
),
DefaultHabit(
icon = "\uD83E\uDD38",
habitName = "Stretch",
startTime = generateHabitTime(11),
duration = generateDuration(10, DurationType.MINUTE),
durationType = DurationType.MINUTE,
habitFrequency = HabitFrequency.DAILY,
habitDays = generateHabitDays()
)
)
))
)
}

private fun generateHabitTime(hour: Int, minute: Int = 0): Long {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ import com.githukudenis.intimo.feature.onboarding.R

@Composable
fun GetStartedBtn(
modifier: Modifier = Modifier,
uiIsValid: Boolean,
multipleClicksCutter: MultipleClicksCutter = remember { MultipleClicksCutter.get() },
onGetStarted: () -> Unit,
) {
Button(
modifier = Modifier
modifier = modifier
.fillMaxWidth(),
onClick = { multipleClicksCutter.processEvent(onGetStarted) },
shape = MaterialTheme.shapes.small,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package com.githukudenis.intimo.feature.onboarding.ui.habit_selection
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeDrawingPadding
import androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope
import androidx.compose.foundation.lazy.staggeredgrid.LazyVerticalStaggeredGrid
Expand All @@ -12,6 +13,7 @@ import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridItemSpan
import androidx.compose.foundation.lazy.staggeredgrid.items
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -54,7 +56,11 @@ private fun OnBoardingContent(
onToggleHabit: (DefaultHabit) -> Unit,
onGetStarted: () -> Unit
) {
Box(modifier = Modifier.safeDrawingPadding()) {
Box(
modifier = Modifier
.fillMaxSize()
.safeDrawingPadding()
) {
LazyVerticalStaggeredGrid(
columns = StaggeredGridCells.Fixed(2),
horizontalArrangement = Arrangement.spacedBy(14.dp),
Expand All @@ -74,11 +80,18 @@ private fun OnBoardingContent(
selectedDefaultHabits = selectedDefaultHabits,
onToggleHabit = onToggleHabit
)
item(span = StaggeredGridItemSpan.FullLine
) {
GetStartedBtn(uiIsValid = uiIsValid, onGetStarted = onGetStarted)
}

}
GetStartedBtn(
modifier = Modifier
.align(Alignment.BottomCenter)
.padding(
bottom = 16.dp,
start = 16.dp,
end = 16.dp
),
uiIsValid = uiIsValid, onGetStarted = onGetStarted
)
}
}

Expand Down
5 changes: 3 additions & 2 deletions feature/summary/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
#-renamesourcefileattribute SourceFile

-dontwarn com.githukudenis.intimo.feature.habit.R$string
#-keep class com.githukudenis.intimo.feature.summary.** { *; }
-keep class com.githukudenis.intimo.feature.summary.ui.home.HabitsState { *; }
-keep class com.githukudenis.intimo.feature.summary.**
# -keep class com.githukudenis.intimo.feature.summary.ui.home.HabitsState { *; }
-dontwarn java.lang.invoke.StringConcatFactory
-dontwarn kotlinx.serialization.KSerializer

58 changes: 29 additions & 29 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
agp = "8.1.4"
agp = "8.2.2"
kotlin = "1.9.0"
crashlytics = "2.9.7"
google-services = "4.3.15"
Expand All @@ -24,7 +24,7 @@ hilt-navigation-compose = "1.0.0"
accompanist = "0.31.5-beta"
room = "2.5.2"
kotlinx-time = "0.4.0"
compose-material="1.6.0-alpha04"
compose-material = "1.6.0-alpha04"
palette = "28.0.0"
support = "28.0.0"
about-libraries = "10.8.3"
Expand All @@ -38,13 +38,13 @@ core-testing = "2.1.0"

[libraries]
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" }
core-testing = { group = "androidx.arch.core", name = "core-testing", version.ref = "core-testing"}
core-testing = { group = "androidx.arch.core", name = "core-testing", version.ref = "core-testing" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-ext-junit" }
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" }
lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle-runtime-ktx" }
lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle-viewmodel-compose"}
lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycle-runtime-compose"}
lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle-viewmodel-compose" }
lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycle-runtime-compose" }
activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activity-compose" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
ui = { group = "androidx.compose.ui", name = "ui" }
Expand All @@ -55,43 +55,43 @@ ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview
ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
material3 = { group = "androidx.compose.material3", name = "material3" }
material-extended-icons = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "material-extended-icons"}
firebase-bom = { group = "com.google.firebase", name = "firebase-bom", version.ref = "firebase-bom"}
material-extended-icons = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "material-extended-icons" }
firebase-bom = { group = "com.google.firebase", name = "firebase-bom", version.ref = "firebase-bom" }
firebase-crashlytics = { group = "com.google.firebase", name = "firebase-crashlytics-ktx" }
firebase-analytics = { group = "com.google.firebase", name = "firebase-analytics-ktx" }
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
datastore-prefs = { group = "androidx.datastore", name = "datastore-preferences", version.ref = "datastore-prefs" }
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt"}
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
hilt-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" }
hilt-android-testing = { group = "com.google.dagger", name = "hilt-android-testing", version.ref = "hilt"}
truth = { group = "com.google.truth", name = "truth", version.ref = "truth"}
coroutines-testing = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines-test"}
hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "hilt-navigation-compose"}
hilt-work = { group = "androidx.hilt", name = "hilt-work", version.ref = "hilt-work"}
accompanist-permissions = { group = "com.google.accompanist", name = "accompanist-permissions", version.ref = "accompanist"}
accompanist-drawable-painter = { group = "com.google.accompanist", name = "accompanist-drawablepainter", version.ref = "accompanist"}
room-runtime = { group="androidx.room", name = "room-runtime", version.ref = "room" }
room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room"}
hilt-android-testing = { group = "com.google.dagger", name = "hilt-android-testing", version.ref = "hilt" }
truth = { group = "com.google.truth", name = "truth", version.ref = "truth" }
coroutines-testing = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines-test" }
hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "hilt-navigation-compose" }
hilt-work = { group = "androidx.hilt", name = "hilt-work", version.ref = "hilt-work" }
accompanist-permissions = { group = "com.google.accompanist", name = "accompanist-permissions", version.ref = "accompanist" }
accompanist-drawable-painter = { group = "com.google.accompanist", name = "accompanist-drawablepainter", version.ref = "accompanist" }
room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
room-testing = { group = "androidx.room", name = "room-testing", version.ref = "room"}
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinx-time"}
palette = { group = "com.android.support", name = "palette-v7", version.ref = "palette"}
room-testing = { group = "androidx.room", name = "room-testing", version.ref = "room" }
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinx-time" }
palette = { group = "com.android.support", name = "palette-v7", version.ref = "palette" }
support-core = { group = "com.android.support", name = "support-core-utils", version.ref = "support" }
about-libraries = { group = "com.mikepenz", name = "aboutlibraries-compose", version.ref = "about-libraries"}
work = { group = "androidx.work", name = "work-runtime-ktx", version.ref = "work"}
work-testing = { group = "androidx.work", name = "work-testing", version.ref = "work"}
play-inapp-review = { group = "com.google.android.play", name = "review-ktx", version.ref = "play-review"}
immutable-collections = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version.ref = "immutable-collections"}
about-libraries = { group = "com.mikepenz", name = "aboutlibraries-compose", version.ref = "about-libraries" }
work = { group = "androidx.work", name = "work-runtime-ktx", version.ref = "work" }
work-testing = { group = "androidx.work", name = "work-testing", version.ref = "work" }
play-inapp-review = { group = "com.google.android.play", name = "review-ktx", version.ref = "play-review" }
immutable-collections = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version.ref = "immutable-collections" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "crashlytics" }
googleServices = { id = "com.google.gms.google-services", version.ref = "google-services" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
daggerHilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt"}
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp"}
kotlinKapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin"}
aboutLibraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "about-libraries"}
daggerHilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
kotlinKapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
aboutLibraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "about-libraries" }

Loading