diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0afd0a193..8da6a054e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -22,7 +22,6 @@ diff --git a/app/src/main/java/xyz/btcland/libretube/PlayerFragment.kt b/app/src/main/java/xyz/btcland/libretube/PlayerFragment.kt index ea506ed39..08bdb99b0 100644 --- a/app/src/main/java/xyz/btcland/libretube/PlayerFragment.kt +++ b/app/src/main/java/xyz/btcland/libretube/PlayerFragment.kt @@ -13,7 +13,6 @@ import androidx.recyclerview.widget.RecyclerView import com.google.android.exoplayer2.ExoPlayer import com.google.android.exoplayer2.MediaItem import com.google.android.exoplayer2.MediaItem.SubtitleConfiguration -import com.google.android.exoplayer2.SimpleExoPlayer import com.google.android.exoplayer2.source.MediaSource import com.google.android.exoplayer2.ui.PlayerView @@ -90,7 +89,6 @@ class PlayerFragment : Fragment() { super.onCreate(savedInstanceState) arguments?.let { videoId = it.getString("videoId") - param2 = it.getString(ARG_PARAM2) } } @@ -171,30 +169,44 @@ class PlayerFragment : Fragment() { mainActivity.supportFragmentManager.beginTransaction() .remove(this) .commit() - } val playImageView = view.findViewById(R.id.play_imageView) playImageView.setOnClickListener{ paused = if(paused){ - playImageView.setImageResource(R.drawable.ic_play) + playImageView.setImageResource(R.drawable.ic_pause) exoPlayer.play() false }else { - playImageView.setImageResource(R.drawable.ic_pause) + playImageView.setImageResource(R.drawable.ic_play) exoPlayer.pause() true } } - view.findViewById(R.id.fullscreen).setOnClickListener{ - exoPlayer.pause() - println(exoPlayer.currentPosition) - println("---------------------------------------------------------------------------------") - val intent = Intent(view.context, Player::class.java) - intent.putExtra("videoId", videoId) - intent.putExtra("seekTo",exoPlayer.currentPosition.toString()) - intent.putExtra("quality",whichQuality.toString()) - startActivity(intent) + if (!isFullScreen){ + view.findViewById(R.id.scrollView2).visibility = View.GONE + view.findViewById(R.id.linLayout).visibility = View.GONE + view.findViewById(R.id.textTest).visibility = View.GONE + view.findViewById(R.id.main_container).visibility = View.GONE + with(motionLayout) { + getConstraintSet(R.id.start).constrainHeight(R.id.player, -1) + enableTransition(R.xml.player_scene,false) + } + (activity as MainActivity)?.supportActionBar?.hide() + isFullScreen=true + + }else{ + view.findViewById(R.id.scrollView2).visibility = View.VISIBLE + view.findViewById(R.id.linLayout).visibility = View.VISIBLE + view.findViewById(R.id.textTest).visibility = View.VISIBLE + view.findViewById(R.id.main_container).visibility = View.VISIBLE + with(motionLayout) { + getConstraintSet(R.id.start).constrainHeight(R.id.player, 0) + enableTransition(R.xml.player_scene,true) + } + (activity as MainActivity)?.supportActionBar?.show() + isFullScreen=false + } } @@ -270,7 +282,7 @@ class PlayerFragment : Fragment() { exoPlayerView.setShowSubtitleButton(true) exoPlayerView.setShowNextButton(false) exoPlayerView.setShowPreviousButton(false) - exoPlayerView.controllerShowTimeoutMs = 1500 + //exoPlayerView.controllerShowTimeoutMs = 1500 exoPlayerView.controllerHideOnTouch = true exoPlayerView.player = exoPlayer exoPlayer.setMediaItem(mediaItem) @@ -362,8 +374,6 @@ class PlayerFragment : Fragment() { override fun onResume() { super.onResume() - - println("wtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtf") } } \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_player.xml b/app/src/main/res/layout/fragment_player.xml index 40c860ecb..9899bc216 100644 --- a/app/src/main/res/layout/fragment_player.xml +++ b/app/src/main/res/layout/fragment_player.xml @@ -24,6 +24,7 @@ > + app:layout_constraintTop_toTopOf="@+id/play_imageView" + android:visibility="gone" + /> \ No newline at end of file diff --git a/app/src/main/res/xml/activity_main_scene.xml b/app/src/main/res/xml/activity_main_scene.xml index a70772e53..fdb97e005 100644 --- a/app/src/main/res/xml/activity_main_scene.xml +++ b/app/src/main/res/xml/activity_main_scene.xml @@ -25,7 +25,7 @@ + android:translationY="-60dp" /> diff --git a/app/src/main/res/xml/player_scene.xml b/app/src/main/res/xml/player_scene.xml index 50dd7fd27..d716e64f7 100644 --- a/app/src/main/res/xml/player_scene.xml +++ b/app/src/main/res/xml/player_scene.xml @@ -33,6 +33,41 @@ + + + + + @@ -95,6 +130,8 @@ android:layout_marginEnd="12dp" android:alpha="1" android:layout_marginStart="8dp" - motion:layout_constraintTop_toTopOf="@+id/play_imageView" /> + motion:layout_constraintTop_toTopOf="@+id/play_imageView" + android:visibility="visible" + /> \ No newline at end of file