From 3499f3f1bcdceb6bd64948e2ac7678a6056515b5 Mon Sep 17 00:00:00 2001 From: X1nto Date: Sat, 2 May 2020 15:23:15 +0400 Subject: [PATCH] experiments with android 6 v3.0 --- app/app.iml | 10 +++++----- .../java/com/vanced/manager/ui/core/BaseActivity.kt | 9 +++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/app.iml b/app/app.iml index a3669c1e..690cfc9a 100644 --- a/app/app.iml +++ b/app/app.iml @@ -72,15 +72,15 @@ - + - + - - - + + + diff --git a/app/src/main/java/com/vanced/manager/ui/core/BaseActivity.kt b/app/src/main/java/com/vanced/manager/ui/core/BaseActivity.kt index 091636d0..b16d0f64 100644 --- a/app/src/main/java/com/vanced/manager/ui/core/BaseActivity.kt +++ b/app/src/main/java/com/vanced/manager/ui/core/BaseActivity.kt @@ -2,18 +2,14 @@ package com.vanced.manager.ui.core import android.annotation.SuppressLint import android.app.ActivityManager -import android.content.Context import android.content.SharedPreferences import android.content.res.Configuration import android.os.Build import android.os.Bundle -import android.util.DisplayMetrics -import android.view.KeyEvent import androidx.appcompat.app.AppCompatActivity import androidx.core.content.res.ResourcesCompat import androidx.preference.PreferenceManager import com.vanced.manager.R -import java.util.* // This activity will NOT be used in manifest // since MainActivity will extend it @@ -24,6 +20,8 @@ open class ThemeActivity : AppCompatActivity() { private lateinit var pref: SharedPreferences override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + pref = PreferenceManager.getDefaultSharedPreferences(this) currentTheme = pref.getString("theme_mode", "").toString() @@ -32,10 +30,10 @@ open class ThemeActivity : AppCompatActivity() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { setTaskBG() } - super.onCreate(savedInstanceState) } override fun onResume() { + super.onResume() val theme = pref.getString("theme_mode", "") //if for some weird reasons we get invalid @@ -48,7 +46,6 @@ open class ThemeActivity : AppCompatActivity() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { setTaskBG() } - super.onResume() } //This stupid ass AppCompatDelegate does