Fix autofill style

This commit is contained in:
J-Jamet
2021-08-04 18:54:34 +02:00
parent e3198031e3
commit 632e0648d4
4 changed files with 25 additions and 3 deletions

View File

@@ -45,6 +45,10 @@ import com.kunzisoft.keepass.utils.LOCK_ACTION
@RequiresApi(api = Build.VERSION_CODES.O)
class AutofillLauncherActivity : DatabaseActivity() {
override fun applyCustomStyle(): Boolean {
return false
}
override fun onDatabaseRetrieved(database: Database?) {
super.onDatabaseRetrieved(database)

View File

@@ -43,6 +43,10 @@ import com.kunzisoft.keepass.settings.PreferencesUtil
*/
class EntrySelectionLauncherActivity : DatabaseActivity() {
override fun applyCustomStyle(): Boolean {
return false
}
override fun onDatabaseRetrieved(database: Database?) {
super.onDatabaseRetrieved(database)
var sharedWebDomain: String? = null

View File

@@ -28,6 +28,10 @@ import com.kunzisoft.keepass.database.search.SearchHelper
*/
class MagikeyboardLauncherActivity : DatabaseActivity() {
override fun applyCustomStyle(): Boolean {
return false
}
override fun onDatabaseRetrieved(database: Database?) {
super.onDatabaseRetrieved(database)
val readOnly = database?.isReadOnly != false

View File

@@ -35,6 +35,7 @@ abstract class StylishActivity : AppCompatActivity() {
@StyleRes
private var themeId: Int = 0
private var customStyle = true
/* (non-Javadoc) Workaround for HTC Linkify issues
* @see android.app.Activity#startActivity(android.content.Intent)
@@ -52,10 +53,18 @@ abstract class StylishActivity : AppCompatActivity() {
}
}
open fun applyCustomStyle(): Boolean {
return true
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
customStyle = applyCustomStyle()
if (customStyle) {
this.themeId = Stylish.getThemeId(this)
setTheme(themeId)
}
// Several gingerbread devices have problems with FLAG_SECURE
window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
@@ -63,7 +72,8 @@ abstract class StylishActivity : AppCompatActivity() {
override fun onResume() {
super.onResume()
if (Stylish.getThemeId(this) != this.themeId) {
if (customStyle && Stylish.getThemeId(this) != this.themeId) {
Log.d(this.javaClass.name, "Theme change detected, restarting activity")
this.recreate()
}