Skip to content

Commit

Permalink
fix: fix 10+ seconds dbox obsecuring gestures
Browse files Browse the repository at this point in the history
  • Loading branch information
abdallahmehiz committed Aug 7, 2024
1 parent 373d8a4 commit 8cda9a0
Showing 1 changed file with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,44 @@ fun GestureHandler(modifier: Modifier = Modifier) {
val currentVolume by viewModel.currentVolume.collectAsState()
val currentBrightness by viewModel.currentBrightness.collectAsState()
val haptics = LocalHapticFeedback.current
Box(
modifier = modifier.fillMaxSize(),
contentAlignment = if (isSeekingForwards) Alignment.CenterEnd else Alignment.CenterStart,
) {
CompositionLocalProvider(
LocalRippleTheme provides PlayerRippleTheme,
) {
if (seekAmount != 0) {
Box(
modifier = Modifier
.fillMaxHeight()
.fillMaxWidth(0.4f), // 2 fifths
contentAlignment = Alignment.Center,
) {
Box(
modifier = Modifier
.fillMaxSize()
.clip(if (isSeekingForwards) RightSideOvalShape else LeftSideOvalShape)
.background(Color.White.copy(alpha))
.indication(interactionSource, rememberRipple()),
)
AndroidView(
factory = { DoubleTapSeekSecondsView(it, null) },
update = {
if (seekAmount != 0) {
it.isForward = isSeekingForwards
it.seconds = seekAmount
it.visibility = View.VISIBLE
it.start()
} else {
it.visibility = View.GONE
}
},
)
}
}
}
}
Box(
modifier = Modifier
.fillMaxSize()
Expand Down Expand Up @@ -222,42 +260,4 @@ fun GestureHandler(modifier: Modifier = Modifier) {
}
},
)
Box(
modifier = modifier.fillMaxSize(),
contentAlignment = if (isSeekingForwards) Alignment.CenterEnd else Alignment.CenterStart,
) {
CompositionLocalProvider(
LocalRippleTheme provides PlayerRippleTheme,
) {
if (seekAmount != 0) {
Box(
modifier = Modifier
.fillMaxHeight()
.fillMaxWidth(0.4f), // 2 fifths
contentAlignment = Alignment.Center,
) {
Box(
modifier = Modifier
.fillMaxSize()
.clip(if (isSeekingForwards) RightSideOvalShape else LeftSideOvalShape)
.background(Color.White.copy(alpha))
.indication(interactionSource, rememberRipple()),
)
AndroidView(
factory = { DoubleTapSeekSecondsView(it, null) },
update = {
if (seekAmount != 0) {
it.isForward = isSeekingForwards
it.seconds = seekAmount
it.visibility = View.VISIBLE
it.start()
} else {
it.visibility = View.GONE
}
},
)
}
}
}
}
}

0 comments on commit 8cda9a0

Please sign in to comment.