-
Notifications
You must be signed in to change notification settings - Fork 0
Add empty state #52
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
Add empty state #52
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1af4f2f
Empty state + UI fixes
amjiao ab841ef
Address UI issues (#51)
zachseidner1 122f021
Address sport filter (issue #40) (#47)
amjiao 115db4d
Empty state + UI fixes
amjiao a7a6b9f
Fix merging
amjiao f34a557
Merge branch 'main' of https://github.com/cuappdev/score-android into…
amjiao ef67bf6
small fix
amjiao a2de9fc
PR Fixes
amjiao 0df55c7
Merge branch 'main' of https://github.com/cuappdev/score-android into…
amjiao 27e37b0
Small fixes
amjiao ee7c182
Merge branch 'main' of https://github.com/cuappdev/score-android into…
amjiao ea55476
PR fixes
amjiao e685120
Merge branch 'main' into Amy/empty-state
amjiao 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
52 changes: 52 additions & 0 deletions
52
app/src/main/java/com/cornellappdev/score/components/EmptyState.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,52 @@ | ||
| package com.cornellappdev.score.components | ||
|
|
||
| import androidx.compose.foundation.Image | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| 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.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.cornellappdev.score.R | ||
| import com.cornellappdev.score.theme.GrayMedium | ||
| import com.cornellappdev.score.theme.GrayPrimary | ||
| import com.cornellappdev.score.theme.Style.bodyNormal | ||
| import com.cornellappdev.score.theme.Style.heading2 | ||
|
|
||
| @Composable | ||
| fun EmptyState( | ||
| modifier: Modifier = Modifier | ||
| ) { | ||
| Column( | ||
| modifier = modifier, | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| verticalArrangement = Arrangement.Center | ||
| ) { | ||
| Image( | ||
| painter = painterResource(R.drawable.ic_speaker_gray), | ||
| contentDescription = "score speaker icon" | ||
| ) | ||
| Spacer(modifier = Modifier.height(16.dp)) | ||
| Text( | ||
| text = "No games yet.", | ||
| style = heading2.copy(color = GrayPrimary) | ||
| ) | ||
| Spacer(modifier = Modifier.height(8.dp)) | ||
| Text( | ||
| text = "Check back here later!", | ||
| style = bodyNormal.copy(color = GrayMedium) | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview | ||
| @Composable | ||
| private fun EmptyStatePreview() = ScorePreview { | ||
| EmptyState() | ||
| } |
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
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,38 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:width="96dp" | ||
| android:height="96dp" | ||
| android:viewportWidth="96" | ||
| android:viewportHeight="96"> | ||
| <group> | ||
| <clip-path | ||
| android:pathData="M0,0h96v96h-96z"/> | ||
| <path | ||
| android:pathData="M15.859,71.188C12.781,70.28 9.709,68.16 7.901,64.318C6.093,60.476 6.418,56.757 7.681,53.806C8.911,50.933 11.086,48.658 13.225,47.652L30.348,39.595C37.133,36.402 42.307,29.228 44.957,21.218C45.712,18.936 47.904,17.77 49.785,17.517C51.66,17.264 54.183,17.823 55.291,20.179L71.744,55.146C72.892,57.586 71.542,59.969 70.135,61.269C68.709,62.586 66.335,63.664 64.03,62.826C56.41,60.056 47.799,59.706 41.258,62.784L24.135,70.84C21.997,71.847 18.858,72.073 15.859,71.188ZM16.991,67.352C19.197,68.003 21.31,67.749 22.432,67.221L39.555,59.164C47.343,55.5 57.113,56.055 65.397,59.067C65.76,59.199 66.602,59.087 67.421,58.33C68.26,57.556 68.186,56.979 68.125,56.849L51.672,21.882C51.593,21.715 51.241,21.357 50.319,21.481C49.403,21.604 48.876,22.107 48.755,22.474C45.891,31.13 40.152,39.403 32.051,43.215L14.928,51.271C13.805,51.799 12.263,53.266 11.358,55.38C10.486,57.417 10.259,59.934 11.52,62.615C12.782,65.296 14.866,66.725 16.991,67.352Z" | ||
| android:fillColor="#C2C2C2" | ||
| android:fillType="evenOdd"/> | ||
| <path | ||
| android:pathData="M64.629,42.871C67.058,41.728 68.101,38.832 66.957,36.403C65.814,33.974 62.919,32.931 60.489,34.074L59.354,31.661C63.116,29.891 67.6,31.506 69.37,35.268C71.141,39.03 69.526,43.514 65.764,45.284L64.629,42.871Z" | ||
| android:fillColor="#C2C2C2" | ||
| android:fillType="evenOdd"/> | ||
| <path | ||
| android:pathData="M38.104,81.957L30.883,65.615L34.542,63.999L41.762,80.34C42.941,83.007 41.869,86.132 39.302,87.514C36.723,88.903 33.508,88.062 31.939,85.588L22.012,69.933L25.39,67.791L35.317,83.446C35.762,84.147 36.674,84.386 37.406,83.992C38.134,83.6 38.438,82.714 38.104,81.957Z" | ||
| android:fillColor="#C2C2C2" | ||
| android:fillType="evenOdd"/> | ||
| <path | ||
| android:pathData="M24.602,44.531L34.039,64.587L31.626,65.722L22.189,45.667L24.602,44.531Z" | ||
| android:fillColor="#C2C2C2" | ||
| android:fillType="evenOdd"/> | ||
| <path | ||
| android:pathData="M72.823,34.255C72.353,33.256 72.782,32.064 73.781,31.594L81.935,27.757C82.935,27.287 84.126,27.716 84.596,28.715C85.067,29.715 84.638,30.906 83.638,31.376L75.484,35.213C74.485,35.683 73.294,35.254 72.823,34.255Z" | ||
| android:fillColor="#C2C2C2" | ||
| android:fillType="evenOdd"/> | ||
| <path | ||
| android:pathData="M67.888,24.635C66.848,24.261 66.309,23.115 66.683,22.076L69.736,13.597C70.11,12.558 71.256,12.019 72.295,12.393C73.334,12.767 73.873,13.913 73.499,14.952L70.447,23.431C70.073,24.47 68.927,25.009 67.888,24.635Z" | ||
| android:fillColor="#C2C2C2" | ||
| android:fillType="evenOdd"/> | ||
| <path | ||
| android:pathData="M89.729,48.915C89.355,49.954 88.21,50.493 87.17,50.119L78.692,47.067C77.652,46.692 77.113,45.547 77.487,44.507C77.862,43.468 79.007,42.929 80.047,43.303L88.525,46.355C89.564,46.73 90.104,47.875 89.729,48.915Z" | ||
| android:fillColor="#C2C2C2" | ||
| android:fillType="evenOdd"/> | ||
| </group> | ||
| </vector> |
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.