Search other extensions

This commit is contained in:
KingLucius 2024-02-26 18:08:06 +02:00
parent e11264f58f
commit f3efbfd45f
3 changed files with 37 additions and 1 deletions

View file

@ -33,6 +33,7 @@ import com.lagradost.cloudstream3.ui.WatchType
import com.lagradost.cloudstream3.ui.download.DownloadButtonSetup
import com.lagradost.cloudstream3.ui.player.ExtractorLinkGenerator
import com.lagradost.cloudstream3.ui.player.GeneratorPlayer
import com.lagradost.cloudstream3.ui.quicksearch.QuickSearchFragment
import com.lagradost.cloudstream3.ui.result.ResultFragment.getStoredData
import com.lagradost.cloudstream3.ui.result.ResultFragment.updateUIEvent
import com.lagradost.cloudstream3.ui.search.SEARCH_ACTION_FOCUSED
@ -272,6 +273,7 @@ class ResultFragmentTv : Fragment() {
resultEpisodesShowButton.onFocusChangeListener = rightListener
resultDescription.onFocusChangeListener = leftListener
resultBookmarkButton.onFocusChangeListener = leftListener
resultSearchButton.onFocusChangeListener = leftListener
resultFavoriteButton.onFocusChangeListener = leftListener
resultEpisodesShowButton.setOnClickListener {
// toggle, to make it more touch accessable just in case someone thinks that a
@ -293,7 +295,8 @@ class ResultFragmentTv : Fragment() {
resultPlayTrailerButton,
resultBookmarkButton,
resultFavoriteButton,
resultSubscribeButton
resultSubscribeButton,
resultSearchButton
)
for (requestView in views) {
if (!requestView.isVisible) continue
@ -878,6 +881,10 @@ class ResultFragmentTv : Fragment() {
// If there is no rating to display, we don't want an empty gap
resultMetaContentRating.width = 0
}
resultSearchButton.setOnClickListener {
QuickSearchFragment.pushSearch(activity, d.title)
}
}
is Resource.Loading -> {

View file

@ -465,6 +465,34 @@ https://developer.android.com/design/ui/tv/samples/jet-fit
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:id="@+id/result_search"
android:orientation="vertical">
<com.google.android.material.button.MaterialButton
android:id="@+id/result_search_Button"
android:focusable="true"
style="@style/ResultSmallButtonTV"
app:iconPadding="0dp"
app:icon="@drawable/search_icon"
android:nextFocusUp="@id/result_search_Button"
android:nextFocusDown="@id/result_description"
android:tag="@string/tv_no_focus_tag">
</com.google.android.material.button.MaterialButton>
<TextView
android:id="@+id/result_search_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top|center_horizontal"
android:minLines="2"
android:text="@string/result_search" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View file

@ -748,4 +748,5 @@
<string name="favorite">Favorite</string>
<string name="movie">Movie</string>
<string name="unfavorite">Unfavorite</string>
<string name="result_search">Search</string>
</resources>