-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(android.NearbyTransitView): Shimmer loading (#631)
- Loading branch information
1 parent
fcca221
commit ca565ac
Showing
12 changed files
with
179 additions
and
85 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
26 changes: 26 additions & 0 deletions
26
androidApp/src/main/java/com/mbta/tid/mbta_app/android/component/LoadingRouteCard.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,26 @@ | ||
package com.mbta.tid.mbta_app.android.component | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.semantics.clearAndSetSemantics | ||
import androidx.compose.ui.semantics.contentDescription | ||
import com.mbta.tid.mbta_app.android.R | ||
import com.mbta.tid.mbta_app.android.nearbyTransit.NearbyRouteView | ||
import com.mbta.tid.mbta_app.model.LoadingPlaceholders | ||
import com.valentinilk.shimmer.shimmer | ||
import kotlinx.datetime.Clock | ||
|
||
@Composable | ||
fun LoadingRouteCard() { | ||
val placeholderRouteData = LoadingPlaceholders.nearbyRoute() | ||
|
||
val contentDesc = stringResource(R.string.loading) | ||
|
||
Column( | ||
modifier = Modifier.shimmer().clearAndSetSemantics { contentDescription = contentDesc } | ||
) { | ||
NearbyRouteView(placeholderRouteData, false, {}, Clock.System.now(), { _, _ -> }) | ||
} | ||
} |
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
Oops, something went wrong.