mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Marquee Result Buttons & Bookmark icon
This commit is contained in:
parent
f17523a600
commit
3c7a14c82b
3 changed files with 133 additions and 18 deletions
|
@ -327,6 +327,78 @@ class ResultFragmentTv : Fragment() {
|
|||
}
|
||||
}
|
||||
|
||||
resultPlayMovieButton.setOnFocusChangeListener { _, hasFocus ->
|
||||
if (!hasFocus) {
|
||||
resultPlayMovieText.isSelected = false
|
||||
return@setOnFocusChangeListener
|
||||
}
|
||||
resultPlayMovieText.isSelected = true
|
||||
}
|
||||
|
||||
resultPlaySeriesButton.setOnFocusChangeListener { _, hasFocus ->
|
||||
if (!hasFocus) {
|
||||
resultPlaySeriesText.isSelected = false
|
||||
return@setOnFocusChangeListener
|
||||
}
|
||||
resultPlaySeriesText.isSelected = true
|
||||
}
|
||||
|
||||
resultResumeSeriesButton.setOnFocusChangeListener { _, hasFocus ->
|
||||
if (!hasFocus) {
|
||||
resultResumeSeriesText.isSelected = false
|
||||
return@setOnFocusChangeListener
|
||||
}
|
||||
resultResumeSeriesText.isSelected = true
|
||||
}
|
||||
|
||||
resultPlayTrailerButton.setOnFocusChangeListener { _, hasFocus ->
|
||||
if (!hasFocus) {
|
||||
resultPlayTrailerText.isSelected = false
|
||||
return@setOnFocusChangeListener
|
||||
}
|
||||
resultPlayTrailerText.isSelected = true
|
||||
}
|
||||
|
||||
resultBookmarkButton.setOnFocusChangeListener { _, hasFocus ->
|
||||
if (!hasFocus) {
|
||||
resultBookmarkText.isSelected = false
|
||||
return@setOnFocusChangeListener
|
||||
}
|
||||
resultBookmarkText.isSelected = true
|
||||
}
|
||||
|
||||
resultFavoriteButton.setOnFocusChangeListener { _, hasFocus ->
|
||||
if (!hasFocus) {
|
||||
resultFavoriteText.isSelected = false
|
||||
return@setOnFocusChangeListener
|
||||
}
|
||||
resultFavoriteText.isSelected = true
|
||||
}
|
||||
|
||||
resultSubscribeButton.setOnFocusChangeListener { _, hasFocus ->
|
||||
if (!hasFocus) {
|
||||
resultSubscribeText.isSelected = false
|
||||
return@setOnFocusChangeListener
|
||||
}
|
||||
resultSubscribeText.isSelected = true
|
||||
}
|
||||
|
||||
resultSearchButton.setOnFocusChangeListener { _, hasFocus ->
|
||||
if (!hasFocus) {
|
||||
resultSearchText.isSelected = false
|
||||
return@setOnFocusChangeListener
|
||||
}
|
||||
resultSearchText.isSelected = true
|
||||
}
|
||||
|
||||
resultEpisodesShowButton.setOnFocusChangeListener { _, hasFocus ->
|
||||
if (!hasFocus) {
|
||||
resultEpisodesShowText.isSelected = false
|
||||
return@setOnFocusChangeListener
|
||||
}
|
||||
resultEpisodesShowText.isSelected = true
|
||||
}
|
||||
|
||||
resultEpisodes.setLinearListLayout(
|
||||
isHorizontal = false,
|
||||
nextUp = FOCUS_SELF,
|
||||
|
@ -527,7 +599,17 @@ class ResultFragmentTv : Fragment() {
|
|||
observe(viewModel.watchStatus) { watchType ->
|
||||
binding?.apply {
|
||||
resultBookmarkText.setText(watchType.stringRes)
|
||||
resultBookmarkButton.setOnClickListener { view ->
|
||||
|
||||
resultBookmarkButton.apply {
|
||||
|
||||
val drawable = if (watchType.stringRes == R.string.type_none) {
|
||||
R.drawable.outline_bookmark_add_24
|
||||
} else {
|
||||
R.drawable.ic_baseline_bookmark_24
|
||||
}
|
||||
setIconResource(drawable)
|
||||
|
||||
setOnClickListener { view ->
|
||||
activity?.showBottomDialog(
|
||||
WatchType.entries.map { view.context.getString(it.stringRes) }.toList(),
|
||||
watchType.ordinal,
|
||||
|
@ -539,6 +621,7 @@ class ResultFragmentTv : Fragment() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
observeNullable(viewModel.favoriteStatus) { isFavorite ->
|
||||
|
||||
|
|
5
app/src/main/res/drawable/outline_bookmark_add_24.xml
Normal file
5
app/src/main/res/drawable/outline_bookmark_add_24.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M17,11v6.97l-5,-2.14l-5,2.14V5h6V3H7C5.9,3 5,3.9 5,5v16l7,-3l7,3V11H17zM21,7h-2v2h-2V7h-2V5h2V3h2v2h2V7z"/>
|
||||
</vector>
|
|
@ -289,7 +289,10 @@ https://developer.android.com/design/ui/tv/samples/jet-fit
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top|center_horizontal"
|
||||
android:minLines="2"
|
||||
android:singleLine="true"
|
||||
android:scrollHorizontally="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:ellipsize="marquee"
|
||||
android:text="@string/movie" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -319,7 +322,10 @@ https://developer.android.com/design/ui/tv/samples/jet-fit
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top|center_horizontal"
|
||||
android:minLines="2"
|
||||
android:singleLine="true"
|
||||
android:scrollHorizontally="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:ellipsize="marquee"
|
||||
android:text="@string/episode" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -347,7 +353,10 @@ https://developer.android.com/design/ui/tv/samples/jet-fit
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top|center_horizontal"
|
||||
android:minLines="2"
|
||||
android:singleLine="true"
|
||||
android:scrollHorizontally="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:ellipsize="marquee"
|
||||
android:text="@string/resume" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -375,7 +384,10 @@ https://developer.android.com/design/ui/tv/samples/jet-fit
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top|center_horizontal"
|
||||
android:minLines="2"
|
||||
android:singleLine="true"
|
||||
android:scrollHorizontally="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:ellipsize="marquee"
|
||||
android:text="@string/play_trailer_button" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -392,7 +404,7 @@ https://developer.android.com/design/ui/tv/samples/jet-fit
|
|||
android:focusable="true"
|
||||
style="@style/ResultSmallButtonTV"
|
||||
app:iconPadding="0dp"
|
||||
app:icon="@drawable/ic_baseline_bookmark_24"
|
||||
app:icon="@drawable/outline_bookmark_add_24"
|
||||
android:nextFocusUp="@id/result_bookmark_Button"
|
||||
android:nextFocusDown="@id/result_description"
|
||||
android:tag="@string/tv_no_focus_tag">
|
||||
|
@ -403,7 +415,10 @@ https://developer.android.com/design/ui/tv/samples/jet-fit
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top|center_horizontal"
|
||||
android:minLines="2"
|
||||
android:singleLine="true"
|
||||
android:scrollHorizontally="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:ellipsize="marquee"
|
||||
android:text="@string/type_none" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -431,7 +446,10 @@ https://developer.android.com/design/ui/tv/samples/jet-fit
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top|center_horizontal"
|
||||
android:minLines="2"
|
||||
android:singleLine="true"
|
||||
android:scrollHorizontally="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:ellipsize="marquee"
|
||||
android:text="@string/favorite" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -459,7 +477,10 @@ https://developer.android.com/design/ui/tv/samples/jet-fit
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top|center_horizontal"
|
||||
android:minLines="2"
|
||||
android:singleLine="true"
|
||||
android:scrollHorizontally="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:ellipsize="marquee"
|
||||
android:text="@string/action_subscribe" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -487,7 +508,10 @@ https://developer.android.com/design/ui/tv/samples/jet-fit
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top|center_horizontal"
|
||||
android:minLines="2"
|
||||
android:singleLine="true"
|
||||
android:scrollHorizontally="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:ellipsize="marquee"
|
||||
android:text="@string/result_search" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -518,7 +542,10 @@ https://developer.android.com/design/ui/tv/samples/jet-fit
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top|center_horizontal"
|
||||
android:minLines="2"
|
||||
android:singleLine="true"
|
||||
android:scrollHorizontally="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:ellipsize="marquee"
|
||||
android:text="@string/episodes" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue