setInitialColor seems not working with BrightnessSlideBar on 2.3.0
I'm using ColorPickerView and after the update setInitialColor doesn't update BrightnessSlideBar while setting the view in onCreate.
If I call setInitialColor in a second moment everything works. Maybe is something related with slider width calculations?
Anyway when setInitialColor works the slider of BrightnessSlideBar is out of bounds if brightness is 100%.
My fix solution:
public class CustomBrightnessSlideBar extends BrightnessSlideBar {
public CustomBrightnessSlideBar(Context context) {
super(context);
}
public CustomBrightnessSlideBar(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomBrightnessSlideBar(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public CustomBrightnessSlideBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public void onInflateFinished() {
// In the original version, the selector is set to the default position at the slide bar end,
// which prevents the correct brightness position of the initial color from being set.
// Just ignore super.onInflateFinished.
}
}
Can confirm that brightness bar ignores initialColor and always on 100%. Any workarounds to fix it in builder initialization without using custom layouts?
Can confirm that brightness bar ignores
initialColorand always on 100%. Any workarounds to fix it in builder initialization without using custom layouts?
view.colorPickerView.post { view.colorPickerView.setInitialColor(color) }
Just need to execute setInitialColor in the post