Affected Device(s): tested on 6 different devices with Android ranging from 6 to 9.
Bug:
ColorPickerPreference crashes whenever there is not enough space in height (landscape mode or split screen).
Stacktrace from an Android 9 device:
java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:1033)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1000)
at android.graphics.Bitmap.createBitmap(Bitmap.java:950)
at android.graphics.Bitmap.createBitmap(Bitmap.java:911)
at com.skydoves.colorpickerview.sliders.AlphaSlideBar.onSizeChanged(AlphaSlideBar.java:74)
at android.view.View.sizeChange(View.java:20875)
at android.view.View.setFrame(View.java:20836)
at android.view.View.layout(View.java:20696)
at android.view.ViewGroup.layout(ViewGroup.java:6198)
[...]
As far as I can tell, the bug sits in com.skydoves.colorpickerview.sliders.AlphaSlideBar.onSizeChanged(AlphaSlideBar.java:74) which is consistent across all devices.
Expected Behavior:
I expect ColorPickerPreference to work in landscape mode the same way it does in portrait mode. It should either show alpha and brightness sliders vertically next to the hue picker or display the whole dialog content in a ScrollView whenever height is too small.
Bug:
ColorPickerPreference
crashes whenever there is not enough space in height (landscape mode or split screen).Stacktrace from an Android 9 device:
As far as I can tell, the bug sits in
com.skydoves.colorpickerview.sliders.AlphaSlideBar.onSizeChanged(AlphaSlideBar.java:74)
which is consistent across all devices.Expected Behavior:
I expect
ColorPickerPreference
to work in landscape mode the same way it does in portrait mode. It should either show alpha and brightness sliders vertically next to the hue picker or display the whole dialog content in aScrollView
whenever height is too small.