Fixed visual bugs for API levels 21-22, removed "Open info panel automatically" feature due to visual bugs, switched out test URLs for real URLs again

This commit is contained in:
Deniz Düzgören
2019-08-01 15:36:21 +02:00
parent 6cf4c44880
commit a2721aabcd
15 changed files with 56 additions and 83 deletions
@@ -52,32 +52,29 @@ class Main : AppCompatActivity(R.layout.app_bar_main) {
notificationJob()
}
val handler = Handler()
val appbarlayout = findViewById<AppBarLayout>(R.id.appbarlayout)
val toolbarTxt = findViewById<TextView>(R.id.toolbarTxt)
val bottomNav = findViewById<BottomNavigationView>(R.id.bottom_nav)
val chip = findViewById<Chip>(R.id.chip)
val contextView = findViewById<View>(R.id.coordination)
val window = this.window as Window
setTheme(R.style.AppTheme0)
if (prefs.getBoolean("openInfo", false)) {
openInfoDialog()
}
when (prefs.getInt("themeInt", 0)) {
0 -> {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
window.navigationBarColor = ContextCompat.getColor(this, R.color.colorBackground)
} else {
window.statusBarColor = ContextCompat.getColor(this, R.color.legacyBlack)
window.navigationBarColor = ContextCompat.getColor(this, R.color.legacyBlack)
}
}
else -> {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
window.navigationBarColor = ContextCompat.getColor(this, R.color.colorBackground)
window.statusBarColor = ContextCompat.getColor(this, R.color.colorBackground)
}
// else -> {
// when (context.resources.configuration.uiMode) {