Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ sealed class PageItemViewHolder(internal val parent: ViewGroup, @LayoutRes layou
time.text = DateTimeUtils.javaDateToTimeSpan(date, parent.context)
.capitalizeWithLocaleWithoutLint(parent.context.currentLocale)

if (page.labels.isNotEmpty()) {
labels.text = page.labels.map { parent.context.getString(it) }.sorted()
.joinToString(prefix = " · ", separator = " · ")
}
labels.text = page.labels.map { parent.context.getString(it) }.sorted()
.joinToString(separator = " · ")
uiHelper.updateVisibility(labels, page.labels.isNotEmpty())

itemView.setOnClickListener { onItemTapped(page) }

Expand Down
152 changes: 88 additions & 64 deletions WordPress/src/main/res/layout/page_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,95 +6,117 @@
android:id="@+id/page_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white">
android:layout_marginEnd="@dimen/page_list_content_margin"
android:layout_marginStart="@dimen/page_list_content_margin"
android:background="@color/white">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/page_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/two_line_list_item_height"
android:background="?attr/selectableItemBackground">
android:layout_height="match_parent"
android:minHeight="@dimen/page_list_row_min_height"
android:background="?selectableItemBackground">

<ImageButton
android:id="@+id/page_more"
android:layout_width="56dp"
android:layout_height="0dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/show_more_desc"
android:paddingEnd="@dimen/page_item_horizontal_padding"
android:paddingStart="@dimen/page_item_horizontal_padding"
android:src="@drawable/ic_ellipsis_vertical_white_24dp"
android:tint="@color/neutral_50"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<ImageView
android:id="@+id/featured_image"
android:layout_width="40dp"
android:layout_height="40dp"
android:contentDescription="@string/featured_image_desc"
app:layout_constraintBottom_toBottomOf="@id/text_layout"
app:layout_constraintEnd_toStartOf="@id/page_more"
app:layout_constraintStart_toEndOf="@id/text_layout"
app:layout_constraintTop_toTopOf="@id/text_layout"
tools:srcCompat="@tools:sample/avatars"/>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/text_layout"
<org.wordpress.android.widgets.WPTextView
android:id="@+id/page_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_alignParentStart="true"
android:layout_marginEnd="@dimen/margin_medium"
android:layout_marginStart="@dimen/page_item_horizontal_padding"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="@dimen/margin_large"
android:ellipsize="end"
android:fontFamily="serif"
android:maxLines="1"
android:textAlignment="textStart"
android:textColor="@color/neutral_80"
android:textSize="@dimen/text_sz_large"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/time_posted"
app:layout_constraintEnd_toStartOf="@+id/featured_image"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toBottomOf="@+id/disabled_overlay"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Porro totam quia architecto ducimus laudantium minus autem"/>

<org.wordpress.android.widgets.WPTextView
android:id="@+id/page_title"
style="@style/PageListItemTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
tools:text="First pag ds ds sddsdsds ds ds dsdse adsd"/>
<org.wordpress.android.widgets.WPTextView
android:id="@+id/time_posted"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/page_item_horizontal_padding"
android:layout_marginTop="@dimen/margin_extra_small"
android:ellipsize="end"
android:maxLines="1"
android:textColor="?attr/wpColorTextSubtle"
android:textSize="@dimen/text_sz_medium"
app:layout_goneMarginBottom="@dimen/margin_large"
app:layout_constraintBottom_toTopOf="@+id/labels"
app:layout_constraintEnd_toStartOf="@+id/featured_image"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/page_title"
tools:text="99 days ago • Eulah Kuvalis"/>

<org.wordpress.android.widgets.WPTextView
android:id="@+id/time_posted"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:textColor="?attr/wpColorTextSubtle"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@id/page_title"
app:layout_constraintTop_toBottomOf="@+id/page_title"
tools:text="2 days ago"/>
<ImageView
android:id="@+id/featured_image"
android:layout_width="@dimen/page_list_featured_image_size"
android:layout_height="@dimen/page_list_featured_image_size"
android:layout_marginEnd="@dimen/page_item_horizontal_padding"
android:background="@color/transparent"
android:contentDescription="@string/featured_image_desc"
app:layout_constraintBottom_toBottomOf="@+id/time_posted"
app:layout_constraintEnd_toStartOf="@+id/page_more"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/page_title"
tools:srcCompat="@tools:sample/avatars"/>

<org.wordpress.android.widgets.WPTextView
android:id="@+id/labels"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:textColor="?attr/wpColorTextSubtle"
android:textSize="14sp"
app:layout_constraintStart_toEndOf="@+id/time_posted"
app:layout_constraintTop_toBottomOf="@+id/page_title"
tools:text="Local Draft"/>
<ImageButton
android:id="@+id/page_more"
android:layout_width="@dimen/page_list_menu_button_size"
android:layout_height="@dimen/page_list_menu_button_size"
android:layout_marginEnd="@dimen/page_item_horizontal_padding"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/more"
android:src="@drawable/ic_ellipsis_vertical_white_24dp"
android:tint="@color/neutral_60"
app:layout_constraintBottom_toBottomOf="@+id/featured_image"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/featured_image"/>

</androidx.constraintlayout.widget.ConstraintLayout>
<FrameLayout
android:id="@+id/disabled_overlay"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white_translucent_65"
android:clickable="true"
android:focusable="true"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

<org.wordpress.android.widgets.WPTextView
android:id="@+id/labels"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAlignment="textStart"
android:maxLines="3"
android:ellipsize="end"
android:layout_marginTop="@dimen/margin_extra_small"
android:layout_marginBottom="@dimen/margin_large"
app:layout_constraintStart_toStartOf="@+id/page_title"
app:layout_constraintEnd_toEndOf="@+id/page_title"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintTop_toBottomOf="@+id/time_posted"
app:layout_constraintBottom_toTopOf="@+id/upload_progress"
tools:text="Facere molestiae est maxime. Laborum nihil voluptatem qui est aut ut. Nisi eveniet id sit voluptatem. Id doloribus itaque sequi eum molestias id repellendus."/>

<ProgressBar
android:id="@+id/upload_progress"
style="?android:attr/progressBarStyleHorizontal"
Expand All @@ -104,7 +126,9 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_layout"/>
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0"/>

</androidx.constraintlayout.widget.ConstraintLayout>

</FrameLayout>
5 changes: 5 additions & 0 deletions WordPress/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<dimen name="site_creation_content_margin">@dimen/content_margin_none</dimen>
<dimen name="post_list_content_margin_standard">@dimen/content_margin_none</dimen>
<dimen name="post_list_content_margin_compact">@dimen/content_margin_none</dimen>
<dimen name="page_list_content_margin">@dimen/content_margin_none</dimen>

<!--
native reader dimens
Expand Down Expand Up @@ -369,6 +370,10 @@
<dimen name="one_line_list_item_height">48dp</dimen>
<dimen name="two_line_list_item_height">72dp</dimen>
<dimen name="page_list_divider_height">40dp</dimen>
<dimen name="page_list_row_min_height">80dp</dimen>
<dimen name="page_list_featured_image_size">40dp</dimen>
<dimen name="page_list_menu_button_size">24dp</dimen>


<dimen name="quota_bar_text_minimum_height">36dp</dimen>

Expand Down