Skip to content

Commit 286e514

Browse files
Merge pull request #326 from appdevforall/feat/ADFA-4910-chip-selected-contrast
ADFA-4910: fix selected-chip text contrast in Books & ZIM (white on teal)
2 parents 9d273fd + 1d1a863 commit 286e514

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎controller/app/src/main/java/org/iiab/controller/redesign/BooksLandingFragment.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ private TextView chip(String text, boolean on, Runnable onClick) {
200200
t.setText(text);
201201
t.setPadding(px(14), px(8), px(14), px(8));
202202
t.setBackgroundResource(on ? R.drawable.k2go_chip_bg : R.drawable.k2go_pill_bg);
203-
t.setTextColor(ContextCompat.getColor(requireContext(), on ? R.color.k2go_on_teal : R.color.k2go_ink));
203+
// ADFA-4910: white on the selected (teal) chip — same as MapsChooseFragment. The theme-split
204+
// k2go_on_teal could resolve to its dark night value in light mode, killing the contrast.
205+
t.setTextColor(ContextCompat.getColor(requireContext(), on ? android.R.color.white : R.color.k2go_ink));
204206
t.setTextAppearance(com.google.android.material.R.style.TextAppearance_Material3_BodySmall);
205207
t.setClickable(true);
206208
t.setOnClickListener(v -> onClick.run());

‎controller/app/src/main/java/org/iiab/controller/redesign/ZimCategoryFragment.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ private void addHeader(String title, String desc) {
275275

276276
private void chip(TextView t, boolean on) {
277277
t.setBackgroundResource(on ? R.drawable.k2go_chip_bg : R.drawable.k2go_pill_bg);
278-
t.setTextColor(ContextCompat.getColor(requireContext(), on ? R.color.k2go_on_teal : R.color.k2go_ink));
278+
// ADFA-4910: white on the selected (teal) chip (same fix as Books / MapsChoose).
279+
t.setTextColor(ContextCompat.getColor(requireContext(), on ? android.R.color.white : R.color.k2go_ink));
279280
}
280281

281282
private View row(Entry e, String labelText, int indent) {

0 commit comments

Comments
 (0)