mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-25 20:55:12 +00:00
removed theme settings for android 6 and lower
This commit is contained in:
parent
85e40c8ba4
commit
95db18de9a
4 changed files with 37 additions and 22 deletions
|
@ -31,8 +31,7 @@
|
|||
</activity>
|
||||
<activity
|
||||
android:name=".ui.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/LightTheme"/>
|
||||
android:label="@string/app_name" />
|
||||
|
||||
<meta-data
|
||||
android:name="preloaded_fonts"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.vanced.manager.ui.fragments
|
||||
|
||||
import android.content.res.Configuration
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
|
@ -15,6 +16,14 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
|||
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
setPreferencesFromResource(R.xml.preferences, rootKey)
|
||||
|
||||
//Fuck Android 6 and 5 users! Because theme is not working
|
||||
//we can't display preference for them.
|
||||
// They should've upgraded to something newer
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
setPreferencesFromResource(R.xml.theme_preference, rootKey)
|
||||
}
|
||||
|
||||
activity?.title = getString(R.string.title_settings)
|
||||
setHasOptionsMenu(true)
|
||||
|
||||
|
|
|
@ -3,35 +3,21 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/category_manager"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<Preference
|
||||
android:key="update_check"
|
||||
android:title="@string/check_updates"
|
||||
android:icon="@drawable/ic_cloud_upload_black_24dp"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/category_interface"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<ListPreference
|
||||
android:icon="@drawable/ic_brush_black_24dp"
|
||||
android:key="theme_mode"
|
||||
android:title="@string/theme"
|
||||
android:summary="@string/theme_summary"
|
||||
android:entries="@array/theme_modes"
|
||||
android:entryValues="@array/theme_modes_values"
|
||||
android:defaultValue="LIGHT"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/category_manager"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<SwitchPreference
|
||||
android:title="@string/push_notifications"
|
||||
android:key="push_notifications_status"
|
||||
android:summary="@string/push_notifications_summary"
|
||||
android:icon="@drawable/ic_notifications_black_24dp"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
21
app/src/main/res/xml/theme_preference.xml
Normal file
21
app/src/main/res/xml/theme_preference.xml
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/category_interface"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<ListPreference
|
||||
android:icon="@drawable/ic_brush_black_24dp"
|
||||
android:key="theme_mode"
|
||||
android:title="@string/theme"
|
||||
android:summary="@string/theme_summary"
|
||||
android:entries="@array/theme_modes"
|
||||
android:entryValues="@array/theme_modes_values"
|
||||
android:defaultValue="LIGHT"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
Loading…
Reference in a new issue