Dbrant has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395667 )
Change subject: Final design tweaks for on-this-day. ...................................................................... Final design tweaks for on-this-day. Bug: T175995 Change-Id: Ia3a02a4e9ed99a7d7897d2401f221bcfcd8254d7 --- M app/src/main/java/org/wikipedia/feed/onthisday/OnThisDayFragment.java M app/src/main/res/layout/fragment_on_this_day.xml M app/src/main/res/layout/view_card_on_this_day.xml M app/src/main/res/layout/view_events_layout.xml M app/src/main/res/layout/view_on_this_day_event.xml 5 files changed, 30 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/67/395667/1 diff --git a/app/src/main/java/org/wikipedia/feed/onthisday/OnThisDayFragment.java b/app/src/main/java/org/wikipedia/feed/onthisday/OnThisDayFragment.java index 24c6819..90cd006 100644 --- a/app/src/main/java/org/wikipedia/feed/onthisday/OnThisDayFragment.java +++ b/app/src/main/java/org/wikipedia/feed/onthisday/OnThisDayFragment.java @@ -234,7 +234,8 @@ @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (holder instanceof EventsViewHolder) { - ((EventsViewHolder) holder).setFields(events.get(position)); + ((EventsViewHolder) holder).setFields(events.get(position), + position > 0 ? events.get(position - 1) : null); if (funnel != null) { funnel.scrolledToPosition(position); } @@ -257,6 +258,8 @@ private TextView yearTextView; private TextView yearsInfoTextView; private RecyclerView pagesRecycler; + private View yearContainer; + private View yearSpace; private WikiSite wiki; EventsViewHolder(View v, WikiSite wiki) { @@ -266,6 +269,8 @@ yearTextView = v.findViewById(R.id.year); yearsInfoTextView = v.findViewById(R.id.years_text); pagesRecycler = v.findViewById(R.id.pages_recycler); + yearContainer = v.findViewById(R.id.years_text_container); + yearSpace = v.findViewById(R.id.years_text_space); this.wiki = wiki; setRecycler(); } @@ -277,12 +282,19 @@ } } - public void setFields(final OnThisDay.Event event) { + public void setFields(@NonNull final OnThisDay.Event event, @Nullable OnThisDay.Event prevEvent) { setPagesRecycler(event); setPads(); descTextView.setText(event.text()); yearTextView.setText(DateUtil.yearToStringWithEra(event.year())); yearsInfoTextView.setText(DateUtil.getYearDifferenceString(event.year())); + if (prevEvent != null && prevEvent.year() == event.year()) { + yearContainer.setVisibility(View.GONE); + yearSpace.setVisibility(View.GONE); + } else { + yearContainer.setVisibility(View.VISIBLE); + yearSpace.setVisibility(prevEvent == null ? View.GONE : View.VISIBLE); + } } private void setPads() { diff --git a/app/src/main/res/layout/fragment_on_this_day.xml b/app/src/main/res/layout/fragment_on_this_day.xml index 2d7d1ef..7037930 100644 --- a/app/src/main/res/layout/fragment_on_this_day.xml +++ b/app/src/main/res/layout/fragment_on_this_day.xml @@ -75,9 +75,9 @@ <ImageView android:id="@+id/calendar" - android:layout_width="84dp" - android:layout_height="92dp" - android:layout_marginBottom="-32dp" + android:layout_width="96dp" + android:layout_height="106dp" + android:layout_marginBottom="-36dp" android:layout_gravity="bottom|end" android:tint="@color/base100" android:alpha="0.5" diff --git a/app/src/main/res/layout/view_card_on_this_day.xml b/app/src/main/res/layout/view_card_on_this_day.xml index 120e84e..cf7ce03 100644 --- a/app/src/main/res/layout/view_card_on_this_day.xml +++ b/app/src/main/res/layout/view_card_on_this_day.xml @@ -92,8 +92,8 @@ android:id="@+id/next_event_years" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingTop="2dp" - android:paddingBottom="4dp" + android:paddingTop="1dp" + android:paddingBottom="3dp" android:paddingEnd="6dp" android:paddingStart="6dp" android:textColor="?attr/chart_shade7" diff --git a/app/src/main/res/layout/view_events_layout.xml b/app/src/main/res/layout/view_events_layout.xml index bac468e..701f286 100644 --- a/app/src/main/res/layout/view_events_layout.xml +++ b/app/src/main/res/layout/view_events_layout.xml @@ -16,7 +16,7 @@ android:background="?attr/paper_color" android:clipChildren="false" android:clipToPadding="false" - android:paddingBottom="36dp" + android:paddingBottom="24dp" android:paddingEnd="3dp"> <include diff --git a/app/src/main/res/layout/view_on_this_day_event.xml b/app/src/main/res/layout/view_on_this_day_event.xml index 1b3e0ec..d162e01 100644 --- a/app/src/main/res/layout/view_on_this_day_event.xml +++ b/app/src/main/res/layout/view_on_this_day_event.xml @@ -10,7 +10,14 @@ android:clipToPadding="false" android:orientation="vertical"> + <View + android:id="@+id/years_text_space" + android:visibility="gone" + android:layout_width="1dp" + android:layout_height="20dp" /> + <RelativeLayout + android:id="@+id/years_text_container" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="12dp" @@ -33,8 +40,8 @@ android:id="@+id/years_text" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingTop="2dp" - android:paddingBottom="4dp" + android:paddingTop="1dp" + android:paddingBottom="3dp" android:paddingEnd="6dp" android:paddingStart="6dp" android:textColor="?attr/chart_shade7" @@ -101,7 +108,7 @@ <android.support.v7.widget.RecyclerView android:id="@+id/pages_recycler" android:layout_width="match_parent" - android:layout_height="80dp" + android:layout_height="72dp" android:layout_marginTop="8dp" android:background="?attr/paper_color" android:clipToPadding="false" -- To view, visit https://gerrit.wikimedia.org/r/395667 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia3a02a4e9ed99a7d7897d2401f221bcfcd8254d7 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Dbrant <dbr...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits