mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
title in fullscreen
This commit is contained in:
parent
eda4133261
commit
e548905873
@ -267,8 +267,13 @@ class PlayerFragment : Fragment() {
|
|||||||
toggleComments()
|
toggleComments()
|
||||||
}
|
}
|
||||||
|
|
||||||
// FullScreen button trigger
|
|
||||||
val fullScreenButton = view.findViewById<ImageButton>(R.id.fullscreen)
|
val fullScreenButton = view.findViewById<ImageButton>(R.id.fullscreen)
|
||||||
|
val exoTitle = view.findViewById<TextView>(R.id.exo_title)
|
||||||
|
val mainContainer = view.findViewById<ConstraintLayout>(R.id.main_container)
|
||||||
|
val linLayout = view.findViewById<LinearLayout>(R.id.linLayout)
|
||||||
|
|
||||||
|
// FullScreen button trigger
|
||||||
fullScreenButton.setOnClickListener {
|
fullScreenButton.setOnClickListener {
|
||||||
exoPlayerView.hideController()
|
exoPlayerView.hideController()
|
||||||
if (!isFullScreen) {
|
if (!isFullScreen) {
|
||||||
@ -276,24 +281,29 @@ class PlayerFragment : Fragment() {
|
|||||||
getConstraintSet(R.id.start).constrainHeight(R.id.player, -1)
|
getConstraintSet(R.id.start).constrainHeight(R.id.player, -1)
|
||||||
enableTransition(R.id.yt_transition, false)
|
enableTransition(R.id.yt_transition, false)
|
||||||
}
|
}
|
||||||
view.findViewById<ConstraintLayout>(R.id.main_container).isClickable = true
|
|
||||||
view.findViewById<LinearLayout>(R.id.linLayout).visibility = View.GONE
|
mainContainer.isClickable = true
|
||||||
|
linLayout.visibility = View.GONE
|
||||||
fullScreenButton.setImageResource(R.drawable.ic_fullscreen_exit)
|
fullScreenButton.setImageResource(R.drawable.ic_fullscreen_exit)
|
||||||
|
exoTitle.visibility = View.VISIBLE
|
||||||
|
|
||||||
val mainActivity = activity as MainActivity
|
val mainActivity = activity as MainActivity
|
||||||
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
|
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
|
||||||
isFullScreen = true
|
|
||||||
} else {
|
} else {
|
||||||
with(motionLayout) {
|
with(motionLayout) {
|
||||||
getConstraintSet(R.id.start).constrainHeight(R.id.player, 0)
|
getConstraintSet(R.id.start).constrainHeight(R.id.player, 0)
|
||||||
enableTransition(R.id.yt_transition, true)
|
enableTransition(R.id.yt_transition, true)
|
||||||
}
|
}
|
||||||
view.findViewById<ConstraintLayout>(R.id.main_container).isClickable = false
|
|
||||||
view.findViewById<LinearLayout>(R.id.linLayout).visibility = View.VISIBLE
|
mainContainer.isClickable = false
|
||||||
|
linLayout.visibility = View.VISIBLE
|
||||||
fullScreenButton.setImageResource(R.drawable.ic_fullscreen)
|
fullScreenButton.setImageResource(R.drawable.ic_fullscreen)
|
||||||
|
exoTitle.visibility = View.GONE
|
||||||
|
|
||||||
val mainActivity = activity as MainActivity
|
val mainActivity = activity as MainActivity
|
||||||
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
|
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
|
||||||
isFullScreen = false
|
|
||||||
}
|
}
|
||||||
|
isFullScreen = !isFullScreen
|
||||||
}
|
}
|
||||||
|
|
||||||
// switching between original aspect ratio (black bars) and zoomed to fill device screen
|
// switching between original aspect ratio (black bars) and zoomed to fill device screen
|
||||||
@ -564,6 +574,8 @@ class PlayerFragment : Fragment() {
|
|||||||
view.findViewById<TextView>(R.id.player_title).text = response.title
|
view.findViewById<TextView>(R.id.player_title).text = response.title
|
||||||
view.findViewById<TextView>(R.id.player_description).text = response.description
|
view.findViewById<TextView>(R.id.player_description).text = response.description
|
||||||
|
|
||||||
|
view.findViewById<TextView>(R.id.exo_title).text = response.title
|
||||||
|
|
||||||
// Listener for play and pause icon change
|
// Listener for play and pause icon change
|
||||||
exoPlayer.addListener(object : Player.Listener {
|
exoPlayer.addListener(object : Player.Listener {
|
||||||
override fun onIsPlayingChanged(isPlaying: Boolean) {
|
override fun onIsPlayingChanged(isPlaying: Boolean) {
|
||||||
|
@ -63,6 +63,17 @@
|
|||||||
android:src="@drawable/ic_unlocked"
|
android:src="@drawable/ic_unlocked"
|
||||||
android:padding="@dimen/exo_icon_padding"
|
android:padding="@dimen/exo_icon_padding"
|
||||||
android:background="#00FFFFFF" />
|
android:background="#00FFFFFF" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/exo_title"
|
||||||
|
android:layout_width="500dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginHorizontal="10dp"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:visibility="gone"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
Loading…
Reference in New Issue
Block a user