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