Skip to content

Commit 4a193d5

Browse files
committed
small fix
1 parent b57a7c3 commit 4a193d5

File tree

9 files changed

+71
-24
lines changed

9 files changed

+71
-24
lines changed

app/src/main/java/com/lagradost/cloudstream3/extractors/BullStream.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class BullStream : ExtractorApi() {
1818
?: return null
1919

2020
val m3u8 = "$mainUrl/m3u8/${data[1]}/${data[2]}/master.txt?s=1&cache=${data[4]}"
21-
println("shiv : $m3u8")
21+
//println("shiv : $m3u8")
2222
return M3u8Helper.generateM3u8(
2323
name,
2424
m3u8,

app/src/main/java/com/lagradost/cloudstream3/extractors/YoutubeExtractor.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ open class YoutubeExtractor : ExtractorApi() {
4646
subtitleCallback: (SubtitleFile) -> Unit,
4747
callback: (ExtractorLink) -> Unit
4848
) {
49-
println("TRYING TO ExTRACT: $url")
5049
if (ytVideos[url].isNullOrEmpty()) {
5150
val link =
5251
YoutubeStreamLinkHandlerFactory.getInstance().fromUrl(

app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeFragment.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,11 @@ class HomeFragment : Fragment() {
585585
setPageTransformer(HomeScrollTransformer())
586586
val callback: OnPageChangeCallback = object : OnPageChangeCallback() {
587587
override fun onPageSelected(position: Int) {
588+
589+
// home_search?.isIconified = true
590+
//home_search?.isVisible = true
591+
//home_search?.clearFocus()
592+
588593
(home_preview_viewpager?.adapter as? HomeScrollAdapter)?.apply {
589594
if (position >= itemCount - 1 && hasMoreItems) {
590595
hasMoreItems = false // dont make two requests

app/src/main/java/com/lagradost/cloudstream3/ui/player/FullScreenPlayer.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
587587
updateLockUI()
588588
}
589589

590-
private fun updateUIVisibility() {
590+
fun updateUIVisibility() {
591591
val isGone = isLocked || !isShowing
592592
var togglePlayerTitleGone = isGone
593593
context?.let {
@@ -1306,12 +1306,6 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
13061306
showTracksDialogue()
13071307
}
13081308

1309-
player_intro_play?.setOnClickListener {
1310-
player_intro_play?.isGone = true
1311-
player.handleEvent(CSPlayerEvent.Play)
1312-
updateUIVisibility()
1313-
}
1314-
13151309
// it is !not! a bug that you cant touch the right side, it does not register inputs on navbar or status bar
13161310
player_holder?.setOnTouchListener { callView, event ->
13171311
return@setOnTouchListener handleMotionEvent(callView, event)

app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultTrailerPlayer.kt

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
package com.lagradost.cloudstream3.ui.result
22

3+
import android.animation.ValueAnimator
34
import android.content.Context
45
import android.content.res.Configuration
56
import android.graphics.Rect
67
import android.os.Bundle
78
import android.view.View
89
import android.view.ViewGroup
910
import android.widget.FrameLayout
11+
import androidx.core.view.isGone
1012
import androidx.core.view.isVisible
1113
import com.discord.panels.PanelsChildGestureRegionObserver
1214
import com.lagradost.cloudstream3.R
15+
import com.lagradost.cloudstream3.ui.player.CSPlayerEvent
1316
import com.lagradost.cloudstream3.ui.player.SubtitleData
1417
import com.lagradost.cloudstream3.utils.IOnBackPressed
1518
import kotlinx.android.synthetic.main.fragment_result.*
@@ -19,6 +22,7 @@ import kotlinx.android.synthetic.main.fragment_result_tv.*
1922
import kotlinx.android.synthetic.main.fragment_trailer.*
2023
import kotlinx.android.synthetic.main.trailer_custom_layout.*
2124

25+
2226
open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreenPlayer(),
2327
PanelsChildGestureRegionObserver.GestureRegionsListener, IOnBackPressed {
2428

@@ -60,14 +64,43 @@ open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreen
6064
result_smallscreen_holder?.isVisible = !isFullScreenPlayer
6165
result_fullscreen_holder?.isVisible = isFullScreenPlayer
6266

67+
val to = sw * h / w
68+
6369
player_background?.apply {
6470
isVisible = true
6571
layoutParams =
6672
FrameLayout.LayoutParams(
6773
FrameLayout.LayoutParams.MATCH_PARENT,
68-
if (isFullScreenPlayer) FrameLayout.LayoutParams.MATCH_PARENT else sw * h / w
74+
if (isFullScreenPlayer) FrameLayout.LayoutParams.MATCH_PARENT else to
75+
)
76+
}
77+
78+
player_intro_play?.apply {
79+
layoutParams =
80+
FrameLayout.LayoutParams(
81+
FrameLayout.LayoutParams.MATCH_PARENT,
82+
result_top_holder?.measuredHeight ?: FrameLayout.LayoutParams.MATCH_PARENT
6983
)
7084
}
85+
86+
if (player_intro_play?.isGone == true) {
87+
result_top_holder?.apply {
88+
89+
val anim = ValueAnimator.ofInt(
90+
measuredHeight,
91+
if (isFullScreenPlayer) ViewGroup.LayoutParams.MATCH_PARENT else to
92+
)
93+
anim.addUpdateListener { valueAnimator ->
94+
val `val` = valueAnimator.animatedValue as Int
95+
val layoutParams: ViewGroup.LayoutParams =
96+
layoutParams
97+
layoutParams.height = `val`
98+
setLayoutParams(layoutParams)
99+
}
100+
anim.duration = 200
101+
anim.start()
102+
}
103+
}
71104
}
72105
}
73106

@@ -79,7 +112,12 @@ open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreen
79112
override fun showMirrorsDialogue() {}
80113
override fun showTracksDialogue() {}
81114

82-
override fun openOnlineSubPicker(context: Context, imdbId: Long?, dismissCallback: () -> Unit) {}
115+
override fun openOnlineSubPicker(
116+
context: Context,
117+
imdbId: Long?,
118+
dismissCallback: () -> Unit
119+
) {
120+
}
83121

84122
override fun subtitlesChanged() {}
85123

@@ -124,6 +162,13 @@ open class ResultTrailerPlayer : com.lagradost.cloudstream3.ui.player.FullScreen
124162
}
125163
updateFullscreen(isFullScreenPlayer)
126164
uiReset()
165+
166+
player_intro_play?.setOnClickListener {
167+
player_intro_play?.isGone = true
168+
player.handleEvent(CSPlayerEvent.Play)
169+
updateUIVisibility()
170+
fixPlayerSize()
171+
}
127172
}
128173

129174
override fun onBackPressed(): Boolean {

app/src/main/res/layout/fragment_result.xml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,10 @@
267267
</LinearLayout>
268268
</FrameLayout>-->
269269
<FrameLayout
270+
android:id="@+id/result_top_holder"
270271
android:layout_width="match_parent"
271272
android:layout_height="200dp">
272273

273-
274274
<FrameLayout
275275
android:id="@+id/result_smallscreen_holder"
276276
android:layout_width="wrap_content"
@@ -279,21 +279,23 @@
279279

280280
<include layout="@layout/fragment_trailer" />
281281
</FrameLayout>
282+
282283
<FrameLayout
283284
android:id="@+id/result_poster_background_holder"
284285
android:layout_width="match_parent"
285286
android:layout_height="match_parent">
286-
<ImageView
287-
android:id="@+id/result_poster_background"
288-
android:layout_width="match_parent"
289-
android:layout_height="match_parent"
290-
android:scaleType="centerCrop" />
291287

292-
<View
293-
android:layout_width="match_parent"
294-
android:layout_height="60dp"
295-
android:layout_gravity="bottom"
296-
android:background="@drawable/background_shadow" />
288+
<ImageView
289+
android:id="@+id/result_poster_background"
290+
android:layout_width="match_parent"
291+
android:layout_height="match_parent"
292+
android:scaleType="centerCrop" />
293+
294+
<View
295+
android:layout_width="match_parent"
296+
android:layout_height="60dp"
297+
android:layout_gravity="bottom"
298+
android:background="@drawable/background_shadow" />
297299
</FrameLayout>
298300
</FrameLayout>
299301

@@ -330,6 +332,7 @@
330332
android:contentDescription="@string/result_poster_img_des"
331333
android:foreground="@drawable/outline_drawable"
332334
android:scaleType="centerCrop"
335+
android:layout_gravity="bottom"
333336
tools:src="@drawable/example_poster" />
334337
</androidx.cardview.widget.CardView>
335338

app/src/main/res/layout/fragment_trailer.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
6-
android:layout_height="0dp"
6+
android:layout_height="match_parent"
77
android:visibility="visible"
88
android:orientation="horizontal"
99
android:id="@+id/player_background"

app/src/main/res/layout/trailer_custom_layout.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
android:layout_width="wrap_content"
6363
android:layout_height="wrap_content"
6464
android:layout_gravity="start|bottom"
65-
android:padding="10dp"
65+
android:padding="15dp"
6666
android:text="@string/trailer"
6767
android:textColor="@android:color/white"
6868
android:textSize="20sp"

app/src/main/res/values/styles.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
<item name="android:textColor">@color/chip_color_text</item>
8484
<item name="checkedIconTint">@color/chip_color_text</item>
8585
<item name="fontFamily">@font/google_sans</item>
86+
<item name="chipIconTint">@color/chip_color_text</item>
8687
<item name="android:fontFamily">@font/google_sans</item>
8788
</style>
8889

0 commit comments

Comments
 (0)