From 56bc46801c67725315aec36ddea74f6d3d03f8b6 Mon Sep 17 00:00:00 2001 From: mcarare Date: Tue, 17 Nov 2020 19:39:46 +0200 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/15788: Remove nested layouts in search dialog layout. --- .../fenix/search/SearchDialogFragment.kt | 8 +- .../res/layout/fragment_search_dialog.xml | 130 +++++++++++------- 2 files changed, 84 insertions(+), 54 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt b/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt index b670be096d..a6b3213277 100644 --- a/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt @@ -501,9 +501,15 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler { searchState.query.isEmpty() && !clipboardUrl.isNullOrEmpty() - fill_link_from_clipboard.visibility = if (shouldShowView) View.VISIBLE else View.GONE + fill_link_from_clipboard.isVisible = shouldShowView + clipboard_url.isVisible = shouldShowView + clipboard_title.isVisible = shouldShowView + link_icon.isVisible = shouldShowView + clipboard_url.text = clipboardUrl + fill_link_from_clipboard.contentDescription = "${clipboard_title.text}, ${clipboard_url.text}." + if (clipboardUrl != null && !((activity as HomeActivity).browsingModeManager.mode.isPrivate)) { requireComponents.core.engine.speculativeConnect(clipboardUrl) } diff --git a/app/src/main/res/layout/fragment_search_dialog.xml b/app/src/main/res/layout/fragment_search_dialog.xml index fec3110b8c..91cdcc8888 100644 --- a/app/src/main/res/layout/fragment_search_dialog.xml +++ b/app/src/main/res/layout/fragment_search_dialog.xml @@ -4,6 +4,7 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - + app:layout_constraintTop_toBottomOf="@+id/toolbar" + tools:visibility="visible" /> - + - + - - + - + app:layout_constraintStart_toStartOf="parent" /> - + - - +