mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-20 17:11:32 -08:00
Fix lock in settings
This commit is contained in:
1 parent
201d8f8aee
commit
4e7f7f7fa0
3 files changed
+9
-7
No files matched your search
@@ -654,8 +654,9 @@ class NestedDatabaseSettingsFragment : NestedSettingsFragment(), DatabaseRetriev
|
||||
inflater.inflate(R.menu.database, menu)
|
||||
if (mDatabaseReadOnly) {
|
||||
menu.findItem(R.id.menu_save_database)?.isVisible = false
|
||||
menu.findItem(R.id.menu_merge_database)?.isVisible = false
|
||||
}
|
||||
if (!mMergeDataAllowed || mDatabaseReadOnly) {
|
||||
if (!mMergeDataAllowed) {
|
||||
menu.findItem(R.id.menu_merge_database)?.isVisible = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import android.widget.Toast
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.dialogs.AssignMasterKeyDialogFragment
|
||||
import com.kunzisoft.keepass.activities.helpers.ExternalFileHelper
|
||||
@@ -52,7 +53,7 @@ open class SettingsActivity
|
||||
|
||||
private var coordinatorLayout: CoordinatorLayout? = null
|
||||
private var toolbar: Toolbar? = null
|
||||
private var lockView: View? = null
|
||||
private var lockView: FloatingActionButton? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -112,11 +113,12 @@ open class SettingsActivity
|
||||
}
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
lockView?.visibility = View.GONE
|
||||
supportFragmentManager.beginTransaction()
|
||||
.add(R.id.fragment_container, retrieveMainFragment())
|
||||
.commit()
|
||||
} else {
|
||||
lockView?.visibility = if (savedInstanceState.getBoolean(SHOW_LOCK)) View.VISIBLE else View.GONE
|
||||
if (savedInstanceState.getBoolean(SHOW_LOCK)) lockView?.show() else lockView?.hide()
|
||||
}
|
||||
|
||||
backupManager = BackupManager(this)
|
||||
@@ -187,14 +189,14 @@ open class SettingsActivity
|
||||
NestedSettingsFragment.Screen.DATABASE,
|
||||
NestedSettingsFragment.Screen.DATABASE_MASTER_KEY,
|
||||
NestedSettingsFragment.Screen.DATABASE_SECURITY -> {
|
||||
lockView?.visibility = View.VISIBLE
|
||||
lockView?.show()
|
||||
}
|
||||
else -> {
|
||||
lockView?.visibility = View.GONE
|
||||
lockView?.hide()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
lockView?.visibility = View.GONE
|
||||
lockView?.hide()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
layout="@layout/view_button_lock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="start|bottom" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
Reference in new issue
Block a user