2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/17364: Make hint scrollable and do not overlap other elements.

This commit is contained in:
mcarare 2021-01-21 14:57:06 +02:00 committed by Mihai Adrian Carare
parent 1668306b55
commit e18afd703c
3 changed files with 131 additions and 109 deletions

View File

@ -471,8 +471,15 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
clear(pill_wrapper.id, BOTTOM)
connect(pill_wrapper.id, BOTTOM, toolbar.id, TOP)
clear(awesome_bar.id, TOP)
clear(awesome_bar.id, BOTTOM)
connect(awesome_bar.id, TOP, search_suggestions_hint.id, BOTTOM)
connect(awesome_bar.id, BOTTOM, pill_wrapper.id, TOP)
clear(search_suggestions_hint.id, TOP)
clear(search_suggestions_hint.id, BOTTOM)
connect(search_suggestions_hint.id, TOP, PARENT_ID, TOP)
connect(search_suggestions_hint.id, BOTTOM, search_hint_bottom_barrier.id, TOP)
clear(fill_link_from_clipboard.id, TOP)
connect(fill_link_from_clipboard.id, BOTTOM, pill_wrapper.id, TOP)

View File

@ -5,12 +5,12 @@
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/search_wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="?attr/scrimBackground"
xmlns:app="http://schemas.android.com/apk/res-auto">
android:background="?attr/scrimBackground">
<mozilla.components.browser.toolbar.BrowserToolbar
android:id="@+id/toolbar"
android:layout_width="0dp"
@ -29,6 +29,36 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<ViewStub
android:id="@+id/search_suggestions_hint"
android:layout_width="0dp"
android:layout_height="0dp"
android:inflatedId="@id/search_suggestions_hint"
android:layout="@layout/search_suggestions_hint"
app:layout_constraintBottom_toTopOf="@id/search_hint_bottom_barrier"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar"
app:layout_constraintHeight_default="wrap"/>
<View
android:id="@+id/search_suggestions_hint_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?neutralFaded"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/search_suggestions_hint"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/search_hint_bottom_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="top"
app:constraint_referenced_ids="awesome_bar,pill_wrapper"/>
<mozilla.components.browser.awesomebar.BrowserAwesomeBar
xmlns:mozac="http://schemas.android.com/apk/res-auto"
android:id="@+id/awesome_bar"
@ -43,38 +73,10 @@
app:layout_constraintBottom_toTopOf="@+id/pill_wrapper"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/top_barrier"
app:layout_constraintTop_toBottomOf="@id/search_suggestions_hint"
mozac:awesomeBarDescriptionTextColor="?secondaryText"
mozac:awesomeBarTitleTextColor="?primaryText" />
<ViewStub
android:id="@+id/search_suggestions_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inflatedId="@id/search_suggestions_hint"
android:layout="@layout/search_suggestions_hint"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/top_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="search_suggestions_hint"/>
<View
android:id="@+id/search_suggestions_hint_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?neutralFaded"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/search_suggestions_hint"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<View
android:id="@+id/fill_link_from_clipboard"
android:layout_width="0dp"

View File

@ -2,91 +2,104 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/foundation"
android:paddingStart="20dp"
android:paddingTop="20dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp">
android:layout_height="match_parent"
android:scrollbars="vertical"
android:fadeScrollbars="false"
app:layout_constraintBottom_toBottomOf="@id/search_divider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar">
<ImageView
android:id="@+id/info_button"
android:layout_width="24dp"
android:layout_height="24dp"
android:importantForAccessibility="no"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_info"
tools:tint="@color/contrast_text_private_theme" />
<TextView
android:id="@+id/title"
android:layout_width="0dp"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:paddingBottom="12dp"
android:textAppearance="?android:attr/textAppearanceListItem"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/search_suggestions_onboarding_title"
tools:textAppearance="?android:attr/textAppearanceListItem" />
android:background="?attr/foundation"
android:paddingStart="20dp"
android:paddingTop="20dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
app:layout_constraintBottom_toTopOf="@id/learn_more"
app:layout_constraintEnd_toEndOf="@id/title"
app:layout_constraintStart_toStartOf="@id/title"
app:layout_constraintTop_toBottomOf="@id/title"
tools:text="@string/search_suggestions_onboarding_text"
tools:textAppearance="?attr/textAppearanceListItemSmall" />
<ImageView
android:id="@+id/info_button"
android:layout_width="24dp"
android:layout_height="24dp"
android:importantForAccessibility="no"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_info"
tools:tint="@color/contrast_text_private_theme" />
<org.mozilla.fenix.utils.LinkTextView
android:id="@+id/learn_more"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:text="@string/exceptions_empty_message_learn_more_link"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/accentHighContrast"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/allow"
app:layout_constraintEnd_toStartOf="@id/dismiss"
app:layout_constraintStart_toStartOf="@id/title"
app:layout_constraintTop_toBottomOf="@id/text"
tools:textColor="@color/accent_high_contrast_private_theme" />
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:paddingBottom="12dp"
android:textAppearance="?android:attr/textAppearanceListItem"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/search_suggestions_onboarding_title"
tools:textAppearance="?android:attr/textAppearanceListItem" />
<com.google.android.material.button.MaterialButton
android:id="@+id/allow"
style="@style/NeutralButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:paddingHorizontal="12dp"
android:text="@string/search_suggestions_onboarding_allow_button"
app:layout_constraintEnd_toEndOf="@id/title"
app:layout_constraintTop_toBottomOf="@id/text" />
<TextView
android:id="@+id/text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
app:layout_constraintBottom_toTopOf="@id/learn_more"
app:layout_constraintEnd_toEndOf="@id/title"
app:layout_constraintStart_toStartOf="@id/title"
app:layout_constraintTop_toBottomOf="@id/title"
tools:text="@string/search_suggestions_onboarding_text"
tools:textAppearance="?attr/textAppearanceListItemSmall" />
<TextView
android:id="@+id/dismiss"
android:layout_width="0dp"
android:layout_height="48dp"
android:fontFamily="@font/metropolis_semibold"
android:gravity="center_vertical"
android:letterSpacing="0"
android:paddingHorizontal="20dp"
android:text="@string/search_suggestions_onboarding_do_not_allow_button"
android:textColor="#ffffff"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/allow"
app:layout_constraintEnd_toStartOf="@id/allow"
app:layout_constraintTop_toTopOf="@id/allow" />
<org.mozilla.fenix.utils.LinkTextView
android:id="@+id/learn_more"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:text="@string/exceptions_empty_message_learn_more_link"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?attr/accentHighContrast"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/allow"
app:layout_constraintEnd_toStartOf="@id/dismiss"
app:layout_constraintStart_toStartOf="@id/title"
app:layout_constraintTop_toBottomOf="@id/text"
tools:textColor="@color/accent_high_contrast_private_theme" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/allow"
style="@style/NeutralButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:paddingHorizontal="12dp"
android:text="@string/search_suggestions_onboarding_allow_button"
app:layout_constraintEnd_toEndOf="@id/title"
app:layout_constraintTop_toBottomOf="@id/text" />
<TextView
android:id="@+id/dismiss"
android:layout_width="0dp"
android:layout_height="48dp"
android:fontFamily="@font/metropolis_semibold"
android:gravity="center_vertical"
android:letterSpacing="0"
android:paddingHorizontal="20dp"
android:text="@string/search_suggestions_onboarding_do_not_allow_button"
android:textColor="#ffffff"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/allow"
app:layout_constraintEnd_toStartOf="@id/allow"
app:layout_constraintTop_toTopOf="@id/allow" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>