From d4589716aaa274aff9032acb3b525362ea273083 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Sat, 12 Aug 2023 18:20:15 +0300 Subject: [PATCH] Improve tablet layout --- .../kotatsu/core/ui/BasePreferenceFragment.kt | 4 +- .../activity_categories.xml | 70 ------------------- .../layout-w600dp-land/activity_details.xml | 1 + .../activity_manga_list.xml | 1 + .../layout-w600dp-land/activity_settings.xml | 5 +- .../fragment_settings_sources.xml | 15 ++++ .../item_recommendation.xml | 67 ++++++++++++++++++ .../res/layout/fragment_settings_sources.xml | 2 +- app/src/main/res/layout/item_manga_grid.xml | 3 +- app/src/main/res/layout/item_manga_list.xml | 1 + .../res/layout/item_manga_list_details.xml | 1 + .../main/res/layout/item_recommendation.xml | 2 +- .../main/res/values-w600dp-land/integers.xml | 4 +- app/src/main/res/values/styles.xml | 8 +++ 14 files changed, 106 insertions(+), 78 deletions(-) delete mode 100644 app/src/main/res/layout-w600dp-land/activity_categories.xml create mode 100644 app/src/main/res/layout-w600dp-land/fragment_settings_sources.xml create mode 100644 app/src/main/res/layout-w600dp-land/item_recommendation.xml diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/ui/BasePreferenceFragment.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/ui/BasePreferenceFragment.kt index ce407ddca..331802824 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/ui/BasePreferenceFragment.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/ui/BasePreferenceFragment.kt @@ -13,6 +13,7 @@ import org.koitharu.kotatsu.core.prefs.AppSettings import org.koitharu.kotatsu.core.ui.util.RecyclerViewOwner import org.koitharu.kotatsu.core.ui.util.WindowInsetsDelegate import org.koitharu.kotatsu.core.util.ext.getThemeColor +import org.koitharu.kotatsu.core.util.ext.parentView import org.koitharu.kotatsu.settings.SettingsActivity import javax.inject.Inject @@ -33,7 +34,8 @@ abstract class BasePreferenceFragment(@StringRes private val titleId: Int) : override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - view.setBackgroundColor(view.context.getThemeColor(android.R.attr.colorBackground)) + val themedContext = (view.parentView ?: view).context + view.setBackgroundColor(themedContext.getThemeColor(android.R.attr.colorBackground)) listView.clipToPadding = false insetsDelegate.onViewCreated(view) insetsDelegate.addInsetsListener(this) diff --git a/app/src/main/res/layout-w600dp-land/activity_categories.xml b/app/src/main/res/layout-w600dp-land/activity_categories.xml deleted file mode 100644 index a7c07c39e..000000000 --- a/app/src/main/res/layout-w600dp-land/activity_categories.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - -