-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #751 from arkivanov/sample-shared-anim
Sample Shared Transitions example without predictive back support
- Loading branch information
Showing
35 changed files
with
497 additions
and
79 deletions.
There are no files selected for viewing
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
25 changes: 25 additions & 0 deletions
25
sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/PainterResource.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,25 @@ | ||
package com.arkivanov.sample.shared | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.graphics.painter.Painter | ||
import decompose.sample.shared.compose.generated.resources.Res | ||
import decompose.sample.shared.compose.generated.resources.cat1 | ||
import decompose.sample.shared.compose.generated.resources.cat2 | ||
import decompose.sample.shared.compose.generated.resources.cat3 | ||
import decompose.sample.shared.compose.generated.resources.cat4 | ||
import decompose.sample.shared.compose.generated.resources.cat5 | ||
import org.jetbrains.compose.resources.ExperimentalResourceApi | ||
import org.jetbrains.compose.resources.painterResource | ||
|
||
@OptIn(ExperimentalResourceApi::class) | ||
@Composable | ||
internal fun painterResource(imageResourceId: ImageResourceId): Painter = | ||
painterResource( | ||
when (imageResourceId) { | ||
ImageResourceId.CAT_1 -> Res.drawable.cat1 | ||
ImageResourceId.CAT_2 -> Res.drawable.cat2 | ||
ImageResourceId.CAT_3 -> Res.drawable.cat3 | ||
ImageResourceId.CAT_4 -> Res.drawable.cat4 | ||
ImageResourceId.CAT_5 -> Res.drawable.cat5 | ||
} | ||
) |
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.