Merge "Change "X over" text color to ColorError" into pi-dev

am: 22bf690fdd

Change-Id: I97eef096124f7ad264e1d0d280e471db9d660d70
This commit is contained in:
Jan Nordqvist
2018-04-05 16:11:16 -07:00
committed by android-build-merger
3 changed files with 9 additions and 2 deletions

View File

@@ -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>

View File

@@ -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));
}
}
}

View File

@@ -369,6 +369,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
@@ -380,6 +382,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