burhanrashid52 / PhotoEditor

A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.
MIT License
4.12k stars 989 forks source link

Update PhotoSaverTask.kt #446

Closed isandoqa closed 1 year ago

isandoqa commented 2 years ago

Use coroutines instead of deprecated AsynTask. Use callback functions directly instead of SaveResultClass. Fix "Software rendering does not support hardware bitmaps" exception.

burhanrashid52 commented 2 years ago

I am not sure, but having a coroutine dependency in the library for just one task does not seem a good trade-off. Maybe we can have a separate suspend function inside the library and the client will decide on how to consume it. To be honest, I am not well versed in coroutine so I may be completely wrong. cc @lucianocheng

lucianocheng commented 2 years ago

@burhanrashid52 using coroutines is probably fine in this case. AsyncTask is deprecated and the only other way to run this not on the UI thread would be Thread, which wouldn't make sense.

Give me a week to compare how this works to our internal implementation then I'll review it.

Use callback functions directly instead of SaveResultClass.

This is probably the bigger change if it changes the API. @isandoqa do you know if this means Java users can't use the callback structure?

isandoqa commented 2 years ago

@lucianocheng PhotoSaverTask is an internal class, it is not accessible from other modules, so no need to concern about java users, unless you plan to write any java components inside the library module itself.

github-actions[bot] commented 2 years ago

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 years ago

This PR was closed because it has been stalled for 5 days with no activity.

github-actions[bot] commented 1 year ago

This PR was closed because it has been stalled for 5 days with no activity.