Skip to content

Commit

Permalink
build: Improve run configuration (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
panpf committed Jun 27, 2024
1 parent ada70ec commit 63e0217
Show file tree
Hide file tree
Showing 18 changed files with 53 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import okio.buffer
import okio.source
import okio.use
import org.jetbrains.compose.resources.ExperimentalResourceApi
import sketch_root.sample.generated.resources.Res
import sketch.sample.generated.resources.Res

@OptIn(ExperimentalResourceApi::class)
actual suspend fun buildFetcherTestItems(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import com.github.panpf.sketch.AsyncImageState
import com.github.panpf.sketch.request.LoadState
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
import sketch_root.sample.generated.resources.Res.drawable
import sketch_root.sample.generated.resources.ic_error_baseline
import sketch.sample.generated.resources.Res.drawable
import sketch.sample.generated.resources.ic_error_baseline

@Composable
fun LoadState(imageState: AsyncImageState, modifier: Modifier = Modifier) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ import kotlinx.coroutines.launch
import org.jetbrains.compose.resources.DrawableResource
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
import sketch_root.sample.generated.resources.Res
import sketch_root.sample.generated.resources.ic_debug
import sketch_root.sample.generated.resources.ic_giphy
import sketch_root.sample.generated.resources.ic_pexels
import sketch_root.sample.generated.resources.ic_phone
import sketch.sample.generated.resources.Res
import sketch.sample.generated.resources.ic_debug
import sketch.sample.generated.resources.ic_giphy
import sketch.sample.generated.resources.ic_pexels
import sketch.sample.generated.resources.ic_phone

expect val gridCellsMinSize: Dp

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import com.github.panpf.sketch.sample.ui.setting.AppSettingsDialog
import com.github.panpf.sketch.sample.ui.setting.Page.LIST
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
import sketch_root.sample.generated.resources.Res.drawable
import sketch_root.sample.generated.resources.ic_layout_grid
import sketch_root.sample.generated.resources.ic_layout_grid_staggered
import sketch_root.sample.generated.resources.ic_pause
import sketch_root.sample.generated.resources.ic_play
import sketch_root.sample.generated.resources.ic_settings
import sketch.sample.generated.resources.Res.drawable
import sketch.sample.generated.resources.ic_layout_grid
import sketch.sample.generated.resources.ic_layout_grid_staggered
import sketch.sample.generated.resources.ic_pause
import sketch.sample.generated.resources.ic_play
import sketch.sample.generated.resources.ic_settings

@OptIn(ExperimentalResourceApi::class)
@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ import com.github.panpf.sketch.sample.util.ifLet
import com.github.panpf.sketch.state.StateImage
import com.github.panpf.sketch.state.rememberIconPainterStateImage
import com.github.panpf.sketch.state.saveCellularTrafficError
import sketch_root.sample.generated.resources.Res
import sketch_root.sample.generated.resources.ic_image_outline
import sketch_root.sample.generated.resources.ic_image_outline_broken
import sketch_root.sample.generated.resources.ic_signal_cellular
import sketch.sample.generated.resources.Res
import sketch.sample.generated.resources.ic_image_outline
import sketch.sample.generated.resources.ic_image_outline_broken
import sketch.sample.generated.resources.ic_signal_cellular

@Composable
expect fun rememberAnimatedPlaceholderStateImage(context: PlatformContext): StateImage?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ import com.github.panpf.sketch.transform.BlurTransformation
import kotlinx.coroutines.launch
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
import sketch_root.sample.generated.resources.Res.drawable
import sketch_root.sample.generated.resources.ic_image2_baseline
import sketch_root.sample.generated.resources.ic_image2_outline
import sketch_root.sample.generated.resources.ic_settings
import sketch.sample.generated.resources.Res.drawable
import sketch.sample.generated.resources.ic_image2_baseline
import sketch.sample.generated.resources.ic_image2_outline
import sketch.sample.generated.resources.ic_settings

@Composable
@OptIn(ExperimentalFoundationApi::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
import sketch_root.sample.generated.resources.Res.drawable
import sketch_root.sample.generated.resources.ic_expand_more
import sketch.sample.generated.resources.Res.drawable
import sketch.sample.generated.resources.ic_expand_more

@Composable
expect fun getSettingsDialogHeight(): Dp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import com.github.panpf.sketch.sample.ui.base.ToolbarScaffold
import com.github.panpf.sketch.sample.ui.components.MyAsyncImage
import com.github.panpf.sketch.state.rememberIconPainterStateImage
import org.jetbrains.compose.resources.ExperimentalResourceApi
import sketch_root.sample.generated.resources.Res.drawable
import sketch_root.sample.generated.resources.ic_image_outline
import sketch.sample.generated.resources.Res.drawable
import sketch.sample.generated.resources.ic_image_outline

class ExifOrientationTestScreen : BaseScreen() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import org.jetbrains.compose.resources.ExperimentalResourceApi
import sketch_root.sample.generated.resources.Res.drawable
import sketch_root.sample.generated.resources.ic_image_outline
import sketch.sample.generated.resources.Res.drawable
import sketch.sample.generated.resources.ic_image_outline
import kotlin.random.Random


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import com.github.panpf.sketch.sample.ui.base.BaseScreen
import com.github.panpf.sketch.sample.ui.base.ToolbarScaffold
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
import sketch_root.sample.generated.resources.Res
import sketch_root.sample.generated.resources.ic_image_outline
import sketch.sample.generated.resources.Res
import sketch.sample.generated.resources.ic_image_outline

class TempTestScreen : BaseScreen() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import cafe.adriel.voyager.navigator.LocalNavigator
import com.github.panpf.sketch.sample.ui.components.AutoLinkText
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
import sketch_root.sample.generated.resources.Res
import sketch_root.sample.generated.resources.ic_github
import sketch.sample.generated.resources.Res
import sketch.sample.generated.resources.ic_github

expect val testItemGridCells: Int

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import com.github.panpf.sketch.request.ImageRequest
import com.github.panpf.sketch.request.placeholder
import com.github.panpf.sketch.sample.ui.util.PreviewWrapper
import com.github.panpf.sketch.state.rememberPainterStateImage
import sketch_root.sample.generated.resources.Res
import sketch_root.sample.generated.resources.ic_image2_outline
import sketch.sample.generated.resources.Res
import sketch.sample.generated.resources.ic_image2_outline


@Preview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import net.harawata.appdirs.AppDirsFactory
import org.jetbrains.compose.resources.ExperimentalResourceApi
import sketch_root.sample.generated.resources.Res
import sketch.sample.generated.resources.Res
import java.io.File

@OptIn(ExperimentalResourceApi::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import platform.Foundation.NSBundle
import platform.Foundation.NSCachesDirectory
import platform.Foundation.NSSearchPathForDirectoriesInDomains
import platform.Foundation.NSUserDomainMask
import sketch_root.sample.generated.resources.Res
import sketch.sample.generated.resources.Res

@OptIn(ExperimentalResourceApi::class)
actual suspend fun buildFetcherTestItems(context: PlatformContext, fromCompose: Boolean): List<FetcherTestItem> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.github.panpf.sketch.PlatformContext
import com.github.panpf.sketch.fetch.newComposeResourceUri
import com.github.panpf.sketch.images.MyImages
import org.jetbrains.compose.resources.ExperimentalResourceApi
import sketch_root.sample.generated.resources.Res
import sketch.sample.generated.resources.Res

@OptIn(ExperimentalResourceApi::class)
actual suspend fun buildFetcherTestItems(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ import com.github.panpf.zoomimage.zoom.valueOf
import kotlinx.coroutines.launch
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
import sketch_root.sample.generated.resources.Res.drawable
import sketch_root.sample.generated.resources.ic_info_baseline
import sketch_root.sample.generated.resources.ic_rotate_right
import sketch_root.sample.generated.resources.ic_save
import sketch_root.sample.generated.resources.ic_share
import sketch_root.sample.generated.resources.ic_zoom_in
import sketch_root.sample.generated.resources.ic_zoom_out
import sketch.sample.generated.resources.Res.drawable
import sketch.sample.generated.resources.ic_info_baseline
import sketch.sample.generated.resources.ic_rotate_right
import sketch.sample.generated.resources.ic_save
import sketch.sample.generated.resources.ic_share
import sketch.sample.generated.resources.ic_zoom_in
import sketch.sample.generated.resources.ic_zoom_out
import kotlin.math.roundToInt

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ import com.github.panpf.sketch.state.ThumbnailMemoryCacheStateImage
import kotlinx.coroutines.launch
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
import sketch_root.sample.generated.resources.Res.drawable
import sketch_root.sample.generated.resources.ic_info_baseline
import sketch_root.sample.generated.resources.ic_rotate_right
import sketch_root.sample.generated.resources.ic_save
import sketch_root.sample.generated.resources.ic_share
import sketch_root.sample.generated.resources.ic_zoom_in
import sketch.sample.generated.resources.Res.drawable
import sketch.sample.generated.resources.ic_info_baseline
import sketch.sample.generated.resources.ic_rotate_right
import sketch.sample.generated.resources.ic_save
import sketch.sample.generated.resources.ic_share
import sketch.sample.generated.resources.ic_zoom_in

@Composable
actual fun PhotoViewer(
Expand Down
3 changes: 3 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// The name of the root project cannot be changed because the sample app needs to rely on
// it when generating compose resources.
rootProject.name = "sketch"

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

dependencyResolutionManagement {
Expand Down

0 comments on commit 63e0217

Please sign in to comment.