jenkins-bot has submitted this change and it was merged.

Change subject: Scrolling header at the top of Feed.
......................................................................


Scrolling header at the top of Feed.

A simple dark-blue background that overlaps behind the Search bar, and a
portion of the first non-search card in the feed.

Also slightly decrease the size of the WP wordmark in the toolbar.

Bug: T145895
Bug: T145888
Change-Id: I6a8fb2b061909075fb477bcf7315bc775cd6d09a
---
M app/src/main/java/org/wikipedia/feed/FeedFragment.java
M app/src/main/java/org/wikipedia/feed/view/FeedView.java
M app/src/main/res/layout/activity_single_fragment_with_toolbar.xml
M app/src/main/res/layout/fragment_feed.xml
M app/src/main/res/values/dimens.xml
5 files changed, 26 insertions(+), 9 deletions(-)

Approvals:
  jenkins-bot: Verified
  Niedzielski: Looks good to me, approved



diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java 
b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
index f233f3e..2f176b3 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
@@ -49,6 +49,7 @@
 public class FeedFragment extends Fragment implements BackPressedHandler {
     @BindView(R.id.feed_swipe_refresh_layout) SwipeRefreshLayout 
swipeRefreshLayout;
     @BindView(R.id.fragment_feed_feed) FeedView feedView;
+    @BindView(R.id.fragment_feed_header) View feedHeader;
     private Unbinder unbinder;
     private WikipediaApp app;
     private FeedCoordinator coordinator;
@@ -282,6 +283,11 @@
         @Override
         public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
             super.onScrolled(recyclerView, dx, dy);
+            int yOffset = feedView.computeVerticalScrollOffset() * 2;
+            if (yOffset <= feedHeader.getHeight()
+                    || feedHeader.getTranslationY() > -feedHeader.getHeight()) 
{
+                feedHeader.setTranslationY(-yOffset);
+            }
             boolean shouldShowSearchIcon = 
feedView.getFirstVisibleItemPosition() != 0;
             if (shouldShowSearchIcon != searchIconVisible) {
                 searchIconVisible = shouldShowSearchIcon;
diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedView.java 
b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
index 68a20c0..50d20d2 100644
--- a/app/src/main/java/org/wikipedia/feed/view/FeedView.java
+++ b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
@@ -64,7 +64,7 @@
                 R.dimen.view_list_card_margin_horizontal, 
R.dimen.view_list_card_margin_vertical,
                 R.dimen.view_list_card_margin_horizontal, 
R.dimen.view_list_card_margin_vertical));
         addItemDecoration(new HeaderMarginItemDecoration(getContext(),
-                R.dimen.view_list_first_card_margin_top));
+                R.dimen.view_feed_padding_top));
         setCallback(new RecyclerViewColumnCallback());
     }
 
diff --git a/app/src/main/res/layout/activity_single_fragment_with_toolbar.xml 
b/app/src/main/res/layout/activity_single_fragment_with_toolbar.xml
index 6202997..f9a5563 100644
--- a/app/src/main/res/layout/activity_single_fragment_with_toolbar.xml
+++ b/app/src/main/res/layout/activity_single_fragment_with_toolbar.xml
@@ -25,7 +25,7 @@
 
         <ImageView
             android:id="@+id/single_fragment_toolbar_wordmark"
-            android:layout_width="128dp"
+            android:layout_width="100dp"
             android:layout_height="wrap_content"
             app:srcCompat="@drawable/feed_header_wordmark"
             android:contentDescription="@null"/>
diff --git a/app/src/main/res/layout/fragment_feed.xml 
b/app/src/main/res/layout/fragment_feed.xml
index 3216b66..913fcc4 100644
--- a/app/src/main/res/layout/fragment_feed.xml
+++ b/app/src/main/res/layout/fragment_feed.xml
@@ -7,11 +7,23 @@
     android:layout_height="match_parent"
     android:background="?attr/feed_window_background_color">
 
-    <org.wikipedia.feed.view.FeedView
-        android:id="@+id/fragment_feed_feed"
+    <FrameLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:scrollbars="vertical"
-        app:minColumnWidth="@dimen/view_feed_min_column_width"/>
+        android:layout_height="match_parent">
+
+        <View
+            android:id="@+id/fragment_feed_header"
+            android:layout_width="match_parent"
+            android:layout_height="96dp"
+            android:background="@color/dark_blue" />
+
+        <org.wikipedia.feed.view.FeedView
+            android:id="@+id/fragment_feed_feed"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:scrollbars="vertical"
+            app:minColumnWidth="@dimen/view_feed_min_column_width"/>
+
+    </FrameLayout>
 
 </android.support.v4.widget.SwipeRefreshLayout>
diff --git a/app/src/main/res/values/dimens.xml 
b/app/src/main/res/values/dimens.xml
index 5043a7a..0ad0aa0 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -90,9 +90,8 @@
 
     <!-- The Feed -->
     <dimen name="view_feed_header_height">160dp</dimen>
-    <dimen name="view_feed_overlap_top">84dp</dimen>
+    <dimen name="view_feed_padding_top">10dp</dimen>
     <dimen name="view_feed_min_column_width">320dp</dimen>
-    <dimen name="view_list_first_card_margin_top">10dp</dimen>
     <dimen name="view_list_card_margin_vertical">5dp</dimen>
     <dimen name="view_list_card_margin_horizontal">7dp</dimen>
     <dimen name="view_list_card_item_margin">16dp</dimen>

-- 
To view, visit https://gerrit.wikimedia.org/r/311189
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6a8fb2b061909075fb477bcf7315bc775cd6d09a
Gerrit-PatchSet: 5
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <dbr...@wikimedia.org>
Gerrit-Reviewer: BearND <bsitzm...@wikimedia.org>
Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: Mholloway <mhollo...@wikimedia.org>
Gerrit-Reviewer: Niedzielski <sniedziel...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to