-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a94909
commit f4bcd7a
Showing
12 changed files
with
442 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...s/onboarding/src/main/kotlin/edu/stanford/spezi/module/onboarding/core/OnboardingTitle.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package edu.stanford.spezi.module.onboarding.core | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.text.style.TextAlign | ||
import edu.stanford.spezi.core.design.theme.Spacings | ||
import edu.stanford.spezi.core.design.theme.SpeziTheme | ||
import edu.stanford.spezi.core.design.theme.TextStyles | ||
import edu.stanford.spezi.core.design.theme.ThemePreviews | ||
|
||
@Composable | ||
fun OnboardingTitle( | ||
title: String, | ||
subtitle: String? = null, | ||
) { | ||
Column(Modifier.padding(vertical = Spacings.medium), horizontalAlignment = Alignment.CenterHorizontally) { | ||
Text( | ||
title, | ||
modifier = Modifier.padding(bottom = Spacings.medium), | ||
style = TextStyles.headlineMedium.copy(fontWeight = FontWeight.Bold), | ||
textAlign = TextAlign.Center | ||
) | ||
|
||
subtitle?.let { subtitle -> | ||
Text( | ||
subtitle, | ||
modifier = Modifier.padding(bottom = Spacings.medium), | ||
style = TextStyles.bodyMedium, | ||
textAlign = TextAlign.Center | ||
) | ||
} | ||
} | ||
} | ||
|
||
@ThemePreviews | ||
@Composable | ||
private fun OnboardingTitlePreview() { | ||
SpeziTheme(isPreview = true) { | ||
OnboardingTitle("Title", "Subtitle") | ||
} | ||
} |
37 changes: 0 additions & 37 deletions
37
...arding/src/main/kotlin/edu/stanford/spezi/module/onboarding/onboarding/OnboardingTitle.kt
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
...n/edu/stanford/spezi/module/onboarding/onboarding/flow/IllegalOnboardingStepComposable.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...onboarding/OnboardingComposableBuilder.kt → ...ding/spezi/OnboardingComposableBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
...main/kotlin/edu/stanford/spezi/module/onboarding/spezi/OnboardingComposableInformation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package edu.stanford.spezi.module.onboarding.spezi | ||
|
||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.filled.Build | ||
import androidx.compose.material.icons.filled.Call | ||
import androidx.compose.material.icons.filled.Email | ||
import androidx.compose.runtime.Composable | ||
import edu.stanford.spezi.core.design.component.ImageResource | ||
import edu.stanford.spezi.core.design.component.StringResource | ||
import edu.stanford.spezi.core.design.component.StringResource.Companion.invoke | ||
import edu.stanford.spezi.core.design.theme.SpeziTheme | ||
import edu.stanford.spezi.core.design.theme.ThemePreviews | ||
import edu.stanford.spezi.module.onboarding.core.OnboardingComposable | ||
import edu.stanford.spezi.module.onboarding.core.OnboardingTitle | ||
|
||
@Composable | ||
fun OnboardingComposable( | ||
title: String, | ||
subtitle: String? = null, | ||
areas: List<OnboardingInformationContent>, | ||
actionText: String, | ||
action: suspend () -> Unit, | ||
) { | ||
OnboardingComposable( | ||
title = { | ||
OnboardingTitle(title, subtitle) | ||
}, | ||
content = { | ||
OnboardingInformation(areas) | ||
}, | ||
action = { | ||
OnboardingActions(actionText, action) | ||
} | ||
) | ||
} | ||
|
||
@ThemePreviews | ||
@Composable | ||
private fun OnboardingComposablePreview() { | ||
val areas = listOf( | ||
OnboardingInformationContent( | ||
icon = ImageResource.Vector(Icons.Default.Email, StringResource("Email")), | ||
title = "Email", | ||
description = "This is an email. And we can write a lot about E-Mails in a section like this. A very long text!" | ||
), | ||
OnboardingInformationContent( | ||
icon = ImageResource.Vector(Icons.Default.Build, StringResource("Wrench")), | ||
title = "Wrench", | ||
description = "This is a wrench!" | ||
), | ||
OnboardingInformationContent( | ||
icon = ImageResource.Vector(Icons.Default.Call, StringResource("Phone")), | ||
title = "Phone", | ||
description = "This is a phone." | ||
) | ||
) | ||
|
||
SpeziTheme(isPreview = true) { | ||
OnboardingComposable( | ||
"Title", | ||
"Subtitle", | ||
areas, | ||
actionText = "Action", | ||
action = {} | ||
) | ||
} | ||
} |
Oops, something went wrong.