changed UI a bit for flashbang + fixed crash inf loading bug

This commit is contained in:
LagradOst 2023-08-12 21:20:51 +02:00
parent ecd529f73b
commit 3ac462ae96
19 changed files with 252 additions and 185 deletions

View file

@ -51,7 +51,7 @@ android {
targetSdk = 33
versionCode = 59
versionName = "4.1.2"
versionName = "4.1.3"
resValue("string", "app_version", "${defaultConfig.versionName}${versionNameSuffix ?: ""}")

View file

@ -278,7 +278,7 @@ var app = Requests(responseParser = object : ResponseParser {
class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
companion object {
const val TAG = "MAINACT"
var lastError: String? = null
/**
* Setting this will automatically enter the query in the search
* next time the search fragment is opened.
@ -599,22 +599,9 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
}
override fun dispatchKeyEvent(event: KeyEvent?): Boolean {
val start = System.currentTimeMillis()
try {
val response = CommonActivity.dispatchKeyEvent(this, event)
if (response != null)
return response
} finally {
debugAssert({
val end = System.currentTimeMillis()
val delta = end - start
delta > 100
}) {
"Took over 100ms to navigate, smth is VERY wrong"
}
}
val response = CommonActivity.dispatchKeyEvent(this, event)
if (response != null)
return response
return super.dispatchKeyEvent(event)
}
@ -1054,10 +1041,11 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
val settingsManager = PreferenceManager.getDefaultSharedPreferences(this)
val errorFile = filesDir.resolve("last_error")
var lastError: String? = null
if (errorFile.exists() && errorFile.isFile) {
lastError = errorFile.readText(Charset.defaultCharset())
errorFile.delete()
} else {
lastError = null
}
val settingsForProvider = SettingsJson()
@ -1167,16 +1155,16 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
}
//Automatically download not existing plugins, using mode specified.
val auto_download_plugin = AutoDownloadMode.getEnum(
val autoDownloadPlugin = AutoDownloadMode.getEnum(
settingsManager.getInt(
getString(R.string.auto_download_plugins_key),
0
)
) ?: AutoDownloadMode.Disable
if (auto_download_plugin != AutoDownloadMode.Disable) {
if (autoDownloadPlugin != AutoDownloadMode.Disable) {
PluginManager.downloadNotExistingPluginsAndLoad(
this@MainActivity,
auto_download_plugin
autoDownloadPlugin
)
}
}

View file

@ -513,9 +513,13 @@ class HomeFragment : Fragment() {
fixGrid()
binding?.apply {
homeChangeApiLoading.setOnClickListener(apiChangeClickListener)
//homeChangeApiLoading.setOnClickListener(apiChangeClickListener)
//homeChangeApiLoading.setOnClickListener(apiChangeClickListener)
homeApiFab.setOnClickListener(apiChangeClickListener)
homeChangeApi.setOnClickListener(apiChangeClickListener)
homeSwitchAccount.setOnClickListener { v ->
DataStoreHelper.showWhoIsWatching(v?.context ?: return@setOnClickListener)
}
homeRandom.setOnClickListener {
if (listHomepageItems.isNotEmpty()) {
activity.loadSearchResult(listHomepageItems.random())
@ -527,21 +531,9 @@ class HomeFragment : Fragment() {
mutableListOf(),
homeViewModel
)
fixPaddingStatusbar(homeLoadingStatusbar)
//fixPaddingStatusbar(homeLoadingStatusbar)
if (isTvSettings()) {
homeApiFab.isVisible = false
if (isTrueTvSettings()) {
homeChangeApiLoading.isVisible = true
homeChangeApiLoading.isFocusable = true
homeChangeApiLoading.isFocusableInTouchMode = true
}
// home_bookmark_select?.isFocusable = true
// home_bookmark_select?.isFocusableInTouchMode = true
} else {
homeApiFab.isVisible = true
homeChangeApiLoading.isVisible = false
}
homeApiFab.isVisible = !isTvSettings()
homeMasterRecycler.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
@ -574,6 +566,7 @@ class HomeFragment : Fragment() {
observe(homeViewModel.apiName) { apiName ->
currentApiName = apiName
binding?.homeApiFab?.text = apiName
binding?.homeChangeApi?.text = apiName
}
observe(homeViewModel.page) { data ->

View file

@ -3,7 +3,6 @@ package com.lagradost.cloudstream3.ui.home
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.appcompat.widget.SearchView
import androidx.core.content.ContextCompat
import androidx.core.view.isGone
@ -13,7 +12,6 @@ import androidx.recyclerview.widget.RecyclerView
import androidx.viewbinding.ViewBinding
import androidx.viewpager2.widget.ViewPager2
import com.google.android.material.chip.Chip
import com.google.android.material.chip.ChipDrawable
import com.google.android.material.chip.ChipGroup
import com.lagradost.cloudstream3.APIHolder.getId
import com.lagradost.cloudstream3.AcraApplication.Companion.getActivity
@ -41,10 +39,9 @@ import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTvSet
import com.lagradost.cloudstream3.utils.DataStoreHelper
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showBottomDialog
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showOptionSelectStringRes
import com.lagradost.cloudstream3.utils.UIHelper.fixPaddingStatusbar
import com.lagradost.cloudstream3.utils.UIHelper.fixPaddingStatusbarMargin
import com.lagradost.cloudstream3.utils.UIHelper.fixPaddingStatusbarView
import com.lagradost.cloudstream3.utils.UIHelper.setImage
import com.lagradost.cloudstream3.utils.UIHelper.populateChips
class HomeParentItemAdapterPreview(
items: MutableList<HomeViewModel.ExpandableHomepageList>,
@ -245,7 +242,11 @@ class HomeParentItemAdapterPreview(
private val previewViewpager: ViewPager2 =
itemView.findViewById(R.id.home_preview_viewpager)
private val previewHeader: FrameLayout = itemView.findViewById(R.id.home_preview)
private val previewViewpagerText: ViewGroup =
itemView.findViewById(R.id.home_preview_viewpager_text)
// private val previewHeader: FrameLayout = itemView.findViewById(R.id.home_preview)
private var resumeHolder: View = itemView.findViewById(R.id.home_watch_holder)
private var resumeRecyclerView: RecyclerView =
itemView.findViewById(R.id.home_watch_child_recyclerview)
@ -254,7 +255,7 @@ class HomeParentItemAdapterPreview(
itemView.findViewById(R.id.home_bookmarked_child_recyclerview)
private var homeAccount: View? =
itemView.findViewById(R.id.home_switch_account)
itemView.findViewById(R.id.home_preview_switch_account)
private var topPadding : View? = itemView.findViewById(R.id.home_padding)
@ -282,26 +283,8 @@ class HomeParentItemAdapterPreview(
item.plot ?: ""
homePreviewText.text = item.name
homePreviewTags.apply {
removeAllViews()
item.tags?.forEach { tag ->
val chip = Chip(context)
val chipDrawable =
ChipDrawable.createFromAttributes(
context,
null,
0,
R.style.ChipFilledSemiTransparent
)
chip.setChipDrawable(chipDrawable)
chip.text = tag
chip.isChecked = false
chip.isCheckable = false
chip.isFocusable = false
chip.isClickable = false
addView(chip)
}
}
populateChips(homePreviewTags,item.tags ?: emptyList(), R.style.ChipFilledSemiTransparent)
homePreviewTags.isGone =
item.tags.isNullOrEmpty()
@ -324,7 +307,7 @@ class HomeParentItemAdapterPreview(
}
(binding as? FragmentHomeHeadBinding)?.apply {
homePreviewImage.setImage(item.posterUrl, item.posterHeaders)
//homePreviewImage.setImage(item.posterUrl, item.posterHeaders)
homePreviewPlay.setOnClickListener { view ->
viewModel.click(
@ -402,7 +385,6 @@ class HomeParentItemAdapterPreview(
if (binding is FragmentHomeHeadTvBinding) {
observe(viewModel.apiName) { name ->
binding.homePreviewChangeApi.text = name
binding.homePreviewChangeApi2.text = name
}
}
observe(viewModel.resumeWatching) {
@ -468,11 +450,6 @@ class HomeParentItemAdapterPreview(
viewModel.loadAndCancel(api, forceReload = true, fromUI = true)
}
}
homePreviewChangeApi2.setOnClickListener { view ->
view.context.selectHomepage(viewModel.repo?.name) { api ->
viewModel.loadAndCancel(api, forceReload = true, fromUI = true)
}
}
// This makes the hidden next buttons only available when on the info button
// Otherwise you might be able to go to the next item without being at the info button
@ -517,10 +494,6 @@ class HomeParentItemAdapterPreview(
}
private fun updatePreview(preview: Resource<Pair<Boolean, List<LoadResponse>>>) {
if (binding is FragmentHomeHeadTvBinding) {
binding.homePreviewChangeApi2.isGone = preview is Resource.Success
}
if (preview is Resource.Success) {
homeNonePadding.apply {
val params = layoutParams
@ -545,14 +518,18 @@ class HomeParentItemAdapterPreview(
previewViewpager.fakeDragBy(1f)
previewViewpager.endFakeDrag()
previewCallback.onPageSelected(0)
previewHeader.isVisible = true
previewViewpager.isVisible = true
previewViewpagerText.isVisible = true
//previewHeader.isVisible = true
}
}
else -> {
previewAdapter.setItems(listOf(), false)
previewViewpager.setCurrentItem(0, false)
previewHeader.isVisible = false
previewViewpager.isVisible = false
previewViewpagerText.isVisible = false
//previewHeader.isVisible = false
}
}
}

View file

@ -18,6 +18,7 @@ import com.lagradost.cloudstream3.HomePageList
import com.lagradost.cloudstream3.LoadResponse
import com.lagradost.cloudstream3.MainAPI
import com.lagradost.cloudstream3.MainActivity
import com.lagradost.cloudstream3.MainActivity.Companion.lastError
import com.lagradost.cloudstream3.SearchResponse
import com.lagradost.cloudstream3.amap
import com.lagradost.cloudstream3.mvvm.Resource
@ -484,7 +485,7 @@ class HomeViewModel : ViewModel() {
} else if (api == null) {
// API is not found aka not loaded or removed, post the loading
// progress if waiting for plugins, otherwise nothing
if(PluginManager.loadedLocalPlugins) {
if(PluginManager.loadedLocalPlugins || PluginManager.checkSafeModeFile() || lastError != null) {
loadAndCancel(noneApi)
} else {
_page.postValue(Resource.Loading())

View file

@ -177,7 +177,7 @@ class SettingsUpdates : PreferenceFragmentCompat() {
val prefNames = resources.getStringArray(R.array.auto_download_plugin)
val prefValues = enumValues<AutoDownloadMode>().sortedBy { x -> x.value }.map { x -> x.value }
val current = settingsManager.getInt(getString(R.string.auto_download_plugins_pref), 0)
val current = settingsManager.getInt(getString(R.string.auto_download_plugins_key), 0)
activity?.showBottomDialog(
prefNames.toList(),
@ -185,7 +185,7 @@ class SettingsUpdates : PreferenceFragmentCompat() {
getString(R.string.automatic_plugin_download_mode_title),
true,
{}) {
settingsManager.edit().putInt(getString(R.string.auto_download_plugins_pref), prefValues[it]).apply()
settingsManager.edit().putInt(getString(R.string.auto_download_plugins_key), prefValues[it]).apply()
(context ?: AcraApplication.context)?.let { ctx -> app.initClient(ctx) }
}
return@setOnPreferenceClickListener true

View file

@ -24,6 +24,7 @@ import androidx.annotation.AttrRes
import androidx.annotation.ColorInt
import androidx.annotation.DrawableRes
import androidx.annotation.IdRes
import androidx.annotation.StyleRes
import androidx.appcompat.view.ContextThemeWrapper
import androidx.appcompat.view.menu.MenuBuilder
import androidx.appcompat.widget.PopupMenu
@ -81,7 +82,7 @@ object UIHelper {
|| Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
}
fun populateChips(view: ChipGroup?, tags: List<String>) {
fun populateChips(view: ChipGroup?, tags: List<String>, @StyleRes style : Int = R.style.ChipFilled) {
if (view == null) return
view.removeAllViews()
val context = view.context ?: return
@ -92,7 +93,7 @@ object UIHelper {
context,
null,
0,
R.style.ChipFilled
style
)
chip.setChipDrawable(chipDrawable)
chip.text = tag
@ -100,7 +101,7 @@ object UIHelper {
chip.isCheckable = false
chip.isFocusable = false
chip.isClickable = false
chip.setTextColor(context.colorFromAttribute(R.attr.textColor))
chip.setTextColor(context.colorFromAttribute(R.attr.white))
view.addView(chip)
}
}

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:color="?attr/black"/>
<item android:color="?attr/white"/>
</selector>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="?attr/white" android:alpha="0.2" />
</selector>

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true">
<shape android:shape="rectangle">
<solid android:color="?attr/white" />
<corners android:radius="3dp"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white_attr_20" />
<corners android:radius="3dp"/>
</shape>
</item>
</selector>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true">
<shape android:shape="rectangle">
<solid android:color="?attr/white" />
<corners android:radius="3dp"/>
</shape>
</item>
</selector>

View file

@ -13,7 +13,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="gone">
tools:visibility="visible">
<ProgressBar
android:layout_width="50dp"
@ -92,22 +92,40 @@
</LinearLayout>
</com.facebook.shimmer.ShimmerFrameLayout>
<FrameLayout
android:id="@+id/home_loading_statusbar"
android:layout_width="match_parent"
android:layout_height="70dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_gravity="end"
android:layout_margin="10dp"
android:background="@color/transparent"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/home_change_api"
style="@style/RegularButtonTV"
android:layout_width="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="@drawable/player_button_tv_attr_no_bg"
android:gravity="center_vertical"
android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusRight="@id/home_switch_account"
android:visibility="gone" />
<ImageView
android:id="@+id/home_change_api_loading"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical|end"
android:id="@+id/home_switch_account"
android:layout_margin="10dp"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/home_change_provider_img_des"
android:src="@drawable/ic_baseline_keyboard_arrow_down_24" />
</FrameLayout>
android:contentDescription="@string/account"
android:nextFocusLeft="@id/home_search"
android:padding="10dp"
android:src="@drawable/ic_outline_account_circle_24" />
</LinearLayout>
</FrameLayout>
<LinearLayout
@ -160,7 +178,8 @@
android:descendantFocusability="afterDescendants"
android:nextFocusLeft="@id/nav_rail_view"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/homepage_parent" />
tools:listitem="@layout/homepage_parent"
tools:visibility="gone" />
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/home_api_fab"

View file

@ -14,7 +14,7 @@
android:layout_height="0dp" />
<FrameLayout
android:id="@+id/home_preview"
android:id="@+id/home_preview_viewpager_text"
android:layout_width="match_parent"
android:layout_height="500dp">
@ -26,15 +26,6 @@
</androidx.viewpager2.widget.ViewPager2>
<ImageView
android:id="@+id/home_preview_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.8"
android:scaleType="centerCrop"
android:visibility="gone"
tools:src="@drawable/example_poster" />
<LinearLayout
android:id="@+id/home_padding"
android:layout_width="match_parent"
@ -44,16 +35,16 @@
<androidx.appcompat.widget.SearchView
android:id="@+id/home_search"
android:nextFocusRight="@id/home_switch_account"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:padding="0dp"
android:layout_marginEnd="50dp"
android:editTextColor="@color/white"
android:gravity="center_vertical"
android:iconifiedByDefault="true"
android:nextFocusRight="@id/home_preview_switch_account"
android:padding="0dp"
android:textColor="@color/white"
android:textColorHint="@color/white"
app:closeIcon="@drawable/ic_baseline_close_24"
@ -64,15 +55,15 @@
tools:ignore="RtlSymmetry" />
<ImageView
android:background="?android:attr/selectableItemBackgroundBorderless"
android:id="@+id/home_preview_switch_account"
android:nextFocusLeft="@id/home_search"
android:id="@+id/home_switch_account"
android:layout_width="50dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginStart="-50dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/account"
android:nextFocusLeft="@id/home_search"
android:padding="10dp"
android:src="@drawable/ic_outline_account_circle_24" />
</LinearLayout>
@ -150,6 +141,7 @@
app:tint="?attr/white" />
</LinearLayout>
</LinearLayout>
</FrameLayout>

View file

@ -15,7 +15,6 @@
android:layout_height="0dp" />
<FrameLayout
android:id="@+id/home_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -28,7 +27,44 @@
</androidx.viewpager2.widget.ViewPager2>
<FrameLayout
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_gravity="end"
android:layout_margin="10dp"
android:background="@drawable/player_button_tv_attr"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/home_preview_change_api"
style="@style/RegularButtonTV"
android:layout_width="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="@drawable/player_button_tv_attr_no_bg"
android:gravity="center_vertical"
android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusRight="@id/home_preview_switch_account"
android:nextFocusDown="@id/home_preview_play_btt" />
<ImageView
android:id="@+id/home_preview_switch_account"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:background="@drawable/player_button_tv_attr_no_bg"
android:contentDescription="@string/account"
android:nextFocusLeft="@id/home_preview_change_api"
android:nextFocusDown="@id/home_preview_info_btt"
android:padding="10dp"
android:src="@drawable/ic_outline_account_circle_24"
android:tag="@string/tv_no_focus_tag"
app:tint="@color/player_on_button_tv_attr" />
</LinearLayout>
<!--<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp">
@ -36,7 +72,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/home_preview_change_api"
style="@style/RegularButtonTV"
android:nextFocusRight="@id/home_switch_account"
android:nextFocusRight="@id/home_preview_switch_account"
android:layout_width="wrap_content"
android:layout_gravity="top|start"
android:layout_marginStart="@dimen/navbar_width"
@ -48,7 +84,7 @@
android:background="?android:attr/selectableItemBackgroundBorderless"
android:nextFocusDown="@id/home_preview_play_btt"
android:nextFocusLeft="@id/home_preview_change_api"
android:id="@+id/home_switch_account"
android:id="@+id/home_preview_switch_account"
android:layout_width="50dp"
android:layout_gravity="end"
android:layout_height="wrap_content"
@ -56,9 +92,9 @@
android:padding="10dp"
android:src="@drawable/ic_outline_account_circle_24" />
</FrameLayout>
</FrameLayout>-->
<LinearLayout
android:id="@+id/home_preview_viewpager_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
@ -138,25 +174,28 @@
android:focusable="false" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp">
<com.google.android.material.button.MaterialButton
android:id="@+id/home_preview_change_api2"
style="@style/RegularButtonTV"
android:layout_width="wrap_content"
android:layout_gravity="top|start"
android:layout_marginStart="@dimen/navbar_width"
android:backgroundTint="@color/semiWhite"
android:minWidth="150dp"
android:nextFocusUp="@id/home_preview_play_btt"
android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusDown="@id/home_watch_child_recyclerview" />
</FrameLayout>
<!-- <FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp">
<com.google.android.material.button.MaterialButton
android:id="@+id/home_preview_change_api2"
style="@style/RegularButtonTV"
android:layout_width="wrap_content"
android:layout_gravity="top|start"
android:layout_marginStart="@dimen/navbar_width"
android:backgroundTint="@color/white_attr_20"
android:minWidth="150dp"
android:nextFocusUp="@id/home_preview_play_btt"
android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusDown="@id/home_watch_child_recyclerview" />
</FrameLayout>-->
<LinearLayout
android:id="@+id/home_watch_holder"
@ -179,12 +218,12 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/home_watch_child_recyclerview"
android:nextFocusUp="@id/home_preview_change_api2"
android:nextFocusDown="@id/home_type_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:descendantFocusability="afterDescendants"
android:nextFocusUp="@id/home_preview_play_btt"
android:nextFocusDown="@id/home_type_holder"
android:orientation="horizontal"
android:paddingStart="@dimen/navbar_width"
android:paddingEnd="5dp"
@ -216,14 +255,14 @@
<com.google.android.material.chip.ChipGroup
android:id="@+id/home_type_holder"
android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusUp="@id/home_watch_child_recyclerview"
android:nextFocusDown="@id/home_bookmarked_child_recyclerview"
android:descendantFocusability="afterDescendants"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/navbar_width"
android:descendantFocusability="afterDescendants"
android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusUp="@id/home_watch_child_recyclerview"
android:nextFocusDown="@id/home_bookmarked_child_recyclerview"
android:orientation="horizontal">
<com.google.android.material.chip.Chip
@ -231,11 +270,11 @@
style="@style/ChipFilled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:nextFocusUp="@id/home_watch_child_recyclerview"
android:nextFocusDown="@id/home_bookmarked_child_recyclerview"
android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusRight="@id/home_plan_to_watch_btt"
android:nextFocusUp="@id/home_watch_child_recyclerview"
android:nextFocusDown="@id/home_bookmarked_child_recyclerview"
android:text="@string/type_watching" />
<com.google.android.material.chip.Chip
@ -243,11 +282,11 @@
style="@style/ChipFilled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:nextFocusUp="@id/home_watch_child_recyclerview"
android:nextFocusDown="@id/home_bookmarked_child_recyclerview"
android:nextFocusLeft="@id/home_type_watching_btt"
android:nextFocusRight="@id/home_type_on_hold_btt"
android:nextFocusUp="@id/home_watch_child_recyclerview"
android:nextFocusDown="@id/home_bookmarked_child_recyclerview"
android:text="@string/type_plan_to_watch" />
<com.google.android.material.chip.Chip
@ -255,11 +294,11 @@
style="@style/ChipFilled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:nextFocusUp="@id/home_watch_child_recyclerview"
android:nextFocusDown="@id/home_bookmarked_child_recyclerview"
android:nextFocusLeft="@id/home_plan_to_watch_btt"
android:nextFocusRight="@id/home_type_dropped_btt"
android:nextFocusUp="@id/home_watch_child_recyclerview"
android:nextFocusDown="@id/home_bookmarked_child_recyclerview"
android:text="@string/type_on_hold" />
<com.google.android.material.chip.Chip
@ -267,37 +306,37 @@
style="@style/ChipFilled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:nextFocusUp="@id/home_watch_child_recyclerview"
android:nextFocusDown="@id/home_bookmarked_child_recyclerview"
android:nextFocusLeft="@id/home_type_on_hold_btt"
android:nextFocusRight="@id/home_type_completed_btt"
android:nextFocusUp="@id/home_watch_child_recyclerview"
android:nextFocusDown="@id/home_bookmarked_child_recyclerview"
android:text="@string/type_dropped" />
<com.google.android.material.chip.Chip
android:id="@+id/home_type_completed_btt"
style="@style/ChipFilled"
android:layout_width="wrap_content"
android:nextFocusUp="@id/home_watch_child_recyclerview"
android:nextFocusDown="@id/home_bookmarked_child_recyclerview"
android:layout_height="wrap_content"
android:nextFocusLeft="@id/home_type_dropped_btt"
android:nextFocusUp="@id/home_watch_child_recyclerview"
android:nextFocusDown="@id/home_bookmarked_child_recyclerview"
android:text="@string/type_completed" />
</com.google.android.material.chip.ChipGroup>
</HorizontalScrollView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/home_bookmarked_child_recyclerview"
android:nextFocusUp="@id/home_type_holder"
android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusDown="@id/home_child_recyclerview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:descendantFocusability="afterDescendants"
android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusUp="@id/home_type_holder"
android:nextFocusDown="@id/home_child_recyclerview"
android:orientation="horizontal"
android:paddingStart="@dimen/navbar_width"
android:paddingEnd="5dp"

View file

@ -8,13 +8,14 @@
android:layout_height="match_parent"
tools:context=".ui.home.HomeFragment">
<FrameLayout
android:id="@+id/home_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/navbar_width"
android:visibility="gone"
tools:visibility="gone">
tools:visibility="visible">
<ProgressBar
android:layout_width="50dp"
@ -93,22 +94,41 @@
</LinearLayout>
</com.facebook.shimmer.ShimmerFrameLayout>
<FrameLayout
android:id="@+id/home_loading_statusbar"
android:layout_width="match_parent"
android:layout_height="70dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_gravity="end"
android:layout_margin="10dp"
android:background="@drawable/player_button_tv_attr"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/home_change_api"
style="@style/RegularButtonTV"
android:layout_width="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="@drawable/player_button_tv_attr_no_bg"
android:gravity="center_vertical"
android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusRight="@id/home_switch_account" />
<ImageView
android:id="@+id/home_change_api_loading"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical|end"
android:id="@+id/home_switch_account"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:background="@drawable/player_button_tv_attr_no_bg"
android:contentDescription="@string/account"
android:nextFocusLeft="@id/home_change_api"
android:layout_margin="10dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/home_change_provider_img_des"
android:src="@drawable/ic_baseline_keyboard_arrow_down_24" />
</FrameLayout>
android:padding="10dp"
android:src="@drawable/ic_outline_account_circle_24"
android:tag="@string/tv_no_focus_tag"
app:tint="@color/player_on_button_tv_attr" />
</LinearLayout>
</FrameLayout>
<LinearLayout
@ -155,7 +175,6 @@
android:textColor="?attr/textColor" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/home_master_recycler"
android:layout_width="match_parent"
@ -164,7 +183,8 @@
android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusUp="@id/home_bookmarked_child_recyclerview"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/homepage_parent_tv" />
tools:listitem="@layout/homepage_parent_tv"
tools:visibility="gone" />
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/home_api_fab"

View file

@ -65,5 +65,6 @@
<attr name="grayTextColor" format="color" />
<attr name="iconColor" format="color" />
<attr name="white" format="color" />
<attr name="black" format="color" />
</declare-styleable>
</resources>

View file

@ -13,7 +13,6 @@
<color name="boxItemBackground">#161616</color> <!-- 17171B 1B1B20-->
<color name="textColor">#e9eaee</color> <!--FFF-->
<color name="semiWhite">#1AFFFFFF</color> <!--FFF-->
<color name="grayTextColor">#9ba0a4</color> <!-- 5e5f62-->
<color name="grayShimmer">#DCDCDC</color> <!-- 5e5f62-->

View file

@ -7,7 +7,6 @@
<string name="auto_update_key" translatable="false">auto_update</string>
<string name="auto_update_plugins_key" translatable="false">auto_update_plugins</string>
<string name="auto_download_plugins_key" translatable="false">auto_download_plugins_key</string>
<string name="auto_download_plugins_pref" translatable="false">auto_download_plugins_pref</string>
<string name="skip_update_key" translatable="false">skip_update_key</string>
<string name="prerelease_update_key" translatable="false">prerelease_update</string>
<string name="manual_check_update_key" translatable="false">manual_check_update</string>

View file

@ -62,7 +62,8 @@
<item name="iconGrayBackground">@color/iconGrayBackground</item>
<item name="boxItemBackground">@color/boxItemBackground</item>
<item name="iconColor">@color/iconColor</item>
<item name="white">#FFF</item>
<item name="white">@color/white</item>
<item name="black">@color/black</item>
<item name="preferenceTheme">@style/CustomPreferenceThemeOverlay</item>
@ -99,7 +100,7 @@
<style name="ChipFilledSemiTransparent" parent="@style/ChipFilled">
<item name="chipBackgroundColor">@color/transparent</item>
<item name="chipSurfaceColor">@color/semiWhite</item>
<item name="chipSurfaceColor">@color/white_attr_20</item>
<item name="backgroundColor">@color/transparent</item>
</style>
@ -117,6 +118,7 @@
<item name="textColor">@color/textColor</item>
<item name="grayTextColor">@color/grayTextColor</item>
<item name="white">@color/white</item>
<item name="black">@color/black</item>
<item name="colorOnPrimary">@color/whiteText</item>
</style>
@ -158,7 +160,9 @@
<item name="boxItemBackground">@color/lightItemBackground</item>
<item name="textColor">@color/lightTextColor</item>
<item name="grayTextColor">@color/lightGrayTextColor</item>
<item name="white">#000</item>
<item name="white">@color/black</item>
<item name="black">@color/white</item>
<item name="colorOnPrimary">@color/blackText</item>
</style>
@ -170,6 +174,7 @@
<item name="textColor">@color/material_dynamic_neutral90</item>
<item name="grayTextColor">@color/material_dynamic_neutral60</item>
<item name="white">@color/material_dynamic_neutral90</item>
<item name="black">@color/material_dynamic_neutral10</item>
<item name="colorOnPrimary">@color/material_on_primary_emphasis_medium</item>
</style>
@ -747,13 +752,13 @@
<item name="android:stateListAnimator">@null</item>
<item name="strokeColor">@color/transparent</item>
<item name="backgroundTint">@null</item>
<item name="android:background">@drawable/player_button_tv</item>
<item name="android:background">@drawable/player_button_tv_attr</item>
<item name="rippleColor">@color/white</item>
<item name="android:shadowColor">@color/transparent</item>
<item name="iconTint">@color/player_on_button_tv</item>
<item name="textColor">@color/player_on_button_tv</item>
<item name="android:textColor">@color/player_on_button_tv</item>
<item name="iconTint">@color/player_on_button_tv_attr</item>
<item name="textColor">@color/player_on_button_tv_attr</item>
<item name="android:textColor">@color/player_on_button_tv_attr</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">40dp</item>
<item name="iconSize">16dp</item>