Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add saveAsFileBlocking() and saveAsBitmapBlocking() #512

Closed
wants to merge 1 commit into from

Conversation

wasky
Copy link
Contributor

@wasky wasky commented Jan 30, 2023

These can be called directly from Java.

These can be called directly from Java.
* @param saveSettings builder for multiple save options [SaveSettings]
*/
@WorkerThread
fun saveAsBitmapBlocking(saveSettings: SaveSettings = SaveSettings.Builder().build()): Bitmap
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use @JvmOverload annotation on a single method in Kotlin to make it interop with Java.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'@jvmoverloads' annotation cannot be used on interface methods

@burhanrashid52
Copy link
Owner

I would avoid giving responsibility to the client for handling saving images for java. Rather I will keep the old interface and introduce new suspend saveFileAsBlocking() APIs for coroutines.

@wasky
Copy link
Contributor Author

wasky commented Jan 31, 2023

I'm not sure if I understand correctly. There's already coroutine version: suspend saveAsFile(). No need for another suspending function. Do you want to remove deprecation warnings from old API and to cancel this PR?

@burhanrashid52
Copy link
Owner

Do you want to remove deprecation warnings from old API and to cancel this PR?

Yes

@wasky wasky closed this Feb 1, 2023
@wasky wasky deleted the PE-511 branch March 3, 2023 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants