better dpad support and bug fix

This commit is contained in:
LagradOst 2021-10-09 23:59:37 +02:00
parent 44e0c1c606
commit 627dd1776b
27 changed files with 344 additions and 174 deletions

View File

@ -117,6 +117,7 @@ class GrdLayoutManager(val context: Context, val spanCoun: Int) : GridLayoutMana
}
}
// https://riptutorial.com/android/example/4810/gridlayoutmanager-with-dynamic-span-count
class AutofitRecyclerView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
RecyclerView(context, attrs) {
@ -145,13 +146,4 @@ class AutofitRecyclerView @JvmOverloads constructor(context: Context, attrs: Att
layoutManager = manager
}
/*override fun onMeasure(widthSpec: Int, heightSpec: Int) {
super.onMeasure(widthSpec, heightSpec)
if (spanCount == 0 && columnWidth > 0) {
val count = max(1, measuredWidth / columnWidth)
spanCount = count
}
}*/
}

View File

@ -406,7 +406,7 @@ class HomeFragment : Fragment() {
reloadStored()
val apiName = context?.getKey<String>(HOMEPAGE_API)
if(homeViewModel.apiName.value != apiName) {
if(homeViewModel.apiName.value != apiName || apiName == null) {
println("Caught home: " + homeViewModel.apiName.value + " at " + apiName)
homeViewModel.loadAndCancel(apiName)
}

View File

@ -52,7 +52,6 @@ class HomeViewModel : ViewModel() {
val resumeWatching: LiveData<List<SearchResponse>> = _resumeWatching
fun loadResumeWatching(context: Context) = viewModelScope.launch {
println("Resume::")
val resumeWatching = withContext(Dispatchers.IO) {
context.getAllResumeStateIds().mapNotNull { id ->
context.getLastWatched(id)
@ -128,7 +127,7 @@ class HomeViewModel : ViewModel() {
}
var onGoingLoad: Job? = null
fun loadAndCancel(api: MainAPI?) {
private fun loadAndCancel(api: MainAPI?) {
onGoingLoad?.cancel()
onGoingLoad = load(api)
}
@ -139,6 +138,7 @@ class HomeViewModel : ViewModel() {
} else {
autoloadRepo()
}
_apiName.postValue(repo?.name)
if (repo?.hasMainPage == true) {
_page.postValue(Resource.Loading())

View File

@ -225,6 +225,8 @@ class ResultFragment : Fragment() {
result_loading.visibility = GONE
result_finish_loading.visibility = VISIBLE
result_loading_error.visibility = GONE
result_bookmark_button.requestFocus()
}
}
}

View File

@ -54,6 +54,8 @@ data class SaveCaptionStyle(
var fixedTextSize: Float?,
)
const val DEF_SUBS_ELEVATION = 20
class SubtitlesFragment : Fragment() {
companion object {
val applyStyleEvent = Event<SaveCaptionStyle>()
@ -94,7 +96,7 @@ class SubtitlesFragment : Fragment() {
CaptionStyleCompat.EDGE_TYPE_OUTLINE,
getDefColor(1),
null,
0,
DEF_SUBS_ELEVATION,
null,
)
}
@ -237,7 +239,7 @@ class SubtitlesFragment : Fragment() {
}
subs_subtitle_elevation.setOnLongClickListener {
state.elevation = 0
state.elevation = DEF_SUBS_ELEVATION
it.context.updateState()
showToast(activity, R.string.subs_default_reset_toast, Toast.LENGTH_SHORT)
return@setOnLongClickListener true

View File

@ -16,7 +16,10 @@ import android.view.View
import android.view.WindowManager
import android.view.inputmethod.InputMethodManager
import android.widget.ImageView
import androidx.annotation.*
import androidx.annotation.AttrRes
import androidx.annotation.ColorInt
import androidx.annotation.IdRes
import androidx.annotation.RequiresApi
import androidx.appcompat.view.ContextThemeWrapper
import androidx.appcompat.view.menu.MenuBuilder
import androidx.appcompat.widget.PopupMenu
@ -30,7 +33,6 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.navigation.fragment.NavHostFragment
import androidx.preference.PreferenceManager
import com.bumptech.glide.Glide
import com.bumptech.glide.load.model.GlideUrl
import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.mvvm.logError
@ -71,8 +73,8 @@ object UIHelper {
}
}
fun Activity?.navigate(@IdRes navigation : Int, arguments : Bundle? = null) {
if(this is FragmentActivity) {
fun Activity?.navigate(@IdRes navigation: Int, arguments: Bundle? = null) {
if (this is FragmentActivity) {
(supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as? NavHostFragment?)?.navController?.navigate(
navigation, arguments
)
@ -93,13 +95,13 @@ object UIHelper {
return color
}
fun ImageView?.setImage(url : String?) {
if(this == null || url.isNullOrBlank()) return
fun ImageView?.setImage(url: String?) {
if (this == null || url.isNullOrBlank()) return
try {
GlideApp.with(this.context)
.load(GlideUrl(url))
.into(this)
} catch (e : Exception) {
} catch (e: Exception) {
logError(e)
}
}
@ -211,6 +213,7 @@ object UIHelper {
fun Context.fixPaddingStatusbar(v: View) {
v.setPadding(v.paddingLeft, v.paddingTop + getStatusBarHeight(), v.paddingRight, v.paddingBottom)
}
fun Context.getNavigationBarHeight(): Int {
var result = 0
val resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android")
@ -281,31 +284,6 @@ object UIHelper {
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
}
/**id, icon, stringRes */
@SuppressLint("RestrictedApi")
fun View.popupMenu(
items: List<Triple<Int, Int, Int>>,
onMenuItemClick: MenuItem.() -> Unit,
): PopupMenu {
val ctw = ContextThemeWrapper(context, R.style.PopupMenu)
val popup = PopupMenu(ctw, this, Gravity.NO_GRAVITY, R.attr.actionOverflowMenuStyle, 0)
items.forEach { (id, icon, stringRes) ->
popup.menu.add(0, id, 0, stringRes).setIcon(icon)
}
(popup.menu as? MenuBuilder)?.setOptionalIconsVisible(true)
popup.setOnMenuItemClickListener {
it.onMenuItemClick()
true
}
popup.show()
return popup
}
/**id, stringRes */
@SuppressLint("RestrictedApi")
fun View.popupMenuNoIcons(

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke android:width="2dp"
android:color="?attr/white"/>
<corners
android:bottomLeftRadius="2dp"
android:bottomRightRadius="2dp"
android:topLeftRadius="2dp"
android:topRightRadius="2dp" />
</shape>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true"
android:drawable="@drawable/outline"/> <!-- focused -->
</selector>

View File

@ -22,6 +22,9 @@
android:layout_height="wrap_content">
</TextView>
<ListView
android:nextFocusRight="@id/cancel_btt"
android:nextFocusLeft="@id/apply_btt"
android:id="@+id/listview1"
android:layout_marginTop="-10dp"
android:layout_marginBottom="60dp"

View File

@ -1,20 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:nextFocusRight="@id/download_child_episode_download"
android:nextFocusLeft="@id/download_child_episode_download"
android:id="@+id/download_child_episode_holder"
android:layout_width="match_parent"
android:layout_height="50dp"
app:cardCornerRadius="@dimen/roundedImageRadius"
app:cardBackgroundColor="@color/transparent"
app:cardElevation="0dp"
android:id="@+id/download_child_episode_holder"
android:foreground="?android:attr/selectableItemBackgroundBorderless"
android:foreground="@drawable/outline_drawable"
android:layout_marginBottom="5dp"
>
<androidx.core.widget.ContentLoadingProgressBar
android:layout_marginBottom="-1.5dp"
android:id="@+id/download_child_episode_progress"
android:layout_marginBottom="-1.5dp"
android:progressTint="?attr/colorPrimary"
android:progressBackgroundTint="?attr/colorPrimary"
style="@android:style/Widget.Material.ProgressBar.Horizontal"
@ -23,13 +28,15 @@
android:layout_gravity="bottom"
android:layout_height="5dp">
</androidx.core.widget.ContentLoadingProgressBar>
<GridLayout android:layout_width="match_parent" android:layout_height="match_parent">
<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/download_child_episode_play"
android:visibility="gone"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_gravity="center_vertical"
android:id="@+id/download_child_episode_play"
android:src="@drawable/ic_baseline_play_arrow_24"
android:contentDescription="@string/episode_play_img_des"/>
<LinearLayout
@ -38,7 +45,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="50dp"
android:layout_width="match_parent"
>
>
<TextView
android:id="@+id/download_child_episode_text"
android:layout_marginStart="10dp"
@ -74,11 +81,11 @@
android:layout_width="wrap_content"
android:layout_height="match_parent">
<androidx.core.widget.ContentLoadingProgressBar
android:id="@+id/download_child_episode_progress_downloaded"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:id="@+id/download_child_episode_progress_downloaded"
android:indeterminate="false"
android:progressDrawable="@drawable/circular_progress_bar"
android:background="@drawable/circle_shape"
@ -90,6 +97,10 @@
android:visibility="visible"
/>
<ImageView
android:nextFocusRight="@id/download_child_episode_holder"
android:nextFocusLeft="@id/download_child_episode_holder"
android:id="@+id/download_child_episode_download"
android:visibility="visible"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
@ -97,7 +108,6 @@
android:layout_gravity="center_vertical"
android:padding="2dp"
android:layout_width="30dp"
android:id="@+id/download_child_episode_download"
android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_baseline_play_arrow_24"
android:contentDescription="@string/download"/>

View File

@ -8,7 +8,7 @@
app:cardCornerRadius="@dimen/roundedImageRadius"
app:cardBackgroundColor="@color/itemBackground"
android:id="@+id/episode_holder"
android:foreground="?android:attr/selectableItemBackgroundBorderless"
android:foreground="@drawable/outline_drawable"
android:layout_marginBottom="10dp"
>
<LinearLayout

View File

@ -26,6 +26,8 @@
</com.google.android.material.appbar.AppBarLayout>
<androidx.recyclerview.widget.RecyclerView
android:nextFocusUp="@id/download_child_toolbar"
android:background="?attr/primaryBlackBackground"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:padding="10dp"

View File

@ -109,6 +109,8 @@
</com.google.android.material.appbar.AppBarLayout>
<androidx.recyclerview.widget.RecyclerView
android:descendantFocusability="afterDescendants"
android:background="?attr/primaryBlackBackground"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:padding="10dp"

View File

@ -10,7 +10,7 @@
tools:context=".ui.home.HomeFragment">
<FrameLayout
android:visibility="visible"
android:visibility="gone"
tools:visibility="gone"
android:id="@+id/home_loading"
android:layout_width="match_parent"
@ -85,6 +85,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:nextFocusDown="@id/home_main_info"
android:id="@+id/home_change_api"
android:layout_margin="10dp"
android:layout_gravity="end"
@ -94,6 +95,7 @@
android:layout_width="25dp"
android:layout_height="25dp"
android:contentDescription="@string/home_change_provider_img_des">
<requestFocus/>
</ImageView>
<LinearLayout
android:layout_marginTop="-20dp"
@ -102,7 +104,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:foreground="?android:attr/selectableItemBackgroundBorderless"
android:foreground="@drawable/outline_drawable"
android:id="@+id/home_main_poster"
tools:src="@drawable/example_poster"
android:layout_gravity="center"
@ -129,6 +131,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:nextFocusLeft="@id/home_reroll_next"
android:nextFocusUp="@id/home_change_api"
android:nextFocusRight="@id/home_main_play"
android:nextFocusDown="@id/home_watch_child_more_info"
android:layout_gravity="center"
android:layout_marginEnd="2dp"
android:id="@+id/home_reroll_prev"
@ -140,6 +147,11 @@
android:contentDescription="@string/home_next_random_img_des">
</ImageView>
<com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/home_reroll_prev"
android:nextFocusUp="@id/home_change_api"
android:nextFocusRight="@id/home_main_info"
android:nextFocusDown="@id/home_watch_child_more_info"
style="@style/WhiteButton"
android:visibility="visible"
android:layout_gravity="center"
@ -150,6 +162,11 @@
android:layout_width="120dp">
</com.google.android.material.button.MaterialButton>
<com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/home_main_play"
android:nextFocusUp="@id/home_change_api"
android:nextFocusRight="@id/home_reroll_next"
android:nextFocusDown="@id/home_watch_child_more_info"
style="@style/BlackButton"
android:visibility="visible"
android:layout_gravity="center"
@ -162,6 +179,11 @@
android:layout_width="120dp">
</com.google.android.material.button.MaterialButton>
<ImageView
android:nextFocusLeft="@id/home_main_info"
android:nextFocusUp="@id/home_change_api"
android:nextFocusRight="@id/home_reroll_prev"
android:nextFocusDown="@id/home_watch_child_more_info"
android:layout_gravity="center"
android:layout_marginStart="2dp"
android:id="@+id/home_reroll_next"
@ -184,6 +206,9 @@
android:layout_height="wrap_content">
<FrameLayout
android:nextFocusUp="@id/home_main_info"
android:nextFocusDown="@id/home_watch_child_recyclerview"
android:foreground="?android:attr/selectableItemBackgroundBorderless"
android:id="@+id/home_watch_child_more_info"
android:padding="12dp"
@ -211,6 +236,8 @@
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:descendantFocusability="afterDescendants"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:id="@+id/home_watch_child_recyclerview"
android:orientation="horizontal"
@ -229,12 +256,17 @@
android:layout_height="wrap_content">
<FrameLayout
android:nextFocusUp="@id/home_watch_child_recyclerview"
android:nextFocusForward="@id/home_bookmarked_child_recyclerview"
android:foreground="?android:attr/selectableItemBackgroundBorderless"
android:id="@+id/home_bookmarked_child_more_info"
android:padding="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:background="?android:attr/selectableItemBackgroundBorderless"
android:id="@+id/home_bookmark_select"
android:src="@drawable/ic_baseline_filter_list_24"
android:layout_width="24dp"
@ -264,6 +296,8 @@
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:descendantFocusability="afterDescendants"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:id="@+id/home_bookmarked_child_recyclerview"
android:orientation="horizontal"
@ -274,6 +308,7 @@
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:descendantFocusability="afterDescendants"
android:id="@+id/home_master_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -18,14 +18,17 @@
android:layout_width="50dp" android:layout_height="50dp">
</ProgressBar>
<LinearLayout
android:id="@+id/result_loading_error"
android:visibility="gone"
tools:visibility="gone"
android:id="@+id/result_loading_error"
android:orientation="vertical"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
android:id="@+id/result_reload_connectionerror"
android:layout_gravity="center"
android:layout_height="50dp"
android:layout_margin="5dp"
@ -43,7 +46,6 @@
app:icon="@drawable/ic_baseline_autorenew_24"
app:iconSize="20dp"
android:text="@string/reload_error"
android:id="@+id/result_reload_connectionerror"
android:textSize="15sp"
app:cornerRadius="5dp"
android:layout_width="wrap_content"
@ -51,6 +53,8 @@
>
</com.google.android.material.button.MaterialButton>
<com.google.android.material.button.MaterialButton
android:id="@+id/result_reload_connection_open_in_browser"
android:layout_gravity="center"
android:layout_height="50dp"
android:layout_margin="5dp"
@ -67,7 +71,6 @@
app:icon="@drawable/ic_baseline_public_24"
app:iconSize="20dp"
android:text="@string/result_open_in_browser"
android:id="@+id/result_reload_connection_open_in_browser"
android:textSize="15sp"
app:cornerRadius="5dp"
android:layout_width="wrap_content"
@ -93,28 +96,33 @@
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/result_poster_blur_holder"
android:visibility="gone"
android:alpha="0"
android:layout_width="match_parent"
android:id="@+id/result_poster_blur_holder"
android:layout_height="180dp">
<ImageView
android:id="@+id/result_poster_blur"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:alpha="0.7"
tools:src="@drawable/example_poster"
android:background="@color/primaryGrayBackground"
android:id="@+id/result_poster_blur"
tools:ignore="ContentDescription"/>
<ImageView
android:src="@drawable/background_shadow"
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_height="30dp" tools:ignore="ContentDescription"/>
android:layout_height="30dp"
tools:ignore="ContentDescription"/>
</FrameLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/result_scroll" android:layout_width="match_parent"
android:id="@+id/result_scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
@ -141,6 +149,8 @@
android:layout_width="100dp"
android:layout_height="140dp">
<ImageView
android:foreground="@drawable/outline_drawable"
android:id="@+id/result_poster"
android:scaleType="centerCrop"
android:layout_width="match_parent"
@ -157,9 +167,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/result_title"
android:layout_marginEnd="50dp"
tools:text="The Perfect Run The Perfect Run The Perfect Run"
android:id="@+id/result_title"
android:textSize="20sp"
android:textStyle="normal"
android:textColor="?attr/textColor" android:layout_width="wrap_content"
@ -189,20 +200,19 @@
android:layout_width="match_parent"
android:layout_height="50dp">
<com.google.android.material.button.MaterialButton
android:layout_marginStart="0dp"
android:nextFocusLeft="@id/result_openinbrower"
android:nextFocusDown="@id/result_descript"
android:nextFocusUp="@id/result_back"
android:nextFocusRight="@id/result_share"
android:layout_gravity="center_vertical"
app:cornerRadius="4dp"
android:id="@+id/result_bookmark_button"
tools:text="Bookmark"
app:rippleColor="?attr/primaryBlackBackground"
android:textColor="?attr/textColor"
app:iconTint="?attr/textColor"
android:textAllCaps="false"
app:icon="@drawable/ic_outline_remove_red_eye_24"
android:backgroundTint="?attr/iconGrayBackground"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="wrap_content"
android:layout_height="50dp">
style="@style/MultiSelectButton">
<requestFocus/>
</com.google.android.material.button.MaterialButton>
@ -227,6 +237,11 @@
android:visibility="gone"
/>
<ImageView
android:nextFocusUp="@id/result_back"
android:nextFocusDown="@id/result_descript"
android:nextFocusLeft="@id/result_bookmark_button"
android:nextFocusRight="@id/result_openinbrower"
android:id="@+id/result_share"
android:layout_width="25dp"
android:layout_height="25dp"
@ -237,6 +252,11 @@
android:layout_gravity="center" android:contentDescription="@string/result_share">
</ImageView>
<ImageView
android:nextFocusUp="@id/result_back"
android:nextFocusDown="@id/result_descript"
android:nextFocusLeft="@id/result_share"
android:nextFocusRight="@id/result_bookmark_button"
android:id="@+id/result_openinbrower"
android:layout_width="25dp"
android:layout_height="25dp"
@ -268,6 +288,12 @@
/>
<TextView
android:padding="10dp"
android:foreground="@drawable/outline_drawable"
android:nextFocusUp="@id/result_bookmark_button"
android:nextFocusDown="@id/result_play_movie"
android:id="@+id/result_descript"
android:textSize="15sp"
tools:text="Ryan Quicksave Romano is an eccentric adventurer with a strange power: he can create a save-point in time and redo his life whenever he dies. Arriving in New Rome, the glitzy capital of sin of a rebuilding Europe, he finds the city torn between mega-corporations, sponsored heroes, superpowered criminals, and true monsters. It's a time of chaos, where potions can grant the power to rule the world and dangers lurk everywhere. "
@ -296,18 +322,24 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
android:nextFocusUp="@id/result_descript"
android:nextFocusDown="@id/result_download_movie"
android:id="@+id/result_play_movie"
style="@style/WhiteButton"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:visibility="visible"
android:layout_gravity="center_vertical"
android:id="@+id/result_play_movie"
android:text="@string/play_movie_button"
app:icon="@drawable/ic_baseline_play_arrow_24"
android:layout_width="match_parent">
</com.google.android.material.button.MaterialButton>
<com.google.android.material.button.MaterialButton
android:nextFocusUp="@id/result_play_movie"
android:nextFocusDown="@id/result_season_button"
android:id="@+id/result_download_movie"
style="@style/BlackButton"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
@ -316,7 +348,6 @@
tools:text="Downloading"
tools:icon="@drawable/netflix_download"
android:id="@+id/result_download_movie"
android:clickable="true"
android:focusable="true"
android:layout_width="match_parent">
@ -389,38 +420,36 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
android:visibility="gone"
android:layout_gravity="center_vertical"
android:id="@+id/result_season_button"
tools:visibility="visible"
tools:text="Season 1"
app:rippleColor="?attr/iconGrayBackground"
android:textColor="?attr/textColor"
app:iconTint="?attr/textColor"
android:textAllCaps="false"
android:nextFocusUp="@id/result_descript"
android:nextFocusRight="@id/result_episode_select"
android:nextFocusLeft="@id/result_episode_select"
android:nextFocusDown="@id/result_episodes"
android:backgroundTint="@color/itemBackground"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="wrap_content"
android:layout_marginEnd="10dp"
android:layout_height="50dp">
</com.google.android.material.button.MaterialButton>
<com.google.android.material.button.MaterialButton
android:id="@+id/result_season_button"
android:visibility="gone"
android:layout_gravity="center_vertical"
android:id="@+id/result_episode_select"
style="@style/MultiSelectButton"
android:layout_marginEnd="10dp">
</com.google.android.material.button.MaterialButton>
<com.google.android.material.button.MaterialButton
tools:visibility="visible"
tools:text="50-100"
app:rippleColor="?attr/iconGrayBackground"
android:textColor="?attr/textColor"
app:iconTint="?attr/textColor"
android:textAllCaps="false"
android:nextFocusUp="@id/result_descript"
android:nextFocusRight="@id/result_season_button"
android:nextFocusLeft="@id/result_season_button"
android:nextFocusDown="@id/result_episodes"
android:backgroundTint="@color/itemBackground"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="wrap_content"
android:layout_marginEnd="10dp"
android:layout_height="50dp">
android:id="@+id/result_episode_select"
android:visibility="gone"
android:layout_gravity="center_vertical"
style="@style/MultiSelectButton"
>
</com.google.android.material.button.MaterialButton>
<TextView
android:layout_width="wrap_content"
@ -436,19 +465,23 @@
</LinearLayout>
<androidx.core.widget.ContentLoadingProgressBar
style="@style/Widget.AppCompat.ProgressBar"
android:id="@+id/result_episode_loading"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_gravity="center"
android:layout_width="50dp"
android:layout_height="50dp">
</androidx.core.widget.ContentLoadingProgressBar>
<androidx.recyclerview.widget.RecyclerView
android:descendantFocusability="afterDescendants"
android:id="@+id/result_episodes"
android:layout_marginTop="0dp"
android:paddingBottom="100dp"
tools:listitem="@layout/result_episode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/result_episodes"
/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
@ -489,6 +522,10 @@
android:contentDescription="@string/search_poster_descript"/>
</androidx.cardview.widget.CardView>-->
<ImageView
android:nextFocusDown="@id/result_bookmark_button"
android:nextFocusRight="@id/result_bookmark_button"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:id="@+id/result_back"
android:clickable="true"
android:focusable="true"

View File

@ -23,6 +23,10 @@
android:layout_marginEnd="30dp"
android:layout_height="30dp">
<androidx.appcompat.widget.SearchView
android:nextFocusRight="@id/search_filter"
android:nextFocusLeft="@id/search_filter"
android:nextFocusDown="@id/cardSpace"
android:id="@+id/main_search"
app:queryBackground="@color/transparent"
app:searchIcon="@drawable/search_icon"
@ -34,6 +38,8 @@
android:layout_gravity="center_vertical"
app:iconifiedByDefault="false"
tools:ignore="RtlSymmetry">
<requestFocus/>
<androidx.core.widget.ContentLoadingProgressBar
android:id="@+id/search_loading_bar"
android:layout_width="20dp" android:layout_height="20dp"
@ -51,6 +57,10 @@
</androidx.appcompat.widget.SearchView>
</FrameLayout>
<ImageView
android:nextFocusRight="@id/main_search"
android:nextFocusLeft="@id/main_search"
android:nextFocusDown="@id/cardSpace"
android:id="@+id/search_filter"
android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_baseline_tune_24"
@ -64,6 +74,8 @@
</FrameLayout>
<com.lagradost.cloudstream3.ui.AutofitRecyclerView
android:descendantFocusability="afterDescendants"
android:background="?attr/primaryBlackBackground"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -77,6 +89,8 @@
android:orientation="vertical"
/>
<androidx.recyclerview.widget.RecyclerView
android:descendantFocusability="afterDescendants"
android:background="?attr/primaryBlackBackground"
android:id="@+id/search_master_recycler"
android:layout_width="match_parent"

View File

@ -8,11 +8,14 @@
android:layout_height="wrap_content">
<FrameLayout
android:nextFocusDown="@id/home_expanded_recycler"
android:foreground="?android:attr/selectableItemBackgroundBorderless"
android:id="@+id/home_expanded_drag_down"
android:padding="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<requestFocus/>
<TextView
android:id="@+id/home_expanded_text"
android:layout_width="wrap_content"
@ -33,6 +36,8 @@
</ImageView>
</FrameLayout>
<com.lagradost.cloudstream3.ui.AutofitRecyclerView
android:descendantFocusability="afterDescendants"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/home_expanded_recycler"

View File

@ -3,7 +3,7 @@
<!-- android:layout_width="114dp"
android:layout_height="180dp"-->
<androidx.cardview.widget.CardView
android:foreground="?android:attr/selectableItemBackgroundBorderless"
android:foreground="@drawable/outline_drawable"
android:layout_margin="2dp"
android:layout_width="114dp"
android:layout_height="180dp"

View File

@ -8,6 +8,8 @@
android:layout_height="wrap_content">
<FrameLayout
android:nextFocusDown="@id/home_child_recyclerview"
android:foreground="?android:attr/selectableItemBackgroundBorderless"
android:id="@+id/home_child_more_info"
android:padding="12dp"
@ -34,6 +36,8 @@
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:descendantFocusability="afterDescendants"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:id="@+id/home_child_recyclerview"
android:orientation="horizontal"

View File

@ -266,6 +266,10 @@
android:layout_height="40dp">
</TextView>
<ImageButton
android:nextFocusUp="@id/video_go_back"
android:nextFocusDown="@id/lock_player"
android:nextFocusLeft="@id/exo_rew"
android:paddingLeft="100dp"
android:id="@id/exo_rew"
android:layout_height="70dp"
@ -293,6 +297,11 @@
android:layout_width="100dp"
android:layout_height="100dp">
<ImageButton
android:nextFocusUp="@id/video_go_back"
android:nextFocusDown="@id/lock_player"
android:nextFocusLeft="@id/exo_rew"
android:nextFocusRight="@id/exo_ffwd"
android:id="@id/exo_play"
android:scaleType="fitCenter"
android:layout_height="70dp"
@ -304,6 +313,11 @@
android:focusable="true"
/>
<ImageButton
android:nextFocusUp="@id/video_go_back"
android:nextFocusDown="@id/lock_player"
android:nextFocusLeft="@id/exo_rew"
android:nextFocusRight="@id/exo_ffwd"
android:id="@id/exo_pause"
android:scaleType="fitCenter"
android:layout_height="70dp"
@ -337,6 +351,10 @@
android:layout_height="40dp">
</TextView>
<ImageButton
android:nextFocusUp="@id/video_go_back"
android:nextFocusDown="@id/lock_player"
android:nextFocusRight="@id/exo_rew"
android:layout_gravity="center"
android:id="@id/exo_ffwd"
android:layout_height="70dp"
@ -467,6 +485,10 @@
android:paddingBottom="10dp"
>
<androidx.cardview.widget.CardView
android:nextFocusLeft="@id/skip_episode"
android:nextFocusRight="@id/resize_player"
android:id="@+id/lock_player"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@ -477,7 +499,6 @@
card_view:cardCornerRadius="@dimen/card_corner_radius"
card_view:cardBackgroundColor="@color/transparent"
android:foreground="?attr/selectableItemBackgroundBorderless"
android:id="@+id/lock_player"
card_view:cardElevation="0dp"
tools:visibility="visible"
>
@ -520,6 +541,10 @@
android:layout_width="wrap_content"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:nextFocusLeft="@id/lock_player"
android:nextFocusRight="@id/playback_speed_btt"
android:id="@+id/resize_player"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@ -531,7 +556,6 @@
card_view:cardBackgroundColor="@color/transparent"
android:foreground="?attr/selectableItemBackgroundBorderless"
card_view:cardElevation="0dp"
android:id="@+id/resize_player"
tools:visibility="visible"
>
<LinearLayout
@ -566,6 +590,10 @@
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:nextFocusLeft="@id/resize_player"
android:nextFocusRight="@id/sources_btt"
android:id="@+id/playback_speed_btt"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
@ -575,7 +603,6 @@
app:cardCornerRadius="@dimen/card_corner_radius"
app:cardBackgroundColor="@color/transparent"
android:foreground="?attr/selectableItemBackgroundBorderless"
android:id="@+id/playback_speed_btt"
app:cardElevation="0dp"
>
@ -613,6 +640,11 @@
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:nextFocusLeft="@id/playback_speed_btt"
android:nextFocusRight="@id/skip_op"
android:id="@+id/sources_btt"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@ -623,7 +655,6 @@
card_view:cardCornerRadius="@dimen/card_corner_radius"
card_view:cardBackgroundColor="@color/transparent"
android:foreground="?attr/selectableItemBackgroundBorderless"
android:id="@+id/sources_btt"
card_view:cardElevation="0dp"
>
@ -660,6 +691,10 @@
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:nextFocusLeft="@id/sources_btt"
android:nextFocusRight="@id/skip_episode"
android:id="@+id/skip_op"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@ -672,7 +707,6 @@
android:foreground="?attr/selectableItemBackgroundBorderless"
card_view:cardElevation="0dp"
android:id="@+id/skip_op"
>
<LinearLayout
android:layout_width="wrap_content"
@ -705,6 +739,11 @@
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:nextFocusLeft="@id/skip_op"
android:nextFocusRight="@id/lock_player"
android:id="@+id/skip_episode"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@ -716,7 +755,6 @@
card_view:cardBackgroundColor="@color/transparent"
android:foreground="?attr/selectableItemBackgroundBorderless"
card_view:cardElevation="0dp"
android:id="@+id/skip_episode"
>
<LinearLayout
android:layout_width="wrap_content"

View File

@ -34,6 +34,9 @@
android:layout_height="wrap_content">
</TextView>
<ListView
android:nextFocusRight="@id/apply_btt"
android:nextFocusLeft="@id/sort_subtitles"
android:id="@+id/sort_providers"
android:background="?attr/primaryBlackBackground"
tools:listitem="@layout/sort_bottom_single_choice"
@ -58,6 +61,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:nextFocusRight="@id/sort_providers"
android:nextFocusDown="@id/sort_subtitles"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
@ -84,6 +90,9 @@
</FrameLayout>
<ListView
android:nextFocusRight="@id/cancel_btt"
android:nextFocusLeft="@id/sort_providers"
android:id="@+id/sort_subtitles"
android:background="?attr/primaryBlackBackground"
tools:listitem="@layout/sort_bottom_single_choice"
@ -103,17 +112,23 @@
android:layout_height="60dp">
<com.google.android.material.button.MaterialButton
android:nextFocusRight="@id/cancel_btt"
android:nextFocusLeft="@id/cancel_btt"
android:id="@+id/apply_btt"
style="@style/WhiteButton"
android:layout_gravity="center_vertical|end"
android:text="@string/sort_apply"
android:id="@+id/apply_btt"
android:layout_width="wrap_content"
/>
<com.google.android.material.button.MaterialButton
android:nextFocusRight="@id/apply_btt"
android:nextFocusLeft="@id/apply_btt"
android:id="@+id/cancel_btt"
style="@style/BlackButton"
android:layout_gravity="center_vertical|end"
android:text="@string/sort_cancel"
android:id="@+id/cancel_btt"
android:layout_width="wrap_content"
/>
</LinearLayout>

View File

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:background="@null"
android:layout_height="match_parent">
<TextView
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:layout_marginTop="20dp"
android:layout_marginBottom="10dp"
android:textStyle="bold"
android:text="@string/player_speed"
android:textSize="20sp"
android:textColor="?attr/textColor"
android:layout_width="match_parent"
android:layout_rowWeight="1"
android:layout_height="wrap_content">
</TextView>
<ListView
android:layout_marginTop="-10dp"
android:paddingTop="10dp"
android:id="@+id/sort_speed"
android:background="?attr/primaryBlackBackground"
tools:listitem="@layout/sort_bottom_single_choice"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_rowWeight="1"
/>
</LinearLayout>

View File

@ -8,17 +8,24 @@
android:layout_height="match_parent">
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/toggle1"
android:layout_marginTop="10dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:textStyle="bold"
android:textSize="20sp"
android:textColor="?attr/textColor"
android:id="@+id/toggle1"
tools:text="Search" android:layout_width="match_parent" android:layout_height="wrap_content">
tools:text="Search"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</com.google.android.material.switchmaterial.SwitchMaterial>
<ListView
android:nextFocusRight="@id/cancel_btt"
android:nextFocusLeft="@id/apply_btt"
android:id="@+id/listview1"
android:layout_marginTop="-10dp"
android:layout_marginBottom="60dp"
@ -29,6 +36,9 @@
android:layout_rowWeight="1"
/>
<ListView
android:nextFocusRight="@id/cancel_btt"
android:nextFocusLeft="@id/apply_btt"
android:id="@+id/listview2"
android:layout_marginTop="-10dp"
android:layout_marginBottom="60dp"
@ -48,17 +58,23 @@
android:layout_height="60dp">
<com.google.android.material.button.MaterialButton
android:nextFocusRight="@id/cancel_btt"
android:nextFocusLeft="@id/cancel_btt"
android:id="@+id/apply_btt"
style="@style/WhiteButton"
android:layout_gravity="center_vertical|end"
android:text="@string/sort_apply"
android:id="@+id/apply_btt"
android:layout_width="wrap_content"
/>
<com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/apply_btt"
android:nextFocusRight="@id/apply_btt"
android:id="@+id/cancel_btt"
style="@style/BlackButton"
android:layout_gravity="center_vertical|end"
android:text="@string/sort_cancel"
android:id="@+id/cancel_btt"
android:layout_width="wrap_content"
/>
</LinearLayout>

View File

@ -1,15 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:nextFocusLeft="@id/result_episode_download"
android:nextFocusRight="@id/result_episode_download"
android:id="@+id/episode_holder"
android:layout_width="match_parent"
android:layout_height="50dp"
app:cardCornerRadius="@dimen/roundedImageRadius"
app:cardBackgroundColor="@color/transparent"
app:cardElevation="0dp"
android:id="@+id/episode_holder"
android:foreground="?android:attr/selectableItemBackgroundBorderless"
android:foreground="@drawable/outline_drawable"
android:layout_marginBottom="5dp"
>
<!-- IDK BUT THIS DOES NOT SEAM LIKE A GOOD WAY OF DOING IT -->
@ -99,6 +104,10 @@
android:visibility="visible"
/>
<ImageView
android:nextFocusLeft="@id/episode_holder"
android:nextFocusRight="@id/episode_holder"
android:id="@+id/result_episode_download"
android:visibility="visible"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
@ -106,7 +115,6 @@
android:layout_gravity="center_vertical"
android:padding="2dp"
android:layout_width="30dp"
android:id="@+id/result_episode_download"
android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_baseline_play_arrow_24"
android:contentDescription="@string/download"/>

View File

@ -1,14 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:nextFocusLeft="@id/episode_poster"
android:nextFocusRight="@id/result_episode_download"
android:id="@+id/episode_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="@dimen/roundedImageRadius"
app:cardBackgroundColor="@color/itemBackground"
android:id="@+id/episode_holder"
android:foreground="?android:attr/selectableItemBackgroundBorderless"
android:foreground="@drawable/outline_drawable"
android:layout_marginBottom="10dp"
>
<LinearLayout
@ -26,8 +31,11 @@
android:layout_height="72dp"
>
<ImageView
android:foreground="?android:attr/selectableItemBackground"
android:nextFocusLeft="@id/result_episode_download"
android:nextFocusRight="@id/episode_holder"
android:id="@+id/episode_poster"
android:foreground="@drawable/outline_drawable"
tools:src="@drawable/example_poster"
android:scaleType="centerCrop"
android:layout_width="match_parent"
@ -98,6 +106,10 @@
android:visibility="visible"
/>
<ImageView
android:nextFocusLeft="@id/episode_poster"
android:nextFocusRight="@id/episode_holder"
android:id="@+id/result_episode_download"
android:visibility="visible"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
@ -105,7 +117,6 @@
android:layout_gravity="center_vertical"
android:padding="2dp"
android:layout_width="30dp"
android:id="@+id/result_episode_download"
android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_baseline_play_arrow_24"
android:contentDescription="@string/download"/>

View File

@ -6,12 +6,12 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:foreground="@drawable/outline_drawable"
android:focusable="true"
android:clickable="true"
android:id="@+id/search_result_root"
>
<androidx.cardview.widget.CardView
android:foreground="?android:attr/selectableItemBackgroundBorderless"
android:layout_margin="2dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -23,8 +23,9 @@
>
<ImageView
android:duplicateParentState="true"
android:id="@+id/imageView"
android:duplicateParentState="true"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -39,6 +40,8 @@
android:layout_gravity="bottom" tools:ignore="ContentDescription">
</ImageView>
<TextView
android:id="@+id/imageText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
@ -46,7 +49,6 @@
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:textColor="@color/textColor"
android:id="@+id/imageText"
android:textStyle="bold"
android:maxLines="2"
android:paddingStart="5dp"
@ -54,9 +56,10 @@
android:ellipsize="end"
/>
<TextView
android:text="Movie"
android:visibility="gone"
android:id="@+id/text_type"
tools:text="Movie"
android:visibility="gone"
android:textColor="@color/textColor"
android:paddingRight="10dp"
android:paddingLeft="10dp"
@ -92,12 +95,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--
<ImageView android:id="@+id/text_is_dub" android:tint="?attr/colorPrimary"
android:src="@drawable/ic_baseline_subtitles_24" android:layout_width="wrap_content"
android:layout_height="20dp">
<!--
<ImageView android:id="@+id/text_is_dub" android:tint="?attr/colorPrimary"
android:src="@drawable/ic_baseline_subtitles_24" android:layout_width="wrap_content"
android:layout_height="20dp">
</ImageView>-->
</ImageView>-->
<TextView
android:text="@string/app_dubbed_text"
android:id="@+id/text_is_dub"

View File

@ -65,6 +65,7 @@
<style name="AppModalStyle"
parent="Widget.Design.BottomSheet.Modal">
<item name="android:background">@drawable/rounded_dialog</item>
<item name="behavior_peekHeight">512dp</item>
</style>
@ -153,13 +154,17 @@
<item name="android:padding">5dp</item>
<item name="android:layout_marginStart">5dp</item>
<item name="android:layout_marginEnd">5dp</item>
<item name="android:layout_height">50dp</item>
<item name="android:layout_height">40dp</item>
<item name="android:textStyle">bold</item>
<item name="android:textAllCaps">false</item>
<item name="iconGravity">textStart</item>
<item name="iconSize">20dp</item>
<item name="cornerRadius">4dp</item>
<item name="android:textSize">15sp</item>
<item name="android:insetTop">0dp</item>
<item name="android:insetBottom">0dp</item>
<item name="android:foreground">@drawable/outline_drawable</item>
</style>
<style name="WhiteButton" parent="NiceButton">
@ -167,7 +172,7 @@
<item name="backgroundTint">?attr/textColor</item>
<item name="iconTint">?attr/iconGrayBackground</item>
<item name="android:textColor">?attr/iconGrayBackground</item>
<item name="rippleColor">?attr/iconGrayBackground</item>
<item name="rippleColor">?attr/primaryBlackBackground</item>
</style>
<style name="BlackButton" parent="NiceButton">
@ -177,6 +182,12 @@
<item name="android:textColor">?attr/textColor</item>
<item name="rippleColor">?attr/textColor</item>
</style>
<style name="MultiSelectButton" parent="BlackButton">
<item name="android:layout_height">40dp</item>
<item name="android:layout_width">wrap_content</item>
</style>
<!--@color/white ?attr/colorPrimary-->
<!--CHECK ?attr/darkBackground ?attr/colorPrimary-->
<!-- CHROMECAST -->