Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep color when there is no icon set #61

Closed
logcat opened this issue Aug 3, 2015 · 4 comments
Closed

Keep color when there is no icon set #61

logcat opened this issue Aug 3, 2015 · 4 comments
Assignees
Labels

Comments

@logcat
Copy link

logcat commented Aug 3, 2015

It's probably better to keep color(extract it before return), so we can set color in xml and drawable in java code.

Related code
https://github.com/mikepenz/Android-Iconics/blob/develop/library-core/src/main/java/com/mikepenz/iconics/view/IconicsImageView.java#L51

@mikepenz
Copy link
Owner

mikepenz commented Aug 3, 2015

@logcat not sure what you mean, but you can't create a IconicsImageView without an icon in first place. If you define the color and the icon (as required) you can just get the icon from the IconicsImageView and alter it at a later time

@mikepenz mikepenz self-assigned this Aug 3, 2015
@logcat
Copy link
Author

logcat commented Aug 3, 2015

You can create imageview like this

<com.mikepenz.iconics.view.IconicsImageView
        android:layout_width="72dp"
        android:layout_height="72dp"
        app:iiv_color="@android:color/holo_red_dark"
        />

and then set icon like this

iconicsImageView.setIcon("gmd-favorite-border");

Then this iconicsImageView will have icon with default color and not color from xml. This is somewhat debatable, but imo would be nice to have color from xml.

@mikepenz
Copy link
Owner

mikepenz commented Aug 3, 2015

@mikepenz mikepenz closed this as completed Aug 3, 2015
@logcat
Copy link
Author

logcat commented Aug 3, 2015

mikepenz added a commit that referenced this issue Aug 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants