1
0
Fork 0

For #5460: Fixes styling of fill link from clipboard (#5464)

master
Sawyer Blatz 2019-09-20 15:29:16 -07:00 committed by GitHub
parent 85314010b6
commit f02603be37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -280,10 +280,12 @@ class SearchFragment : Fragment(), BackHandler {
}
private fun updateClipboardSuggestion(searchState: SearchFragmentState, clipboardUrl: String?) {
fill_link_from_clipboard.visibility =
val shouldBeVisible =
if (searchState.showClipboardSuggestions && searchState.query.isEmpty() && !clipboardUrl.isNullOrEmpty())
View.VISIBLE else View.GONE
View.VISIBLE else View.GONE
fill_link_from_clipboard.visibility = shouldBeVisible
divider_line.visibility = shouldBeVisible
clipboard_url.text = clipboardUrl
}

View File

@ -47,6 +47,7 @@
android:id="@+id/fill_link_from_clipboard"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_marginTop="8dp"
android:focusable="true"
android:clickable="true"
android:background="?selectableItemBackground"
@ -99,10 +100,21 @@
app:layout_constraintVertical_chainStyle="packed"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:id="@+id/divider_line"
android:layout_width="match_parent"
android:layout_height="1.5dp"
android:background="?neutralFaded"
android:layout_marginStart="8dp"
app:layout_constraintStart_toStartOf="@id/fill_link_from_clipboard"
app:layout_constraintEnd_toEndOf="@id/fill_link_from_clipboard"
app:layout_constraintTop_toBottomOf="@id/fill_link_from_clipboard" />
<TextView
android:id="@+id/search_with_shortcuts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:fontFamily="Inter UI"
android:letterSpacing="0.15"
android:text="@string/search_shortcuts_search_with"