mr0xf00 / easycrop

Image cropper for jetpack compose
Apache License 2.0
81 stars 17 forks source link

Add a paramter to pass extra padding around crop rect #7

Open ammargitham opened 1 year ago

ammargitham commented 1 year ago

When using the CroppingPreview directly, or the cropper dialog with 0 padding, the crop handles overlap the back gestures area. This change allows the user to pass extra padding so that the crop handles do not overlap the gesture area.

I think instead of the library adding the gesture padding internally, it should be up to the user to pass the values.

For the demo to work correctly, I had to set WindowCompat.setDecorFitsSystemWindows(window, false) in the MainActivity. Otherwise WindowInsets.mandatorySystemGestures will always be zero.

Before padding:

https://user-images.githubusercontent.com/8017365/234936914-5892e11c-4912-4049-8e14-435daab513b5.mp4

After padding:

https://user-images.githubusercontent.com/8017365/234936995-de9e9951-3fc4-414c-9ff5-8f9e1e814dd7.mp4