Skip to content

Tidy up MediaSendFragment #1068

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

Merged
merged 10 commits into from
Apr 3, 2025
Merged

Tidy up MediaSendFragment #1068

merged 10 commits into from
Apr 3, 2025

Conversation

SessionHero01
Copy link
Collaborator

This PR contains changes to improve the code quality in MediaSendFragment, and also:

  1. Changes the BlobProvider to use CompletableFuture so we can await them in coroutine
  2. When rendering a edited bitmap, use a temporary file instead of in memory bytes to save memory
  3. Use coroutine for the rendering/saving process instead of async task.

}

override fun onStart() {
super.onStart()

fragmentPagerAdapter!!.restoreState(viewModel!!.drawState)
viewModel!!.onImageEditorStarted()
val viewModel = viewModel
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason you are re attributing viewModel and the adapter here and in onStop? Can't you use them directly if they are set up properly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Apparently smartcasts can't be applied to properties

@SessionHero01 SessionHero01 marked this pull request as draft April 2, 2025 22:11
@SessionHero01 SessionHero01 marked this pull request as ready for review April 3, 2025 02:43
@SessionHero01 SessionHero01 merged commit dbcffbd into dev Apr 3, 2025
4 checks passed
@SessionHero01 SessionHero01 deleted the tidy-up-media-send branch April 3, 2025 05:16
@SessionHero01 SessionHero01 mentioned this pull request Apr 29, 2025
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