Skip to content

Commit 6090d0f

Browse files
authored
Episode title in downloaded & offline logo (#2375)
1 parent 124288c commit 6090d0f

File tree

7 files changed

+88
-38
lines changed

7 files changed

+88
-38
lines changed

app/src/main/java/com/lagradost/cloudstream3/ui/download/DownloadButtonSetup.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ object DownloadButtonSetup {
141141
uri = Uri.EMPTY,
142142
id = it.id,
143143
parentId = it.parentId,
144-
name = act.getString(R.string.downloaded_file),
144+
name = it.name ?: act.getString(R.string.downloaded_file),
145145
season = it.season,
146146
episode = it.episode,
147147
headerName = parent.name,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
304304
}
305305

306306
val titleMove = if (isShowing) 0f else -50.toPx.toFloat()
307-
playerBinding?.playerVideoTitle?.let {
307+
playerBinding?.playerVideoTitleHolder?.let {
308308
ObjectAnimator.ofFloat(it, "translationY", titleMove).apply {
309309
duration = 200
310310
start()
@@ -839,7 +839,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
839839

840840
val fadeTo = if (isLocked) 0f else 1f
841841
playerBinding?.apply {
842-
val fadeAnimation = AlphaAnimation(playerVideoTitle.alpha, fadeTo).apply {
842+
val fadeAnimation = AlphaAnimation(playerVideoTitleHolder.alpha, fadeTo).apply {
843843
duration = 100
844844
fillAfter = true
845845
}
@@ -860,7 +860,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
860860
//TITLE
861861
playerVideoTitleRez.startAnimation(fadeAnimation)
862862
playerEpisodeFiller.startAnimation(fadeAnimation)
863-
playerVideoTitle.startAnimation(fadeAnimation)
863+
playerVideoTitleHolder.startAnimation(fadeAnimation)
864864
playerTopHolder.startAnimation(fadeAnimation)
865865
// BOTTOM
866866
playerLockHolder.startAnimation(fadeAnimation)
@@ -893,7 +893,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
893893
val showPlayerEpisodes = !isGone && isThereEpisodes()
894894
playerEpisodesButtonRoot.isVisible = showPlayerEpisodes
895895
playerEpisodesButton.isVisible = showPlayerEpisodes
896-
playerVideoTitle.isGone = togglePlayerTitleGone
896+
playerVideoTitleHolder.isGone = togglePlayerTitleGone
897897
// player_video_title_rez?.isGone = isGone
898898
playerEpisodeFiller.isGone = isGone
899899
playerCenterMenu.isGone = isGone

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,7 @@ class GeneratorPlayer : FullScreenPlayer() {
18061806

18071807
playerBinding?.playerEpisodeFillerHolder?.isVisible = isFiller ?: false
18081808
playerBinding?.playerVideoTitle?.text = playerVideoTitle
1809+
playerBinding?.offlinePin?.isVisible = lastUsedGenerator is DownloadFileGenerator
18091810
}
18101811

18111812
@SuppressLint("SetTextI18n")
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="960"
5+
android:viewportHeight="960">
6+
<path
7+
android:pathData="M320,680h320v-80L320,600v80ZM438,560 L664,334 607,279 438,448 352,362 296,418 438,560ZM480,880q-83,0 -156,-31.5T197,763q-54,-54 -85.5,-127T80,480q0,-83 31.5,-156T197,197q54,-54 127,-85.5T480,80q83,0 156,31.5T763,197q54,54 85.5,127T880,480q0,83 -31.5,156T763,763q-54,54 -127,85.5T480,880ZM480,800q134,0 227,-93t93,-227q0,-134 -93,-227t-227,-93q-134,0 -227,93t-93,227q0,134 93,227t227,93ZM480,480Z"
8+
android:fillColor="#e3e3e3"/>
9+
</vector>

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

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,31 @@
146146
android:gravity="center"
147147
android:textColor="@color/white"
148148
tools:text="1920x1080" />
149-
150-
<TextView
151-
android:maxLines="2"
152-
android:id="@+id/player_video_title"
149+
<LinearLayout
150+
android:id="@+id/player_video_title_holder"
153151
android:layout_width="match_parent"
154152
android:layout_height="wrap_content"
155-
android:gravity="center"
156-
android:textColor="@color/white"
157-
android:textStyle="bold"
158-
android:visibility="visible"
159-
tools:text="Hello world" />
160-
161-
153+
android:gravity="center">
154+
<TextView
155+
android:maxLines="2"
156+
android:id="@+id/player_video_title"
157+
android:layout_width="wrap_content"
158+
android:layout_height="wrap_content"
159+
android:gravity="center"
160+
android:textColor="@color/white"
161+
android:textStyle="bold"
162+
android:visibility="visible"
163+
tools:text="Hello world " />
164+
<ImageView
165+
android:id="@+id/offline_pin"
166+
android:layout_width="16dp"
167+
android:layout_height="16dp"
168+
android:layout_marginStart="2dp"
169+
android:src="@drawable/ic_offline_pin_24"
170+
android:visibility="gone"
171+
tools:visibility="visible"
172+
android:layout_gravity="center"/>
173+
</LinearLayout>
162174
</LinearLayout>
163175

164176
<!-- Removed as it has no use anymore-->

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

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -252,21 +252,34 @@
252252
android:layout_marginTop="20dp"
253253
android:layout_marginEnd="32dp"
254254
android:orientation="vertical">
255-
256-
<TextView
257-
android:maxLines="2"
258-
android:id="@+id/player_video_title"
255+
<LinearLayout
256+
android:id="@+id/player_video_title_holder"
259257
android:layout_width="wrap_content"
260258
android:layout_height="wrap_content"
261-
android:layout_gravity="end"
262-
android:gravity="end"
263-
android:maxWidth="600dp"
264-
android:textAlignment="viewEnd"
265-
android:textColor="@color/white"
266-
android:textSize="16sp"
267-
android:textStyle="bold"
268-
tools:text="Hello world" />
269-
259+
android:layout_gravity="end">
260+
<TextView
261+
android:maxLines="2"
262+
android:id="@+id/player_video_title"
263+
android:layout_width="wrap_content"
264+
android:layout_height="wrap_content"
265+
android:layout_gravity="end"
266+
android:gravity="end"
267+
android:maxWidth="600dp"
268+
android:textAlignment="viewEnd"
269+
android:textColor="@color/white"
270+
android:textSize="16sp"
271+
android:textStyle="bold"
272+
tools:text="Hello world" />
273+
<ImageView
274+
android:id="@+id/offline_pin"
275+
android:layout_width="18dp"
276+
android:layout_height="18dp"
277+
android:layout_marginStart="2dp"
278+
android:src="@drawable/ic_offline_pin_24"
279+
android:visibility="gone"
280+
tools:visibility="visible"
281+
android:layout_gravity="start"/>
282+
</LinearLayout>
270283
<TextView
271284
android:id="@+id/player_video_title_rez"
272285
android:layout_width="wrap_content"

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

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,32 @@
8888
android:layout_marginEnd="32dp"
8989
android:orientation="vertical">
9090

91-
<TextView
92-
android:maxLines="2"
93-
android:id="@+id/player_video_title"
91+
92+
<LinearLayout
93+
android:id="@+id/player_video_title_holder"
9494
android:layout_width="match_parent"
9595
android:layout_height="wrap_content"
96-
android:gravity="end"
97-
android:textColor="@color/white"
98-
android:textSize="16sp"
99-
android:textStyle="bold"
100-
tools:text="Hello world" />
101-
96+
android:gravity="center">
97+
<TextView
98+
android:maxLines="2"
99+
android:id="@+id/player_video_title"
100+
android:layout_width="match_parent"
101+
android:layout_height="wrap_content"
102+
android:gravity="end"
103+
android:textColor="@color/white"
104+
android:textSize="16sp"
105+
android:textStyle="bold"
106+
tools:text="Hello world" />
107+
<ImageView
108+
android:id="@+id/offline_pin"
109+
android:layout_width="16dp"
110+
android:layout_height="16dp"
111+
android:layout_marginStart="2dp"
112+
android:src="@drawable/ic_offline_pin_24"
113+
android:visibility="gone"
114+
tools:visibility="visible"
115+
android:layout_gravity="center"/>
116+
</LinearLayout>
102117
<TextView
103118
android:id="@+id/player_video_title_rez"
104119
android:layout_width="match_parent"

0 commit comments

Comments
 (0)