RangeSeekBar icon indicating copy to clipboard operation
RangeSeekBar copied to clipboard

Change minsdk to 21

Open codefury opened this issue 5 years ago • 5 comments

Manifest merger fails because this library is using minSdk as 23 Can you change it to uses-sdk:minSdkVersion 21

codefury avatar Mar 20 '19 10:03 codefury

The minSdk 23 seems to only be required by the DrawableWrapper class usage in DrawableUtils.canSafelyMutateDrawable static function.

But something is bothering me in its usage:

        } else if (drawable instanceof DrawableWrapper) {
            return canSafelyMutateDrawable(
                Objects.requireNonNull(((DrawableWrapper) drawable).getDrawable()));
        } else if (drawable instanceof ScaleDrawable) {
            return canSafelyMutateDrawable(Objects.requireNonNull(((ScaleDrawable) drawable).getDrawable()));
        }

According to Android documentation the DrawableWrapper is a superclass of ScaleDrawable.

So the else if (drawable instanceof ScaleDrawable) will never be reached.

The most interesting part of this is that this DrawableUtils.canSafelyMutateDrawable is never used.

ludovic-garcia avatar Apr 29 '19 15:04 ludovic-garcia

+1 for this request

sebargarcia avatar May 30 '19 14:05 sebargarcia

If you can change the minsdk to 21 that will be very useful to me too. I really need this slider.

selini avatar Oct 31 '19 11:10 selini

The minSdk 23 seems to only be required by the DrawableWrapper class usage in DrawableUtils.canSafelyMutateDrawable static function.

But something is bothering me in its usage:

        } else if (drawable instanceof DrawableWrapper) {
            return canSafelyMutateDrawable(
                Objects.requireNonNull(((DrawableWrapper) drawable).getDrawable()));
        } else if (drawable instanceof ScaleDrawable) {
            return canSafelyMutateDrawable(Objects.requireNonNull(((ScaleDrawable) drawable).getDrawable()));
        }

According to Android documentation the DrawableWrapper is a superclass of ScaleDrawable.

So the else if (drawable instanceof ScaleDrawable) will never be reached.

The most interesting part of this is that this DrawableUtils.canSafelyMutateDrawable is never used.

Depending on this answer, if the only need for the minsdk 23 is in DrawableUtils.canSafelyMutateDrawable which is never used then you can add the following in your manifest. <uses-sdk tools:overrideLibrary="it.sephiroth.android.library.rangeseekbar"/> and include xmlns:tools="http://schemas.android.com/tools" before the tag as following

<manifest ...
xmlns:tools="http://schemas.android.com/tools"
...>

bTodary avatar Nov 11 '19 16:11 bTodary

@bTodary I have try it an it works. Thanks!

selini avatar Nov 12 '19 09:11 selini