mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
tv fixes
This commit is contained in:
parent
f063a4b3a1
commit
e05d7a82de
7 changed files with 51 additions and 20 deletions
|
@ -75,6 +75,9 @@ class EpisodeAdapter(
|
|||
}
|
||||
|
||||
override fun onViewDetachedFromWindow(holder: RecyclerView.ViewHolder) {
|
||||
if(holder.itemView.hasFocus()) {
|
||||
holder.itemView.clearFocus()
|
||||
}
|
||||
if (holder is DownloadButtonViewHolder) {
|
||||
holder.downloadButton.dispose()
|
||||
}
|
||||
|
|
|
@ -11,14 +11,10 @@ import android.text.Editable
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.AbsListView
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.ImageView
|
||||
import android.widget.Toast
|
||||
import android.widget.*
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.core.view.isGone
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.core.widget.NestedScrollView
|
||||
import androidx.core.widget.doOnTextChanged
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.preference.PreferenceManager
|
||||
|
@ -41,7 +37,6 @@ import com.lagradost.cloudstream3.ui.WatchType
|
|||
import com.lagradost.cloudstream3.ui.download.DOWNLOAD_ACTION_DOWNLOAD
|
||||
import com.lagradost.cloudstream3.ui.download.DownloadButtonSetup.handleDownloadClick
|
||||
import com.lagradost.cloudstream3.ui.download.EasyDownloadButton
|
||||
import com.lagradost.cloudstream3.ui.player.CSPlayerEvent
|
||||
import com.lagradost.cloudstream3.ui.quicksearch.QuickSearchFragment
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTrueTvSettings
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTvSettings
|
||||
|
@ -59,8 +54,6 @@ import com.lagradost.cloudstream3.utils.UIHelper.colorFromAttribute
|
|||
import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe
|
||||
import com.lagradost.cloudstream3.utils.UIHelper.fixPaddingStatusbar
|
||||
import com.lagradost.cloudstream3.utils.UIHelper.hideKeyboard
|
||||
import com.lagradost.cloudstream3.utils.UIHelper.popCurrentPage
|
||||
import com.lagradost.cloudstream3.utils.UIHelper.popupMenuNoIcons
|
||||
import kotlinx.android.synthetic.main.fragment_result.*
|
||||
import kotlinx.android.synthetic.main.fragment_result.result_cast_items
|
||||
import kotlinx.android.synthetic.main.fragment_result.result_cast_text
|
||||
|
@ -96,7 +89,6 @@ import kotlinx.android.synthetic.main.fragment_result.result_resume_progress_hol
|
|||
import kotlinx.android.synthetic.main.fragment_result.result_resume_series_progress
|
||||
import kotlinx.android.synthetic.main.fragment_result.result_resume_series_progress_text
|
||||
import kotlinx.android.synthetic.main.fragment_result.result_resume_series_title
|
||||
import kotlinx.android.synthetic.main.fragment_result.result_scroll
|
||||
import kotlinx.android.synthetic.main.fragment_result.result_tag
|
||||
import kotlinx.android.synthetic.main.fragment_result.result_tag_holder
|
||||
import kotlinx.android.synthetic.main.fragment_result.result_title
|
||||
|
@ -106,6 +98,13 @@ import kotlinx.android.synthetic.main.fragment_result_tv.*
|
|||
import kotlinx.android.synthetic.main.fragment_trailer.*
|
||||
import kotlinx.android.synthetic.main.result_sync.*
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import android.widget.EditText
|
||||
|
||||
import android.widget.AbsListView
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const val START_ACTION_RESUME_LATEST = 1
|
||||
const val START_ACTION_LOAD_EP = 2
|
||||
|
@ -498,7 +497,7 @@ open class ResultFragment : ResultTrailerPlayer() {
|
|||
}
|
||||
}
|
||||
|
||||
result_episodes.adapter =
|
||||
result_episodes?.adapter =
|
||||
EpisodeAdapter(
|
||||
api.hasDownloadSupport,
|
||||
{ episodeClick ->
|
||||
|
@ -747,10 +746,6 @@ open class ResultFragment : ResultTrailerPlayer() {
|
|||
syncModel.publishUserData()
|
||||
}
|
||||
|
||||
observe(viewModel.episodesCountText) { count ->
|
||||
result_episodes_text.setText(count)
|
||||
}
|
||||
|
||||
observe(viewModel.trailers) { trailers ->
|
||||
setTrailers(trailers.flatMap { it.mirros }) // I dont care about subtitles yet!
|
||||
}
|
||||
|
@ -815,7 +810,7 @@ open class ResultFragment : ResultTrailerPlayer() {
|
|||
updateList(d.actors ?: emptyList())
|
||||
}
|
||||
|
||||
result_open_in_browser?.isGone = d.url.isBlank()
|
||||
result_open_in_browser?.isVisible = d.url.startsWith("http")
|
||||
result_open_in_browser?.setOnClickListener {
|
||||
val i = Intent(ACTION_VIEW)
|
||||
i.data = Uri.parse(d.url)
|
||||
|
@ -923,6 +918,7 @@ open class ResultFragment : ResultTrailerPlayer() {
|
|||
}
|
||||
}
|
||||
|
||||
result_open_in_browser?.isVisible = url.startsWith("http")
|
||||
result_open_in_browser?.setOnClickListener {
|
||||
val i = Intent(ACTION_VIEW)
|
||||
i.data = Uri.parse(url)
|
||||
|
|
|
@ -193,6 +193,10 @@ class ResultFragmentPhone : ResultFragment() {
|
|||
//result_poster_blur_holder?.translationY = -scrollY.toFloat()
|
||||
})
|
||||
|
||||
observe(viewModel.episodesCountText) { count ->
|
||||
result_episodes_text.setText(count)
|
||||
}
|
||||
|
||||
observe(viewModel.selectPopup) { popup ->
|
||||
when (popup) {
|
||||
is Some.Success -> {
|
||||
|
|
|
@ -102,6 +102,11 @@ class ResultFragmentTv : ResultFragment() {
|
|||
result_dub_selection.setAdapter()
|
||||
result_recommendations_filter_selection.setAdapter()
|
||||
|
||||
|
||||
observe(viewModel.episodesCountText) { count ->
|
||||
result_episodes_text.setText(count)
|
||||
}
|
||||
|
||||
observe(viewModel.selectedRangeIndex) { selected ->
|
||||
result_range_selection.select(selected)
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import com.google.android.material.button.MaterialButton
|
|||
import com.lagradost.cloudstream3.ActorData
|
||||
import com.lagradost.cloudstream3.ActorRole
|
||||
import com.lagradost.cloudstream3.R
|
||||
import com.lagradost.cloudstream3.ui.download.DownloadButtonViewHolder
|
||||
import com.lagradost.cloudstream3.ui.home.ParentItemAdapter
|
||||
import com.lagradost.cloudstream3.ui.settings.AccountAdapter
|
||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTrueTvSettings
|
||||
|
@ -39,6 +40,12 @@ class SelectAdaptor(val callback: (Any) -> Unit) : RecyclerView.Adapter<Recycler
|
|||
}
|
||||
}
|
||||
|
||||
override fun onViewDetachedFromWindow(holder: RecyclerView.ViewHolder) {
|
||||
if(holder.itemView.hasFocus()) {
|
||||
holder.itemView.clearFocus()
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return selection.size
|
||||
}
|
||||
|
|
|
@ -106,6 +106,8 @@ class SyncViewModel : ViewModel() {
|
|||
Log.i(TAG, "addFromUrl = $url")
|
||||
|
||||
if (url == null || hasAddedFromUrl.contains(url)) return@ioSafe
|
||||
if(!url.startsWith("http")) return@ioSafe
|
||||
|
||||
SyncUtil.getIdsFromUrl(url)?.let { (malId, aniListId) ->
|
||||
hasAddedFromUrl.add(url)
|
||||
|
||||
|
|
|
@ -194,6 +194,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_height="30dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
|
@ -212,6 +213,7 @@
|
|||
android:src="@drawable/ic_baseline_arrow_back_24"
|
||||
android:contentDescription="@string/go_back"
|
||||
app:tint="?attr/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result_title"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -391,7 +393,7 @@
|
|||
|
||||
<LinearLayout
|
||||
android:id="@+id/result_movie_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal"
|
||||
|
@ -404,9 +406,9 @@
|
|||
|
||||
android:id="@+id/result_play_movie"
|
||||
style="@style/WhiteButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
|
||||
android:minWidth="250dp"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
|
@ -418,9 +420,10 @@
|
|||
|
||||
|
||||
<FrameLayout
|
||||
android:minWidth="250dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:id="@+id/result_movie_progress_downloaded_holder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
@ -646,12 +649,22 @@
|
|||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginBottom="5dp"
|
||||
android:id="@+id/result_next_airing_holder"
|
||||
android:layout_gravity="start"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result_episodes_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textColor="?attr/textColor"
|
||||
android:textSize="17sp"
|
||||
android:textStyle="normal"
|
||||
tools:text="8 Episodes" />
|
||||
<TextView
|
||||
android:gravity="center"
|
||||
|
||||
|
@ -754,6 +767,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.lagradost.cloudstream3.ui.AutofitRecyclerView
|
||||
android:nextFocusUp="@id/result_recommendations_filter_selection"
|
||||
android:descendantFocusability="afterDescendants"
|
||||
|
|
Loading…
Reference in a new issue