mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Fix keyboard selection
This commit is contained in:
@@ -576,14 +576,18 @@ class GroupActivity : LockingActivity(),
|
||||
EntryActivity.launch(this@GroupActivity, entryVersioned, mReadOnly)
|
||||
},
|
||||
{ searchInfo ->
|
||||
if (!mReadOnly && PreferencesUtil.isKeyboardSaveSearchInfoEnable(this@GroupActivity)) {
|
||||
if (!mReadOnly
|
||||
&& searchInfo != null
|
||||
&& PreferencesUtil.isKeyboardSaveSearchInfoEnable(this@GroupActivity)) {
|
||||
updateEntryWithSearchInfo(entryVersioned, searchInfo)
|
||||
} else {
|
||||
entrySelectedForKeyboardSelection(entryVersioned)
|
||||
}
|
||||
},
|
||||
{ searchInfo, _ ->
|
||||
if (!mReadOnly && PreferencesUtil.isAutofillSaveSearchInfoEnable(this@GroupActivity)) {
|
||||
if (!mReadOnly
|
||||
&& searchInfo != null
|
||||
&& PreferencesUtil.isAutofillSaveSearchInfoEnable(this@GroupActivity)) {
|
||||
updateEntryWithSearchInfo(entryVersioned, searchInfo)
|
||||
} else {
|
||||
entrySelectedForAutofillSelection(entryVersioned)
|
||||
@@ -629,7 +633,7 @@ class GroupActivity : LockingActivity(),
|
||||
onValidateSpecialMode()
|
||||
}
|
||||
|
||||
private fun updateEntryWithSearchInfo(entry: Entry, searchInfo: SearchInfo?) {
|
||||
private fun updateEntryWithSearchInfo(entry: Entry, searchInfo: SearchInfo) {
|
||||
val newEntry = Entry(entry)
|
||||
newEntry.setEntryInfo(mDatabase, newEntry.getEntryInfo(mDatabase).apply {
|
||||
saveSearchInfo(mDatabase, searchInfo)
|
||||
|
||||
@@ -184,7 +184,6 @@ class MagikIME : InputMethodService(), KeyboardView.OnKeyboardActionListener {
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
private fun switchToPreviousKeyboard() {
|
||||
var imeManager: InputMethodManager? = null
|
||||
try {
|
||||
|
||||
@@ -123,29 +123,27 @@ class EntryInfo : Parcelable {
|
||||
(customFields as ArrayList<Field>).add(Field(field.name + suffix, field.protectedValue))
|
||||
}
|
||||
|
||||
fun saveSearchInfo(database: Database?, searchInfo: SearchInfo?) {
|
||||
searchInfo?.let { mSearchInfo ->
|
||||
mSearchInfo.webDomain?.let { webDomain ->
|
||||
// If unable to save web domain in custom field or URL not populated, save in URL
|
||||
if (database?.allowEntryCustomFields() != true || url.isEmpty()) {
|
||||
val retrievedScheme = mSearchInfo.webScheme
|
||||
val scheme = if (retrievedScheme.isNullOrEmpty()) "http" else retrievedScheme
|
||||
url = "$scheme://$webDomain"
|
||||
} else {
|
||||
// Save web domain in custom field
|
||||
addUniqueField(Field(WEB_DOMAIN_FIELD_NAME,
|
||||
ProtectedString(false, webDomain))
|
||||
fun saveSearchInfo(database: Database?, searchInfo: SearchInfo) {
|
||||
searchInfo.webDomain?.let { webDomain ->
|
||||
// If unable to save web domain in custom field or URL not populated, save in URL
|
||||
if (database?.allowEntryCustomFields() != true || url.isEmpty()) {
|
||||
val retrievedScheme = searchInfo.webScheme
|
||||
val scheme = if (retrievedScheme.isNullOrEmpty()) "http" else retrievedScheme
|
||||
url = "$scheme://$webDomain"
|
||||
} else {
|
||||
// Save web domain in custom field
|
||||
addUniqueField(Field(WEB_DOMAIN_FIELD_NAME,
|
||||
ProtectedString(false, webDomain))
|
||||
)
|
||||
}
|
||||
} ?: run {
|
||||
// Save application id in custom field
|
||||
if (database?.allowEntryCustomFields() == true) {
|
||||
searchInfo.applicationId?.let { applicationId ->
|
||||
addUniqueField(Field(APPLICATION_ID_FIELD_NAME,
|
||||
ProtectedString(false, applicationId))
|
||||
)
|
||||
}
|
||||
} ?: run {
|
||||
// Save application id in custom field
|
||||
if (database?.allowEntryCustomFields() == true) {
|
||||
mSearchInfo.applicationId?.let { applicationId ->
|
||||
addUniqueField(Field(APPLICATION_ID_FIELD_NAME,
|
||||
ProtectedString(false, applicationId))
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user