0
0
Fork 0
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:
X1nto 2020-05-02 19:55:34 +04:00
parent 85e40c8ba4
commit 95db18de9a
4 changed files with 37 additions and 22 deletions

View file

@ -31,8 +31,7 @@
</activity> </activity>
<activity <activity
android:name=".ui.MainActivity" android:name=".ui.MainActivity"
android:label="@string/app_name" android:label="@string/app_name" />
android:theme="@style/LightTheme"/>
<meta-data <meta-data
android:name="preloaded_fonts" android:name="preloaded_fonts"

View file

@ -1,6 +1,7 @@
package com.vanced.manager.ui.fragments package com.vanced.manager.ui.fragments
import android.content.res.Configuration import android.content.res.Configuration
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.Menu import android.view.Menu
import android.view.MenuInflater import android.view.MenuInflater
@ -15,6 +16,14 @@ class SettingsFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.preferences, rootKey) 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) activity?.title = getString(R.string.title_settings)
setHasOptionsMenu(true) setHasOptionsMenu(true)

View file

@ -3,35 +3,21 @@
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">
<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 <PreferenceCategory
android:title="@string/category_manager" android:title="@string/category_manager"
app:iconSpaceReserved="false"> app:iconSpaceReserved="false">
<Preference
android:key="update_check"
android:title="@string/check_updates"
android:icon="@drawable/ic_cloud_upload_black_24dp"/>
<SwitchPreference <SwitchPreference
android:title="@string/push_notifications" android:title="@string/push_notifications"
android:key="push_notifications_status" android:key="push_notifications_status"
android:summary="@string/push_notifications_summary" android:summary="@string/push_notifications_summary"
android:icon="@drawable/ic_notifications_black_24dp"/> android:icon="@drawable/ic_notifications_black_24dp"/>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View 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>