@ -0,0 +1,24 @@
|
||||
package example.imageviewer.icon |
||||
|
||||
import androidx.compose.material.icons.materialIcon |
||||
import androidx.compose.material.icons.materialPath |
||||
|
||||
val IconCustomArrowBack = materialIcon("Filled.CustomArrowBack") { |
||||
val startY = 12f |
||||
val startX = 1f |
||||
val arrowWidth = 8f |
||||
val arrowHeight = 14f |
||||
val lineWidth = 14f |
||||
val lineHeight = 2f |
||||
materialPath { |
||||
moveTo(startX, startY) |
||||
lineToRelative(arrowWidth, arrowHeight / 2) |
||||
verticalLineToRelative(-arrowHeight) |
||||
close() |
||||
moveTo(startX + arrowWidth, startY + lineHeight / 2) |
||||
verticalLineToRelative(-lineHeight) |
||||
horizontalLineToRelative(lineWidth) |
||||
verticalLineToRelative(lineHeight) |
||||
close() |
||||
} |
||||
} |
@ -0,0 +1,53 @@
|
||||
package example.imageviewer.icon |
||||
|
||||
import androidx.compose.material.icons.materialIcon |
||||
import androidx.compose.material.icons.materialPath |
||||
|
||||
// TODO Copied from "material:material-icons-extended", because this artifact is not working on iOS for now |
||||
val IconAutoFixHigh = materialIcon(name = "Filled.AutoFixHigh") { |
||||
materialPath { |
||||
moveTo(7.5f, 5.6f) |
||||
lineTo(10.0f, 7.0f) |
||||
lineTo(8.6f, 4.5f) |
||||
lineTo(10.0f, 2.0f) |
||||
lineTo(7.5f, 3.4f) |
||||
lineTo(5.0f, 2.0f) |
||||
lineToRelative(1.4f, 2.5f) |
||||
lineTo(5.0f, 7.0f) |
||||
close() |
||||
moveTo(19.5f, 15.4f) |
||||
lineTo(17.0f, 14.0f) |
||||
lineToRelative(1.4f, 2.5f) |
||||
lineTo(17.0f, 19.0f) |
||||
lineToRelative(2.5f, -1.4f) |
||||
lineTo(22.0f, 19.0f) |
||||
lineToRelative(-1.4f, -2.5f) |
||||
lineTo(22.0f, 14.0f) |
||||
close() |
||||
moveTo(22.0f, 2.0f) |
||||
lineToRelative(-2.5f, 1.4f) |
||||
lineTo(17.0f, 2.0f) |
||||
lineToRelative(1.4f, 2.5f) |
||||
lineTo(17.0f, 7.0f) |
||||
lineToRelative(2.5f, -1.4f) |
||||
lineTo(22.0f, 7.0f) |
||||
lineToRelative(-1.4f, -2.5f) |
||||
close() |
||||
moveTo(14.37f, 7.29f) |
||||
curveToRelative(-0.39f, -0.39f, -1.02f, -0.39f, -1.41f, 0.0f) |
||||
lineTo(1.29f, 18.96f) |
||||
curveToRelative(-0.39f, 0.39f, -0.39f, 1.02f, 0.0f, 1.41f) |
||||
lineToRelative(2.34f, 2.34f) |
||||
curveToRelative(0.39f, 0.39f, 1.02f, 0.39f, 1.41f, 0.0f) |
||||
lineTo(16.7f, 11.05f) |
||||
curveToRelative(0.39f, -0.39f, 0.39f, -1.02f, 0.0f, -1.41f) |
||||
lineToRelative(-2.33f, -2.35f) |
||||
close() |
||||
moveTo(13.34f, 12.78f) |
||||
lineToRelative(-2.12f, -2.12f) |
||||
lineToRelative(2.44f, -2.44f) |
||||
lineToRelative(2.12f, 2.12f) |
||||
lineToRelative(-2.44f, 2.44f) |
||||
close() |
||||
} |
||||
} |
@ -0,0 +1,39 @@
|
||||
package example.imageviewer.icon |
||||
|
||||
import androidx.compose.material.icons.materialIcon |
||||
import androidx.compose.material.icons.materialPath |
||||
|
||||
// TODO Copied from "material:material-icons-extended", because this artifact is not working on iOS for now |
||||
val IconIosShare = materialIcon(name = "Filled.IosShare") { |
||||
materialPath { |
||||
moveTo(16.0f, 5.0f) |
||||
lineToRelative(-1.42f, 1.42f) |
||||
lineToRelative(-1.59f, -1.59f) |
||||
lineTo(12.99f, 16.0f) |
||||
horizontalLineToRelative(-1.98f) |
||||
lineTo(11.01f, 4.83f) |
||||
lineTo(9.42f, 6.42f) |
||||
lineTo(8.0f, 5.0f) |
||||
lineToRelative(4.0f, -4.0f) |
||||
lineToRelative(4.0f, 4.0f) |
||||
close() |
||||
moveTo(20.0f, 10.0f) |
||||
verticalLineToRelative(11.0f) |
||||
curveToRelative(0.0f, 1.1f, -0.9f, 2.0f, -2.0f, 2.0f) |
||||
lineTo(6.0f, 23.0f) |
||||
curveToRelative(-1.11f, 0.0f, -2.0f, -0.9f, -2.0f, -2.0f) |
||||
lineTo(4.0f, 10.0f) |
||||
curveToRelative(0.0f, -1.11f, 0.89f, -2.0f, 2.0f, -2.0f) |
||||
horizontalLineToRelative(3.0f) |
||||
verticalLineToRelative(2.0f) |
||||
lineTo(6.0f, 10.0f) |
||||
verticalLineToRelative(11.0f) |
||||
horizontalLineToRelative(12.0f) |
||||
lineTo(18.0f, 10.0f) |
||||
horizontalLineToRelative(-3.0f) |
||||
lineTo(15.0f, 8.0f) |
||||
horizontalLineToRelative(3.0f) |
||||
curveToRelative(1.1f, 0.0f, 2.0f, 0.89f, 2.0f, 2.0f) |
||||
close() |
||||
} |
||||
} |
@ -0,0 +1,32 @@
|
||||
package example.imageviewer.icon |
||||
|
||||
import androidx.compose.material.icons.materialIcon |
||||
import androidx.compose.material.icons.materialPath |
||||
|
||||
// TODO Copied from "material:material-icons-extended", because this artifact is not working on iOS for now |
||||
val IconMap = materialIcon(name = "Filled.Map") { |
||||
materialPath { |
||||
moveTo(20.5f, 3.0f) |
||||
lineToRelative(-0.16f, 0.03f) |
||||
lineTo(15.0f, 5.1f) |
||||
lineTo(9.0f, 3.0f) |
||||
lineTo(3.36f, 4.9f) |
||||
curveToRelative(-0.21f, 0.07f, -0.36f, 0.25f, -0.36f, 0.48f) |
||||
verticalLineTo(20.5f) |
||||
curveToRelative(0.0f, 0.28f, 0.22f, 0.5f, 0.5f, 0.5f) |
||||
lineToRelative(0.16f, -0.03f) |
||||
lineTo(9.0f, 18.9f) |
||||
lineToRelative(6.0f, 2.1f) |
||||
lineToRelative(5.64f, -1.9f) |
||||
curveToRelative(0.21f, -0.07f, 0.36f, -0.25f, 0.36f, -0.48f) |
||||
verticalLineTo(3.5f) |
||||
curveToRelative(0.0f, -0.28f, -0.22f, -0.5f, -0.5f, -0.5f) |
||||
close() |
||||
moveTo(15.0f, 19.0f) |
||||
lineToRelative(-6.0f, -2.11f) |
||||
verticalLineTo(5.0f) |
||||
lineToRelative(6.0f, 2.11f) |
||||
verticalLineTo(19.0f) |
||||
close() |
||||
} |
||||
} |
@ -0,0 +1,28 @@
|
||||
package example.imageviewer.icon |
||||
|
||||
import androidx.compose.material.icons.materialIcon |
||||
import androidx.compose.material.icons.materialPath |
||||
|
||||
// TODO Copied from "material:material-icons-extended", because this artifact is not working on iOS for now |
||||
val IconMenu = materialIcon(name = "Filled.Menu") { |
||||
materialPath { |
||||
moveTo(3.0f, 18.0f) |
||||
horizontalLineToRelative(18.0f) |
||||
verticalLineToRelative(-2.0f) |
||||
lineTo(3.0f, 16.0f) |
||||
verticalLineToRelative(2.0f) |
||||
close() |
||||
moveTo(3.0f, 13.0f) |
||||
horizontalLineToRelative(18.0f) |
||||
verticalLineToRelative(-2.0f) |
||||
lineTo(3.0f, 11.0f) |
||||
verticalLineToRelative(2.0f) |
||||
close() |
||||
moveTo(3.0f, 6.0f) |
||||
verticalLineToRelative(2.0f) |
||||
horizontalLineToRelative(18.0f) |
||||
lineTo(21.0f, 6.0f) |
||||
lineTo(3.0f, 6.0f) |
||||
close() |
||||
} |
||||
} |
@ -0,0 +1,28 @@
|
||||
package example.imageviewer.icon |
||||
|
||||
import androidx.compose.material.icons.materialIcon |
||||
import androidx.compose.material.icons.materialPath |
||||
|
||||
// TODO Copied from "material:material-icons-extended", because this artifact is not working on iOS for now |
||||
val IconMoreVert = materialIcon(name = "Filled.MoreVert") { |
||||
materialPath { |
||||
moveTo(12.0f, 8.0f) |
||||
curveToRelative(1.1f, 0.0f, 2.0f, -0.9f, 2.0f, -2.0f) |
||||
reflectiveCurveToRelative(-0.9f, -2.0f, -2.0f, -2.0f) |
||||
reflectiveCurveToRelative(-2.0f, 0.9f, -2.0f, 2.0f) |
||||
reflectiveCurveToRelative(0.9f, 2.0f, 2.0f, 2.0f) |
||||
close() |
||||
moveTo(12.0f, 10.0f) |
||||
curveToRelative(-1.1f, 0.0f, -2.0f, 0.9f, -2.0f, 2.0f) |
||||
reflectiveCurveToRelative(0.9f, 2.0f, 2.0f, 2.0f) |
||||
reflectiveCurveToRelative(2.0f, -0.9f, 2.0f, -2.0f) |
||||
reflectiveCurveToRelative(-0.9f, -2.0f, -2.0f, -2.0f) |
||||
close() |
||||
moveTo(12.0f, 16.0f) |
||||
curveToRelative(-1.1f, 0.0f, -2.0f, 0.9f, -2.0f, 2.0f) |
||||
reflectiveCurveToRelative(0.9f, 2.0f, 2.0f, 2.0f) |
||||
reflectiveCurveToRelative(2.0f, -0.9f, 2.0f, -2.0f) |
||||
reflectiveCurveToRelative(-0.9f, -2.0f, -2.0f, -2.0f) |
||||
close() |
||||
} |
||||
} |
@ -0,0 +1,36 @@
|
||||
package example.imageviewer.icon |
||||
|
||||
import androidx.compose.material.icons.materialIcon |
||||
import androidx.compose.material.icons.materialPath |
||||
|
||||
// TODO Copied from "material:material-icons-extended", because this artifact is not working on iOS for now |
||||
val IconPhotoCamera = materialIcon(name = "Filled.PhotoCamera") { |
||||
materialPath { |
||||
moveTo(12.0f, 12.0f) |
||||
moveToRelative(-3.2f, 0.0f) |
||||
arcToRelative(3.2f, 3.2f, 0.0f, true, true, 6.4f, 0.0f) |
||||
arcToRelative(3.2f, 3.2f, 0.0f, true, true, -6.4f, 0.0f) |
||||
} |
||||
materialPath { |
||||
moveTo(9.0f, 2.0f) |
||||
lineTo(7.17f, 4.0f) |
||||
lineTo(4.0f, 4.0f) |
||||
curveToRelative(-1.1f, 0.0f, -2.0f, 0.9f, -2.0f, 2.0f) |
||||
verticalLineToRelative(12.0f) |
||||
curveToRelative(0.0f, 1.1f, 0.9f, 2.0f, 2.0f, 2.0f) |
||||
horizontalLineToRelative(16.0f) |
||||
curveToRelative(1.1f, 0.0f, 2.0f, -0.9f, 2.0f, -2.0f) |
||||
lineTo(22.0f, 6.0f) |
||||
curveToRelative(0.0f, -1.1f, -0.9f, -2.0f, -2.0f, -2.0f) |
||||
horizontalLineToRelative(-3.17f) |
||||
lineTo(15.0f, 2.0f) |
||||
lineTo(9.0f, 2.0f) |
||||
close() |
||||
moveTo(12.0f, 17.0f) |
||||
curveToRelative(-2.76f, 0.0f, -5.0f, -2.24f, -5.0f, -5.0f) |
||||
reflectiveCurveToRelative(2.24f, -5.0f, 5.0f, -5.0f) |
||||
reflectiveCurveToRelative(5.0f, 2.24f, 5.0f, 5.0f) |
||||
reflectiveCurveToRelative(-2.24f, 5.0f, -5.0f, 5.0f) |
||||
close() |
||||
} |
||||
} |
@ -0,0 +1,28 @@
|
||||
package example.imageviewer.icon |
||||
|
||||
import androidx.compose.material.icons.materialIcon |
||||
import androidx.compose.material.icons.materialPath |
||||
|
||||
// TODO Copied from "material:material-icons-extended", because this artifact is not working on iOS for now |
||||
val IconVisibility = materialIcon(name = "Filled.Visibility") { |
||||
materialPath { |
||||
moveTo(12.0f, 4.5f) |
||||
curveTo(7.0f, 4.5f, 2.73f, 7.61f, 1.0f, 12.0f) |
||||
curveToRelative(1.73f, 4.39f, 6.0f, 7.5f, 11.0f, 7.5f) |
||||
reflectiveCurveToRelative(9.27f, -3.11f, 11.0f, -7.5f) |
||||
curveToRelative(-1.73f, -4.39f, -6.0f, -7.5f, -11.0f, -7.5f) |
||||
close() |
||||
moveTo(12.0f, 17.0f) |
||||
curveToRelative(-2.76f, 0.0f, -5.0f, -2.24f, -5.0f, -5.0f) |
||||
reflectiveCurveToRelative(2.24f, -5.0f, 5.0f, -5.0f) |
||||
reflectiveCurveToRelative(5.0f, 2.24f, 5.0f, 5.0f) |
||||
reflectiveCurveToRelative(-2.24f, 5.0f, -5.0f, 5.0f) |
||||
close() |
||||
moveTo(12.0f, 9.0f) |
||||
curveToRelative(-1.66f, 0.0f, -3.0f, 1.34f, -3.0f, 3.0f) |
||||
reflectiveCurveToRelative(1.34f, 3.0f, 3.0f, 3.0f) |
||||
reflectiveCurveToRelative(3.0f, -1.34f, 3.0f, -3.0f) |
||||
reflectiveCurveToRelative(-1.34f, -3.0f, -3.0f, -3.0f) |
||||
close() |
||||
} |
||||
} |
@ -1,85 +0,0 @@
|
||||
package example.imageviewer.view |
||||
|
||||
import androidx.compose.animation.AnimatedContent |
||||
import androidx.compose.animation.AnimatedContentScope |
||||
import androidx.compose.animation.ExperimentalAnimationApi |
||||
import androidx.compose.animation.core.FastOutSlowInEasing |
||||
import androidx.compose.animation.core.tween |
||||
import androidx.compose.animation.with |
||||
import androidx.compose.foundation.Image |
||||
import androidx.compose.foundation.background |
||||
import androidx.compose.foundation.clickable |
||||
import androidx.compose.foundation.interaction.MutableInteractionSource |
||||
import androidx.compose.foundation.layout.Box |
||||
import androidx.compose.foundation.layout.Spacer |
||||
import androidx.compose.foundation.layout.fillMaxSize |
||||
import androidx.compose.foundation.layout.fillMaxWidth |
||||
import androidx.compose.foundation.layout.height |
||||
import androidx.compose.runtime.Composable |
||||
import androidx.compose.runtime.LaunchedEffect |
||||
import androidx.compose.runtime.getValue |
||||
import androidx.compose.runtime.mutableStateOf |
||||
import androidx.compose.runtime.remember |
||||
import androidx.compose.runtime.setValue |
||||
import androidx.compose.ui.Alignment |
||||
import androidx.compose.ui.Modifier |
||||
import androidx.compose.ui.graphics.Color |
||||
import androidx.compose.ui.graphics.ImageBitmap |
||||
import androidx.compose.ui.layout.ContentScale |
||||
import androidx.compose.ui.unit.dp |
||||
import example.imageviewer.LocalImageProvider |
||||
import example.imageviewer.model.PictureData |
||||
|
||||
@OptIn(ExperimentalAnimationApi::class) |
||||
@Composable |
||||
internal fun PreviewImage( |
||||
picture: PictureData, |
||||
onClick: () -> Unit, |
||||
) { |
||||
val imageProvider = LocalImageProvider.current |
||||
val interactionSource = remember { MutableInteractionSource() } |
||||
Box( |
||||
Modifier.fillMaxWidth().height(393.dp).background(Color.Black), |
||||
contentAlignment = Alignment.Center |
||||
) { |
||||
Box( |
||||
modifier = Modifier |
||||
.fillMaxSize() |
||||
.clickable(interactionSource, indication = null, onClick = onClick), |
||||
) { |
||||
AnimatedContent( |
||||
targetState = picture, |
||||
transitionSpec = { |
||||
slideIntoContainer( |
||||
towards = AnimatedContentScope.SlideDirection.Left, |
||||
animationSpec = tween(durationMillis = 500, easing = FastOutSlowInEasing) |
||||
) with slideOutOfContainer( |
||||
towards = AnimatedContentScope.SlideDirection.Left, |
||||
animationSpec = tween(durationMillis = 500, easing = FastOutSlowInEasing) |
||||
) |
||||
} |
||||
) { currentPicture -> |
||||
var image: ImageBitmap? by remember(currentPicture) { mutableStateOf(null) } |
||||
LaunchedEffect(currentPicture) { |
||||
image = imageProvider.getImage(currentPicture) |
||||
} |
||||
if (image != null) { |
||||
Box(Modifier.fillMaxSize()) { |
||||
Image( |
||||
bitmap = image!!, |
||||
contentDescription = null, |
||||
modifier = Modifier |
||||
.fillMaxSize(), |
||||
contentScale = ContentScale.Crop |
||||
) |
||||
MemoryTextOverlay(currentPicture) |
||||
} |
||||
} else { |
||||
Spacer( |
||||
modifier = Modifier.fillMaxSize() |
||||
) |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 6.3 KiB |
@ -1,41 +0,0 @@
|
||||
package example.imageviewer |
||||
|
||||
import androidx.compose.material.icons.materialIcon |
||||
import androidx.compose.material.icons.materialPath |
||||
import androidx.compose.ui.graphics.vector.ImageVector |
||||
|
||||
// TODO Copied from material3, because "material:material-icons-extended" not working on iOS for now |
||||
val IosShareIcon: ImageVector = |
||||
materialIcon(name = "Filled.IosShare") { |
||||
materialPath { |
||||
moveTo(16.0f, 5.0f) |
||||
lineToRelative(-1.42f, 1.42f) |
||||
lineToRelative(-1.59f, -1.59f) |
||||
lineTo(12.99f, 16.0f) |
||||
horizontalLineToRelative(-1.98f) |
||||
lineTo(11.01f, 4.83f) |
||||
lineTo(9.42f, 6.42f) |
||||
lineTo(8.0f, 5.0f) |
||||
lineToRelative(4.0f, -4.0f) |
||||
lineToRelative(4.0f, 4.0f) |
||||
close() |
||||
moveTo(20.0f, 10.0f) |
||||
verticalLineToRelative(11.0f) |
||||
curveToRelative(0.0f, 1.1f, -0.9f, 2.0f, -2.0f, 2.0f) |
||||
lineTo(6.0f, 23.0f) |
||||
curveToRelative(-1.11f, 0.0f, -2.0f, -0.9f, -2.0f, -2.0f) |
||||
lineTo(4.0f, 10.0f) |
||||
curveToRelative(0.0f, -1.11f, 0.89f, -2.0f, 2.0f, -2.0f) |
||||
horizontalLineToRelative(3.0f) |
||||
verticalLineToRelative(2.0f) |
||||
lineTo(6.0f, 10.0f) |
||||
verticalLineToRelative(11.0f) |
||||
horizontalLineToRelative(12.0f) |
||||
lineTo(18.0f, 10.0f) |
||||
horizontalLineToRelative(-3.0f) |
||||
lineTo(15.0f, 8.0f) |
||||
horizontalLineToRelative(3.0f) |
||||
curveToRelative(1.1f, 0.0f, 2.0f, 0.89f, 2.0f, 2.0f) |
||||
close() |
||||
} |
||||
} |