Closes #26530: add top spacing to header in history list

This commit is contained in:
mike a 2022-08-19 11:28:01 -07:00 committed by mergify[bot]
parent 6a7f9075ad
commit cb3f620507
5 changed files with 24 additions and 3 deletions

View File

@ -114,6 +114,8 @@ class HistoryView(
private fun updateEmptyState(userHasHistory: Boolean) {
binding.historyList.isInvisible = !userHasHistory
binding.historyEmptyView.isVisible = !userHasHistory
binding.topSpacer.isVisible = !userHasHistory
with(binding.recentlyClosedNavEmpty) {
recentlyClosedNav.setOnClickListener {
interactor.onRecentlyClosedClicked()

View File

@ -113,6 +113,7 @@ class HistoryListItemViewHolder(
} else {
binding.headerTitle.visibility = View.GONE
}
binding.bottomSpacer.isVisible = headerText != null
}
private fun toggleTopContent(
@ -120,6 +121,7 @@ class HistoryListItemViewHolder(
isNormalMode: Boolean,
) {
binding.recentlyClosedNavEmpty.recentlyClosedNav.isVisible = showTopContent
binding.topSpacer.isVisible = showTopContent
if (showTopContent) {
val numRecentTabs = itemView.context.components.core.store.state.closedTabs.size

View File

@ -20,12 +20,19 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/top_spacer"
android:layout_width="match_parent"
android:layout_height="8dp"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"/>
<include
android:id="@+id/recently_closed_nav_empty"
layout="@layout/recently_closed_nav_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@+id/top_spacer" />
<TextView
android:id="@+id/history_empty_view"

View File

@ -10,10 +10,22 @@
android:importantForAccessibility="no"
android:orientation="vertical">
<View
android:id="@+id/top_spacer"
android:layout_width="match_parent"
android:layout_height="8dp"
android:visibility="gone"/>
<include
android:id="@+id/recently_closed_nav_empty"
layout="@layout/recently_closed_nav_item" />
<View
android:id="@+id/bottom_spacer"
android:layout_width="match_parent"
android:layout_height="32dp"
android:visibility="gone"/>
<TextView
android:id="@+id/header_title"
style="@style/Header14TextStyle"

View File

@ -8,8 +8,6 @@
android:id="@+id/recently_closed_nav"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"