Android-Iconics icon indicating copy to clipboard operation
Android-Iconics copied to clipboard

Keep color when there is no icon set

Open logcat opened this issue 11 years ago • 4 comments

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

logcat avatar Aug 03 '15 13:08 logcat

@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 avatar Aug 03 '15 15:08 mikepenz

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.

logcat avatar Aug 03 '15 15:08 logcat

@logcat ok just checked the source code. it should use the set color. https://github.com/mikepenz/Android-Iconics/blob/develop/library-core/src/main/java/com/mikepenz/iconics/view/IconicsImageView.java#L84

mikepenz avatar Aug 03 '15 18:08 mikepenz

except color is null, because of this line https://github.com/mikepenz/Android-Iconics/blob/develop/library-core/src/main/java/com/mikepenz/iconics/view/IconicsImageView.java#L48

however, I am not sure that it's a bug

logcat avatar Aug 03 '15 18:08 logcat