Updated on 2026-08-14
This commit is contained in:
parent
531affeb7c
commit
542c1d341f
2 changed files with 40 additions and 21 deletions
|
|
@ -54,28 +54,46 @@ fun StoriesScreen(
|
|||
Modifier
|
||||
.fillMaxSize()
|
||||
.background(Color(0xFF090E13))
|
||||
.pointerInput(Unit) {
|
||||
val maxWidth = this.size.width
|
||||
detectTapGestures(
|
||||
onPress = {
|
||||
val pressStartTime = System.currentTimeMillis()
|
||||
isPressed.value = true
|
||||
this.tryAwaitRelease()
|
||||
val pressEndTime = System.currentTimeMillis()
|
||||
val totalPressTime = pressEndTime - pressStartTime
|
||||
if (totalPressTime < 200) {
|
||||
val isTapOnRightTwoTiers = (it.x > (maxWidth / 2))
|
||||
if (isTapOnRightTwoTiers) {
|
||||
goToNextScreen()
|
||||
} else {
|
||||
goToPreviousScreen()
|
||||
}
|
||||
}
|
||||
isPressed.value = false
|
||||
},
|
||||
)
|
||||
}
|
||||
) {
|
||||
Row(
|
||||
Modifier.fillMaxSize()
|
||||
) {
|
||||
Box(
|
||||
Modifier
|
||||
.weight(1f)
|
||||
.fillMaxHeight()
|
||||
.pointerInput(isPressed) {
|
||||
detectTapGestures(
|
||||
onPress = {
|
||||
val pressStartTime = System.currentTimeMillis()
|
||||
isPressed.value = true
|
||||
this.tryAwaitRelease()
|
||||
val pressEndTime = System.currentTimeMillis()
|
||||
val totalPressTime = pressEndTime - pressStartTime
|
||||
if (totalPressTime < 200) goToPreviousScreen()
|
||||
isPressed.value = false
|
||||
},
|
||||
)
|
||||
}
|
||||
)
|
||||
Box(
|
||||
Modifier.weight(1f)
|
||||
.fillMaxHeight()
|
||||
.pointerInput(isPressed) {
|
||||
detectTapGestures(
|
||||
onPress = {
|
||||
val pressStartTime = System.currentTimeMillis()
|
||||
isPressed.value = true
|
||||
this.tryAwaitRelease()
|
||||
val pressEndTime = System.currentTimeMillis()
|
||||
val totalPressTime = pressEndTime - pressStartTime
|
||||
if (totalPressTime < 200) goToNextScreen()
|
||||
isPressed.value = false
|
||||
},
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
if (!isDarkBackground) {
|
||||
Image(
|
||||
painter = painterResource(id = R.drawable.ic_overlay),
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import android.view.View
|
|||
import android.view.animation.OvershootInterpolator
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.constraintlayout.widget.ConstraintSet
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.transition.TransitionInflater
|
||||
import androidx.transition.TransitionManager
|
||||
import com.squareup.picasso.Picasso
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue