-
Notifications
You must be signed in to change notification settings - Fork 0
Error and Loading State UI #33
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 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
e033a35
LoadingState set up
amjiao 8b226d5
LoadingState set up
amjiao d05dfc8
Finish LoadingState
amjiao c374983
Spacing fix
amjiao 83e081f
Finish ErrorState
amjiao e5c2177
LoadingState set up
amjiao df00252
LoadingState set up
amjiao 54c9372
Finish LoadingState
amjiao 8c8037c
Spacing fix
amjiao 4c38dfe
Finish ErrorState
amjiao e60c5f5
Merge remote-tracking branch 'origin/Amy/error-loading-states' into A…
amjiao f8608d2
Abstracting Error/Loading ui to take custom inputs
amjiao 5f986aa
add onRefresh
amjiao b781e27
GameDetailsLoadingState
amjiao 0b1963f
PR fixes
amjiao 86ec992
Merge branch 'main' into Amy/error-loading-states
amjiao acc40c8
Import fix
amjiao 42c8fe4
ScorePreview + small fixes
amjiao 5c52d62
Merge branch 'main' into Amy/error-loading-states
amjiao a992ad3
Remove redundant code
amjiao 5daf380
Rename to GameDetailsLoadingScreen for consistency
amjiao b7739a4
PR fixes
amjiao c480669
Quick migration of remaining previews
zachseidner1 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
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
31 changes: 31 additions & 0 deletions
31
app/src/main/java/com/cornellappdev/score/components/ScorePreview.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,31 @@ | ||
| package com.cornellappdev.score.components | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.CompositionLocalProvider | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.unit.Dp | ||
| import androidx.compose.ui.unit.dp | ||
| import com.cornellappdev.score.theme.LocalInfiniteLoading | ||
|
|
||
| @Composable | ||
| fun ScorePreview( | ||
| padding: Dp = 0.dp, | ||
| backgroundColor: Color = Color.White, | ||
| content: @Composable () -> Unit | ||
| ) { | ||
| CompositionLocalProvider( | ||
amjiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| LocalInfiniteLoading provides 0f | ||
| ) { | ||
| Column( | ||
| modifier = Modifier | ||
| .background(backgroundColor) | ||
| .padding(padding) | ||
| ) { | ||
| content() | ||
| } | ||
| } | ||
| } | ||
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
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.