When I start the app some of my vector assets have the value of wrong color. If I start the app in light mode the vectors use the dark mode colors.
If the dark mode is turned on and then off then vectors use normal colors (from light mode)
my drawable resource
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="460dp"
android:height="265dp"
android:viewportWidth="460"
android:viewportHeight="270">
<path
android:pathData="M139.85,137.51C155.15,142.34 170.44,165.68 170.44,181.78C170.44,197.88 170.44,212.37 170.44,230.08C170.44,247.79 154.34,262.28 136.63,262.28C118.92,262.28 51.3,262.28 35.2,262.28C19.1,262.28 3,247.79 3,231.69C3,215.59 3,197.88 3,181.78C3,165.68 14.79,147.5 33.59,137.51M139.85,137.51C102.02,176.95 57.74,164.07 33.59,137.51M139.85,137.51C147.1,127.85 155.93,111.63 155.95,93.23C155.99,55 122.14,24 86.72,24C51.3,24 17.45,55 17.49,93.23C17.51,111.63 22.1,124.2 33.59,137.51"
android:strokeWidth="20"
android:strokeColor="@color/black"/>
<path
android:pathData="M280.85,116.5C243.02,155.95 198.74,143.07 174.59,116.5M280.85,116.5C288.1,106.85 296.93,90.63 296.95,72.23C296.99,34 263.14,3 227.72,3C192.3,3 158.45,34 158.49,72.23C158.51,90.63 163.1,103.2 174.59,116.5M280.85,116.5C291.13,119.75 301.4,131.35 307.04,143.5M176.2,241.28C192.3,241.28 259.92,241.28 277.63,241.28C281.01,241.28 284.34,240.75 287.5,239.77M176.2,241.28C173.61,241.28 171.02,240.9 168.5,240.21C171.44,240.94 173.12,241.24 176.2,241.28ZM174.59,116.5C162.97,122.69 154.02,131.99 148.89,142"
android:strokeWidth="20"
android:strokeColor="@color/black"/>
<path
android:pathData="M422.85,137.51C438.15,142.34 453.44,165.68 453.44,181.78C453.44,197.88 453.44,212.37 453.44,230.08C453.44,247.79 437.34,262.28 419.63,262.28C401.92,262.28 334.3,262.28 318.2,262.28C302.1,262.28 286,247.79 286,231.69C286,215.59 286,197.88 286,181.78C286,165.68 297.79,147.5 316.59,137.51M422.85,137.51C385.02,176.95 340.74,164.07 316.59,137.51M422.85,137.51C430.1,127.85 438.93,111.63 438.95,93.23C438.99,55 405.14,24 369.72,24C334.3,24 300.45,55 300.49,93.23C300.51,111.63 305.1,124.2 316.59,137.51"
android:strokeWidth="20"
android:strokeColor="@color/black"/>
</vector>
my collors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<color name="black">#FF000000</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<color name="black">#D9D9D9</color>
</resources>
bottom_navigation_menu
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/HomepageActivity"
android:icon="@drawable/ic_home"
android:title="" />
<item
android:id="@+id/FollowingActivity"
android:icon="@drawable/ic_following"
android:title="" />
<item
android:id="@+id/action_logout"
android:title="" />
<item
android:id="@+id/AllChatsActivity"
android:icon="@drawable/ic_chat"
android:title="" />
<item
android:id="@+id/ProfileActivity"
android:icon="@drawable/ic_profile"
android:title="" />
</menu>
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bottomAppBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:minHeight="?attr/actionBarSize"
app:contentInsetEnd="0dp"
app:contentInsetStart="0dp"
app:fabAlignmentMode="center"
app:fabCradleMargin="8dp"
app:fabCradleRoundedCornerRadius="16dp"
app:hideOnScroll="true">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottomNavigationView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/foreground"
app:itemIconSize="30dp"
app:labelVisibilityMode="unlabeled"
app:menu="@menu/bottom_navigation_menu" />
</com.google.android.material.bottomappbar.BottomAppBar>
This is what I am expecting
and this is what I am getting as result
I tried using
android:tint="?attr/colorControlNormal"
but it did not help
New contributor
bacan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2