Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,14 @@ private TextView chip(String text, boolean on, Runnable onClick) {
t.setText(text);
t.setPadding(px(14), px(8), px(14), px(8));
t.setBackgroundResource(on ? R.drawable.k2go_chip_bg : R.drawable.k2go_pill_bg);
// ADFA-4910: white on the selected (teal) chip — same as MapsChooseFragment. The theme-split
// k2go_on_teal could resolve to its dark night value in light mode, killing the contrast.
t.setTextColor(ContextCompat.getColor(requireContext(), on ? android.R.color.white : R.color.k2go_ink));
// ADFA-5248: apply the text appearance FIRST, then the color. TextAppearance_Material3_*
// carries its own colorOnSurface, so setting the color before it silently overwrote the chip
// color (the real bug the ticket reported: onSurface flips with the theme, giving dark-on-
// dark-teal in light mode and light-on-aqua in dark mode — never legible on the teal fill).
// With the order fixed, k2go_on_teal sticks: it flips against the fill (light text on the
// dark-teal light-mode fill, dark text on the light-aqua dark-mode fill).
t.setTextAppearance(com.google.android.material.R.style.TextAppearance_Material3_BodySmall);
t.setTextColor(ContextCompat.getColor(requireContext(), on ? R.color.k2go_on_teal : R.color.k2go_ink));
t.setClickable(true);
t.setOnClickListener(v -> onClick.run());
return t;
Expand Down Expand Up @@ -366,18 +370,23 @@ private View cell(JSONObject b, int coverColorRes) {
return box;
}

/** A pill band under the title. A faint white stroke keeps it legible on any cover color. */
/**
* A state pill under the title. ADFA-5248: the pill is a light (cream) surface so it separates
* from ANY of the 6 covers (all medium/dark) — the old colored fill matched the same-hue covers
* (green band on a green cover) and vanished. The semantic hue now lives in the TEXT ({@code
* colorRes}), which reads darkly on the cream pill.
*/
private TextView band(int colorRes, String text) {
TextView t = new TextView(requireContext());
t.setText(text);
t.setGravity(Gravity.CENTER);
t.setPadding(px(12), px(4), px(12), px(4));
t.setTextAppearance(com.google.android.material.R.style.TextAppearance_Material3_BodySmall);
t.setTextColor(0xFFFFFFFF);
t.setTextColor(ContextCompat.getColor(requireContext(), colorRes));
GradientDrawable d = new GradientDrawable();
d.setColor(ContextCompat.getColor(requireContext(), colorRes));
d.setColor(ContextCompat.getColor(requireContext(), R.color.k2go_band_surface));
d.setCornerRadius(px(8));
d.setStroke(px(1), 0x4DFFFFFF);
d.setStroke(px(1), 0x1A000000); // subtle dark hairline to define the pill edge on any cover
t.setBackground(d);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
Expand Down
9 changes: 7 additions & 2 deletions controller/app/src/main/res/values/colors_k2go.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@
<color name="k2go_cover_4">#B5432E</color> <!-- clay -->
<color name="k2go_cover_5">#2E7D4F</color> <!-- forest -->
<color name="k2go_cover_6">#4A5568</color> <!-- slate -->
<color name="k2go_band_library">#2E9E5B</color> <!-- green band: already in your books -->
<color name="k2go_band_selected">#4A504E</color> <!-- gray band: selected to add -->
<!-- ADFA-5248: cover state bands. The band is a light (cream) pill so it reads on ANY of the
6 covers above (all medium/dark); the semantic hue lives in the TEXT, not the fill, which
is why the old green fill vanished on the green covers. Mode-independent (sits on a fixed
cover color), so no -night twin. -->
<color name="k2go_band_surface">#FBF8F3</color> <!-- cream band pill: high contrast on every cover -->
<color name="k2go_band_library">#12633C</color> <!-- band TEXT (dark green): already in your books -->
<color name="k2go_band_selected">#3A403E</color> <!-- band TEXT (dark gray): selected to add -->

<!-- ADFA-4886: WebView nav "Exit" tint. Red is the universal alert/exit color; kept fixed in
both light and dark (no values-night override) so the exit affordance always reads the same. -->
Expand Down
Loading