Merge "In Data Usage screen, hide data bar if plan is unlimited" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
91ea3c5e56
@@ -129,14 +129,15 @@ public class DataUsageSummaryPreference extends Preference {
|
||||
public void onBindViewHolder(PreferenceViewHolder holder) {
|
||||
super.onBindViewHolder(holder);
|
||||
|
||||
|
||||
ProgressBar bar = (ProgressBar) holder.findViewById(R.id.determinateBar);
|
||||
if (mChartEnabled && (!TextUtils.isEmpty(mStartLabel) || !TextUtils.isEmpty(mEndLabel))) {
|
||||
bar.setVisibility(View.VISIBLE);
|
||||
holder.findViewById(R.id.label_bar).setVisibility(View.VISIBLE);
|
||||
ProgressBar bar = (ProgressBar) holder.findViewById(R.id.determinateBar);
|
||||
bar.setProgress((int) (mProgress * 100));
|
||||
((TextView) holder.findViewById(android.R.id.text1)).setText(mStartLabel);
|
||||
((TextView) holder.findViewById(android.R.id.text2)).setText(mEndLabel);
|
||||
} else {
|
||||
bar.setVisibility(View.GONE);
|
||||
holder.findViewById(R.id.label_bar).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
@@ -228,6 +228,7 @@ public class DataUsageSummaryPreferenceTest {
|
||||
|
||||
bindViewHolder();
|
||||
assertThat(mLabelBar.getVisibility()).isEqualTo(View.GONE);
|
||||
assertThat(mProgressBar.getVisibility()).isEqualTo(View.GONE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -236,6 +237,7 @@ public class DataUsageSummaryPreferenceTest {
|
||||
|
||||
bindViewHolder();
|
||||
assertThat(mLabelBar.getVisibility()).isEqualTo(View.GONE);
|
||||
assertThat(mProgressBar.getVisibility()).isEqualTo(View.GONE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -245,6 +247,7 @@ public class DataUsageSummaryPreferenceTest {
|
||||
|
||||
bindViewHolder();
|
||||
assertThat(mLabelBar.getVisibility()).isEqualTo(View.VISIBLE);
|
||||
assertThat(mProgressBar.getVisibility()).isEqualTo(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user