Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3449)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionMainMenuFooter.java

Issue 2849563004: Data savings on overflow menu should use most recent data collection start date (Closed)
Patch Set: fix branches Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionMainMenuFooter.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionMainMenuFooter.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionMainMenuFooter.java
index f77c23d3ee207a3c765a3a7b8c1140c71a583a1d..20eea200d4a65775f5d70b374adcb8eaa84e0b1f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionMainMenuFooter.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionMainMenuFooter.java
@@ -53,12 +53,17 @@ public class DataReductionMainMenuFooter extends FrameLayout implements View.OnC
DataReductionProxySettings.getInstance()
.getContentLengthSavedInHistorySummary());
- long millisSinceEpoch =
+ long chartStartDateInMillisSinceEpoch =
DataReductionProxySettings.getInstance().getDataReductionLastUpdateTime()
- DateUtils.DAY_IN_MILLIS * ChartDataUsageView.DAYS_IN_CHART;
+ long firstEnabledInMillisSinceEpoch = DataReductionProxySettings.getInstance()
+ .getDataReductionProxyFirstEnabledTime();
+ long mostRecentTime = chartStartDateInMillisSinceEpoch > firstEnabledInMillisSinceEpoch
+ ? chartStartDateInMillisSinceEpoch
+ : firstEnabledInMillisSinceEpoch;
+
final int flags = DateUtils.FORMAT_ABBREV_MONTH | DateUtils.FORMAT_NO_YEAR;
- String date =
- DateUtils.formatDateTime(getContext(), millisSinceEpoch, flags).toString();
+ String date = DateUtils.formatDateTime(getContext(), mostRecentTime, flags).toString();
itemText.setText(
getContext().getString(R.string.data_reduction_saved_label, dataSaved));
@@ -67,6 +72,12 @@ public class DataReductionMainMenuFooter extends FrameLayout implements View.OnC
int lightActiveColor = ApiCompatibilityUtils.getColor(
getContext().getResources(), R.color.light_active_color);
itemText.setTextColor(lightActiveColor);
+
+ // Reset the icon to blue.
+ ImageView icon = (ImageView) findViewById(R.id.chart_icon);
+ 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);
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698