Dbrant has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372886 )

Change subject: Refactor/standardize status bar appearance in 
CollapsingToolbarLayouts.
......................................................................

Refactor/standardize status bar appearance in CollapsingToolbarLayouts.

This updates the appearance of the system status bar in activities that
use a full-screen CollapsingToolbarLayout, to make it fully transparent
(instead of partially translucent). Also:

- Refactor the layout of the News fragment to use a CollapsingToolbarLayout,
  instead of a custom-ish toolbar plus image combo.
- Simplify our gradient generator, and make it use a power of 2 instead of
  3, which results in a slightly deeper gradient that doesn't drop off so
  quickly.

Bug: T163594
Change-Id: I87087dcca52b46acaab0a90654a32c0679832e51
---
M app/src/main/java/org/wikipedia/activity/BaseActivity.java
M app/src/main/java/org/wikipedia/feed/news/NewsActivity.java
M app/src/main/java/org/wikipedia/feed/news/NewsFragment.java
M app/src/main/java/org/wikipedia/gallery/GalleryActivity.java
M app/src/main/java/org/wikipedia/offline/CompilationDetailActivity.java
M app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java
M app/src/main/java/org/wikipedia/page/PageActivity.java
M app/src/main/java/org/wikipedia/page/PageToolbarHideHandler.java
M app/src/main/java/org/wikipedia/page/leadimages/PageHeaderImageView.java
M app/src/main/java/org/wikipedia/readinglist/ReadingListActivity.java
M app/src/main/java/org/wikipedia/readinglist/ReadingListHeaderView.java
M app/src/main/java/org/wikipedia/util/GradientUtil.java
M app/src/main/res/layout/fragment_compilation_detail.xml
M app/src/main/res/layout/fragment_news.xml
M app/src/main/res/layout/fragment_reading_list.xml
15 files changed, 126 insertions(+), 81 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/86/372886/1

diff --git a/app/src/main/java/org/wikipedia/activity/BaseActivity.java 
b/app/src/main/java/org/wikipedia/activity/BaseActivity.java
index a208649..0eab824 100644
--- a/app/src/main/java/org/wikipedia/activity/BaseActivity.java
+++ b/app/src/main/java/org/wikipedia/activity/BaseActivity.java
@@ -9,6 +9,7 @@
 import android.net.ConnectivityManager;
 import android.os.Build;
 import android.os.Bundle;
+import android.support.annotation.ColorInt;
 import android.support.annotation.ColorRes;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
@@ -102,6 +103,16 @@
         }
     }
 
+    protected void setStatusBarOverlayColor(@ColorInt int color) {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            View v = 
getWindow().getDecorView().findViewById(android.R.id.statusBarBackground);
+            if (v != null) {
+                v.setBackgroundColor(color);
+                v.setVisibility(View.INVISIBLE);
+            }
+        }
+    }
+
     @Override public boolean isDestroyed() {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
             return super.isDestroyed();
diff --git a/app/src/main/java/org/wikipedia/feed/news/NewsActivity.java 
b/app/src/main/java/org/wikipedia/feed/news/NewsActivity.java
index 6bc7b9c..69ab964 100644
--- a/app/src/main/java/org/wikipedia/feed/news/NewsActivity.java
+++ b/app/src/main/java/org/wikipedia/feed/news/NewsActivity.java
@@ -2,6 +2,7 @@
 
 import android.content.Context;
 import android.content.Intent;
+import android.graphics.Color;
 import android.os.Build;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
@@ -21,10 +22,9 @@
     public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setSharedElementTransitions();
-
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
-            
getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
-                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+            getWindow().setStatusBarColor(Color.TRANSPARENT);
         }
     }
 
diff --git a/app/src/main/java/org/wikipedia/feed/news/NewsFragment.java 
b/app/src/main/java/org/wikipedia/feed/news/NewsFragment.java
index 4b4e6ca..9649e08 100644
--- a/app/src/main/java/org/wikipedia/feed/news/NewsFragment.java
+++ b/app/src/main/java/org/wikipedia/feed/news/NewsFragment.java
@@ -4,8 +4,8 @@
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
+import android.support.design.widget.AppBarLayout;
 import android.support.v4.app.Fragment;
-import android.support.v4.content.ContextCompat;
 import android.support.v7.app.AppCompatActivity;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
@@ -26,7 +26,6 @@
 import org.wikipedia.page.ExclusiveBottomSheetPresenter;
 import org.wikipedia.page.PageActivity;
 import org.wikipedia.readinglist.AddToReadingListDialog;
-import org.wikipedia.util.DimenUtil;
 import org.wikipedia.util.GradientUtil;
 import org.wikipedia.util.ResourceUtil;
 import org.wikipedia.util.ShareUtil;
@@ -45,13 +44,14 @@
 import static org.wikipedia.feed.news.NewsActivity.EXTRA_NEWS_ITEM;
 import static org.wikipedia.feed.news.NewsActivity.EXTRA_WIKI;
 import static org.wikipedia.richtext.RichTextUtil.stripHtml;
-import static org.wikipedia.util.DimenUtil.newsFeatureImageHeightForDevice;
 
 public class NewsFragment extends Fragment {
     @BindView(R.id.view_news_fullscreen_header_image) 
FaceAndColorDetectImageView image;
     @BindView(R.id.view_news_fullscreen_story_text) TextView text;
     @BindView(R.id.view_news_fullscreen_link_card_list) RecyclerView links;
     @BindView(R.id.view_news_fullscreen_toolbar) Toolbar toolbar;
+    @BindView(R.id.news_app_bar) AppBarLayout appBarLayout;
+    @BindView(R.id.view_news_fullscreen_gradient) View gradientView;
 
     private ExclusiveBottomSheetPresenter bottomSheetPresenter = new 
ExclusiveBottomSheetPresenter();
     private Unbinder unbinder;
@@ -73,9 +73,7 @@
         View view = inflater.inflate(R.layout.fragment_news, container, false);
         unbinder = ButterKnife.bind(this, view);
 
-        ViewUtil.setTopPaddingDp(toolbar, (int) 
DimenUtil.getTranslucentStatusBarHeight(getContext()));
-        ViewUtil.setBackgroundDrawable(toolbar, GradientUtil.getCubicGradient(
-                ContextCompat.getColor(getContext(), 
R.color.lead_gradient_start), Gravity.TOP));
+        ViewUtil.setBackgroundDrawable(gradientView, 
GradientUtil.getPowerGradient(R.color.lead_gradient_start, Gravity.TOP));
         getAppCompatActivity().setSupportActionBar(toolbar);
         
getAppCompatActivity().getSupportActionBar().setDisplayHomeAsUpEnabled(true);
         getAppCompatActivity().getSupportActionBar().setTitle("");
@@ -84,11 +82,9 @@
         WikiSite wiki = GsonUnmarshaller.unmarshal(WikiSite.class, 
getActivity().getIntent().getStringExtra(EXTRA_WIKI));
 
         Uri imageUri = item.featureImage();
-        int height = imageUri == null ? 
DimenUtil.getContentTopOffsetPx(getContext()) : 
newsFeatureImageHeightForDevice();
         if (imageUri == null) {
-            toolbar.setBackgroundColor(ContextCompat.getColor(getContext(), 
R.color.main_toolbar_background));
+            appBarLayout.setExpanded(false, false);
         }
-        DimenUtil.setViewHeight(image, height);
         image.loadImage(imageUri);
         text.setText(stripHtml(item.story()));
         initRecycler();
diff --git a/app/src/main/java/org/wikipedia/gallery/GalleryActivity.java 
b/app/src/main/java/org/wikipedia/gallery/GalleryActivity.java
index e74d996..f329e27 100644
--- a/app/src/main/java/org/wikipedia/gallery/GalleryActivity.java
+++ b/app/src/main/java/org/wikipedia/gallery/GalleryActivity.java
@@ -173,7 +173,7 @@
         // force the theme to dark...
         setTheme(Theme.DARK.getResourceId());
 
-        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
WindowManager.LayoutParams.FLAG_FULLSCREEN);
+        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
         setContentView(R.layout.activity_gallery);
         initToolbar();
 
@@ -196,9 +196,9 @@
 
         errorView = (WikiErrorView) findViewById(R.id.view_gallery_error);
         ((ImageView) errorView.findViewById(R.id.view_wiki_error_icon))
-                .setColorFilter(ContextCompat.getColor(this, 
R.color.view_wiki_error_icon_tint_light));
+                
.setColorFilter(color(R.color.view_wiki_error_icon_tint_light));
         ((TextView) errorView.findViewById(R.id.view_wiki_error_text))
-                .setTextColor(ContextCompat.getColor(this, 
R.color.view_wiki_error_text_color_light));
+                .setTextColor(color(R.color.view_wiki_error_text_color_light));
         errorView.setBackClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -627,8 +627,7 @@
     }
 
     private void setBackgroundGradient(View view, int gravity) {
-        ViewUtil.setBackgroundDrawable(view, GradientUtil.getCubicGradient(
-                color(R.color.lead_gradient_start), gravity));
+        ViewUtil.setBackgroundDrawable(view, 
GradientUtil.getPowerGradient(R.color.lead_gradient_start, gravity));
     }
 
     private void initToolbar() {
diff --git 
a/app/src/main/java/org/wikipedia/offline/CompilationDetailActivity.java 
b/app/src/main/java/org/wikipedia/offline/CompilationDetailActivity.java
index a67eff7..21eb366 100644
--- a/app/src/main/java/org/wikipedia/offline/CompilationDetailActivity.java
+++ b/app/src/main/java/org/wikipedia/offline/CompilationDetailActivity.java
@@ -2,6 +2,7 @@
 
 import android.content.Context;
 import android.content.Intent;
+import android.graphics.Color;
 import android.os.Build;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
@@ -17,9 +18,9 @@
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
-            
getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
-                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+            getWindow().setStatusBarColor(Color.TRANSPARENT);
         }
     }
 
diff --git 
a/app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java 
b/app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java
index 918afb2..81701de 100644
--- a/app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java
+++ b/app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java
@@ -1,6 +1,5 @@
 package org.wikipedia.offline;
 
-import android.graphics.Color;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
@@ -67,7 +66,7 @@
         compilation = GsonUnmarshaller.unmarshal(Compilation.class,
                 getActivity().getIntent().getStringExtra(EXTRA_COMPILATION));
 
-        ViewUtil.setBackgroundDrawable(gradientView, 
GradientUtil.getCubicGradient(Color.BLACK, Gravity.TOP));
+        ViewUtil.setBackgroundDrawable(gradientView, 
GradientUtil.getPowerGradient(R.color.lead_gradient_start, Gravity.TOP));
 
         imageView.loadImage(compilation.featureImageUri());
         nameView.setText(compilation.name());
diff --git a/app/src/main/java/org/wikipedia/page/PageActivity.java 
b/app/src/main/java/org/wikipedia/page/PageActivity.java
index 7294385..41ef67e 100644
--- a/app/src/main/java/org/wikipedia/page/PageActivity.java
+++ b/app/src/main/java/org/wikipedia/page/PageActivity.java
@@ -122,8 +122,7 @@
         app.checkCrashes(this);
 
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
-            
getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
-                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+            
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
         }
 
         PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
diff --git a/app/src/main/java/org/wikipedia/page/PageToolbarHideHandler.java 
b/app/src/main/java/org/wikipedia/page/PageToolbarHideHandler.java
index d1546ed..be902f0 100644
--- a/app/src/main/java/org/wikipedia/page/PageToolbarHideHandler.java
+++ b/app/src/main/java/org/wikipedia/page/PageToolbarHideHandler.java
@@ -2,9 +2,7 @@
 
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.LayerDrawable;
-import android.support.annotation.ColorInt;
 import android.support.annotation.NonNull;
-import android.support.v4.content.ContextCompat;
 import android.view.Gravity;
 import android.view.View;
 
@@ -26,8 +24,7 @@
 
         LayerDrawable toolbarBackgroundLayers = (LayerDrawable) 
hideableView.getBackground();
         toolbarBackground = 
toolbarBackgroundLayers.findDrawableByLayerId(R.id.toolbar_background_solid).mutate();
-        initToolbarGradient(toolbarBackgroundLayers,
-                ContextCompat.getColor(hideableView.getContext(), 
R.color.lead_gradient_start));
+        initToolbarGradient(toolbarBackgroundLayers);
 
         statusBar = 
hideableView.findViewById(R.id.empty_status_bar).getBackground().mutate();
     }
@@ -60,8 +57,8 @@
         statusBar.setAlpha(opacity);
     }
 
-    private void initToolbarGradient(LayerDrawable toolbarBackgroundLayers, 
@ColorInt int baseColor) {
-        toolbarGradient = GradientUtil.getCubicGradient(baseColor, 
Gravity.TOP);
+    private void initToolbarGradient(LayerDrawable toolbarBackgroundLayers) {
+        toolbarGradient = 
GradientUtil.getPowerGradient(R.color.lead_gradient_start, Gravity.TOP);
         
toolbarBackgroundLayers.setDrawableByLayerId(R.id.toolbar_background_gradient, 
toolbarGradient);
     }
 
diff --git 
a/app/src/main/java/org/wikipedia/page/leadimages/PageHeaderImageView.java 
b/app/src/main/java/org/wikipedia/page/leadimages/PageHeaderImageView.java
index 4ec2722..2fefdfd 100644
--- a/app/src/main/java/org/wikipedia/page/leadimages/PageHeaderImageView.java
+++ b/app/src/main/java/org/wikipedia/page/leadimages/PageHeaderImageView.java
@@ -6,9 +6,7 @@
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.os.Build;
-import android.support.annotation.ColorInt;
 import android.support.annotation.Nullable;
-import android.support.v4.content.ContextCompat;
 import android.text.TextUtils;
 import android.util.AttributeSet;
 import android.view.Gravity;
@@ -22,7 +20,7 @@
 import butterknife.BindView;
 import butterknife.ButterKnife;
 
-import static org.wikipedia.util.GradientUtil.getCubicGradient;
+import static org.wikipedia.util.GradientUtil.getPowerGradient;
 
 public class PageHeaderImageView extends FrameLayout {
     @BindView(R.id.view_page_header_image_image) FaceAndColorDetectImageView 
image;
@@ -89,8 +87,7 @@
         inflate(getContext(), R.layout.view_page_header_image, this);
         ButterKnife.bind(this);
 
-        @ColorInt int color = ContextCompat.getColor(getContext(), 
R.color.new_lead_gradient_start);
-        Drawable gradient = getCubicGradient(color, Gravity.BOTTOM);
+        Drawable gradient = getPowerGradient(R.color.new_lead_gradient_start, 
Gravity.BOTTOM);
         ViewUtil.setBackgroundDrawable(gradientView, gradient);
     }
 }
diff --git 
a/app/src/main/java/org/wikipedia/readinglist/ReadingListActivity.java 
b/app/src/main/java/org/wikipedia/readinglist/ReadingListActivity.java
index c89ccd6..ea1d314 100644
--- a/app/src/main/java/org/wikipedia/readinglist/ReadingListActivity.java
+++ b/app/src/main/java/org/wikipedia/readinglist/ReadingListActivity.java
@@ -2,6 +2,7 @@
 
 import android.content.Context;
 import android.content.Intent;
+import android.graphics.Color;
 import android.os.Build;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
@@ -16,9 +17,9 @@
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
-            
getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
-                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+            getWindow().setStatusBarColor(Color.TRANSPARENT);
         }
     }
 
diff --git 
a/app/src/main/java/org/wikipedia/readinglist/ReadingListHeaderView.java 
b/app/src/main/java/org/wikipedia/readinglist/ReadingListHeaderView.java
index 25b4b4f..a56e924 100644
--- a/app/src/main/java/org/wikipedia/readinglist/ReadingListHeaderView.java
+++ b/app/src/main/java/org/wikipedia/readinglist/ReadingListHeaderView.java
@@ -2,7 +2,6 @@
 
 import android.annotation.TargetApi;
 import android.content.Context;
-import android.graphics.Color;
 import android.os.Build;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
@@ -79,8 +78,7 @@
         setLayoutParams(new 
ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                 ViewGroup.LayoutParams.MATCH_PARENT));
 
-        ViewUtil.setBackgroundDrawable(gradientView,
-                GradientUtil.getCubicGradient(Color.BLACK, Gravity.TOP));
+        ViewUtil.setBackgroundDrawable(gradientView, 
GradientUtil.getPowerGradient(R.color.lead_gradient_start, Gravity.TOP));
 
         if (isInEditMode()) {
             return;
diff --git a/app/src/main/java/org/wikipedia/util/GradientUtil.java 
b/app/src/main/java/org/wikipedia/util/GradientUtil.java
index 50e1d86..f5919c5 100644
--- a/app/src/main/java/org/wikipedia/util/GradientUtil.java
+++ b/app/src/main/java/org/wikipedia/util/GradientUtil.java
@@ -7,28 +7,33 @@
 import android.graphics.drawable.PaintDrawable;
 import android.graphics.drawable.ShapeDrawable;
 import android.graphics.drawable.shapes.RectShape;
+import android.support.annotation.ColorInt;
+import android.support.annotation.ColorRes;
+import android.support.v4.content.ContextCompat;
 import android.view.Gravity;
+
+import org.wikipedia.WikipediaApp;
 
 public final class GradientUtil {
     private static final int GRADIENT_NUM_STOPS = 8;
-    private static final int GRADIENT_POWER = 3;
+    private static final int GRADIENT_POWER = 2;
 
-    public static Drawable getCubicGradient(int baseColor, int gravity) {
+    public static Drawable getPowerGradient(@ColorRes int baseColor, int 
gravity) {
         PaintDrawable drawable = new PaintDrawable();
         drawable.setShape(new RectShape());
-        setCubicGradient(drawable, baseColor, gravity);
+        setPowerGradient(drawable, 
ContextCompat.getColor(WikipediaApp.getInstance(), baseColor), gravity);
         return drawable;
     }
 
     /**
-     * Create a cubic gradient by using a compound gradient composed of a 
series of linear
+     * Create a power gradient by using a compound gradient composed of a 
series of linear
      * gradients with intermediate color values.
      * adapted from: 
https://github.com/romannurik/muzei/blob/master/main/src/main/java/com/google/android/apps/muzei/util/ScrimUtil.java
      * @param baseColor The color from which the gradient starts (the ending 
color is transparent).
      * @param gravity Where the gradient should start from. Note: when making 
horizontal gradients,
      *                remember to use START/END, instead of LEFT/RIGHT.
      */
-    public static void setCubicGradient(PaintDrawable drawable, int baseColor, 
int gravity) {
+    private static void setPowerGradient(PaintDrawable drawable, @ColorInt int 
baseColor, int gravity) {
         final int[] stopColors = new int[GRADIENT_NUM_STOPS];
 
         int red = Color.red(baseColor);
diff --git a/app/src/main/res/layout/fragment_compilation_detail.xml 
b/app/src/main/res/layout/fragment_compilation_detail.xml
index bb96751..9fedcc7 100644
--- a/app/src/main/res/layout/fragment_compilation_detail.xml
+++ b/app/src/main/res/layout/fragment_compilation_detail.xml
@@ -22,7 +22,7 @@
             app:layout_scrollFlags="scroll|exitUntilCollapsed"
             android:fitsSystemWindows="true"
             app:contentScrim="?attr/main_toolbar_color"
-            app:statusBarScrim="?attr/main_toolbar_color">
+            app:statusBarScrim="?attr/main_status_bar_color">
 
             <FrameLayout
                 android:id="@+id/compilation_detail_header_container"
diff --git a/app/src/main/res/layout/fragment_news.xml 
b/app/src/main/res/layout/fragment_news.xml
index 9a3539f..3cbfd9f 100644
--- a/app/src/main/res/layout/fragment_news.xml
+++ b/app/src/main/res/layout/fragment_news.xml
@@ -1,47 +1,89 @@
 <?xml version="1.0" encoding="utf-8"?>
-<FrameLayout
+<android.support.design.widget.CoordinatorLayout
     xmlns:android="http://schemas.android.com/apk/res/android";
     xmlns:app="http://schemas.android.com/apk/res-auto";
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="?attr/window_background_color">
+    android:background="?attr/window_background_color"
+    android:fitsSystemWindows="true">
 
-    <LinearLayout
+    <android.support.design.widget.AppBarLayout
+        android:id="@+id/news_app_bar"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/readingListLeadHeight"
+        android:fitsSystemWindows="true">
+
+        <android.support.design.widget.CollapsingToolbarLayout
+            android:id="@+id/news_toolbar_container"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            app:layout_scrollFlags="scroll|exitUntilCollapsed"
+            android:fitsSystemWindows="true"
+            app:contentScrim="?attr/main_toolbar_color"
+            app:statusBarScrim="?attr/main_status_bar_color">
+
+            <FrameLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:fitsSystemWindows="true"
+                app:layout_collapseMode="parallax">
+
+                <org.wikipedia.views.FaceAndColorDetectImageView
+                    style="@style/SimpleDraweeViewPlaceholder"
+                    android:id="@+id/view_news_fullscreen_header_image"
+                    app:actualImageScaleType="focusCrop"
+                    app:fadeDuration="0"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:transitionName="@string/transition_news_item"/>
+
+                <View
+                    android:id="@+id/view_news_fullscreen_gradient"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"/>
+
+            </FrameLayout>
+
+            <android.support.v7.widget.Toolbar
+                android:id="@+id/view_news_fullscreen_toolbar"
+                android:layout_width="match_parent"
+                android:layout_height="?attr/actionBarSize"
+                android:theme="@style/AppTheme.ToolbarTheme"
+                app:layout_collapseMode="pin" />
+
+        </android.support.design.widget.CollapsingToolbarLayout>
+
+    </android.support.design.widget.AppBarLayout>
+
+    <android.support.v4.widget.NestedScrollView
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:orientation="vertical">
+        android:scrollbars="vertical"
+        app:layout_behavior="@string/appbar_scrolling_view_behavior">
 
-        <!-- Height set dynamically based on device properties -->
-        <org.wikipedia.views.FaceAndColorDetectImageView
-            style="@style/SimpleDraweeViewPlaceholder"
-            android:id="@+id/view_news_fullscreen_header_image"
-            app:actualImageScaleType="focusCrop"
-            app:fadeDuration="0"
+        <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:transitionName="@string/transition_news_item"/>
+            android:layout_height="match_parent"
+            android:orientation="vertical"
+            android:fitsSystemWindows="true">
 
-        <TextView
-            android:id="@+id/view_news_fullscreen_story_text"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:padding="16dp"
-            android:textSize="16sp"
-            android:fontFamily="serif"
-            android:lineSpacingMultiplier="1.2"
-            style="@style/RtlAwareTextView"/>
+            <TextView
+                android:id="@+id/view_news_fullscreen_story_text"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="16dp"
+                android:textSize="16sp"
+                android:fontFamily="serif"
+                android:lineSpacingMultiplier="1.2"
+                style="@style/RtlAwareTextView"/>
 
-        <android.support.v7.widget.RecyclerView
-            android:id="@+id/view_news_fullscreen_link_card_list"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content" />
+            <android.support.v7.widget.RecyclerView
+                android:id="@+id/view_news_fullscreen_link_card_list"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content" />
 
-    </LinearLayout>
+        </LinearLayout>
 
-    <android.support.v7.widget.Toolbar
-        android:id="@+id/view_news_fullscreen_toolbar"
-        android:theme="@style/AppTheme.ToolbarTheme"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
+    </android.support.v4.widget.NestedScrollView>
 
-</FrameLayout>
\ No newline at end of file
+</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_reading_list.xml 
b/app/src/main/res/layout/fragment_reading_list.xml
index 7ec234a..3e296a2 100644
--- a/app/src/main/res/layout/fragment_reading_list.xml
+++ b/app/src/main/res/layout/fragment_reading_list.xml
@@ -21,7 +21,7 @@
             app:layout_scrollFlags="scroll|exitUntilCollapsed"
             android:fitsSystemWindows="true"
             app:contentScrim="?attr/main_toolbar_color"
-            app:statusBarScrim="?attr/main_toolbar_color">
+            app:statusBarScrim="?attr/main_status_bar_color">
 
             <org.wikipedia.readinglist.ReadingListHeaderView
                 android:id="@+id/reading_list_header"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I87087dcca52b46acaab0a90654a32c0679832e51
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

Reply via email to