Skip to content

Commit 13ec1ef

Browse files
dhanuarfBnyro
authored andcommitted
feat(video player): properly increase timebar touch area
1 parent bf430d6 commit 13ec1ef

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,6 @@ class CustomExoPlayerView(
331331
if (isLive) player?.let { it.seekTo(it.duration) }
332332
}
333333

334-
// forward touch events to the time bar for better accessibility
335-
binding.progressBar.setOnTouchListener { _, motionEvent ->
336-
binding.exoProgress.onTouchEvent(motionEvent)
337-
}
338-
339334
updateCurrentPosition()
340335

341336
activity.supportFragmentManager.setFragmentResultListener(
@@ -1171,8 +1166,8 @@ class CustomExoPlayerView(
11711166
*/
11721167
fun updateMarginsByFullscreenMode() {
11731168
// add a larger bottom margin to the time bar in landscape mode
1174-
binding.progressBar.updateLayoutParams<MarginLayoutParams> {
1175-
bottomMargin = (if (isFullscreen()) 20f else 10f).dpToPx()
1169+
binding.exoProgress.updateLayoutParams<MarginLayoutParams> {
1170+
bottomMargin = (if (isFullscreen()) 20f else 0f).dpToPx()
11761171
}
11771172

11781173
updateTopBarMargin()

app/src/main/res/layout/exo_styled_player_control_view.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@
323323
app:played_color="?attr/colorSecondary"
324324
app:scrubber_color="?attr/colorSecondary"
325325
app:scrubber_dragged_size="16dp"
326-
app:scrubber_enabled_size="12dp" />
326+
app:scrubber_enabled_size="12dp"
327+
app:touch_target_height="35dp" />
327328

328329
</LinearLayout>
329330

0 commit comments

Comments
 (0)