diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/BullStream.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/BullStream.kt index d4f87f4c..e5368bc3 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/BullStream.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/BullStream.kt @@ -18,7 +18,7 @@ class BullStream : ExtractorApi() { ?: return null val m3u8 = "$mainUrl/m3u8/${data[1]}/${data[2]}/master.txt?s=1&cache=${data[4]}" - println("shiv : $m3u8") + //println("shiv : $m3u8") return M3u8Helper.generateM3u8( name, m3u8, diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/YoutubeExtractor.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/YoutubeExtractor.kt index 572d93a3..23704e90 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/YoutubeExtractor.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/YoutubeExtractor.kt @@ -46,7 +46,6 @@ open class YoutubeExtractor : ExtractorApi() { subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit ) { - println("TRYING TO ExTRACT: $url") if (ytVideos[url].isNullOrEmpty()) { val link = YoutubeStreamLinkHandlerFactory.getInstance().fromUrl( diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt index 4b9dd5be..a73fc873 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt @@ -585,6 +585,11 @@ class HomeFragment : Fragment() { setPageTransformer(HomeScrollTransformer()) val callback: OnPageChangeCallback = object : OnPageChangeCallback() { override fun onPageSelected(position: Int) { + + // home_search?.isIconified = true + //home_search?.isVisible = true + //home_search?.clearFocus() + (home_preview_viewpager?.adapter as? HomeScrollAdapter)?.apply { if (position >= itemCount - 1 && hasMoreItems) { hasMoreItems = false // dont make two requests diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/player/FullScreenPlayer.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/player/FullScreenPlayer.kt index 1ddd752f..52125c68 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/player/FullScreenPlayer.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/player/FullScreenPlayer.kt @@ -587,7 +587,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() { updateLockUI() } - private fun updateUIVisibility() { + fun updateUIVisibility() { val isGone = isLocked || !isShowing var togglePlayerTitleGone = isGone context?.let { @@ -1306,12 +1306,6 @@ open class FullScreenPlayer : AbstractPlayerFragment() { showTracksDialogue() } - player_intro_play?.setOnClickListener { - player_intro_play?.isGone = true - player.handleEvent(CSPlayerEvent.Play) - updateUIVisibility() - } - // it is !not! a bug that you cant touch the right side, it does not register inputs on navbar or status bar player_holder?.setOnTouchListener { callView, event -> return@setOnTouchListener handleMotionEvent(callView, event) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultTrailerPlayer.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultTrailerPlayer.kt index 8a6e5b37..bf47209a 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultTrailerPlayer.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultTrailerPlayer.kt @@ -1,5 +1,6 @@ package com.lagradost.cloudstream3.ui.result +import android.animation.ValueAnimator import android.content.Context import android.content.res.Configuration import android.graphics.Rect @@ -7,9 +8,11 @@ import android.os.Bundle import android.view.View import android.view.ViewGroup import android.widget.FrameLayout +import androidx.core.view.isGone import androidx.core.view.isVisible import com.discord.panels.PanelsChildGestureRegionObserver import com.lagradost.cloudstream3.R +import com.lagradost.cloudstream3.ui.player.CSPlayerEvent import com.lagradost.cloudstream3.ui.player.SubtitleData import com.lagradost.cloudstream3.utils.IOnBackPressed import kotlinx.android.synthetic.main.fragment_result.* @@ -19,6 +22,7 @@ import kotlinx.android.synthetic.main.fragment_result_tv.* import kotlinx.android.synthetic.main.fragment_trailer.* import kotlinx.android.synthetic.main.trailer_custom_layout.* + open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreenPlayer(), PanelsChildGestureRegionObserver.GestureRegionsListener, IOnBackPressed { @@ -60,14 +64,43 @@ open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreen result_smallscreen_holder?.isVisible = !isFullScreenPlayer result_fullscreen_holder?.isVisible = isFullScreenPlayer + val to = sw * h / w + player_background?.apply { isVisible = true layoutParams = FrameLayout.LayoutParams( FrameLayout.LayoutParams.MATCH_PARENT, - if (isFullScreenPlayer) FrameLayout.LayoutParams.MATCH_PARENT else sw * h / w + if (isFullScreenPlayer) FrameLayout.LayoutParams.MATCH_PARENT else to ) } + + player_intro_play?.apply { + layoutParams = + FrameLayout.LayoutParams( + FrameLayout.LayoutParams.MATCH_PARENT, + result_top_holder?.measuredHeight ?: FrameLayout.LayoutParams.MATCH_PARENT + ) + } + + if (player_intro_play?.isGone == true) { + result_top_holder?.apply { + + val anim = ValueAnimator.ofInt( + measuredHeight, + if (isFullScreenPlayer) ViewGroup.LayoutParams.MATCH_PARENT else to + ) + anim.addUpdateListener { valueAnimator -> + val `val` = valueAnimator.animatedValue as Int + val layoutParams: ViewGroup.LayoutParams = + layoutParams + layoutParams.height = `val` + setLayoutParams(layoutParams) + } + anim.duration = 200 + anim.start() + } + } } } @@ -79,7 +112,12 @@ open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreen override fun showMirrorsDialogue() {} override fun showTracksDialogue() {} - override fun openOnlineSubPicker(context: Context, imdbId: Long?, dismissCallback: () -> Unit) {} + override fun openOnlineSubPicker( + context: Context, + imdbId: Long?, + dismissCallback: () -> Unit + ) { + } override fun subtitlesChanged() {} @@ -124,6 +162,13 @@ open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreen } updateFullscreen(isFullScreenPlayer) uiReset() + + player_intro_play?.setOnClickListener { + player_intro_play?.isGone = true + player.handleEvent(CSPlayerEvent.Play) + updateUIVisibility() + fixPlayerSize() + } } override fun onBackPressed(): Boolean { diff --git a/app/src/main/res/layout/fragment_result.xml b/app/src/main/res/layout/fragment_result.xml index ed2ec6bd..f88fc173 100644 --- a/app/src/main/res/layout/fragment_result.xml +++ b/app/src/main/res/layout/fragment_result.xml @@ -267,10 +267,10 @@ --> - + - - + + + @@ -330,6 +332,7 @@ android:contentDescription="@string/result_poster_img_des" android:foreground="@drawable/outline_drawable" android:scaleType="centerCrop" + android:layout_gravity="bottom" tools:src="@drawable/example_poster" /> diff --git a/app/src/main/res/layout/fragment_trailer.xml b/app/src/main/res/layout/fragment_trailer.xml index fd348760..ff477118 100644 --- a/app/src/main/res/layout/fragment_trailer.xml +++ b/app/src/main/res/layout/fragment_trailer.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="0dp" + android:layout_height="match_parent" android:visibility="visible" android:orientation="horizontal" android:id="@+id/player_background" diff --git a/app/src/main/res/layout/trailer_custom_layout.xml b/app/src/main/res/layout/trailer_custom_layout.xml index 854855ef..0dd19a5b 100644 --- a/app/src/main/res/layout/trailer_custom_layout.xml +++ b/app/src/main/res/layout/trailer_custom_layout.xml @@ -62,7 +62,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="start|bottom" - android:padding="10dp" + android:padding="15dp" android:text="@string/trailer" android:textColor="@android:color/white" android:textSize="20sp" diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 13089cc2..9c2f62fc 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -83,6 +83,7 @@ @color/chip_color_text @color/chip_color_text @font/google_sans + @color/chip_color_text @font/google_sans