dokar3 / pinch-zoom-grid Goto Github PK
View Code? Open in Web Editor NEWCompose pinch-to-zoom wrapper for LazyVerticalGrid and LazyHorizontalGrid.
License: Apache License 2.0
Compose pinch-to-zoom wrapper for LazyVerticalGrid and LazyHorizontalGrid.
License: Apache License 2.0
I was searching for a way to do this but I always struggled with one thing that if the items is clickable how can we detect the gesture?
I tested this on this library as well. Try adding a clickable on the picture composable and try to pinch zoom. You will find that the app detect a click on the items itself if the screen full of items, it won't detect it as pinch zoom gesture
@Composable
fun PinchZoomGridScope.ImageItem(
index: Int,
showText: Boolean,
modifier: Modifier = Modifier,
) {
val placeholder = remember(index) {
val random = Random(index)
Color(
random.nextInt(100, 255),
random.nextInt(100, 255),
random.nextInt(100, 255),
)
}
Box(modifier = modifier.clickable { }) {
AsyncImage(
model = "https://picsum.photos/seed/${index + 1000}/500/500",
contentDescription = null,
modifier = Modifier
.pinchItem(key = index)
.fillMaxWidth()
.aspectRatio(1f)
.background(placeholder),
)
if (showText) {
Text(
text = "$index",
modifier = Modifier
.pinchItem(
key = "$index-text",
transitions = PinchItemTransitions.Translate,
)
.background(
color = Color.Black.copy(alpha = 0.8f),
shape = RoundedCornerShape(bottomEnd = 8.dp)
)
.padding(horizontal = 8.dp, vertical = 4.dp),
fontSize = 18.sp,
)
}
}
}
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
com.android.library
, com.android.application
).github/workflows/android.yaml
actions/checkout v4
actions/setup-java v4
gradle.properties
settings.gradle.kts
build.gradle.kts
gradle/libs.versions.toml
io.coil-kt:coil-compose 2.7.0
androidx.core:core-ktx 1.13.1
junit:junit 4.13.2
androidx.test.ext:junit 1.2.0
androidx.test.espresso:espresso-core 3.5.1
androidx.lifecycle:lifecycle-runtime-ktx 2.8.2
androidx.activity:activity-compose 1.9.0
androidx.compose:compose-bom 2024.06.00
com.android.application 8.5.1
org.jetbrains.kotlin.android 1.9.22
com.android.library 8.5.1
com.vanniktech.maven.publish 0.29.0
pinchzoomgrid/gradle.properties
pinchzoomgrid/build.gradle.kts
sample/build.gradle.kts
gradle/wrapper/gradle-wrapper.properties
gradle 8.8
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.