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

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

Issue 2836253002: Make the Data Saver site breakdown "Remaining sites" expandable (Closed)
Patch Set: Expand site breakdown on click 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 | « no previous file | 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/DataReductionSiteBreakdownView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionSiteBreakdownView.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionSiteBreakdownView.java
index 8070d1198801b4a87113e52e7ee4349729cd05ff..1a72748c259933371712ecbb7075cee28a6e2ff1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionSiteBreakdownView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionSiteBreakdownView.java
@@ -29,7 +29,8 @@ import java.util.List;
* with the most data use or data savings.
*/
public class DataReductionSiteBreakdownView extends LinearLayout {
- private static final int NUM_DATA_USE_ITEMS_TO_DISPLAY = 10;
+ private static final int NUM_DATA_USE_ITEMS_TO_ADD = 10;
+ private int mNumDataUseItemsToDisplay = 10;
private TableLayout mTableLayout;
private TextView mDataUsedTitle;
@@ -166,7 +167,7 @@ public class DataReductionSiteBreakdownView extends LinearLayout {
int everythingElseDataSavings = 0;
for (int i = 0; i < mDataUseItems.size(); i++) {
- if (i < NUM_DATA_USE_ITEMS_TO_DISPLAY) {
+ if (i < mNumDataUseItemsToDisplay) {
TableRow row = (TableRow) LayoutInflater.from(getContext())
.inflate(R.layout.data_usage_breakdown_row, null);
@@ -207,7 +208,15 @@ public class DataReductionSiteBreakdownView extends LinearLayout {
dataUsedView.setTextColor(lightActiveColor);
dataSavedView.setTextColor(lightActiveColor);
- mTableLayout.addView(row, NUM_DATA_USE_ITEMS_TO_DISPLAY + 1);
+ row.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mNumDataUseItemsToDisplay += NUM_DATA_USE_ITEMS_TO_ADD;
+ updateSiteBreakdown();
+ }
+ });
+
+ mTableLayout.addView(row, mNumDataUseItemsToDisplay + 1);
}
mTableLayout.requestLayout();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698