-
Notifications
You must be signed in to change notification settings - Fork 4
GT-2980 No Personalized Lessons UI #4430
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f5eab57
Add dataLoaded flag to delay rendering; Add string resources
tjohnson009 f5bc2b4
Create and add NoPersonalizedLessons UI
tjohnson009 700c206
Modify exclamation icon for NoPersonalizedLessons composable
tjohnson009 0758049
Rename onClick param for easier readability and remove unused imports
tjohnson009 9f29aae
Swap icon to more closely reflect Figma design
tjohnson009 2ef35c2
Add closer matching icon for NoPersonalizedLessons composable
tjohnson009 593fd99
Sharpen string resource name for NoPersonalizedLessons.kt file
tjohnson009 324ef2c
Add @color/tintable to icon
tjohnson009 87b8ea8
Update tests to account for new dataLoaded flag
tjohnson009 a28310d
Update screenshot tests to account for NoPersonalizedLessons UI
tjohnson009 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
56 changes: 56 additions & 0 deletions
56
app/src/main/kotlin/org/cru/godtools/ui/dashboard/lessons/NoPersonalizedLessons.kt
This file contains hidden or 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,56 @@ | ||
| package org.cru.godtools.ui.dashboard.lessons | ||
|
|
||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.material3.Button | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.material3.MaterialTheme | ||
| import androidx.compose.material3.Surface | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.painterResource | ||
| import androidx.compose.ui.res.stringResource | ||
| import androidx.compose.ui.text.style.TextAlign | ||
| import androidx.compose.ui.unit.dp | ||
| import org.cru.godtools.R | ||
|
|
||
| @Composable | ||
| internal fun NoPersonalizedLessons(onGoToAllLessons: () -> Unit, modifier: Modifier = Modifier) { | ||
| Surface( | ||
| color = MaterialTheme.colorScheme.surfaceVariant, | ||
| modifier = modifier.fillMaxWidth(), | ||
| ) { | ||
| Column( | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| modifier = Modifier.padding(24.dp), | ||
| ) { | ||
| Icon( | ||
| painter = painterResource(R.drawable.ic_priority_high), | ||
| contentDescription = null, | ||
| modifier = Modifier.size(64.dp), | ||
| ) | ||
|
tjohnson009 marked this conversation as resolved.
|
||
| Text( | ||
| text = stringResource(R.string.dashboard_lessons_section_personalized_no_lessons_title), | ||
| style = MaterialTheme.typography.titleMedium, | ||
| textAlign = TextAlign.Center, | ||
| modifier = Modifier.padding(top = 16.dp), | ||
| ) | ||
| Text( | ||
| text = stringResource(R.string.dashboard_lessons_section_personalized_no_lessons_description), | ||
| style = MaterialTheme.typography.bodyMedium, | ||
| textAlign = TextAlign.Center, | ||
| modifier = Modifier.padding(top = 8.dp), | ||
| ) | ||
| Button( | ||
| onClick = onGoToAllLessons, | ||
| modifier = Modifier.padding(top = 16.dp), | ||
| ) { | ||
| Text(stringResource(R.string.dashboard_lessons_section_personalized_no_lessons_action_all_lessons)) | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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,9 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:width="48dp" | ||
| android:height="48dp" | ||
| android:viewportWidth="960" | ||
| android:viewportHeight="960"> | ||
| <path | ||
| android:pathData="M479.88,796.92q-21.78,0 -37.18,-15.51 -15.39,-15.52 -15.39,-37.3 0,-21.78 15.51,-37.18 15.51,-15.39 37.3,-15.39 21.78,0 37.18,15.51 15.39,15.51 15.39,37.3 0,21.78 -15.51,37.18 -15.51,15.39 -37.3,15.39ZM432.69,600.77v-457.69h94.62v457.69h-94.62Z" | ||
| android:fillColor="@color/tintable"/> | ||
| </vector> |
This file contains hidden or 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 hidden or 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
4 changes: 2 additions & 2 deletions
4
...ion_-_Localization_Settings_Box[Nexus_5,locale=null,NIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...ion_-_Localization_Settings_Box[Nexus_5,locale=null,NOTNIGHT,ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
..._-_Localization_Settings_Box[Nexus_5,locale=null,NOTNIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...-_Localization_Settings_Box[Pixel_6_Pro,locale=null,NIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...ocalization_Settings_Box[Pixel_6_Pro,locale=null,NOTNIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...ation_-_No_Personalized_Lessons[Nexus_5,locale=null,NIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...ation_-_No_Personalized_Lessons[Nexus_5,locale=null,NOTNIGHT,ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...on_-_No_Personalized_Lessons[Nexus_5,locale=null,NOTNIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...n_-_No_Personalized_Lessons[Pixel_6_Pro,locale=null,NIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
..._No_Personalized_Lessons[Pixel_6_Pro,locale=null,NOTNIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.