mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-12-05 00:02:27 -08:00
Fix orientation change dimension
This commit is contained in:
1 parent
8bf017e14e
commit
b598945903
3 files changed
+25
-17
No files matched your search
@@ -94,13 +94,15 @@ class ListNodesFragment : StylishFragment(), SortDialogFragment.SortSelectionLis
|
||||
}
|
||||
}
|
||||
|
||||
mAdapter = NodeAdapter(contextThemed, currentActivity.menuInflater)
|
||||
mAdapter?.apply {
|
||||
setReadOnly(readOnly)
|
||||
setIsASearchResult(isASearchResult)
|
||||
setOnNodeClickListener(nodeClickCallback)
|
||||
setActivateContextMenu(true)
|
||||
setNodeMenuListener(nodeMenuListener)
|
||||
contextThemed?.let { context ->
|
||||
mAdapter = NodeAdapter(context, currentActivity.menuInflater)
|
||||
mAdapter?.apply {
|
||||
setReadOnly(readOnly)
|
||||
setIsASearchResult(isASearchResult)
|
||||
setOnNodeClickListener(nodeClickCallback)
|
||||
setActivateContextMenu(true)
|
||||
setNodeMenuListener(nodeMenuListener)
|
||||
}
|
||||
}
|
||||
prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ abstract class StylishFragment : Fragment() {
|
||||
|
||||
@StyleRes
|
||||
protected var themeId: Int = 0
|
||||
protected lateinit var contextThemed: Context
|
||||
protected var contextThemed: Context? = null
|
||||
|
||||
override fun onAttach(context: Context?) {
|
||||
super.onAttach(context)
|
||||
@@ -50,11 +50,17 @@ abstract class StylishFragment : Fragment() {
|
||||
val window = activity!!.window
|
||||
|
||||
val attrColorPrimaryDark = intArrayOf(android.R.attr.colorPrimaryDark)
|
||||
val taColorPrimaryDark = contextThemed.theme.obtainStyledAttributes(attrColorPrimaryDark)
|
||||
window.statusBarColor = taColorPrimaryDark.getColor(0, Color.BLACK)
|
||||
taColorPrimaryDark.recycle()
|
||||
val taColorPrimaryDark = contextThemed?.theme?.obtainStyledAttributes(attrColorPrimaryDark)
|
||||
val defaultColor = Color.BLACK
|
||||
window.statusBarColor = taColorPrimaryDark?.getColor(0, defaultColor) ?: defaultColor
|
||||
taColorPrimaryDark?.recycle()
|
||||
}
|
||||
|
||||
return super.onCreateView(inflater, container, savedInstanceState)
|
||||
}
|
||||
|
||||
override fun onDetach() {
|
||||
contextThemed = null
|
||||
super.onDetach()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user