Yalantis / uCrop

Image Cropping Library for Android
https://yalantis.com/blog/introducing-ucrop-our-own-image-cropping-library-for-android/
11.89k stars 2.16k forks source link

Unable to change active widget color #541

Open mark-software opened 5 years ago

mark-software commented 5 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? In version 2.2.3 the very bottom bar that has the controls is purple and I cannot change it. I have tried every color option and it does not change. options.setActiveWidgetColor(color) does not seem to have any effect. I have verified that the correct option is in the bundle com.yalantis.ucrop.UcropColorWidgetActive.

Seems to use the color resource ucrop_color_widget_background. Also, there seems to be no option to change the color used for resource ucrop_color_widget_rotate_mid_line.

What is the expected behavior? I would expect that calling options.setActiveWidgetColor(color) with a resolved color would change the color.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. With version 2.2.3 use the following code in a fragment to start uCrop and you'll see that the bottom bar color is not changeable.

UCrop.Options options = new UCrop.Options();
options.setActiveWidgetColor(color); 

UCrop.of(source, destination)
        .withAspectRatio(1f, 1f)
        .withOptions(options)
        .start(context, this);

Please attach any image files, URL and stack trace that can be used to reproduce the bug. image

Which versions of uCrop, and which Android API versions are affected by this issue? Did this work in previous versions of uCrop? Version 2.2.3. This is the first time I'm using the library so I don't know when it broke. Experiencing this behavior on Android Q as well as Android M so doesn't seem to be API specific.

mark-software commented 5 years ago

@p1nkydev @Julia-Ts what's the turnaround time to fix issues like this? We'd love to use this in our production app after the issues are resolved.

angelsfan1 commented 5 years ago

Although this is indeed a bug in the code you can still change the color by simply overriding the color value and use the override flag to indicate this is intended.

mark-software commented 5 years ago

@angelsfan1 can you please give me a code sample to help me understand?

leonardopaglia commented 5 years ago

@markymark1988 I found a temporary solution in this thread, hope it helps you too: https://github.com/Yalantis/uCrop/issues/520

mark-software commented 5 years ago

Thank you, @leonardopaglia. This works for me

<color name="ucrop_color_widget_rotate_mid_line" tools:override="true">#000000</color>
<color name="ucrop_color_widget_background" tools:override="true">#000000</color>

I do hope they update the SDK to support this programmatically.

amirVirtuenetz commented 1 year ago

how can I change the text color and icon color