From cc7e47bbb6e02a004decb1c29476c503207094cb Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Fri, 22 Nov 2019 19:29:53 +0100 Subject: [PATCH] Added themes All files (that used styles) were refactored to use styles directly so themes can only actually adjust colors - Elaborate themes would be super hard to maintain and would certainly break over time --- app/src/main/AndroidManifest.xml | 1 - .../main/java/com/topjohnwu/magisk/Config.kt | 3 + .../magisk/model/entity/recycler/ThemeItem.kt | 14 ++ .../magisk/model/navigation/Navigation.kt | 5 + .../magisk/redesign/compat/CompatActivity.kt | 4 +- .../redesign/settings/SettingsViewModel.kt | 4 +- .../topjohnwu/magisk/redesign/theme/Theme.kt | 50 +++++ .../magisk/redesign/theme/ThemeFragment.kt | 9 + .../magisk/redesign/theme/ThemeViewModel.kt | 20 +- .../magisk/utils/DataBindingAdapters.kt | 5 + .../drawable/bg_selection_circle_green.xml | 8 + app/src/main/res/drawable/ic_paint.xml | 10 + app/src/main/res/layout/activity_main_md2.xml | 8 +- .../main/res/layout/dialog_magisk_base.xml | 18 +- app/src/main/res/layout/fragment_hide_md2.xml | 6 +- app/src/main/res/layout/fragment_home_md2.xml | 44 ++-- .../main/res/layout/fragment_install_md2.xml | 32 +-- app/src/main/res/layout/fragment_log_md2.xml | 2 +- .../main/res/layout/fragment_module_md2.xml | 6 +- .../res/layout/fragment_safetynet_md2.xml | 30 +-- .../main/res/layout/fragment_settings_md2.xml | 120 +++++------ .../res/layout/fragment_superuser_md2.xml | 20 +- .../main/res/layout/fragment_theme_md2.xml | 192 +++++++++++++++++- .../main/res/layout/include_hide_filter.xml | 15 +- .../res/layout/include_install_options.xml | 6 +- .../main/res/layout/include_module_filter.xml | 11 +- app/src/main/res/layout/item_console_md2.xml | 2 +- app/src/main/res/layout/item_developer.xml | 4 +- .../main/res/layout/item_developer_link.xml | 4 +- app/src/main/res/layout/item_hide_md2.xml | 14 +- .../main/res/layout/item_hide_process_md2.xml | 4 +- .../main/res/layout/item_log_access_md2.xml | 8 +- .../main/res/layout/item_log_track_md2.xml | 2 +- .../main/res/layout/item_module_download.xml | 2 +- app/src/main/res/layout/item_module_md2.xml | 12 +- app/src/main/res/layout/item_policy_md2.xml | 16 +- app/src/main/res/layout/item_repo_md2.xml | 18 +- .../main/res/layout/item_safe_mode_notice.xml | 4 +- app/src/main/res/layout/item_section_md2.xml | 4 +- app/src/main/res/layout/item_theme.xml | 182 +++++++++++++++++ .../main/res/layout/markdown_window_md2.xml | 2 +- .../res/layout/swicher_caption_variant.xml | 2 +- app/src/main/res/values-night/themes_md2.xml | 28 ++- app/src/main/res/values/attrs.xml | 78 ------- app/src/main/res/values/strings_md2.xml | 1 + app/src/main/res/values/styles_md2.xml | 79 +------ app/src/main/res/values/styles_md2_impl.xml | 16 +- app/src/main/res/values/styles_view_md2.xml | 4 +- app/src/main/res/values/themes_md2.xml | 79 +++++-- 49 files changed, 799 insertions(+), 409 deletions(-) create mode 100644 app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ThemeItem.kt create mode 100644 app/src/main/java/com/topjohnwu/magisk/redesign/theme/Theme.kt create mode 100644 app/src/main/res/drawable/bg_selection_circle_green.xml create mode 100644 app/src/main/res/drawable/ic_paint.xml create mode 100644 app/src/main/res/layout/item_theme.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index dc1867923..3e73a2004 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - diff --git a/app/src/main/java/com/topjohnwu/magisk/Config.kt b/app/src/main/java/com/topjohnwu/magisk/Config.kt index cd5b229f7..2effcd5d7 100644 --- a/app/src/main/java/com/topjohnwu/magisk/Config.kt +++ b/app/src/main/java/com/topjohnwu/magisk/Config.kt @@ -13,6 +13,7 @@ import com.topjohnwu.magisk.di.Protected import com.topjohnwu.magisk.extensions.get import com.topjohnwu.magisk.extensions.inject import com.topjohnwu.magisk.model.preference.PreferenceModel +import com.topjohnwu.magisk.redesign.theme.Theme import com.topjohnwu.magisk.utils.BiometricHelper import com.topjohnwu.magisk.utils.Utils import com.topjohnwu.superuser.Shell @@ -52,6 +53,7 @@ object Config : PreferenceModel, DBConfig { const val DOWNLOAD_PATH = "download_path" const val REDESIGN = "redesign" const val SAFETY = "safety_notice" + const val THEME_ORDINAL = "theme_ordinal" // system state const val MAGISKHIDE = "magiskhide" @@ -125,6 +127,7 @@ object Config : PreferenceModel, DBConfig { Key.DARK_THEME_EXTENDED, AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM ) + var themeOrdinal by preference(Key.THEME_ORDINAL, Theme.Piplup.ordinal) var suReAuth by preference(Key.SU_REAUTH, false) var checkUpdate by preference(Key.CHECK_UPDATES, true) var magiskHide by preference(Key.MAGISKHIDE, true) diff --git a/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ThemeItem.kt b/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ThemeItem.kt new file mode 100644 index 000000000..c9e44f6fb --- /dev/null +++ b/app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ThemeItem.kt @@ -0,0 +1,14 @@ +package com.topjohnwu.magisk.model.entity.recycler + +import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.databinding.ComparableRvItem +import com.topjohnwu.magisk.redesign.theme.Theme + +class ThemeItem(val theme: Theme) : ComparableRvItem() { + + override val layoutRes = R.layout.item_theme + + override fun contentSameAs(other: ThemeItem) = itemSameAs(other) + override fun itemSameAs(other: ThemeItem) = theme == other.theme + +} \ No newline at end of file diff --git a/app/src/main/java/com/topjohnwu/magisk/model/navigation/Navigation.kt b/app/src/main/java/com/topjohnwu/magisk/model/navigation/Navigation.kt index 18d6794af..dfa2da71b 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/navigation/Navigation.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/navigation/Navigation.kt @@ -8,6 +8,7 @@ import com.topjohnwu.magisk.Const import com.topjohnwu.magisk.intent import com.topjohnwu.magisk.redesign.install.InstallFragment import com.topjohnwu.magisk.redesign.safetynet.SafetynetFragment +import com.topjohnwu.magisk.redesign.theme.ThemeFragment import com.topjohnwu.magisk.ui.MainActivity import com.topjohnwu.magisk.ui.hide.MagiskHideFragment import com.topjohnwu.magisk.ui.home.HomeFragment @@ -98,6 +99,10 @@ object Navigation { navDirections { destination = InstallFragment::class } } + fun theme() = MagiskNavigationEvent { + navDirections { destination = ThemeFragment::class } + } + fun fromSection(section: String) = when (section) { "superuser" -> superuser() "modules" -> modules() diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatActivity.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatActivity.kt index 42a9e6f59..647c4ba07 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatActivity.kt @@ -10,7 +10,6 @@ import androidx.core.content.getSystemService import androidx.databinding.OnRebindCallback import androidx.databinding.ViewDataBinding import androidx.fragment.app.Fragment -import com.topjohnwu.magisk.R import com.topjohnwu.magisk.base.BaseActivity import com.topjohnwu.magisk.extensions.snackbar import com.topjohnwu.magisk.extensions.startAnimations @@ -18,13 +17,14 @@ import com.topjohnwu.magisk.model.events.SnackbarEvent import com.topjohnwu.magisk.model.events.ViewEvent import com.topjohnwu.magisk.model.navigation.MagiskNavigationEvent import com.topjohnwu.magisk.model.navigation.Navigator +import com.topjohnwu.magisk.redesign.theme.Theme import kotlin.reflect.KClass abstract class CompatActivity : BaseActivity(), CompatView, Navigator { - override val themeRes = R.style.Foundation_Default + override val themeRes = Theme.selected.themeRes override val viewRoot: View get() = binding.root override val navigation: CompatNavigationDelegate>? by lazy { CompatNavigationDelegate(this) diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/settings/SettingsViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/settings/SettingsViewModel.kt index dca920e12..2dbcce10a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/settings/SettingsViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/settings/SettingsViewModel.kt @@ -4,7 +4,7 @@ import com.topjohnwu.magisk.Config import com.topjohnwu.magisk.extensions.addOnPropertyChangedCallback import com.topjohnwu.magisk.extensions.toggle import com.topjohnwu.magisk.model.events.DieEvent -import com.topjohnwu.magisk.model.events.dialog.DarkThemeDialog +import com.topjohnwu.magisk.model.navigation.Navigation import com.topjohnwu.magisk.redesign.compat.CompatViewModel import com.topjohnwu.magisk.utils.KObservableField @@ -21,6 +21,6 @@ class SettingsViewModel : CompatViewModel() { } fun toggle(item: KObservableField) = item.toggle() - fun darkModePressed() = DarkThemeDialog().publish() + fun themePressed() = Navigation.theme().publish() } \ No newline at end of file diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/theme/Theme.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/theme/Theme.kt new file mode 100644 index 000000000..048ebf1da --- /dev/null +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/theme/Theme.kt @@ -0,0 +1,50 @@ +package com.topjohnwu.magisk.redesign.theme + +import com.topjohnwu.magisk.Config +import com.topjohnwu.magisk.R + +enum class Theme( + val themeName: String, + val themeRes: Int +) { + + Piplup( + themeName = "Piplup", + themeRes = R.style.ThemeFoundationMD2_Piplup + ), + PiplupAmoled( + themeName = "AMOLED", + themeRes = R.style.ThemeFoundationMD2_Amoled + ), + Rayquaza( + themeName = "Rayquaza", + themeRes = R.style.ThemeFoundationMD2_Rayquaza + ), + Zapdos( + themeName = "Zapdos", + themeRes = R.style.ThemeFoundationMD2_Zapdos + ), + Charmeleon( + themeName = "Charmeleon", + themeRes = R.style.ThemeFoundationMD2_Charmeleon + ), + Mew( + themeName = "Mew", + themeRes = R.style.ThemeFoundationMD2_Mew + ), + Salamence( + themeName = "Salamence", + themeRes = R.style.ThemeFoundationMD2_Salamence + ); + + val isSelected get() = Config.themeOrdinal == ordinal + + fun select() { + Config.themeOrdinal = ordinal + } + + companion object { + val selected get() = values().getOrNull(Config.themeOrdinal) ?: Piplup + } + +} diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/theme/ThemeFragment.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/theme/ThemeFragment.kt index 830846b49..26cb5e4e2 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/theme/ThemeFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/theme/ThemeFragment.kt @@ -1,5 +1,6 @@ package com.topjohnwu.magisk.redesign.theme +import android.graphics.Insets import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.FragmentThemeMd2Binding import com.topjohnwu.magisk.redesign.compat.CompatFragment @@ -10,4 +11,12 @@ class ThemeFragment : CompatFragment() override val layoutRes = R.layout.fragment_theme_md2 override val viewModel by viewModel() + override fun consumeSystemWindowInsets(insets: Insets) = insets + + override fun onStart() { + super.onStart() + + activity.title = getString(R.string.section_theme) + } + } \ No newline at end of file diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/theme/ThemeViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/theme/ThemeViewModel.kt index 171418aeb..9bbacac6a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/theme/ThemeViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/theme/ThemeViewModel.kt @@ -1,5 +1,23 @@ package com.topjohnwu.magisk.redesign.theme +import com.topjohnwu.magisk.BR +import com.topjohnwu.magisk.model.entity.recycler.ThemeItem +import com.topjohnwu.magisk.model.events.RecreateEvent +import com.topjohnwu.magisk.model.events.dialog.DarkThemeDialog import com.topjohnwu.magisk.redesign.compat.CompatViewModel +import com.topjohnwu.magisk.redesign.home.itemBindingOf +import com.topjohnwu.magisk.redesign.superuser.diffListOf -class ThemeViewModel : CompatViewModel() \ No newline at end of file +class ThemeViewModel : CompatViewModel() { + + val items = diffListOf(*Theme.values().map { ThemeItem(it) }.toTypedArray()) + val itemBinding = itemBindingOf { it.bindExtra(BR.viewModel, this) } + + fun saveTheme(theme: Theme) { + theme.select() + RecreateEvent().publish() + } + + fun darkModePressed() = DarkThemeDialog().publish() + +} \ No newline at end of file diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt b/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt index eebc0ed0e..3d76715e9 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt @@ -455,4 +455,9 @@ fun View.setRotationNotAnimated(rotation: Int) { @BindingAdapter("android:text") fun TextView.setTextSafe(text: Int) { if (text == 0) this.text = null else setText(text) +} + +@BindingAdapter("android:theme") +fun View.setThemeCompat(theme: Int) { + } \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_selection_circle_green.xml b/app/src/main/res/drawable/bg_selection_circle_green.xml new file mode 100644 index 000000000..38788d14a --- /dev/null +++ b/app/src/main/res/drawable/bg_selection_circle_green.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_paint.xml b/app/src/main/res/drawable/ic_paint.xml new file mode 100644 index 000000000..9917845ce --- /dev/null +++ b/app/src/main/res/drawable/ic_paint.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main_md2.xml b/app/src/main/res/layout/activity_main_md2.xml index f51d38a17..6f55fa2dc 100644 --- a/app/src/main/res/layout/activity_main_md2.xml +++ b/app/src/main/res/layout/activity_main_md2.xml @@ -27,14 +27,14 @@ diff --git a/app/src/main/res/layout/dialog_magisk_base.xml b/app/src/main/res/layout/dialog_magisk_base.xml index d5bed6b79..a665c867f 100644 --- a/app/src/main/res/layout/dialog_magisk_base.xml +++ b/app/src/main/res/layout/dialog_magisk_base.xml @@ -16,7 +16,7 @@ android:layout_height="match_parent"> @@ -154,7 +154,7 @@ diff --git a/app/src/main/res/layout/fragment_home_md2.xml b/app/src/main/res/layout/fragment_home_md2.xml index 0606134f6..ebc6b5a56 100644 --- a/app/src/main/res/layout/fragment_home_md2.xml +++ b/app/src/main/res/layout/fragment_home_md2.xml @@ -45,7 +45,7 @@ android:paddingTop="@dimen/l1"> + android:textAppearance="@style/AppearanceFoundation.Title" /> + android:textAppearance="@style/AppearanceFoundation.Caption.Variant" /> + android:textAppearance="@style/AppearanceFoundation.Title" /> diff --git a/app/src/main/res/layout/fragment_log_md2.xml b/app/src/main/res/layout/fragment_log_md2.xml index 13e333407..acfe2264c 100644 --- a/app/src/main/res/layout/fragment_log_md2.xml +++ b/app/src/main/res/layout/fragment_log_md2.xml @@ -45,7 +45,7 @@ diff --git a/app/src/main/res/layout/fragment_safetynet_md2.xml b/app/src/main/res/layout/fragment_safetynet_md2.xml index f2b02907c..ba39e10cd 100644 --- a/app/src/main/res/layout/fragment_safetynet_md2.xml +++ b/app/src/main/res/layout/fragment_safetynet_md2.xml @@ -37,7 +37,7 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/safetynet_attest_loading" - android:textAppearance="?appearanceTextTitleNormal" /> + android:textAppearance="@style/AppearanceFoundation.Title" /> @@ -251,12 +251,12 @@ android:layout_gravity="center_vertical" android:gravity="start" android:text="basicIntegrity" - android:textAppearance="?appearanceTextBodyOnPrimary" + android:textAppearance="@style/AppearanceFoundation.Body.OnPrimary" android:textStyle="bold" tools:ignore="HardcodedText" /> @@ -268,7 +268,7 @@ - - - - - - - - - - - - - - + android:layout_height="wrap_content" + android:paddingTop="@dimen/l1"> + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_superuser_md2.xml b/app/src/main/res/layout/fragment_superuser_md2.xml index 89f00bcd8..140c8675a 100644 --- a/app/src/main/res/layout/fragment_superuser_md2.xml +++ b/app/src/main/res/layout/fragment_superuser_md2.xml @@ -31,7 +31,7 @@ diff --git a/app/src/main/res/layout/fragment_theme_md2.xml b/app/src/main/res/layout/fragment_theme_md2.xml index 5d47e2e50..ace460cd3 100644 --- a/app/src/main/res/layout/fragment_theme_md2.xml +++ b/app/src/main/res/layout/fragment_theme_md2.xml @@ -1,8 +1,11 @@ - + + + @@ -12,11 +15,194 @@ + android:clipToPadding="false" + android:fillViewport="true" + android:paddingStart="@dimen/l1" + android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size + (int) @dimen/l1}" + android:paddingEnd="@dimen/l1" + android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/l1}"> + android:layout_height="wrap_content" + android:columnCount="2" + android:orientation="vertical" + android:useDefaultMargins="true"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/include_hide_filter.xml b/app/src/main/res/layout/include_hide_filter.xml index 6f225c122..a1c18a36a 100644 --- a/app/src/main/res/layout/include_hide_filter.xml +++ b/app/src/main/res/layout/include_hide_filter.xml @@ -31,7 +31,7 @@ android:layout_height="wrap_content" android:text="@string/hide_filters" android:textAllCaps="true" - android:textAppearance="?appearanceTextCaptionNormal" + android:textAppearance="@style/AppearanceFoundation.Caption" android:textColor="?colorPrimary" android:textStyle="bold" app:layout_constraintTop_toTopOf="parent" /> @@ -52,7 +52,7 @@ android:layout_height="wrap_content" android:checked="@={viewModel.showSystem}" android:text="@string/show_system_app" - android:textAppearance="?appearanceTextCaptionNormal" + android:textAppearance="@style/AppearanceFoundation.Caption" app:checkedIcon="@drawable/ic_check_md2" app:chipBackgroundColor="?colorSurfaceVariant" tools:checked="true" /> @@ -65,7 +65,7 @@ android:layout_height="wrap_content" android:checkable="false" android:text="@{viewModel.query}" - android:textAppearance="?appearanceTextCaptionNormal" + android:textAppearance="@style/AppearanceFoundation.Caption" app:chipBackgroundColor="?colorSurfaceVariant" /> @@ -77,14 +77,14 @@ android:layout_marginTop="@dimen/l1" android:text="@string/hide_search" android:textAllCaps="true" - android:textAppearance="?appearanceTextCaptionNormal" + android:textAppearance="@style/AppearanceFoundation.Caption" android:textColor="?colorPrimary" android:textStyle="bold" app:layout_constraintTop_toBottomOf="@+id/hide_filter_chip_group" /> @@ -128,6 +128,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" app:backgroundTint="?colorPrimary" + app:tint="?colorOnPrimary" app:elevation="0dp" app:fabSize="mini" app:layout_constraintBottom_toBottomOf="@+id/hide_filter_search" diff --git a/app/src/main/res/layout/include_install_options.xml b/app/src/main/res/layout/include_install_options.xml index 196a798c1..7874da119 100644 --- a/app/src/main/res/layout/include_install_options.xml +++ b/app/src/main/res/layout/include_install_options.xml @@ -21,7 +21,7 @@ tools:layout_gravity="center"> @@ -115,6 +115,7 @@ android:layout_marginEnd="@dimen/l1" app:backgroundTint="?colorPrimary" app:elevation="0dp" + app:tint="?colorOnPrimary" app:fabSize="mini" app:layout_constraintBottom_toBottomOf="@+id/module_filter_search" app:layout_constraintEnd_toEndOf="parent" @@ -122,7 +123,7 @@ app:srcCompat="@drawable/ic_check_md2" /> diff --git a/app/src/main/res/layout/item_developer.xml b/app/src/main/res/layout/item_developer.xml index 3af38b3f4..063d8ea67 100644 --- a/app/src/main/res/layout/item_developer.xml +++ b/app/src/main/res/layout/item_developer.xml @@ -21,7 +21,7 @@ tools:layout_gravity="center|start"> diff --git a/app/src/main/res/layout/item_developer_link.xml b/app/src/main/res/layout/item_developer_link.xml index bcdf8181b..491288330 100644 --- a/app/src/main/res/layout/item_developer_link.xml +++ b/app/src/main/res/layout/item_developer_link.xml @@ -25,7 +25,7 @@ diff --git a/app/src/main/res/layout/item_hide_process_md2.xml b/app/src/main/res/layout/item_hide_process_md2.xml index c61aa76fd..f6bf8c7f8 100644 --- a/app/src/main/res/layout/item_hide_process_md2.xml +++ b/app/src/main/res/layout/item_hide_process_md2.xml @@ -31,7 +31,7 @@ android:layout_marginBottom="@dimen/l_50" android:singleLine="true" android:text="@{item.item.name}" - android:textAppearance="?appearanceTextCaptionVariant" + android:textAppearance="@style/AppearanceFoundation.Caption.Variant" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/hide_process_checkbox" app:layout_constraintStart_toStartOf="parent" @@ -40,7 +40,7 @@ @@ -98,7 +98,7 @@ app:layout_constraintTop_toBottomOf="@+id/module_description" /> @@ -82,7 +82,7 @@ android:layout_height="wrap_content" android:layout_marginStart="@dimen/l1" android:text="@{item.item.lastUpdateString}" - android:textAppearance="?appearanceTextCaptionVariant" + android:textAppearance="@style/AppearanceFoundation.Caption.Variant" android:textSize="11sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/module_info" @@ -93,7 +93,7 @@ @@ -22,7 +22,7 @@ android:gravity="center" android:padding="@dimen/l1" android:text="@string/module_safe_mode_message" - android:textAppearance="?appearanceTextCaptionOnPrimary" + android:textAppearance="@style/AppearanceFoundation.Caption.OnPrimary" android:textStyle="bold" /> diff --git a/app/src/main/res/layout/item_section_md2.xml b/app/src/main/res/layout/item_section_md2.xml index 66bf2b8be..be9e8abd2 100644 --- a/app/src/main/res/layout/item_section_md2.xml +++ b/app/src/main/res/layout/item_section_md2.xml @@ -25,7 +25,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:text="@{item.title}" - android:textAppearance="?appearanceTextBodyNormal" + android:textAppearance="@style/AppearanceFoundation.Body" android:textColor="@color/color_primary_transient" android:textStyle="bold" tools:text="@tools:sample/lorem/random" @@ -36,7 +36,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/markdown_window_md2.xml b/app/src/main/res/layout/markdown_window_md2.xml index 4d9941eac..f0fd7ac4f 100644 --- a/app/src/main/res/layout/markdown_window_md2.xml +++ b/app/src/main/res/layout/markdown_window_md2.xml @@ -10,6 +10,6 @@ android:layout_marginStart="15dp" android:layout_marginEnd="15dp" android:paddingTop="10dp" - android:textAppearance="?appearanceTextCaptionNormal" /> + android:textAppearance="@style/AppearanceFoundation.Caption" /> \ No newline at end of file diff --git a/app/src/main/res/layout/swicher_caption_variant.xml b/app/src/main/res/layout/swicher_caption_variant.xml index 5737e4880..02c1d64a7 100644 --- a/app/src/main/res/layout/swicher_caption_variant.xml +++ b/app/src/main/res/layout/swicher_caption_variant.xml @@ -7,4 +7,4 @@ android:gravity="start|center_vertical" android:singleLine="true" tools:text="@string/magisk" - android:textAppearance="?appearanceTextCaptionVariant" /> \ No newline at end of file + android:textAppearance="@style/AppearanceFoundation.Caption.Variant" /> \ No newline at end of file diff --git a/app/src/main/res/values-night/themes_md2.xml b/app/src/main/res/values-night/themes_md2.xml index eb432d541..d72ce1b6a 100644 --- a/app/src/main/res/values-night/themes_md2.xml +++ b/app/src/main/res/values-night/themes_md2.xml @@ -1,24 +1,36 @@ - + + + + \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index a8dd8f25f..6c064a318 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -7,84 +7,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/values/strings_md2.xml b/app/src/main/res/values/strings_md2.xml index 11bca52c2..3cdbf7a45 100644 --- a/app/src/main/res/values/strings_md2.xml +++ b/app/src/main/res/values/strings_md2.xml @@ -14,6 +14,7 @@ @string/superuser @string/log @string/settings + Themes is not installed has invalid update channel! diff --git a/app/src/main/res/values/styles_md2.xml b/app/src/main/res/values/styles_md2.xml index 4d0ee6142..a4b6094dd 100644 --- a/app/src/main/res/values/styles_md2.xml +++ b/app/src/main/res/values/styles_md2.xml @@ -25,87 +25,10 @@ @drawable/bg_selectable @drawable/bg_selectable_borderless @dimen/internal_action_bar_size - - @style/WidgetFoundation.Appbar - - @style/WidgetFoundation.Toolbar - - @style/WidgetFoundation.Card - @style/WidgetFoundation.Card.Variant - @style/WidgetFoundation.Card.Elevated - @style/WidgetFoundation.Card.OnPrimary - - @style/WidgetFoundation.Button - @style/WidgetFoundation.Button.OnPrimary - @style/WidgetFoundation.Button.Outlined - - @style/WidgetFoundation.Button.Outlined.OnPrimary - - @style/WidgetFoundation.Button.Flat - @style/WidgetFoundation.Button.Flat.OnPrimary - @style/WidgetFoundation.Button.Text - @style/WidgetFoundation.Button.Text.Secondary - @style/WidgetFoundation.Button.Text.OnPrimary - @style/WidgetFoundation.Button.Error - - @style/WidgetFoundation.Icon - @style/WidgetFoundation.Icon.Primary - @style/WidgetFoundation.Icon.OnPrimary - @style/WidgetFoundation.Icon.Error - - @style/WidgetFoundation.Image.Big - @style/WidgetFoundation.Image - @style/WidgetFoundation.Image.Small - - @style/WidgetFoundation.Checkbox - - @style/WidgetFoundation.RadioButton - - @style/WidgetFoundation.ProgressBar - - @style/WidgetFoundation.ProgressBar.Indeterminate - - - @style/WidgetFoundation.ProgressBar.Indeterminate.Circular - - - - - @style/AppearanceFoundation.Display - @style/AppearanceFoundation.Display.Variant - @style/AppearanceFoundation.Display.OnPrimary - - - @style/AppearanceFoundation.Display.OnPrimary.Variant - - - @style/AppearanceFoundation.Title - @style/AppearanceFoundation.Title.Variant - @style/AppearanceFoundation.Title.OnPrimary - - @style/AppearanceFoundation.Title.OnPrimary.Variant - - - @style/AppearanceFoundation.Body - @style/AppearanceFoundation.Body.Variant - @style/AppearanceFoundation.Body.OnPrimary - - @style/AppearanceFoundation.Body.OnPrimary.Variant - - - @style/AppearanceFoundation.Caption - @style/AppearanceFoundation.Caption.Variant - @style/AppearanceFoundation.Caption.OnPrimary - - - @style/AppearanceFoundation.Caption.OnPrimary.Variant - \ No newline at end of file diff --git a/app/src/main/res/values/styles_md2_impl.xml b/app/src/main/res/values/styles_md2_impl.xml index 3c3cd8756..ab3780e96 100644 --- a/app/src/main/res/values/styles_md2_impl.xml +++ b/app/src/main/res/values/styles_md2_impl.xml @@ -1,10 +1,4 @@ - + + + + + + + + + + + +