From f6629fef7a529d1f91df0c0c17dbea336ca2f401 Mon Sep 17 00:00:00 2001 From: Adolfo Santiago Date: Fri, 1 Oct 2021 18:35:23 +0200 Subject: [PATCH] Show video controls always at the bottom --- .../tusky/fragment/ViewVideoFragment.kt | 6 +- .../main/res/layout/fragment_view_video.xml | 88 +++++++++++-------- 2 files changed, 56 insertions(+), 38 deletions(-) diff --git a/husky/app/src/main/java/com/keylesspalace/tusky/fragment/ViewVideoFragment.kt b/husky/app/src/main/java/com/keylesspalace/tusky/fragment/ViewVideoFragment.kt index b19433f..bb297c9 100644 --- a/husky/app/src/main/java/com/keylesspalace/tusky/fragment/ViewVideoFragment.kt +++ b/husky/app/src/main/java/com/keylesspalace/tusky/fragment/ViewVideoFragment.kt @@ -44,6 +44,7 @@ import com.keylesspalace.tusky.util.visible import kotlinx.android.synthetic.main.activity_view_media.toolbar import kotlinx.android.synthetic.main.fragment_view_video.mediaDescription import kotlinx.android.synthetic.main.fragment_view_video.progressBar +import kotlinx.android.synthetic.main.fragment_view_video.videoControls import kotlinx.android.synthetic.main.fragment_view_video.videoView import timber.log.Timber @@ -141,7 +142,8 @@ class ViewVideoFragment : ViewMediaFragment() { player.prepare() } - videoView.requestFocus() + videoControls.player = videoView.player + //videoView.requestFocus() if(arguments!!.getBoolean(ARG_START_POSTPONED_TRANSITION)) { mediaActivity.onBringUp() @@ -237,6 +239,8 @@ class ViewVideoFragment : ViewMediaFragment() { Player.STATE_READY, Player.STATE_ENDED -> { progressBar.visibility = View.GONE + videoControls.show() + videoControls.visibility = View.VISIBLE } else -> { } diff --git a/husky/app/src/main/res/layout/fragment_view_video.xml b/husky/app/src/main/res/layout/fragment_view_video.xml index fac0534..7ca4410 100644 --- a/husky/app/src/main/res/layout/fragment_view_video.xml +++ b/husky/app/src/main/res/layout/fragment_view_video.xml @@ -1,44 +1,58 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/videoContainer" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:clickable="true" + android:focusable="true"> - + - + - + + +