Merge "Fix crash when tapping on cell icon in QS." into nyc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a9db1aa382
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.systemui.qs.tiles;
|
package com.android.systemui.qs.tiles;
|
||||||
|
|
||||||
|
import android.annotation.ColorInt;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
@@ -65,7 +66,7 @@ public class DataUsageDetailView extends LinearLayout {
|
|||||||
final Resources res = mContext.getResources();
|
final Resources res = mContext.getResources();
|
||||||
final int titleId;
|
final int titleId;
|
||||||
final long bytes;
|
final long bytes;
|
||||||
int usageColor = 0;
|
@ColorInt int usageColor = 0;
|
||||||
final String top;
|
final String top;
|
||||||
String bottom = null;
|
String bottom = null;
|
||||||
if (info.usageLevel < info.warningLevel || info.limitLevel <= 0) {
|
if (info.usageLevel < info.warningLevel || info.limitLevel <= 0) {
|
||||||
@@ -90,7 +91,7 @@ public class DataUsageDetailView extends LinearLayout {
|
|||||||
formatBytes(info.usageLevel));
|
formatBytes(info.usageLevel));
|
||||||
bottom = res.getString(R.string.quick_settings_cellular_detail_data_limit,
|
bottom = res.getString(R.string.quick_settings_cellular_detail_data_limit,
|
||||||
formatBytes(info.limitLevel));
|
formatBytes(info.limitLevel));
|
||||||
usageColor = R.color.system_warning_color;
|
usageColor = mContext.getColor(R.color.system_warning_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usageColor == 0) {
|
if (usageColor == 0) {
|
||||||
@@ -101,7 +102,7 @@ public class DataUsageDetailView extends LinearLayout {
|
|||||||
title.setText(titleId);
|
title.setText(titleId);
|
||||||
final TextView usage = (TextView) findViewById(R.id.usage_text);
|
final TextView usage = (TextView) findViewById(R.id.usage_text);
|
||||||
usage.setText(formatBytes(bytes));
|
usage.setText(formatBytes(bytes));
|
||||||
usage.setTextColor(mContext.getColor(usageColor));
|
usage.setTextColor(usageColor);
|
||||||
final DataUsageGraph graph = (DataUsageGraph) findViewById(R.id.usage_graph);
|
final DataUsageGraph graph = (DataUsageGraph) findViewById(R.id.usage_graph);
|
||||||
graph.setLevels(info.limitLevel, info.warningLevel, info.usageLevel);
|
graph.setLevels(info.limitLevel, info.warningLevel, info.usageLevel);
|
||||||
final TextView carrier = (TextView) findViewById(R.id.usage_carrier_text);
|
final TextView carrier = (TextView) findViewById(R.id.usage_carrier_text);
|
||||||
|
|||||||
Reference in New Issue
Block a user