diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 88ea6ba64..8f5d7d3c2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -11,32 +11,32 @@ + android:theme="@style/Theme.Purple"> + android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> + android:supportsPictureInPicture="true"> @@ -44,16 +44,16 @@ + android:icon="@mipmap/ic_gradient" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_gradient_round" + android:supportsPictureInPicture="true" + android:targetActivity=".MainActivity"> @@ -61,16 +61,16 @@ + android:icon="@mipmap/ic_fire" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_fire_round" + android:supportsPictureInPicture="true" + android:targetActivity=".MainActivity"> @@ -78,16 +78,16 @@ + android:icon="@mipmap/ic_flame" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_flame_round" + android:supportsPictureInPicture="true" + android:targetActivity=".MainActivity"> @@ -95,16 +95,16 @@ + android:icon="@mipmap/ic_shaped" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_shaped_round" + android:supportsPictureInPicture="true" + android:targetActivity=".MainActivity"> @@ -112,16 +112,16 @@ + android:icon="@mipmap/ic_torch" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_torch_round" + android:supportsPictureInPicture="true" + android:targetActivity=".MainActivity"> @@ -129,16 +129,16 @@ + android:icon="@mipmap/ic_legacy" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_legacy_round" + android:supportsPictureInPicture="true" + android:targetActivity=".MainActivity"> @@ -146,16 +146,16 @@ + android:icon="@mipmap/ic_bird" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_bird_round" + android:supportsPictureInPicture="true" + android:targetActivity=".MainActivity"> diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt index 1f81707c6..54fe27fd7 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt @@ -267,8 +267,12 @@ class PlayerFragment : Fragment() { toggleComments() } - // FullScreen button trigger val fullScreenButton = view.findViewById(R.id.fullscreen) + val exoTitle = view.findViewById(R.id.exo_title) + val mainContainer = view.findViewById(R.id.main_container) + val linLayout = view.findViewById(R.id.linLayout) + + // FullScreen button trigger fullScreenButton.setOnClickListener { exoPlayerView.hideController() if (!isFullScreen) { @@ -276,24 +280,29 @@ class PlayerFragment : Fragment() { getConstraintSet(R.id.start).constrainHeight(R.id.player, -1) enableTransition(R.id.yt_transition, false) } - view.findViewById(R.id.main_container).isClickable = true - view.findViewById(R.id.linLayout).visibility = View.GONE + + mainContainer.isClickable = true + linLayout.visibility = View.GONE fullScreenButton.setImageResource(R.drawable.ic_fullscreen_exit) + exoTitle.visibility = View.VISIBLE + val mainActivity = activity as MainActivity mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE - isFullScreen = true } else { with(motionLayout) { getConstraintSet(R.id.start).constrainHeight(R.id.player, 0) enableTransition(R.id.yt_transition, true) } - view.findViewById(R.id.main_container).isClickable = false - view.findViewById(R.id.linLayout).visibility = View.VISIBLE + + mainContainer.isClickable = false + linLayout.visibility = View.VISIBLE fullScreenButton.setImageResource(R.drawable.ic_fullscreen) + exoTitle.visibility = View.INVISIBLE + val mainActivity = activity as MainActivity mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT - isFullScreen = false } + isFullScreen = !isFullScreen } // switching between original aspect ratio (black bars) and zoomed to fill device screen @@ -556,6 +565,7 @@ class PlayerFragment : Fragment() { context?.getString(R.string.views, response.views.formatShort()) + " • " + response.uploadDate view.findViewById(R.id.textLike).text = response.likes.formatShort() + view.findViewById(R.id.textDislike).text = response.dislikes.formatShort() val channelImage = view.findViewById(R.id.player_channelImage) Picasso.get().load(response.uploaderAvatar).into(channelImage) view.findViewById(R.id.player_channelName).text = response.uploader @@ -564,6 +574,8 @@ class PlayerFragment : Fragment() { view.findViewById(R.id.player_title).text = response.title view.findViewById(R.id.player_description).text = response.description + view.findViewById(R.id.exo_title).text = response.title + // Listener for play and pause icon change exoPlayer.addListener(object : Player.Listener { override fun onIsPlayingChanged(isPlaying: Boolean) { @@ -758,7 +770,7 @@ class PlayerFragment : Fragment() { val defres = PreferenceHelper.getString(requireContext(), "default_res", "")!! val qualityText = view.findViewById(R.id.quality_text) - val qualitySelect = view.findViewById(R.id.quality_select) + val qualitySelect = view.findViewById(R.id.quality_linLayout) var videosNameArray: Array = arrayOf() var videosUrlArray: Array = arrayOf() @@ -941,12 +953,14 @@ class PlayerFragment : Fragment() { } private fun lockPlayer(isLocked: Boolean) { - val visibility = if (isLocked) View.VISIBLE else View.GONE - exoPlayerView.findViewById(R.id.controls_top_right).visibility = visibility + val visibility = if (isLocked) View.VISIBLE else View.INVISIBLE + exoPlayerView.findViewById(R.id.exo_top_bar_right).visibility = visibility exoPlayerView.findViewById(R.id.exo_play_pause).visibility = visibility exoPlayerView.findViewById