androidx / constraintlayout

ConstraintLayout is an Android layout component which allows you to position and size widgets in a flexible way
Apache License 2.0
1.06k stars 177 forks source link

setDragScale method in OnSwipe only accepts integer values #833

Open chandruscm opened 11 months ago

chandruscm commented 11 months ago

When programmatically adding an OnSwipe behaviour to a Motion Layout Transition, the dragScale cannot be set to values less than 1 since the public setDragScale method only accepts an integer.

// ../constraintlayout/motion/widget/OnSwipe.java

public OnSwipe setDragScale(int dragScale) {
        mDragScale = dragScale;
        return this;
    }

The expectation would be to pass a float value as the xml attribute allows it.

The same signature is used for setDragThreshold.

Happy to create a quick PR if this is indeed unintended.