Skip to content

Colors in attrs.xml too #5

@StefMa

Description

@StefMa

I'm very confused why the colors are handled over the colors.xml file instead like the texts via the attributes file?

We can set it up like this too:

    <declare-styleable name="MaterialLoginView">
        <attr name="loginTitle" format="string" />
        <attr name="loginHint" format="string" />
        <attr name="loginPasswordHint" format="string" />
        <attr name="loginActionText" format="string" />
        <attr name="loginTextColor" format="reference" />

        <attr name="registerTitle" format="string" />
        <attr name="registerHint" format="string" />
        <attr name="registerPasswordHint" format="string" />
        <attr name="registerRepeatPasswordHint" format="string" />
        <attr name="registerActionText" format="string" />
        <attr name="registerTextColor" format="reference" />
        <attr name="registerIcon" format="reference" />
    </declare-styleable>

and use it like

        app:loginTextColor="@color/material_login_register_color"

Any opinion not to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions