Merge "Change "X over" text color to ColorError" into pi-dev am: 22bf690fdd
am: b2a8860b3c
Change-Id: Ibc163d39ea4b6708699ba53334d080c8258fde63
This commit is contained in:
@@ -59,8 +59,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamily"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?android:attr/colorAccent" />
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -234,10 +234,14 @@ public class DataUsageSummaryPreference extends Preference {
|
||||
usageRemainingField.setText(
|
||||
TextUtils.expandTemplate(getContext().getText(R.string.data_remaining),
|
||||
Formatter.formatFileSize(getContext(), dataRemaining)));
|
||||
usageRemainingField.setTextColor(
|
||||
Utils.getColorAttr(getContext(), android.R.attr.colorAccent));
|
||||
} else {
|
||||
usageRemainingField.setText(
|
||||
TextUtils.expandTemplate(getContext().getText(R.string.data_overusage),
|
||||
Formatter.formatFileSize(getContext(), -dataRemaining)));
|
||||
usageRemainingField.setTextColor(
|
||||
Utils.getColorAttr(getContext(), android.R.attr.colorError));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -378,6 +378,8 @@ public class DataUsageSummaryPreferenceTest {
|
||||
bindViewHolder();
|
||||
assertThat(mDataUsed.getText().toString()).isEqualTo("1.00 MB used");
|
||||
assertThat(mDataRemaining.getText().toString()).isEqualTo("9.00 MB left");
|
||||
final int colorId = Utils.getColorAttr(mContext, android.R.attr.colorAccent);
|
||||
assertThat(mDataRemaining.getCurrentTextColor()).isEqualTo(colorId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -389,6 +391,8 @@ public class DataUsageSummaryPreferenceTest {
|
||||
bindViewHolder();
|
||||
assertThat(mDataUsed.getText().toString()).isEqualTo("11.00 MB used");
|
||||
assertThat(mDataRemaining.getText().toString()).isEqualTo("1.00 MB over");
|
||||
final int colorId = Utils.getColorAttr(mContext, android.R.attr.colorError);
|
||||
assertThat(mDataRemaining.getCurrentTextColor()).isEqualTo(colorId);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user