android TV homepage redesign

This commit is contained in:
LagradOst 2022-01-24 21:39:22 +01:00
parent 6677d6aaee
commit e2405f2526
4 changed files with 705 additions and 118 deletions

View File

@ -55,8 +55,38 @@ import com.lagradost.cloudstream3.utils.UIHelper.getSpanCount
import com.lagradost.cloudstream3.utils.UIHelper.popupMenuNoIcons import com.lagradost.cloudstream3.utils.UIHelper.popupMenuNoIcons
import com.lagradost.cloudstream3.utils.UIHelper.popupMenuNoIconsAndNoStringRes import com.lagradost.cloudstream3.utils.UIHelper.popupMenuNoIconsAndNoStringRes
import com.lagradost.cloudstream3.utils.UIHelper.setImage import com.lagradost.cloudstream3.utils.UIHelper.setImage
import com.lagradost.cloudstream3.utils.UIHelper.setImageBlur
import com.lagradost.cloudstream3.widget.CenterZoomLayoutManager import com.lagradost.cloudstream3.widget.CenterZoomLayoutManager
import kotlinx.android.synthetic.main.fragment_home.* import kotlinx.android.synthetic.main.fragment_home.*
import kotlinx.android.synthetic.main.fragment_home.home_api_fab
import kotlinx.android.synthetic.main.fragment_home.home_bookmarked_child_more_info
import kotlinx.android.synthetic.main.fragment_home.home_bookmarked_child_recyclerview
import kotlinx.android.synthetic.main.fragment_home.home_bookmarked_holder
import kotlinx.android.synthetic.main.fragment_home.home_change_api
import kotlinx.android.synthetic.main.fragment_home.home_change_api_loading
import kotlinx.android.synthetic.main.fragment_home.home_loaded
import kotlinx.android.synthetic.main.fragment_home.home_loading
import kotlinx.android.synthetic.main.fragment_home.home_loading_error
import kotlinx.android.synthetic.main.fragment_home.home_loading_shimmer
import kotlinx.android.synthetic.main.fragment_home.home_loading_statusbar
import kotlinx.android.synthetic.main.fragment_home.home_main_poster_recyclerview
import kotlinx.android.synthetic.main.fragment_home.home_master_recycler
import kotlinx.android.synthetic.main.fragment_home.home_plan_to_watch_btt
import kotlinx.android.synthetic.main.fragment_home.home_provider_meta_info
import kotlinx.android.synthetic.main.fragment_home.home_provider_name
import kotlinx.android.synthetic.main.fragment_home.home_reload_connection_open_in_browser
import kotlinx.android.synthetic.main.fragment_home.home_reload_connectionerror
import kotlinx.android.synthetic.main.fragment_home.home_statusbar
import kotlinx.android.synthetic.main.fragment_home.home_type_completed_btt
import kotlinx.android.synthetic.main.fragment_home.home_type_dropped_btt
import kotlinx.android.synthetic.main.fragment_home.home_type_on_hold_btt
import kotlinx.android.synthetic.main.fragment_home.home_type_watching_btt
import kotlinx.android.synthetic.main.fragment_home.home_watch_child_more_info
import kotlinx.android.synthetic.main.fragment_home.home_watch_child_recyclerview
import kotlinx.android.synthetic.main.fragment_home.home_watch_holder
import kotlinx.android.synthetic.main.fragment_home.home_watch_parent_item_title
import kotlinx.android.synthetic.main.fragment_home.result_error_text
import kotlinx.android.synthetic.main.fragment_home_tv.*
import java.util.* import java.util.*
const val HOME_BOOKMARK_VALUE_LIST = "home_bookmarked_last_list" const val HOME_BOOKMARK_VALUE_LIST = "home_bookmarked_last_list"
@ -73,8 +103,10 @@ class HomeFragment : Fragment() {
bottomSheetDialogBuilder.setContentView(R.layout.home_episodes_expanded) bottomSheetDialogBuilder.setContentView(R.layout.home_episodes_expanded)
val title = bottomSheetDialogBuilder.findViewById<TextView>(R.id.home_expanded_text)!! val title = bottomSheetDialogBuilder.findViewById<TextView>(R.id.home_expanded_text)!!
title.text = item.name title.text = item.name
val recycle = bottomSheetDialogBuilder.findViewById<AutofitRecyclerView>(R.id.home_expanded_recycler)!! val recycle =
val titleHolder = bottomSheetDialogBuilder.findViewById<FrameLayout>(R.id.home_expanded_drag_down)!! bottomSheetDialogBuilder.findViewById<AutofitRecyclerView>(R.id.home_expanded_recycler)!!
val titleHolder =
bottomSheetDialogBuilder.findViewById<FrameLayout>(R.id.home_expanded_drag_down)!!
titleHolder.setOnClickListener { titleHolder.setOnClickListener {
bottomSheetDialogBuilder.dismissSafe(this) bottomSheetDialogBuilder.dismissSafe(this)
@ -125,7 +157,8 @@ class HomeFragment : Fragment() {
var currentValidApis: MutableList<MainAPI> = mutableListOf() var currentValidApis: MutableList<MainAPI> = mutableListOf()
val preSelectedTypes = this.getKey<List<String>>(HOME_PREF_HOMEPAGE) val preSelectedTypes = this.getKey<List<String>>(HOME_PREF_HOMEPAGE)
?.mapNotNull { listName -> TvType.values().firstOrNull { it.name == listName } }?.toMutableList() ?.mapNotNull { listName -> TvType.values().firstOrNull { it.name == listName } }
?.toMutableList()
?: mutableListOf(TvType.Movie, TvType.TvSeries) ?: mutableListOf(TvType.Movie, TvType.TvSeries)
val anime = dialog.findViewById<MaterialButton>(R.id.home_select_anime) val anime = dialog.findViewById<MaterialButton>(R.id.home_select_anime)
@ -190,7 +223,8 @@ class HomeFragment : Fragment() {
} }
for ((button, validTypes) in pairList) { for ((button, validTypes) in pairList) {
val isValid = validAPIs.any { api -> validTypes.any { api.supportedTypes.contains(it) } } val isValid =
validAPIs.any { api -> validTypes.any { api.supportedTypes.contains(it) } }
button?.isVisible = isValid button?.isVisible = isValid
if (isValid) { if (isValid) {
fun buttonContains(): Boolean { fun buttonContains(): Boolean {
@ -235,14 +269,16 @@ class HomeFragment : Fragment() {
): View? { ): View? {
//homeViewModel = //homeViewModel =
// ViewModelProvider(this).get(HomeViewModel::class.java) // ViewModelProvider(this).get(HomeViewModel::class.java)
val layout =
return inflater.inflate(R.layout.fragment_home, container, false) if (context?.isTvSettings() == true) R.layout.fragment_home_tv else R.layout.fragment_home
return inflater.inflate(layout, container, false)
} }
private var currentHomePage: HomePageResponse? = null private var currentHomePage: HomePageResponse? = null
private fun toggleMainVisibility(visible: Boolean) { private fun toggleMainVisibility(visible: Boolean) {
home_main_holder.isVisible = visible home_main_holder?.isVisible = visible
home_main_poster_recyclerview?.isVisible = visible
} }
private fun fixGrid() { private fun fixGrid() {
@ -295,7 +331,20 @@ class HomeFragment : Fragment() {
} }
}*/ }*/
var currentApiName: String? = null private fun focusCallback(card : SearchResponse) {
home_focus_text?.text = card.name
home_blur_poster?.setImageBlur(card.posterUrl,50)
}
private fun homeHandleSearch(callback : SearchClickCallback) {
if(callback.action == SEARCH_ACTION_FOCUSED) {
focusCallback(callback.card)
} else {
handleSearchClickCallback(activity, callback)
}
}
private var currentApiName: String? = null
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@ -321,7 +370,8 @@ class HomeFragment : Fragment() {
Pair(R.string.anime, listOf(TvType.Anime, TvType.ONA, TvType.AnimeMovie)), Pair(R.string.anime, listOf(TvType.Anime, TvType.ONA, TvType.AnimeMovie)),
Pair(R.string.torrent, listOf(TvType.Torrent)), Pair(R.string.torrent, listOf(TvType.Torrent)),
).filter { item -> currentApi.supportedTypes.any { type -> item.second.contains(type) } } ).filter { item -> currentApi.supportedTypes.any { type -> item.second.contains(type) } }
home_provider_meta_info?.text = typeChoices.joinToString(separator = ", ") { getString(it.first) } home_provider_meta_info?.text =
typeChoices.joinToString(separator = ", ") { getString(it.first) }
home_provider_meta_info?.isVisible = true home_provider_meta_info?.isVisible = true
} }
} }
@ -338,15 +388,16 @@ class HomeFragment : Fragment() {
} }
val randomSize = items.size val randomSize = items.size
home_main_poster_recyclerview.adapter = home_main_poster_recyclerview?.adapter =
HomeChildItemAdapter( HomeChildItemAdapter(
items, items,
R.layout.home_result_big_grid, R.layout.home_result_big_grid,
nextFocusUp = home_main_poster_recyclerview.nextFocusUpId, nextFocusUp = home_main_poster_recyclerview.nextFocusUpId,
nextFocusDown = home_main_poster_recyclerview.nextFocusDownId nextFocusDown = home_main_poster_recyclerview.nextFocusDownId
) { callback -> ) { callback ->
handleSearchClickCallback(activity, callback) homeHandleSearch(callback)
} }
if (context?.isTvSettings() == false) {
home_main_poster_recyclerview?.post { home_main_poster_recyclerview?.post {
(home_main_poster_recyclerview?.layoutManager as CenterZoomLayoutManager?)?.let { manager -> (home_main_poster_recyclerview?.layoutManager as CenterZoomLayoutManager?)?.let { manager ->
manager.updateSize(forceUpdate = true) manager.updateSize(forceUpdate = true)
@ -361,6 +412,11 @@ class HomeFragment : Fragment() {
} }
} }
} }
} else {
items.firstOrNull()?.let {
focusCallback(it)
}
}
toggleMainVisibility(true) toggleMainVisibility(true)
} }
} }
@ -425,8 +481,9 @@ class HomeFragment : Fragment() {
} }
val adapter: RecyclerView.Adapter<RecyclerView.ViewHolder> = ParentItemAdapter(listOf(), { callback -> val adapter: RecyclerView.Adapter<RecyclerView.ViewHolder> =
handleSearchClickCallback(activity, callback) ParentItemAdapter(listOf(), { callback ->
homeHandleSearch(callback)
}, { item -> }, { item ->
activity?.loadHomepageList(item) activity?.loadHomepageList(item)
}) })
@ -447,7 +504,8 @@ class HomeFragment : Fragment() {
item.first?.setOnLongClickListener { itemView -> item.first?.setOnLongClickListener { itemView ->
val list = EnumSet.noneOf(WatchType::class.java) val list = EnumSet.noneOf(WatchType::class.java)
itemView.context.getKey<IntArray>(HOME_BOOKMARK_VALUE_LIST)?.map { WatchType.fromInternalId(it) }?.let { itemView.context.getKey<IntArray>(HOME_BOOKMARK_VALUE_LIST)
?.map { WatchType.fromInternalId(it) }?.let {
list.addAll(it) list.addAll(it)
} }
@ -492,7 +550,8 @@ class HomeFragment : Fragment() {
home_bookmarked_holder.isVisible = pair.first home_bookmarked_holder.isVisible = pair.first
val bookmarks = pair.second val bookmarks = pair.second
(home_bookmarked_child_recyclerview?.adapter as HomeChildItemAdapter?)?.cardList = bookmarks (home_bookmarked_child_recyclerview?.adapter as HomeChildItemAdapter?)?.cardList =
bookmarks
home_bookmarked_child_recyclerview?.adapter?.notifyDataSetChanged() home_bookmarked_child_recyclerview?.adapter?.notifyDataSetChanged()
home_bookmarked_child_more_info?.setOnClickListener { home_bookmarked_child_more_info?.setOnClickListener {
@ -507,13 +566,15 @@ class HomeFragment : Fragment() {
observe(homeViewModel.resumeWatching) { resumeWatching -> observe(homeViewModel.resumeWatching) { resumeWatching ->
home_watch_holder?.isVisible = resumeWatching.isNotEmpty() home_watch_holder?.isVisible = resumeWatching.isNotEmpty()
(home_watch_child_recyclerview?.adapter as HomeChildItemAdapter?)?.cardList = resumeWatching (home_watch_child_recyclerview?.adapter as HomeChildItemAdapter?)?.cardList =
resumeWatching
home_watch_child_recyclerview?.adapter?.notifyDataSetChanged() home_watch_child_recyclerview?.adapter?.notifyDataSetChanged()
home_watch_child_more_info?.setOnClickListener { home_watch_child_more_info?.setOnClickListener {
activity?.loadHomepageList( activity?.loadHomepageList(
HomePageList( HomePageList(
home_watch_parent_item_title?.text?.toString() ?: getString(R.string.continue_watching), home_watch_parent_item_title?.text?.toString()
?: getString(R.string.continue_watching),
resumeWatching resumeWatching
) )
) )
@ -528,7 +589,14 @@ class HomeFragment : Fragment() {
if (callback.action == SEARCH_ACTION_SHOW_METADATA) { if (callback.action == SEARCH_ACTION_SHOW_METADATA) {
val id = callback.card.id val id = callback.card.id
if (id != null) { if (id != null) {
callback.view.popupMenuNoIcons(listOf(Pair(0, R.string.action_remove_from_bookmarks))) { callback.view.popupMenuNoIcons(
listOf(
Pair(
0,
R.string.action_remove_from_bookmarks
)
)
) {
if (itemId == 0) { if (itemId == 0) {
setResultWatchState(id, WatchType.NONE.internalId) setResultWatchState(id, WatchType.NONE.internalId)
reloadStored() reloadStored()
@ -536,11 +604,11 @@ class HomeFragment : Fragment() {
} }
} }
} else { } else {
handleSearchClickCallback(activity, callback) homeHandleSearch(callback)
} }
} }
home_watch_child_recyclerview.adapter = HomeChildItemAdapter( home_watch_child_recyclerview?.adapter = HomeChildItemAdapter(
ArrayList(), ArrayList(),
nextFocusUp = home_watch_child_recyclerview?.nextFocusUpId, nextFocusUp = home_watch_child_recyclerview?.nextFocusUpId,
nextFocusDown = home_watch_child_recyclerview?.nextFocusDownId nextFocusDown = home_watch_child_recyclerview?.nextFocusDownId
@ -557,7 +625,12 @@ class HomeFragment : Fragment() {
if (itemId == 1) { if (itemId == 1) {
handleSearchClickCallback( handleSearchClickCallback(
activity, activity,
SearchClickCallback(SEARCH_ACTION_LOAD, callback.view, -1, callback.card) SearchClickCallback(
SEARCH_ACTION_LOAD,
callback.view,
-1,
callback.card
)
) )
reloadStored() reloadStored()
} }
@ -571,34 +644,43 @@ class HomeFragment : Fragment() {
} }
} }
} else { } else {
handleSearchClickCallback(activity, callback) homeHandleSearch(callback)
} }
} }
context?.fixPaddingStatusbarView(home_statusbar) context?.fixPaddingStatusbarView(home_statusbar)
context?.fixPaddingStatusbar(home_loading_statusbar) context?.fixPaddingStatusbar(home_loading_statusbar)
home_master_recycler.adapter = adapter home_master_recycler.adapter = adapter
home_master_recycler.layoutManager = GridLayoutManager(context, 1) home_master_recycler.layoutManager = GridLayoutManager(context, 1)
if (context?.isTvSettings() == false) {
LinearSnapHelper().attachToRecyclerView(home_main_poster_recyclerview) // snap LinearSnapHelper().attachToRecyclerView(home_main_poster_recyclerview) // snap
val centerLayoutManager = CenterZoomLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) val centerLayoutManager =
CenterZoomLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
centerLayoutManager.setOnSizeListener { index -> centerLayoutManager.setOnSizeListener { index ->
(home_main_poster_recyclerview?.adapter as HomeChildItemAdapter?)?.cardList?.get(index)?.let { random -> (home_main_poster_recyclerview?.adapter as HomeChildItemAdapter?)?.cardList?.get(
home_main_play.setOnClickListener { index
)?.let { random ->
home_main_play?.setOnClickListener {
activity.loadSearchResult(random, START_ACTION_RESUME_LATEST) activity.loadSearchResult(random, START_ACTION_RESUME_LATEST)
} }
home_main_info.setOnClickListener { home_main_info?.setOnClickListener {
activity.loadSearchResult(random) activity.loadSearchResult(random)
} }
home_main_text.text = home_main_text?.text =
random.name + if (random is AnimeSearchResponse && !random.dubStatus.isNullOrEmpty()) { random.name + if (random is AnimeSearchResponse && !random.dubStatus.isNullOrEmpty()) {
random.dubStatus.joinToString(prefix = "", separator = " | ") { it.name } random.dubStatus.joinToString(
prefix = "",
separator = " | "
) { it.name }
} else "" } else ""
} }
} }
home_main_poster_recyclerview?.layoutManager = centerLayoutManager // scale home_main_poster_recyclerview?.layoutManager = centerLayoutManager // scale
}
reloadStored() reloadStored()
val apiName = context?.getKey<String>(HOMEPAGE_API) val apiName = context?.getKey<String>(HOMEPAGE_API)

View File

@ -36,6 +36,7 @@ import androidx.fragment.app.FragmentActivity
import androidx.navigation.fragment.NavHostFragment import androidx.navigation.fragment.NavHostFragment
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import com.bumptech.glide.load.model.GlideUrl import com.bumptech.glide.load.model.GlideUrl
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.mvvm.logError import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTvSettings import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTvSettings
@ -69,7 +70,7 @@ object UIHelper {
) )
} }
fun Activity?.getSpanCount() : Int? { fun Activity?.getSpanCount(): Int? {
val compactView = this?.getGridIsCompact() ?: return null val compactView = this?.getGridIsCompact() ?: return null
val spanCountLandscape = if (compactView) 2 else 6 val spanCountLandscape = if (compactView) 2 else 6
val spanCountPortrait = if (compactView) 1 else 3 val spanCountPortrait = if (compactView) 1 else 3
@ -122,18 +123,23 @@ object UIHelper {
if (this == null || url.isNullOrBlank()) return if (this == null || url.isNullOrBlank()) return
try { try {
GlideApp.with(this.context) GlideApp.with(this.context)
.load(GlideUrl(url)) .load(GlideUrl(url)).transition(
DrawableTransitionOptions.withCrossFade()
)
.into(this) .into(this)
} catch (e: Exception) { } catch (e: Exception) {
logError(e) logError(e)
} }
} }
fun ImageView?.setImageBlur(url: String?, radius : Int, sample : Int = 3) { fun ImageView?.setImageBlur(url: String?, radius: Int, sample: Int = 3) {
if (this == null || url.isNullOrBlank()) return if (this == null || url.isNullOrBlank()) return
try { try {
GlideApp.with(this.context) GlideApp.with(this.context)
.load(GlideUrl(url)).apply(bitmapTransform(BlurTransformation(radius, sample))) .load(GlideUrl(url)).apply(bitmapTransform(BlurTransformation(radius, sample)))
.transition(
DrawableTransitionOptions.withCrossFade()
)
.into(this) .into(this)
} catch (e: Exception) { } catch (e: Exception) {
logError(e) logError(e)
@ -236,7 +242,7 @@ object UIHelper {
}*/ }*/
fun Context.getStatusBarHeight(): Int { fun Context.getStatusBarHeight(): Int {
if(isTvSettings()) { if (isTvSettings()) {
return 0 return 0
} }
@ -249,7 +255,12 @@ object UIHelper {
} }
fun Context.fixPaddingStatusbar(v: View) { fun Context.fixPaddingStatusbar(v: View) {
v.setPadding(v.paddingLeft, v.paddingTop + getStatusBarHeight(), v.paddingRight, v.paddingBottom) v.setPadding(
v.paddingLeft,
v.paddingTop + getStatusBarHeight(),
v.paddingRight,
v.paddingBottom
)
} }
fun Context.fixPaddingStatusbarView(v: View) { fun Context.fixPaddingStatusbarView(v: View) {
@ -310,8 +321,11 @@ object UIHelper {
fun Context.shouldShowPIPMode(isInPlayer: Boolean): Boolean { fun Context.shouldShowPIPMode(isInPlayer: Boolean): Boolean {
return try { return try {
val settingsManager = PreferenceManager.getDefaultSharedPreferences(this) val settingsManager = PreferenceManager.getDefaultSharedPreferences(this)
settingsManager?.getBoolean(getString(R.string.pip_enabled_key), true) ?: true && isInPlayer settingsManager?.getBoolean(
} catch (e : Exception) { getString(R.string.pip_enabled_key),
true
) ?: true && isInPlayer
} catch (e: Exception) {
logError(e) logError(e)
false false
} }
@ -329,13 +343,15 @@ object UIHelper {
} }
fun hideKeyboard(view: View) { fun hideKeyboard(view: View) {
val inputMethodManager = view.context.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager? val inputMethodManager =
view.context.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager?
inputMethodManager?.hideSoftInputFromWindow(view.windowToken, 0) inputMethodManager?.hideSoftInputFromWindow(view.windowToken, 0)
} }
fun showInputMethod(view: View?) { fun showInputMethod(view: View?) {
if(view == null) return if (view == null) return
val inputMethodManager = view.context.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager? val inputMethodManager =
view.context.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager?
inputMethodManager?.showSoftInput(view, 0) inputMethodManager?.showSoftInput(view, 0)
} }

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -15,13 +14,14 @@
android:id="@+id/home_loading" android:id="@+id/home_loading"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ProgressBar <ProgressBar
android:layout_gravity="center" android:layout_gravity="center"
android:visibility="gone" android:visibility="gone"
tools:visibility="gone" tools:visibility="gone"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp"> android:layout_height="50dp" />
</ProgressBar>
<com.facebook.shimmer.ShimmerFrameLayout <com.facebook.shimmer.ShimmerFrameLayout
android:id="@+id/home_loading_shimmer" android:id="@+id/home_loading_shimmer"
app:shimmer_base_alpha="0.2" app:shimmer_base_alpha="0.2"
@ -34,14 +34,17 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <FrameLayout
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:layout_margin="@dimen/loading_margin" android:layout_margin="@dimen/loading_margin"
android:layout_gravity="center" android:layout_gravity="center"
@ -49,16 +52,16 @@
android:background="@color/grayShimmer" android:background="@color/grayShimmer"
android:translationX="-164dp" android:translationX="-164dp"
android:layout_width="125dp" android:layout_width="125dp"
android:layout_height="200dp"> android:layout_height="200dp" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:layout_margin="@dimen/loading_margin" android:layout_margin="@dimen/loading_margin"
android:layout_gravity="center" android:layout_gravity="center"
app:cardCornerRadius="@dimen/loading_radius" app:cardCornerRadius="@dimen/loading_radius"
android:background="@color/grayShimmer" android:background="@color/grayShimmer"
android:layout_width="148dp" android:layout_width="148dp"
android:layout_height="234dp"> android:layout_height="234dp" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:layout_margin="@dimen/loading_margin" android:layout_margin="@dimen/loading_margin"
android:layout_gravity="center" android:layout_gravity="center"
@ -66,10 +69,10 @@
android:background="@color/grayShimmer" android:background="@color/grayShimmer"
android:translationX="164dp" android:translationX="164dp"
android:layout_width="125dp" android:layout_width="125dp"
android:layout_height="200dp"> android:layout_height="200dp" />
</androidx.cardview.widget.CardView>
</FrameLayout> </FrameLayout>
<include layout="@layout/loading_line_short_center"/>
<include layout="@layout/loading_line_short_center" />
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
@ -77,11 +80,14 @@
android:layout_marginStart="@dimen/result_padding" android:layout_marginStart="@dimen/result_padding"
android:layout_marginEnd="@dimen/result_padding" android:layout_marginEnd="@dimen/result_padding"
android:layout_width="match_parent" android:layout_height="wrap_content"> android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/loading_list"/> <include layout="@layout/loading_list" />
<include layout="@layout/loading_list"/>
<include layout="@layout/loading_list"/> <include layout="@layout/loading_list" />
<include layout="@layout/loading_list" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</com.facebook.shimmer.ShimmerFrameLayout> </com.facebook.shimmer.ShimmerFrameLayout>
@ -90,6 +96,7 @@
android:id="@+id/home_loading_statusbar" android:id="@+id/home_loading_statusbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp"> android:layout_height="70dp">
<ImageView <ImageView
android:id="@+id/home_change_api_loading" android:id="@+id/home_change_api_loading"
android:layout_margin="10dp" android:layout_margin="10dp"
@ -99,8 +106,7 @@
android:src="@drawable/ic_baseline_keyboard_arrow_down_24" android:src="@drawable/ic_baseline_keyboard_arrow_down_24"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:contentDescription="@string/home_change_provider_img_des"> android:contentDescription="@string/home_change_provider_img_des" />
</ImageView>
</FrameLayout> </FrameLayout>
</FrameLayout> </FrameLayout>
@ -112,6 +118,7 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:layout_gravity="center" android:layout_gravity="center"
style="@style/WhiteButton" style="@style/WhiteButton"
@ -122,8 +129,8 @@
android:text="@string/reload_error" android:text="@string/reload_error"
android:id="@+id/home_reload_connectionerror" android:id="@+id/home_reload_connectionerror"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:minWidth="200dp" android:minWidth="200dp" />
/>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:layout_gravity="center" android:layout_gravity="center"
style="@style/BlackButton" style="@style/BlackButton"
@ -134,8 +141,8 @@
android:text="@string/result_open_in_browser" android:text="@string/result_open_in_browser"
android:id="@+id/home_reload_connection_open_in_browser" android:id="@+id/home_reload_connection_open_in_browser"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:minWidth="200dp" android:minWidth="200dp" />
/>
<TextView <TextView
android:layout_margin="5dp" android:layout_margin="5dp"
android:gravity="center" android:gravity="center"
@ -143,9 +150,9 @@
android:id="@+id/result_error_text" android:id="@+id/result_error_text"
android:textColor="?attr/textColor" android:textColor="?attr/textColor"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
/>
</LinearLayout> </LinearLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:background="?attr/primaryBlackBackground" android:background="?attr/primaryBlackBackground"
tools:visibility="visible" tools:visibility="visible"
@ -158,16 +165,19 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<View <View
android:background="?attr/primaryGrayBackground" android:background="?attr/primaryGrayBackground"
android:id="@+id/home_statusbar" android:id="@+id/home_statusbar"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="match_parent"/> android:layout_width="match_parent" />
<FrameLayout <FrameLayout
android:id="@+id/home_settings_bar" android:id="@+id/home_settings_bar"
android:background="?attr/primaryGrayBackground" android:background="?attr/primaryGrayBackground"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp"> android:layout_height="70dp">
<LinearLayout <LinearLayout
android:layout_marginEnd="50dp" android:layout_marginEnd="50dp"
android:paddingTop="10dp" android:paddingTop="10dp"
@ -179,6 +189,7 @@
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/home_profile_picture_holder" android:id="@+id/home_profile_picture_holder"
android:layout_marginEnd="20dp" android:layout_marginEnd="20dp"
@ -186,19 +197,21 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_width="35dp" android:layout_width="35dp"
android:layout_height="35dp"> android:layout_height="35dp">
<ImageView <ImageView
android:id="@+id/home_profile_picture" android:id="@+id/home_profile_picture"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:ignore="ContentDescription"> tools:ignore="ContentDescription" />
</ImageView>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
<LinearLayout <LinearLayout
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<TextView <TextView
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_gravity="center" android:layout_gravity="center"
@ -208,8 +221,8 @@
tools:text="Hello World" tools:text="Hello World"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content" />
</TextView>
<TextView <TextView
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_gravity="center" android:layout_gravity="center"
@ -218,8 +231,7 @@
android:textSize="14sp" android:textSize="14sp"
tools:text="Hello World" tools:text="Hello World"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content" />
</TextView>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
@ -238,7 +250,8 @@
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:contentDescription="@string/home_change_provider_img_des"> android:contentDescription="@string/home_change_provider_img_des">
<requestFocus/>
<requestFocus />
</ImageView> </ImageView>
</FrameLayout> </FrameLayout>
@ -248,6 +261,7 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:descendantFocusability="afterDescendants" android:descendantFocusability="afterDescendants"
android:nextFocusUp="@id/home_change_api" android:nextFocusUp="@id/home_change_api"
@ -262,8 +276,7 @@
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:listitem="@layout/home_result_grid" tools:listitem="@layout/home_result_grid" />
/>
<!--<ImageView <!--<ImageView
android:foreground="@drawable/outline_drawable" android:foreground="@drawable/outline_drawable"
android:id="@+id/home_main_poster" android:id="@+id/home_main_poster"
@ -286,7 +299,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:maxLines="2" android:maxLines="2"
android:ellipsize="end" android:ellipsize="end"
android:layout_height="40sp"/> android:layout_height="40sp" />
<LinearLayout <LinearLayout
android:padding="5dp" android:padding="5dp"
android:layout_gravity="center" android:layout_gravity="center"
@ -309,8 +323,8 @@
app:icon="@drawable/ic_baseline_play_arrow_24" app:icon="@drawable/ic_baseline_play_arrow_24"
android:minWidth="120dp" android:minWidth="120dp"
android:layout_width="wrap_content"> android:layout_width="wrap_content" />
</com.google.android.material.button.MaterialButton>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/home_main_play" android:nextFocusLeft="@id/home_main_play"
android:nextFocusUp="@id/home_main_poster_recyclerview" android:nextFocusUp="@id/home_main_poster_recyclerview"
@ -328,8 +342,7 @@
android:focusable="true" android:focusable="true"
android:minWidth="120dp" android:minWidth="120dp"
android:layout_width="wrap_content"> android:layout_width="wrap_content" />
</com.google.android.material.button.MaterialButton>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
@ -351,12 +364,13 @@
android:padding="12dp" android:padding="12dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <TextView
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:id="@+id/home_watch_parent_item_title" android:id="@+id/home_watch_parent_item_title"
style="@style/WatchHeaderText" style="@style/WatchHeaderText"
android:text="@string/continue_watching" android:text="@string/continue_watching" />
/>
<ImageView <ImageView
app:tint="?attr/textColor" app:tint="?attr/textColor"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
@ -364,8 +378,7 @@
android:src="@drawable/ic_baseline_arrow_forward_24" android:src="@drawable/ic_baseline_arrow_forward_24"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:contentDescription="@string/home_more_info"> android:contentDescription="@string/home_more_info" />
</ImageView>
</FrameLayout> </FrameLayout>
@ -378,8 +391,7 @@
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:listitem="@layout/home_result_grid" tools:listitem="@layout/home_result_grid" />
/>
</LinearLayout> </LinearLayout>
@ -404,52 +416,60 @@
android:paddingEnd="12dp" android:paddingEnd="12dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<HorizontalScrollView <HorizontalScrollView
android:fadingEdge="horizontal" android:fadingEdge="horizontal"
android:requiresFadingEdge="horizontal" android:requiresFadingEdge="horizontal"
android:layout_marginEnd="50dp" android:layout_marginEnd="50dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/nav_rail_view" android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusRight="@id/home_plan_to_watch_btt" android:nextFocusRight="@id/home_plan_to_watch_btt"
android:id="@+id/home_type_watching_btt" android:id="@+id/home_type_watching_btt"
android:text="@string/type_watching" android:text="@string/type_watching"
style="@style/RoundedSelectableButton"/> style="@style/RoundedSelectableButton" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/home_type_watching_btt" android:nextFocusLeft="@id/home_type_watching_btt"
android:nextFocusRight="@id/home_type_on_hold_btt" android:nextFocusRight="@id/home_type_on_hold_btt"
android:id="@+id/home_plan_to_watch_btt" android:id="@+id/home_plan_to_watch_btt"
android:text="@string/type_plan_to_watch" android:text="@string/type_plan_to_watch"
style="@style/RoundedSelectableButton"/> style="@style/RoundedSelectableButton" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/home_plan_to_watch_btt" android:nextFocusLeft="@id/home_plan_to_watch_btt"
android:nextFocusRight="@id/home_type_dropped_btt" android:nextFocusRight="@id/home_type_dropped_btt"
android:id="@+id/home_type_on_hold_btt" android:id="@+id/home_type_on_hold_btt"
android:text="@string/type_on_hold" android:text="@string/type_on_hold"
style="@style/RoundedSelectableButton"/> style="@style/RoundedSelectableButton" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/home_type_on_hold_btt" android:nextFocusLeft="@id/home_type_on_hold_btt"
android:nextFocusRight="@id/home_type_completed_btt" android:nextFocusRight="@id/home_type_completed_btt"
android:id="@+id/home_type_dropped_btt" android:id="@+id/home_type_dropped_btt"
android:text="@string/type_dropped" android:text="@string/type_dropped"
style="@style/RoundedSelectableButton"/> style="@style/RoundedSelectableButton" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/home_type_dropped_btt" android:nextFocusLeft="@id/home_type_dropped_btt"
android:id="@+id/home_type_completed_btt" android:id="@+id/home_type_completed_btt"
android:text="@string/type_completed" android:text="@string/type_completed"
style="@style/RoundedSelectableButton"/> style="@style/RoundedSelectableButton" />
</LinearLayout> </LinearLayout>
</HorizontalScrollView> </HorizontalScrollView>
<ImageView <ImageView
app:tint="?attr/textColor" app:tint="?attr/textColor"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
@ -457,9 +477,9 @@
android:src="@drawable/ic_baseline_arrow_forward_24" android:src="@drawable/ic_baseline_arrow_forward_24"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:contentDescription="@string/home_more_info"> android:contentDescription="@string/home_more_info" />
</ImageView>
</FrameLayout> </FrameLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:paddingHorizontal="5dp" android:paddingHorizontal="5dp"
android:clipToPadding="false" android:clipToPadding="false"
@ -470,8 +490,7 @@
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:listitem="@layout/home_result_grid" tools:listitem="@layout/home_result_grid" />
/>
</LinearLayout> </LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
@ -480,16 +499,15 @@
android:id="@+id/home_master_recycler" android:id="@+id/home_master_recycler"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:listitem="@layout/homepage_parent" tools:listitem="@layout/homepage_parent" />
/>
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:visibility="gone" android:visibility="gone"
tools:visibility="visible" tools:visibility="visible"
android:id="@+id/home_api_fab" android:id="@+id/home_api_fab"
app:icon="@drawable/ic_baseline_filter_list_24" app:icon="@drawable/ic_baseline_filter_list_24"
style="@style/ExtendedFloatingActionButton" style="@style/ExtendedFloatingActionButton"
tools:ignore="ContentDescription"> tools:ignore="ContentDescription" />
</com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton>
</FrameLayout> </FrameLayout>

View File

@ -0,0 +1,471 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/home_root"
tools:context=".ui.home.HomeFragment">
<FrameLayout
android:visibility="gone"
tools:visibility="gone"
android:id="@+id/home_loading"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:layout_gravity="center"
android:visibility="gone"
tools:visibility="gone"
android:layout_width="50dp"
android:layout_height="50dp" />
<com.facebook.shimmer.ShimmerFrameLayout
android:id="@+id/home_loading_shimmer"
app:shimmer_base_alpha="0.2"
app:shimmer_highlight_alpha="0.3"
app:shimmer_duration="@integer/loading_time"
app:shimmer_auto_start="true"
android:paddingTop="40dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:layout_margin="@dimen/loading_margin"
android:layout_gravity="center"
app:cardCornerRadius="@dimen/loading_radius"
android:background="@color/grayShimmer"
android:translationX="-164dp"
android:layout_width="125dp"
android:layout_height="200dp" />
<androidx.cardview.widget.CardView
android:layout_margin="@dimen/loading_margin"
android:layout_gravity="center"
app:cardCornerRadius="@dimen/loading_radius"
android:background="@color/grayShimmer"
android:layout_width="148dp"
android:layout_height="234dp" />
<androidx.cardview.widget.CardView
android:layout_margin="@dimen/loading_margin"
android:layout_gravity="center"
app:cardCornerRadius="@dimen/loading_radius"
android:background="@color/grayShimmer"
android:translationX="164dp"
android:layout_width="125dp"
android:layout_height="200dp" />
</FrameLayout>
<include layout="@layout/loading_line_short_center" />
<LinearLayout
android:orientation="vertical"
android:layout_marginTop="@dimen/result_padding"
android:layout_marginStart="@dimen/result_padding"
android:layout_marginEnd="@dimen/result_padding"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/loading_list" />
<include layout="@layout/loading_list" />
<include layout="@layout/loading_list" />
</LinearLayout>
</LinearLayout>
</com.facebook.shimmer.ShimmerFrameLayout>
<FrameLayout
android:id="@+id/home_loading_statusbar"
android:layout_width="match_parent"
android:layout_height="70dp">
<ImageView
android:id="@+id/home_change_api_loading"
android:layout_margin="10dp"
android:layout_gravity="center_vertical|end"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_baseline_keyboard_arrow_down_24"
android:layout_width="30dp"
android:layout_height="30dp"
android:contentDescription="@string/home_change_provider_img_des" />
</FrameLayout>
</FrameLayout>
<LinearLayout
android:visibility="gone"
tools:visibility="gone"
android:id="@+id/home_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:layout_gravity="center"
style="@style/WhiteButton"
android:layout_margin="5dp"
app:icon="@drawable/ic_baseline_autorenew_24"
android:text="@string/reload_error"
android:id="@+id/home_reload_connectionerror"
android:layout_width="wrap_content"
android:minWidth="200dp" />
<com.google.android.material.button.MaterialButton
android:layout_gravity="center"
style="@style/BlackButton"
android:layout_margin="5dp"
app:icon="@drawable/ic_baseline_public_24"
android:text="@string/result_open_in_browser"
android:id="@+id/home_reload_connection_open_in_browser"
android:layout_width="wrap_content"
android:minWidth="200dp" />
<TextView
android:layout_margin="5dp"
android:gravity="center"
android:layout_gravity="center"
android:id="@+id/result_error_text"
android:textColor="?attr/textColor"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:background="?attr/primaryBlackBackground"
tools:visibility="visible"
android:visibility="gone"
android:id="@+id/home_loaded"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:background="?attr/primaryGrayBackground"
android:id="@+id/home_statusbar"
android:layout_height="wrap_content"
android:layout_width="match_parent" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:scaleType="centerCrop"
tools:src="@drawable/example_poster"
android:id="@+id/home_blur_poster"
android:layout_width="match_parent"
android:layout_height="200dp" />
<ImageView
android:id="@+id/shadow_overlay"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@drawable/background_shadow" />
<LinearLayout
android:layout_marginTop="100dp"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="100dp">
<!--
<androidx.cardview.widget.CardView
android:id="@+id/home_profile_picture_holder"
android:layout_marginEnd="20dp"
app:cardCornerRadius="100dp"
android:layout_gravity="center_vertical"
android:layout_width="35dp"
android:layout_height="35dp">
<ImageView
android:id="@+id/home_profile_picture"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
</androidx.cardview.widget.CardView>-->
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:nextFocusDown="@id/home_main_poster_recyclerview"
android:nextFocusUp="@id/nav_rail_view"
android:nextFocusLeft="@id/nav_rail_view"
android:layout_gravity="center_vertical"
android:id="@+id/home_change_api"
android:layout_margin="10dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:foreground="@drawable/outline_drawable"
android:src="@drawable/ic_baseline_filter_list_24"
android:layout_width="30dp"
android:layout_height="30dp"
android:contentDescription="@string/home_change_provider_img_des">
<requestFocus />
</ImageView>
<TextView
android:maxLines="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:layout_gravity="center_vertical"
android:textStyle="bold"
android:textSize="25sp"
tools:text="The Perfect Run"
android:id="@+id/home_focus_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_marginStart="12dp"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:gravity="center_vertical"
android:id="@+id/home_provider_name"
android:textColor="?attr/grayTextColor"
android:textSize="20sp"
android:paddingEnd="10dp"
tools:text="Hello World"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:gravity="center_vertical"
android:id="@+id/home_provider_meta_info"
android:textColor="?attr/grayTextColor"
android:textSize="20sp"
tools:text="Hello World"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:paddingHorizontal="5dp"
android:clipToPadding="false"
android:descendantFocusability="afterDescendants"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:id="@+id/home_main_poster_recyclerview"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:listitem="@layout/home_result_grid" />
</LinearLayout>
</FrameLayout>
<LinearLayout
android:id="@+id/home_watch_holder"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:nextFocusLeft="@id/nav_rail_view"
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"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_gravity="center_vertical"
android:id="@+id/home_watch_parent_item_title"
style="@style/WatchHeaderText"
android:text="@string/continue_watching" />
<ImageView
app:tint="?attr/textColor"
android:layout_marginEnd="5dp"
android:layout_gravity="end|center_vertical"
android:src="@drawable/ic_baseline_arrow_forward_24"
android:layout_width="30dp"
android:layout_height="match_parent"
android:contentDescription="@string/home_more_info" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:paddingHorizontal="5dp"
android:clipToPadding="false"
android:descendantFocusability="afterDescendants"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:id="@+id/home_watch_child_recyclerview"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:listitem="@layout/home_result_grid" />
</LinearLayout>
<LinearLayout
android:id="@+id/home_bookmarked_holder"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:nextFocusLeft="@id/nav_rail_view"
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:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<HorizontalScrollView
android:fadingEdge="horizontal"
android:requiresFadingEdge="horizontal"
android:layout_marginEnd="50dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusRight="@id/home_plan_to_watch_btt"
android:id="@+id/home_type_watching_btt"
android:text="@string/type_watching"
style="@style/RoundedSelectableButton" />
<com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/home_type_watching_btt"
android:nextFocusRight="@id/home_type_on_hold_btt"
android:id="@+id/home_plan_to_watch_btt"
android:text="@string/type_plan_to_watch"
style="@style/RoundedSelectableButton" />
<com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/home_plan_to_watch_btt"
android:nextFocusRight="@id/home_type_dropped_btt"
android:id="@+id/home_type_on_hold_btt"
android:text="@string/type_on_hold"
style="@style/RoundedSelectableButton" />
<com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/home_type_on_hold_btt"
android:nextFocusRight="@id/home_type_completed_btt"
android:id="@+id/home_type_dropped_btt"
android:text="@string/type_dropped"
style="@style/RoundedSelectableButton" />
<com.google.android.material.button.MaterialButton
android:nextFocusLeft="@id/home_type_dropped_btt"
android:id="@+id/home_type_completed_btt"
android:text="@string/type_completed"
style="@style/RoundedSelectableButton" />
</LinearLayout>
</HorizontalScrollView>
<ImageView
app:tint="?attr/textColor"
android:layout_marginEnd="5dp"
android:layout_gravity="end|center_vertical"
android:src="@drawable/ic_baseline_arrow_forward_24"
android:layout_width="30dp"
android:layout_height="match_parent"
android:contentDescription="@string/home_more_info" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:paddingHorizontal="5dp"
android:clipToPadding="false"
android:descendantFocusability="afterDescendants"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:id="@+id/home_bookmarked_child_recyclerview"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:listitem="@layout/home_result_grid" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:nextFocusLeft="@id/nav_rail_view"
android:descendantFocusability="afterDescendants"
android:id="@+id/home_master_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/homepage_parent" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:visibility="gone"
tools:visibility="visible"
android:id="@+id/home_api_fab"
app:icon="@drawable/ic_baseline_filter_list_24"
style="@style/ExtendedFloatingActionButton"
tools:ignore="ContentDescription" />
</FrameLayout>