mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Refactor magikeyboard settings and add autofill settings
This commit is contained in:
@@ -137,12 +137,12 @@
|
||||
<activity android:name="com.kunzisoft.keepass.autofill.AutofillLauncherActivity"
|
||||
android:configChanges="keyboardHidden" />
|
||||
<activity android:name="com.kunzisoft.keepass.settings.SettingsAdvancedUnlockActivity" />
|
||||
<activity android:name="com.kunzisoft.keepass.settings.SettingsAutofillActivity" />
|
||||
<activity android:name="com.kunzisoft.keepass.settings.AutofillSettingsActivity" />
|
||||
<activity android:name="com.kunzisoft.keepass.magikeyboard.KeyboardLauncherActivity"
|
||||
android:label="@string/keyboard_name"
|
||||
android:exported="true">
|
||||
</activity>
|
||||
<activity android:name="com.kunzisoft.keepass.settings.MagikIMESettings"
|
||||
<activity android:name="com.kunzisoft.keepass.settings.MagikeyboardSettingsActivity"
|
||||
android:label="@string/keyboard_setting_label">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
||||
@@ -52,7 +52,6 @@ import com.kunzisoft.keepass.notifications.ClipboardEntryNotificationService
|
||||
import com.kunzisoft.keepass.notifications.DatabaseTaskNotificationService.Companion.ACTION_DATABASE_DELETE_ENTRY_HISTORY
|
||||
import com.kunzisoft.keepass.notifications.DatabaseTaskNotificationService.Companion.ACTION_DATABASE_RESTORE_ENTRY_HISTORY
|
||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||
import com.kunzisoft.keepass.settings.SettingsAutofillActivity
|
||||
import com.kunzisoft.keepass.tasks.AttachmentFileBinderManager
|
||||
import com.kunzisoft.keepass.timeout.ClipboardHelper
|
||||
import com.kunzisoft.keepass.timeout.TimeoutHelper
|
||||
@@ -475,8 +474,7 @@ class EntryActivity : LockingActivity() {
|
||||
getString(R.string.entry_user_name)))
|
||||
},
|
||||
{
|
||||
// Launch autofill settings
|
||||
startActivity(Intent(this@EntryActivity, SettingsAutofillActivity::class.java))
|
||||
performedNextEducation(entryActivityEducation, menu)
|
||||
})
|
||||
|
||||
if (!entryCopyEducationPerformed) {
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2019 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePassDX.
|
||||
*
|
||||
* KeePassDX is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* KeePassDX is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.kunzisoft.keepass.settings
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.stylish.StylishActivity
|
||||
|
||||
class AutofillSettingsActivity : StylishActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
setContentView(R.layout.activity_toolbar)
|
||||
val toolbar = findViewById<Toolbar>(R.id.toolbar)
|
||||
toolbar.setTitle(R.string.autofill_preference_title)
|
||||
setSupportActionBar(toolbar)
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.fragment_container, AutofillSettingsFragment())
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
android.R.id.home -> onBackPressed()
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019 Jeremy Jamet / Kunzisoft.
|
||||
* Copyright 2020 Jeremy Jamet / Kunzisoft.
|
||||
*
|
||||
* This file is part of KeePassDX.
|
||||
*
|
||||
@@ -20,16 +20,14 @@
|
||||
package com.kunzisoft.keepass.settings
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
|
||||
class SettingsAutofillActivity : SettingsActivity() {
|
||||
import com.kunzisoft.keepass.R
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
mTimeoutEnable = false
|
||||
}
|
||||
class AutofillSettingsFragment : PreferenceFragmentCompat() {
|
||||
|
||||
override fun retrieveMainFragment(): Fragment {
|
||||
return NestedSettingsFragment.newInstance(NestedSettingsFragment.Screen.FORM_FILLING)
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
// Load the preferences from an XML resource
|
||||
setPreferencesFromResource(R.xml.preferences_autofill, rootKey)
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ import android.view.MenuItem
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.stylish.StylishActivity
|
||||
|
||||
class MagikIMESettings : StylishActivity() {
|
||||
class MagikeyboardSettingsActivity : StylishActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -39,7 +39,7 @@ class MagikIMESettings : StylishActivity() {
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.fragment_container, MagikIMESettingsFragment())
|
||||
.replace(R.id.fragment_container, MagikeyboardSettingsFragment())
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ import androidx.preference.PreferenceFragmentCompat
|
||||
|
||||
import com.kunzisoft.keepass.R
|
||||
|
||||
class MagikIMESettingsFragment : PreferenceFragmentCompat() {
|
||||
class MagikeyboardSettingsFragment : PreferenceFragmentCompat() {
|
||||
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
// Load the preferences from an XML resource
|
||||
@@ -24,7 +24,6 @@ import android.os.Bundle
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.dialogs.AssignMasterKeyDialogFragment
|
||||
import com.kunzisoft.keepass.database.element.Database
|
||||
|
||||
class MainPreferenceFragment : PreferenceFragmentCompat() {
|
||||
|
||||
@@ -160,12 +160,7 @@ class NestedAppSettingsFragment : NestedSettingsFragment() {
|
||||
}
|
||||
|
||||
findPreference<Preference>(getString(R.string.magic_keyboard_preference_key))?.setOnPreferenceClickListener {
|
||||
startActivity(Intent(context, MagikIMESettings::class.java))
|
||||
false
|
||||
}
|
||||
|
||||
findPreference<Preference>(getString(R.string.clipboard_explanation_key))?.setOnPreferenceClickListener {
|
||||
UriUtil.gotoUrl(context!!, R.string.clipboard_explanation_url)
|
||||
startActivity(Intent(context, MagikeyboardSettingsActivity::class.java))
|
||||
false
|
||||
}
|
||||
|
||||
@@ -174,6 +169,16 @@ class NestedAppSettingsFragment : NestedSettingsFragment() {
|
||||
false
|
||||
}
|
||||
|
||||
findPreference<Preference>(getString(R.string.settings_autofill_key))?.setOnPreferenceClickListener {
|
||||
startActivity(Intent(context, AutofillSettingsActivity::class.java))
|
||||
false
|
||||
}
|
||||
|
||||
findPreference<Preference>(getString(R.string.clipboard_explanation_key))?.setOnPreferenceClickListener {
|
||||
UriUtil.gotoUrl(context!!, R.string.clipboard_explanation_url)
|
||||
false
|
||||
}
|
||||
|
||||
// Present in two places
|
||||
allowCopyPassword()
|
||||
}
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
<string name="autofill_explanation_key" translatable="false">autofill_explanation_key</string>
|
||||
<string name="settings_autofill_enable_key" translatable="false">settings_autofill_enable_key</string>
|
||||
<bool name="settings_autofill_enable_default" translatable="false">false</bool>
|
||||
<string name="settings_autofill_key" translatable="false">settings_autofill_key</string>
|
||||
<string name="keyboard_selection_entry_key" translatable="false">keyboard_selection_entry_key</string>
|
||||
<bool name="keyboard_selection_entry_default" translatable="false">false</bool>
|
||||
<string name="keyboard_notification_entry_key" translatable="false">keyboard_notification_entry_key</string>
|
||||
@@ -132,6 +133,10 @@
|
||||
<bool name="keyboard_key_vibrate_default" translatable="false">true</bool>
|
||||
<string name="keyboard_key_sound_key" translatable="false">keyboard_key_sound_key</string>
|
||||
<bool name="keyboard_key_sound_default" translatable="false">false</bool>
|
||||
<string name="autofill_auto_search_key" translatable="false">autofill_auto_search_key</string>
|
||||
<bool name="autofill_auto_search_default" translatable="false">true</bool>
|
||||
<string name="autofill_close_database_key" translatable="false">autofill_close_database_key</string>
|
||||
<bool name="autofill_close_database_default" translatable="false">false</bool>
|
||||
|
||||
<!-- Advanced Unlock Settings -->
|
||||
<string name="settings_advanced_unlock_key" translatable="false">settings_advanced_unlock_key</string>
|
||||
|
||||
@@ -284,6 +284,7 @@
|
||||
<string name="autofill_sign_in_prompt">Sign in with KeePassDX</string>
|
||||
<string name="autofill_explanation_summary">Enable autofilling to quickly fill out forms in other apps</string>
|
||||
<string name="set_autofill_service_title">Set default autofill service</string>
|
||||
<string name="autofill_preference_title">Autofill settings</string>
|
||||
<string name="password_size_title">Generated password size</string>
|
||||
<string name="password_size_summary">Sets default size of the generated passwords</string>
|
||||
<string name="list_password_generator_options_title">Password characters</string>
|
||||
@@ -380,6 +381,10 @@
|
||||
<string name="keyboard_auto_go_action_summary">\"Go\" key action after pressing a \"Field\" key</string>
|
||||
<string name="keyboard_key_vibrate_title">Vibratory keypresses</string>
|
||||
<string name="keyboard_key_sound_title">Audible keypresses</string>
|
||||
<string name="autofill_auto_search_title">Auto search</string>
|
||||
<string name="autofill_auto_search_summary">Automatically suggest search results from the web domain or applicationId</string>
|
||||
<string name="autofill_close_database_title">Close database</string>
|
||||
<string name="autofill_close_database_summary">Close the database after a suggestion of entries</string>
|
||||
<string name="allow_no_password_title">Allow no master key</string>
|
||||
<string name="allow_no_password_summary">Enable the \"Open\" button if no credentials are selected</string>
|
||||
<string name="delete_entered_password_title">Delete password</string>
|
||||
|
||||
@@ -19,4 +19,4 @@ Attributes for the Autofill service that tell the framework what will act as the
|
||||
Settings Activity. This is pointed to in the service's meta-data in the application's manifest.
|
||||
-->
|
||||
<autofill-service xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:settingsActivity="com.kunzisoft.keepass.settings.SettingsAutofillActivity" />
|
||||
android:settingsActivity="com.kunzisoft.keepass.settings.AutofillSettingsActivity" />
|
||||
@@ -20,7 +20,7 @@
|
||||
<input-method
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:settingsActivity="com.kunzisoft.keepass.settings.MagikIMESettings"
|
||||
android:settingsActivity="com.kunzisoft.keepass.settings.MagikeyboardSettingsActivity"
|
||||
android:supportsSwitchingToNextInputMethod="true"
|
||||
tools:ignore="UnusedAttribute">
|
||||
<subtype
|
||||
|
||||
37
app/src/main/res/xml/preferences_autofill.xml
Normal file
37
app/src/main/res/xml/preferences_autofill.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2018 Jeremy Jamet / Kunzisoft.
|
||||
|
||||
This file is part of KeePassDX.
|
||||
|
||||
KeePassDX is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
KeePassDX is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<PreferenceCategory
|
||||
android:title="@string/search_label">
|
||||
<SwitchPreference
|
||||
android:key="@string/autofill_auto_search_key"
|
||||
android:title="@string/autofill_auto_search_title"
|
||||
android:summary="@string/autofill_auto_search_summary"
|
||||
android:defaultValue="@bool/autofill_auto_search_default"/>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory
|
||||
android:title="@string/general">
|
||||
<SwitchPreference
|
||||
android:key="@string/autofill_close_database_key"
|
||||
android:title="@string/autofill_close_database_title"
|
||||
android:summary="@string/autofill_close_database_summary"
|
||||
android:defaultValue="@bool/autofill_close_database_default"/>
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
@@ -30,7 +30,7 @@
|
||||
android:title="@string/device_keyboard_setting_title" />
|
||||
<Preference
|
||||
android:key="@string/magic_keyboard_preference_key"
|
||||
android:title="@string/magic_keyboard_title" />
|
||||
android:title="@string/keyboard_setting_label" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
@@ -44,6 +44,9 @@
|
||||
android:key="@string/settings_autofill_enable_key"
|
||||
android:title="@string/set_autofill_service_title"
|
||||
android:defaultValue="@bool/settings_autofill_enable_default"/>
|
||||
<Preference
|
||||
android:key="@string/settings_autofill_key"
|
||||
android:title="@string/autofill_preference_title" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
|
||||
Reference in New Issue
Block a user