2020-07-17 16:35:39 +02:00
|
|
|
package sushi.hardcore.droidfs
|
|
|
|
|
|
|
|
import android.content.SharedPreferences
|
|
|
|
import android.os.Bundle
|
|
|
|
import android.view.WindowManager
|
2021-11-09 11:12:09 +01:00
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
2020-07-17 16:35:39 +02:00
|
|
|
|
2021-11-09 11:12:09 +01:00
|
|
|
open class BaseActivity: AppCompatActivity() {
|
2020-07-17 16:35:39 +02:00
|
|
|
protected lateinit var sharedPrefs: SharedPreferences
|
2022-09-23 12:09:22 +02:00
|
|
|
protected var applyCustomTheme: Boolean = true
|
2023-02-28 22:50:59 +01:00
|
|
|
lateinit var theme: Theme
|
2021-11-09 11:12:09 +01:00
|
|
|
|
2020-07-17 16:35:39 +02:00
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
2023-02-28 22:50:59 +01:00
|
|
|
super.onCreate(savedInstanceState)
|
2023-03-07 23:25:17 +01:00
|
|
|
sharedPrefs = (application as VolumeManagerApp).sharedPreferences
|
2023-02-28 22:50:59 +01:00
|
|
|
theme = Theme.fromSharedPrefs(sharedPrefs)
|
|
|
|
if (applyCustomTheme) {
|
|
|
|
setTheme(theme.toResourceId())
|
2021-06-07 14:55:01 +02:00
|
|
|
}
|
2023-02-28 22:50:59 +01:00
|
|
|
if (!sharedPrefs.getBoolean("usf_screenshot", false)) {
|
2020-07-21 15:05:05 +02:00
|
|
|
window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
|
|
|
|
}
|
2020-07-17 16:35:39 +02:00
|
|
|
}
|
|
|
|
}
|