diff --git a/CHANGELOG b/CHANGELOG index 3f6ae7f05..491166860 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ KeePassDX(4.4.4) - * Fix back to previous keyboard #2529 + * Fix return to previous keyboard #2529 + * Fix keyboard view update #2539 KeePassDX(4.4.3) * Fix a Passkey reference #2554 diff --git a/app/src/main/java/com/kunzisoft/keepass/credentialprovider/magikeyboard/KeyboardView.java b/app/src/main/java/com/kunzisoft/keepass/credentialprovider/magikeyboard/KeyboardView.java index fc992247e..ca9c988e4 100644 --- a/app/src/main/java/com/kunzisoft/keepass/credentialprovider/magikeyboard/KeyboardView.java +++ b/app/src/main/java/com/kunzisoft/keepass/credentialprovider/magikeyboard/KeyboardView.java @@ -661,8 +661,9 @@ public class KeyboardView extends View implements View.OnClickListener { } private void onBufferDraw() { - if (mBuffer == null || mKeyboardChanged) { - if (mBuffer == null || mKeyboardChanged && + if (mBuffer == null || mKeyboardChanged || + (mBuffer.getWidth() != getWidth() || mBuffer.getHeight() != getHeight())) { + if (mBuffer == null || (mBuffer.getWidth() != getWidth() || mBuffer.getHeight() != getHeight())) { // Make sure our bitmap is at least 1x1 final int width = Math.max(1, getWidth()); diff --git a/app/src/main/java/com/kunzisoft/keepass/credentialprovider/magikeyboard/MagikeyboardService.kt b/app/src/main/java/com/kunzisoft/keepass/credentialprovider/magikeyboard/MagikeyboardService.kt index e54c65c5e..905039206 100644 --- a/app/src/main/java/com/kunzisoft/keepass/credentialprovider/magikeyboard/MagikeyboardService.kt +++ b/app/src/main/java/com/kunzisoft/keepass/credentialprovider/magikeyboard/MagikeyboardService.kt @@ -95,6 +95,7 @@ class MagikeyboardService : InputMethodService(), private var mDatabaseTaskProvider: DatabaseTaskProvider? = null private var mDatabase: ContextualDatabase? = null + private var rootView: View? = null private var keyboardView: KeyboardView? = null private var entryContainer: View? = null private var databaseText: TextView? = null @@ -228,20 +229,21 @@ class MagikeyboardService : InputMethodService(), override fun onCreateInputView(): View { - val rootKeyboardView = layoutInflater.inflate(R.layout.keyboard_container, null) - entryContainer = rootKeyboardView.findViewById(R.id.magikeyboard_entry_container) - entryListView = rootKeyboardView.findViewById(R.id.magikeyboard_entry_list) - databaseText = rootKeyboardView.findViewById(R.id.magikeyboard_database_text) - databaseColorView = rootKeyboardView.findViewById(R.id.magikeyboard_database_color) - containerPackageText = rootKeyboardView.findViewById(R.id.magikeyboard_container_package) - containerShareText = rootKeyboardView.findViewById(R.id.magikeyboard_share_browser) - shareBrowserText = rootKeyboardView.findViewById(R.id.magikeyboard_share_browser_text) - packageText = rootKeyboardView.findViewById(R.id.magikeyboard_package_text) - appIdIcon = rootKeyboardView.findViewById(R.id.magikeyboard_app_id_icon) - webDomainIcon = rootKeyboardView.findViewById(R.id.magikeyboard_web_domain_icon) - keyboardView = rootKeyboardView.findViewById(R.id.magikeyboard_view) - screenshotModeView = rootKeyboardView.findViewById(R.id.screenshot_mode_banner) - timeoutProgressBar = rootKeyboardView.findViewById(R.id.magikeyboard_timeout_progress) + rootView = layoutInflater.inflate(R.layout.keyboard_container, null) + val root = rootView!! + entryContainer = root.findViewById(R.id.magikeyboard_entry_container) + entryListView = root.findViewById(R.id.magikeyboard_entry_list) + databaseText = root.findViewById(R.id.magikeyboard_database_text) + databaseColorView = root.findViewById(R.id.magikeyboard_database_color) + containerPackageText = root.findViewById(R.id.magikeyboard_container_package) + containerShareText = root.findViewById(R.id.magikeyboard_share_browser) + shareBrowserText = root.findViewById(R.id.magikeyboard_share_browser_text) + packageText = root.findViewById(R.id.magikeyboard_package_text) + appIdIcon = root.findViewById(R.id.magikeyboard_app_id_icon) + webDomainIcon = root.findViewById(R.id.magikeyboard_web_domain_icon) + keyboardView = root.findViewById(R.id.magikeyboard_view) + screenshotModeView = root.findViewById(R.id.screenshot_mode_banner) + timeoutProgressBar = root.findViewById(R.id.magikeyboard_timeout_progress) if (keyboardView != null) { keyboard = Keyboard(this, R.xml.keyboard_password) @@ -283,10 +285,10 @@ class MagikeyboardService : InputMethodService(), assignKeyboardView() keyboardView?.onKeyboardActionListener = this - return rootKeyboardView + return root } - return rootKeyboardView + return root } private fun getEntryInfo(entryId: UUID? = entriesAdapter?.selectedEntry?.id): EntryInfo? { @@ -346,6 +348,8 @@ class MagikeyboardService : InputMethodService(), } setDatabaseViews() entriesAdapter?.notifyDataSetChanged() + // To fix height calculation + rootView?.post { rootView?.requestLayout() } } private fun setDatabaseViews() { @@ -777,4 +781,4 @@ class MagikeyboardService : InputMethodService(), }) } } -} \ No newline at end of file +} diff --git a/app/src/main/res/layout/keyboard_container.xml b/app/src/main/res/layout/keyboard_container.xml index 5c9a06619..fa77eac84 100644 --- a/app/src/main/res/layout/keyboard_container.xml +++ b/app/src/main/res/layout/keyboard_container.xml @@ -22,8 +22,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:fitsSystemWindows="true" android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentBottom="true" + android:layout_height="wrap_content" android:paddingTop="4dp" android:paddingBottom="8dp" android:background="@color/grey_blue_deep" diff --git a/fastlane/metadata/android/en-US/changelogs/44400.txt b/fastlane/metadata/android/en-US/changelogs/44400.txt index f28fb76e4..f5a9c7e23 100644 --- a/fastlane/metadata/android/en-US/changelogs/44400.txt +++ b/fastlane/metadata/android/en-US/changelogs/44400.txt @@ -1 +1,2 @@ - * Fix back to previous keyboard #2529 + * Fix return to previous keyboard #2529 + * Fix keyboard view update #2539 diff --git a/fastlane/metadata/android/fr-FR/changelogs/44400.txt b/fastlane/metadata/android/fr-FR/changelogs/44400.txt index 077bc7db0..5899e3aa5 100644 --- a/fastlane/metadata/android/fr-FR/changelogs/44400.txt +++ b/fastlane/metadata/android/fr-FR/changelogs/44400.txt @@ -1 +1,2 @@ - * Correction retour au clavier précédent #2529 \ No newline at end of file + * Correction retour au clavier précédent #2529 + * Correction de la mise à jour de la vue de clavier #2539 \ No newline at end of file