|
40 | 40 | import java.text.SimpleDateFormat; |
41 | 41 | import java.util.Date; |
42 | 42 | import java.util.Locale; |
| 43 | +import android.graphics.Color; |
43 | 44 | import android.graphics.PorterDuff; |
44 | 45 | import android.graphics.drawable.Drawable; |
| 46 | +import android.content.res.ColorStateList; |
45 | 47 | import androidx.core.content.ContextCompat; |
| 48 | +import androidx.core.widget.CompoundButtonCompat; |
46 | 49 |
|
47 | 50 | public class AppListArrayAdapter extends ArrayAdapter<PackageInfoData> { |
48 | 51 |
|
@@ -220,6 +223,9 @@ public View getView(final int position, View convertView, ViewGroup parent) { |
220 | 223 | holder.box_tor = addSupport(holder.box_tor, holder.app, 3); |
221 | 224 | } |
222 | 225 |
|
| 226 | + // Apply high contrast checkbox tinting for e-paper displays |
| 227 | + applyHighContrastCheckboxTint(holder); |
| 228 | + |
223 | 229 | setupExpandableView(holder, convertView, position); |
224 | 230 | addEventListenter(holder); |
225 | 231 |
|
@@ -618,6 +624,40 @@ private CheckBox removeSupport(View convertView, int id) { |
618 | 624 | return check; |
619 | 625 | } |
620 | 626 |
|
| 627 | + /** |
| 628 | + * Apply high contrast checkbox tinting for e-paper displays |
| 629 | + */ |
| 630 | + private void applyHighContrastCheckboxTint(AppStateHolder holder) { |
| 631 | + if (!"LHC".equals(G.getSelectedTheme())) { |
| 632 | + return; |
| 633 | + } |
| 634 | + |
| 635 | + // Pure black color for maximum contrast on e-paper |
| 636 | + ColorStateList colorStateList = ColorStateList.valueOf(Color.BLACK); |
| 637 | + |
| 638 | + if (holder.box_wifi != null) { |
| 639 | + CompoundButtonCompat.setButtonTintList(holder.box_wifi, colorStateList); |
| 640 | + } |
| 641 | + if (holder.box_3g != null) { |
| 642 | + CompoundButtonCompat.setButtonTintList(holder.box_3g, colorStateList); |
| 643 | + } |
| 644 | + if (holder.box_roam != null) { |
| 645 | + CompoundButtonCompat.setButtonTintList(holder.box_roam, colorStateList); |
| 646 | + } |
| 647 | + if (holder.box_vpn != null) { |
| 648 | + CompoundButtonCompat.setButtonTintList(holder.box_vpn, colorStateList); |
| 649 | + } |
| 650 | + if (holder.box_tether != null) { |
| 651 | + CompoundButtonCompat.setButtonTintList(holder.box_tether, colorStateList); |
| 652 | + } |
| 653 | + if (holder.box_lan != null) { |
| 654 | + CompoundButtonCompat.setButtonTintList(holder.box_lan, colorStateList); |
| 655 | + } |
| 656 | + if (holder.box_tor != null) { |
| 657 | + CompoundButtonCompat.setButtonTintList(holder.box_tor, colorStateList); |
| 658 | + } |
| 659 | + } |
| 660 | + |
621 | 661 |
|
622 | 662 | static class AppStateHolder { |
623 | 663 | private CheckBox box_lan; |
|
0 commit comments