Divider only shows when both panel and "Search with" are visible
This commit is contained in:
parent
cbdf83c12a
commit
3283d6ed0b
|
@ -222,6 +222,9 @@ class SearchFragment : Fragment(), UserInteractionHandler {
|
|||
|
||||
inflated.text.text =
|
||||
getString(R.string.search_suggestions_onboarding_text, getString(R.string.app_name))
|
||||
|
||||
inflated.title.text =
|
||||
getString(R.string.search_suggestions_onboarding_title)
|
||||
}
|
||||
|
||||
view.search_suggestions_onboarding.setOnInflateListener((stubListener))
|
||||
|
@ -334,8 +337,12 @@ class SearchFragment : Fragment(), UserInteractionHandler {
|
|||
}
|
||||
|
||||
private fun updateSearchSuggestionsHintVisibility(state: SearchFragmentState) {
|
||||
view?.findViewById<View>(R.id.search_suggestions_onboarding)
|
||||
?.isVisible = state.showSearchSuggestionsHint
|
||||
view?.apply {
|
||||
findViewById<View>(R.id.search_suggestions_onboarding)?.isVisible = state.showSearchSuggestionsHint
|
||||
|
||||
search_suggestions_onboarding_divider?.isVisible =
|
||||
search_with_shortcuts.isVisible && state.showSearchSuggestionsHint
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -71,7 +71,7 @@ internal fun SearchFragment.setOutOfExperimentConstraints(layout: ConstraintLayo
|
|||
awesomeBar {
|
||||
connect(
|
||||
TOP to TOP of UNSET,
|
||||
TOP to BOTTOM of awesomeBar_barrier,
|
||||
TOP to BOTTOM of search_with_shortcuts,
|
||||
BOTTOM to TOP of pillWrapper
|
||||
)
|
||||
}
|
||||
|
|
|
@ -23,6 +23,16 @@
|
|||
app:layout_constraintBottom_toTopOf="@id/awesomeBar_barrier"
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar_wrapper"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/search_suggestions_onboarding_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?neutralFaded"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/search_suggestions_onboarding"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/toolbar_wrapper"
|
||||
android:layout_width="0dp"
|
||||
|
@ -58,7 +68,8 @@
|
|||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/toolbar_wrapper"
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar_wrapper"
|
||||
app:layout_constraintStart_toStartOf="@id/toolbar_wrapper">
|
||||
app:layout_constraintStart_toStartOf="@id/toolbar_wrapper"
|
||||
app:layout_constraintBottom_toBottomOf="@id/awesomeBar_barrier">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/link_icon"
|
||||
|
@ -116,8 +127,7 @@
|
|||
android:layout_marginEnd="@dimen/search_fragment_shortcuts_label_margin_horizontal"
|
||||
android:text="@string/search_shortcuts_search_with"
|
||||
app:layout_constraintStart_toStartOf="@id/toolbar_wrapper"
|
||||
app:layout_constraintTop_toBottomOf="@id/fill_link_from_clipboard"
|
||||
app:layout_constraintBottom_toTopOf="@id/awesomeBar_barrier"
|
||||
app:layout_constraintTop_toBottomOf="@id/awesomeBar_barrier"
|
||||
tools:text="Search with" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
|
@ -125,7 +135,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="search_with_shortcuts,search_suggestions_onboarding"/>
|
||||
app:constraint_referenced_ids="fill_link_from_clipboard,search_suggestions_onboarding"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/search_divider"
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="20dp"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<ImageView
|
||||
|
@ -15,7 +17,8 @@
|
|||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_info"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:tint="@color/contrast_text_private_theme"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
|
@ -27,18 +30,20 @@
|
|||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@string/search_suggestions_onboarding_title" />
|
||||
tools:text="@string/search_suggestions_onboarding_title"
|
||||
tools:textAppearance="?android:attr/textAppearanceListItem"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/search_suggestions_onboarding_text"
|
||||
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" />
|
||||
app:layout_constraintTop_toBottomOf="@id/title"
|
||||
tools:text="@string/search_suggestions_onboarding_text"
|
||||
tools:textAppearance="?attr/textAppearanceListItemSmall"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/learn_more"
|
||||
|
@ -51,7 +56,8 @@
|
|||
app:layout_constraintBottom_toTopOf="@id/allow"
|
||||
app:layout_constraintEnd_toEndOf="@id/title"
|
||||
app:layout_constraintStart_toStartOf="@id/title"
|
||||
app:layout_constraintTop_toBottomOf="@id/text" />
|
||||
app:layout_constraintTop_toBottomOf="@id/text"
|
||||
tools:textColor="@color/accent_high_contrast_private_theme"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/allow"
|
||||
|
@ -62,7 +68,7 @@
|
|||
android:text="@string/search_suggestions_onboarding_allow_button"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/title"
|
||||
app:layout_constraintTop_toBottomOf="@id/text" />
|
||||
app:layout_constraintTop_toBottomOf="@id/learn_more" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dismiss"
|
||||
|
|
Loading…
Reference in New Issue
Block a user