QS: Don't show graph or warning text when not present

Change-Id: Ic2cfcc0716a70a3d577d17e5af9c5d1f7f8fd4c6
Fixes: 30694497
Fixes: 30898011
This commit is contained in:
Jason Monk
2016-09-23 14:18:19 -04:00
parent 69659cb96d
commit a03c641c60

View File

@@ -115,6 +115,12 @@ public class DataUsageDetailView extends LinearLayout {
final TextView infoBottom = (TextView) findViewById(R.id.usage_info_bottom_text);
infoBottom.setVisibility(bottom != null ? View.VISIBLE : View.GONE);
infoBottom.setText(bottom);
boolean showLevel = info.warningLevel > 0 || info.limitLevel > 0;
graph.setVisibility(showLevel ? View.VISIBLE : View.GONE);
if (!showLevel) {
infoTop.setVisibility(View.GONE);
}
}
private String formatBytes(long bytes) {