Commit 2e451bd9 authored by Robert Ogden's avatar Robert Ogden Committed by Commit Bot

Replace Data Saver Main Menu Footer Icon

The new icon, same as the other preview icons, is simpler and smaller.

This CL implements the UI mocks, specifically:
* New speedometer icon
* No enabled/disabled shading
* 24dp instead of 32dp

Bug: 909915
Change-Id: Icf4aed99869986b8e285a14e3179e7a054584667
Reviewed-on: https://chromium-review.googlesource.com/c/1481795Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634679}
parent 3825dbd3
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2017 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/main_menu_chart">
<bitmap
android:src="@drawable/data_reduction_main_menu_chart"
android:gravity="bottom" />
</item>
<item android:drawable="@drawable/data_reduction_main_menu_chart_base" />
</layer-list>
\ No newline at end of file
......@@ -27,8 +27,8 @@
<!-- ContentDescription is set in Java code. -->
<ImageView
tools:ignore="ContentDescription"
android:id="@+id/chart_icon"
android:src="@drawable/data_reduction_main_menu_icon"
android:id="@+id/icon"
android:src="@drawable/preview_pin_round"
android:layout_width="@dimen/data_reduction_main_menu_icon_width"
android:layout_height="match_parent"
android:layout_gravity="start|center_vertical" />
......
......@@ -168,7 +168,7 @@
<!-- Data Saver -->
<dimen name="data_usage_chart_height">252dp</dimen>
<dimen name="data_reduction_main_menu_icon_width">32dp</dimen>
<dimen name="data_reduction_main_menu_icon_width">24dp</dimen>
<dimen name="data_saver_menu_footer_min_show_height">240dp</dimen>
<!-- The size of the text for tab titles. -->
......
......@@ -5,10 +5,6 @@
package org.chromium.chrome.browser.preferences.datareduction;
import android.content.Context;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.os.Bundle;
import android.text.format.DateUtils;
import android.text.format.Formatter;
......@@ -46,7 +42,7 @@ public class DataReductionMainMenuItem extends FrameLayout implements View.OnCli
TextView itemText = (TextView) findViewById(R.id.menu_item_text);
TextView itemSummary = (TextView) findViewById(R.id.menu_item_summary);
ImageView icon = (ImageView) findViewById(R.id.chart_icon);
ImageView icon = (ImageView) findViewById(R.id.icon);
icon.setContentDescription(getContext().getString(
DataReductionBrandingResourceProvider.getDataSaverBrandedString(
R.string.data_reduction_title)));
......@@ -78,11 +74,6 @@ public class DataReductionMainMenuItem extends FrameLayout implements View.OnCli
int textColorLink = ApiCompatibilityUtils.getColor(
getContext().getResources(), R.color.default_text_color_link);
itemText.setTextColor(textColorLink);
// Reset the icon to blue.
LayerDrawable layers = (LayerDrawable) icon.getDrawable();
Drawable chart = layers.findDrawableByLayerId(R.id.main_menu_chart);
chart.setColorFilter(null);
} else {
DataReductionProxyUma.dataReductionProxyUIAction(
DataReductionProxyUma.ACTION_MAIN_MENU_DISPLAYED_OFF);
......@@ -90,13 +81,6 @@ public class DataReductionMainMenuItem extends FrameLayout implements View.OnCli
itemText.setText(DataReductionBrandingResourceProvider.getDataSaverBrandedString(
R.string.data_reduction_title));
itemSummary.setText(R.string.text_off);
// Make the icon grey.
LayerDrawable layers = (LayerDrawable) icon.getDrawable();
Drawable chart = layers.findDrawableByLayerId(R.id.main_menu_chart);
ColorMatrix matrix = new ColorMatrix();
matrix.setSaturation(0);
chart.setColorFilter(new ColorMatrixColorFilter(matrix));
}
setOnClickListener(this);
......
......@@ -249,7 +249,7 @@ public class PromoDialogTest {
public void testBasic_HeaderBehavior_WithIllustration() throws Exception {
// With an illustration, the header View is part of the scrollable content.
DialogParams dialogParams = new DialogParams();
dialogParams.drawableResource = R.drawable.data_reduction_main_menu_chart;
dialogParams.drawableResource = R.drawable.preview_pin_round;
dialogParams.headerStringResource = R.string.data_reduction_promo_title;
dialogParams.primaryButtonStringResource = R.string.data_reduction_enable_button;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment