traccar / traccar-client-android

Traccar Client for Android
https://www.traccar.org/client
Apache License 2.0
666 stars 737 forks source link

Color resources for drawable icons #454

Open Anton-V-K opened 1 year ago

Anton-V-K commented 1 year ago

Icons refactoring (b80fde0b6dc0e69c46071ce9e38edda00d7f723c) made most (all?) of drawable icons "non-themable" - they are drawn with hard-coded color values instead of colors from \app\src\main\res\values\colors.xml. An example from \app\src\main\res\drawable\ic_launcher_foreground.xml (path is omitted for brevity):

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="64"
    android:viewportHeight="64">
  <group android:scaleX="0.71"
      android:scaleY="0.71"
      android:translateX="9.28"
      android:translateY="9.28">
    <path
        android:pathData="..."
        android:strokeWidth=".84379"
        android:fillColor="#2e7d32"/>
  </group>
</vector>

The color should be specified as android:fillColor="@color/primary". I'm not sure whether this issue hits end-users (it is worth checking whether the app adapts properly to UI theme tuning) - I've discovered it when customizing the look for a debug build with status widget (#429).

The list of icons to fix:

tananaev commented 1 year ago

They should work just fine with Dynamic Color, if that's what you're talking about. But I don't mind using color resources if you want to send a PR for that.

Anton-V-K commented 1 year ago

May I add these changes to the existing PR #431 (into the same branch) or a new dedicated PR is needed?

tananaev commented 1 year ago

I'd prefer to do a separate PR for that.