myanmarking

    myanmarking

    1 year ago
    previously, we could have vector drawables with theme colors, ex:
    <vector xmlns:android="<http://schemas.android.com/apk/res/android>"
        android:width="184dp"
        android:height="184dp"
        android:viewportWidth="184"
        android:viewportHeight="184">
        <path
            android:fillColor="?attr/colorPrimary"
            android:fillType="evenOdd"
            android:pathData="M22 92a70 70 0 1 1 140 0 70 70 0 1 1-140 0" />
    is there any recommended path for compose ?
    a

    alorma

    11 months ago
    Use
    tint
    attribute of
    Icon
    myanmarking

    myanmarking

    11 months ago
    ya, doesn’t really work. Only parts of the vector are colored dynamically based on theme primary color
    Peter Mandeljc

    Peter Mandeljc

    11 months ago
    Currently, I think, the best approach is still to continue defining theme and colors in xml and reference xml colors from compose. Otherwise your theme will be different until activity boots up. Taking that into account, basically nothing changed in your case 😃
    myanmarking

    myanmarking

    11 months ago
    ya kinda. but if you have single app multi fragment approach, and you have different themes for each feature, you would have to define the theme in xml parent. OR just use wrapperLayoutInflator or sth with new theme for the fragment. But since compose get’s rid of all of that. hm … idk. Maybe use LayoutInflator theme wrapper for ComposeView ?