Cooltey has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/392545 )
Change subject: Update the position of the date read text on the cards ...................................................................... Update the position of the date read text on the cards - Update the position of the date read text on the `Continue reading` and `Because you read` cards - Add a setSubtitle() to CardLargeHeaderView and adjust the view_card_header_large.xml layout - Update the strings.xml and change the `Yesterday` and `Today` string to lowercase Bug: T140685 Change-Id: I7e4b38dd5e2124e8c305e7da88c51f29dc76033f --- M app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java M app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java M app/src/main/java/org/wikipedia/feed/view/CardLargeHeaderView.java M app/src/main/res/layout/view_card_header_large.xml M app/src/main/res/values-qq/strings.xml M app/src/main/res/values/strings.xml 6 files changed, 31 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/45/392545/1 diff --git a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java index 92adc7e..444c1b3 100644 --- a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java +++ b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java @@ -33,13 +33,13 @@ int age = (int) card.daysOld(); String subtitle = getSubtitle(age); headerView().setTitle(card.title()) - .setSubtitle(subtitle) .setImage(R.drawable.ic_restore_black_24dp) .setImageCircleColor(R.color.base30) .setCard(card) .setCallback(getCallback()); largeHeaderView().setTitle(card.pageTitle()) .setImage(card.image()) + .setSubtitle(subtitle) .onClickListener(new SelectPageCallbackAdapter(card)) .setVisibility(VISIBLE); } diff --git a/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java b/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java index f17dca9..ad7409a 100644 --- a/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java +++ b/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java @@ -32,13 +32,13 @@ subtitle = getResources().getQuantityString(subtitlePlural, age, age); } headerView().setTitle(R.string.view_continue_reading_card_title) - .setSubtitle(subtitle) .setImage(R.drawable.ic_arrow_forward_black_24dp) .setImageCircleColor(R.color.base30) .setCard(card) .setCallback(getCallback()); largeHeaderView().setTitle(card.title()) .setImage(card.image()) + .setSubtitle(subtitle) .onClickListener(new CardClickListener()) .setVisibility(VISIBLE); } diff --git a/app/src/main/java/org/wikipedia/feed/view/CardLargeHeaderView.java b/app/src/main/java/org/wikipedia/feed/view/CardLargeHeaderView.java index ea53217..fd4eb43 100644 --- a/app/src/main/java/org/wikipedia/feed/view/CardLargeHeaderView.java +++ b/app/src/main/java/org/wikipedia/feed/view/CardLargeHeaderView.java @@ -25,6 +25,7 @@ @BindView(R.id.view_card_header_large_background) View backgroundView; @BindView(R.id.view_card_header_large_image) FaceAndColorDetectImageView imageView; @BindView(R.id.view_card_header_large_title) TextView titleView; + @BindView(R.id.view_card_header_large_subtitle) TextView subtitleView; public CardLargeHeaderView(Context context) { super(context); @@ -61,6 +62,11 @@ return this; } + @NonNull public CardLargeHeaderView setSubtitle(@Nullable CharSequence subtitle) { + subtitleView.setText(String.format(getResources().getString(R.string.view_continue_reading_card_subtitle_read_date), subtitle)); + return this; + } + @NonNull public CardLargeHeaderView onClickListener(@Nullable OnClickListener listener) { backgroundView.setOnClickListener(listener); return this; diff --git a/app/src/main/res/layout/view_card_header_large.xml b/app/src/main/res/layout/view_card_header_large.xml index 1c61bc1..c1498de 100644 --- a/app/src/main/res/layout/view_card_header_large.xml +++ b/app/src/main/res/layout/view_card_header_large.xml @@ -28,7 +28,10 @@ android:layout_height="wrap_content" android:ellipsize="end" android:maxLines="2" - android:padding="16dp" + android:paddingTop="16dp" + android:paddingLeft="16dp" + android:paddingBottom="8dp" + android:paddingRight="16dp" android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textColor="@android:color/white" android:textSize="16sp" @@ -36,4 +39,17 @@ app:layout_constraintStart_toStartOf="parent" tools:text="Title" /> + <TextView + android:id="@+id/view_card_header_large_subtitle" + style="@style/RtlAwareTextView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:paddingLeft="16dp" + android:paddingBottom="16dp" + android:paddingRight="16dp" + android:textAppearance="@style/TextAppearance.AppCompat.Medium" + android:textColor="@android:color/white" + android:textSize="12sp" + app:layout_constraintTop_toBottomOf="@+id/view_card_header_large_title" + tools:text="Lorem ipsum" /> </merge> \ No newline at end of file diff --git a/app/src/main/res/values-qq/strings.xml b/app/src/main/res/values-qq/strings.xml index 98335dc..44441f7 100644 --- a/app/src/main/res/values-qq/strings.xml +++ b/app/src/main/res/values-qq/strings.xml @@ -400,10 +400,11 @@ <string name="view_static_card_icon_content_description">Feed card icon description for use when the icon cannot be seen and acessibility.</string> <string name="view_card_news_title">Feed card title for news articles.</string> <plurals name="view_continue_reading_card_subtitle"> - <item quantity="one">Subtitle for a day old \"continue reading\" card. The first word should have an initial uppercase letter if appropriate for the language. Example: [[phabricator:F4695814]]. Use the %d parameter to insert the number of days passed since the content (an article) was last seen.</item> + <item quantity="one">Subtitle for a day old \"continue reading\" card. The word should be in lowercase if appropriate for the language.</item> <item quantity="other">Subtitle for a \"continue reading\" card two or more days old. The first word should have an initial uppercase letter if appropriate for the language. Example: [[phabricator:F4695814]]. Use the %d parameter to insert the number of days passed since the content (an article) was last seen.</item> </plurals> - <string name="view_continue_reading_card_subtitle_today">Shown on cards in the feed when the card has today\'s date.\n{{Identical|Today}}</string> + <string name="view_continue_reading_card_subtitle_today">Shown on cards in the feed when the card has today\'s date.\n{{Identical|today}}. The word should be in lowercase if appropriate for the language.</string> + <string name="view_continue_reading_card_subtitle_read_date">Subtitle for number of days passed since the article was last seen and shown on cards in the feed. Use the %s parameter to insert the number of days passed since the content (an article) was last seen.</string> <string name="view_announcement_card_negative_action">Button label that allows the user to decline the action that this card is requesting.\n{{Identical|No thanks}}</string> <string name="view_offline_card_text">Message in the feed informing the user that additional content cannot be loaded while offline.</string> <string name="view_featured_article_card_title">Title shown in the Featured Article card in the Explore feed\n{{Identical|Featured article}}</string> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c8d4a29..8f5e481 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -434,10 +434,11 @@ <string name="view_static_card_icon_content_description">Card icon</string> <string name="view_card_news_title">In the news</string> <plurals name="view_continue_reading_card_subtitle"> - <item quantity="one">Yesterday</item> + <item quantity="one">yesterday</item> <item quantity="other">%d days ago</item> </plurals> - <string name="view_continue_reading_card_subtitle_today">Today</string> + <string name="view_continue_reading_card_subtitle_today">today</string> + <string name="view_continue_reading_card_subtitle_read_date">Read %s</string> <string name="view_announcement_card_negative_action">No thanks</string> <string name="view_offline_card_text">Content cannot be loaded when offline.</string> <string name="view_featured_article_card_title">Featured article</string> -- To view, visit https://gerrit.wikimedia.org/r/392545 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e4b38dd5e2124e8c305e7da88c51f29dc76033f Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Cooltey <cf...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits