longitachi / ZLPhotoBrowser

Wechat-like image picker. Support select photos, videos, gif and livePhoto. Support edit image and crop video. 微信样式的图片选择器,支持预览/相册内拍照及录视频、拖拽/滑动选择,编辑图片/视频,支持多语言国际化等功能;
MIT License
4.77k stars 966 forks source link

Feature: Global Undo/Redo #856

Closed patryk-sredzinski closed 11 months ago

patryk-sredzinski commented 1 year ago

Feature Description

I have been thinking of having an universal UNDO and REDO button on the top right corner of the Image Editing Controller. That allows you to undo drawings, mosaic, stickers, filters etc.

What do you think about this? I have got this working:

https://github.com/longitachi/ZLPhotoBrowser/assets/23390884/a4257ef0-4bd9-4ab2-b6c2-ed09df70d24a

Do you think we can get something like that? What I currently have are changes that required me to completely remove 'REDO' functionality, and I don't like the code I did as it is more like a workaround and not really fitting your code style.

I could work on something like that, If you'll give me some advices how you'd like to (if at all) to have this supported. Being sure that my code will eventually end up on a master branch would be a good motivation.

https://github.com/patryk-sredzinski/ZLPhotoBrowser/pull/10/files - Those are the changes I did to make what we see above.

longitachi commented 1 year ago

Thanks for your contribution. You can push your code in this branch (https://github.com/longitachi/ZLPhotoBrowser/tree/zl/universal-undo), I will also develop in this branch.

longitachi commented 1 year ago

I see that WeChat has recently added this feature as well. I wasn't sure about the UI style before, but now I can follow WeChat's UI.