diff --git a/doc/modularization.png b/doc/modularization.png deleted file mode 100644 index 2fd9aa8..0000000 Binary files a/doc/modularization.png and /dev/null differ diff --git a/feature/image_viewer/src/main/java/com/mobiledevpro/image/viewer/view/ImageViewerScreen.kt b/feature/image_viewer/src/main/java/com/mobiledevpro/image/viewer/view/ImageViewerScreen.kt index a53658c..78ceef1 100644 --- a/feature/image_viewer/src/main/java/com/mobiledevpro/image/viewer/view/ImageViewerScreen.kt +++ b/feature/image_viewer/src/main/java/com/mobiledevpro/image/viewer/view/ImageViewerScreen.kt @@ -107,11 +107,8 @@ fun ImageViewerScreen() { fun BoxScope.UpperImage() { var imageScale by remember { mutableFloatStateOf(1f) } var imageOffset by remember { mutableStateOf(Offset.Zero) } + var rotation by remember { mutableFloatStateOf(0f) } - val transformState = rememberTransformableState { zoomChange, panChange, rotationChange -> - imageScale = (imageScale * zoomChange).coerceIn(1f, 5f) - imageOffset += panChange - } val model = ImageRequest.Builder(LocalContext.current) .data("https://c4.wallpaperflare.com/wallpaper/83/500/871/waterfall-high-resolution-desktop-wallpaper-preview.jpg") @@ -121,23 +118,26 @@ fun BoxScope.UpperImage() { .diskCachePolicy(CachePolicy.DISABLED) .build() + val transformState = rememberTransformableState { zoomChange, panChange, rotationChange -> + imageScale = (imageScale * zoomChange).coerceIn(0.5f, 5f) + imageOffset += panChange + rotation += rotationChange + } + AsyncImage( model = model, contentDescription = "", contentScale = ContentScale.FillHeight, - onState = { state -> - Log.d("UI", "AsyncImage.state: $state") - }, modifier = Modifier .align(Alignment.Center) .fillMaxWidth() .scale(imageScale) .graphicsLayer { - Log.d("UI", "ImageViewerScreen: graphicsLayer: scale $scaleX $scaleY") scaleX = imageScale scaleY = imageScale translationX = imageOffset.x translationY = imageOffset.y + rotationZ = rotation } .transformable(transformState) .pointerInput(Unit) { @@ -145,6 +145,7 @@ fun BoxScope.UpperImage() { Log.d("UI", "ImageViewerScreen: on double tap") imageScale = 1f imageOffset = Offset.Zero + rotation = 0F }) } ) @@ -154,10 +155,12 @@ fun BoxScope.UpperImage() { fun BoxScope.LowerImage() { var imageScale by remember { mutableFloatStateOf(1f) } var imageOffset by remember { mutableStateOf(Offset.Zero) } + var rotation by remember { mutableFloatStateOf(0f) } val transformState = rememberTransformableState { zoomChange, panChange, rotationChange -> - imageScale = (imageScale * zoomChange).coerceIn(1f, 5f) + imageScale = (imageScale * zoomChange).coerceIn(0.5f, 5f) imageOffset += panChange + rotation += rotationChange } val model = ImageRequest.Builder(LocalContext.current) @@ -180,11 +183,11 @@ fun BoxScope.LowerImage() { .fillMaxWidth() .scale(imageScale) .graphicsLayer { - Log.d("UI", "ImageViewerScreen: graphicsLayer: scale $scaleX $scaleY") scaleX = imageScale scaleY = imageScale translationX = imageOffset.x translationY = imageOffset.y + rotationZ = rotation } .transformable(transformState) .pointerInput(Unit) { @@ -192,6 +195,7 @@ fun BoxScope.LowerImage() { Log.d("UI", "ImageViewerScreen: on double tap") imageScale = 1f imageOffset = Offset.Zero + rotation = 0F }) } ) diff --git a/maestro/people-profile-flow.yaml b/maestro/people-profile-flow.yaml deleted file mode 100644 index 838873d..0000000 --- a/maestro/people-profile-flow.yaml +++ /dev/null @@ -1,28 +0,0 @@ -appId: com.mobiledevpro.apptemplate.compose ---- -- launchApp: - appId: "com.mobiledevpro.apptemplate.compose" - clearState: true -- waitForAnimationToEnd: - timeout: 1500 -#- extendedWaitUntil: -# visible: "Next" -# timeout: 1500 -#- tapOn: "Next" -#- tapOn: "Next" -#- tapOn: "Next" -- extendedWaitUntil: - visible: "People" - timeout: 5000 -- tapOn: "People" -- extendedWaitUntil: - visible: "Manilla Andrews" - timeout: 5000 -- tapOn: "Manilla Andrews" -- "waitForAnimationToEnd" -- "back" - -# How to run this flow: -# 1. Install Maestro: Terminal -> curl -Ls "https://get.maestro.mobile.dev" | bash -# 2. Install the app on emulator (doesn't work with physical device) -# 3. Run the flow: Terminal -> maestro test -c maestro/people-profile-flow.yaml \ No newline at end of file