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

Added blur for Android version older than 12 #746

Merged

Conversation

sockenklaus
Copy link
Contributor

Closes #733

I added a check for the Android version in app/src/main/java/com/jerboa/ui/components/common/PictrsImage.kt

Android version 12 or newer still uses the Jetpack Compose function .blur().
For older versions I added a BlurTransformation provided by https://github.com/T8RIN/BlurTransformation that is applied to the Coil ImageRequest.

Because I added a new utility class to the project i created a new package com.jerboa.util and moved the existing class Util.kt to this package. This lead to a lot of refactoring to meet the lint requirements. Hence the many changes.

The real changes are in:
app/src/main/java/com/jerboa/ui/components/common/PictrsImage.kt

and

app/src/main/java/com/jerboa/util/BlurTransformation.kt

…rsions < Android 12.

Android 12 and above still uses the compose .blur function, older Android versions blur the images with a BlurTransformation provided by T8RIN.
@sockenklaus sockenklaus changed the title Added backwards compatibility for blurring NSFW images for Android ve… Added blur for Android version older than 12 Jun 18, 2023
Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

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

I'm guessing you accidentally added a lot more than was necessary for some reason, or github messed up somehow, due to all the conflicts. You might need to start from scratch from main, and copy your new file over.

@sockenklaus
Copy link
Contributor Author

I'm guessing you accidentally added a lot more than was necessary for some reason, or github messed up somehow, due to all the conflicts. You might need to start from scratch from main, and copy your new file over.

Ugh honestly I'm 99 % sure i made a stupid decision moving and renaming your Util.kt class grouping it with my newly added BlurTransformation.kt in the package com.jerboa.util... I thought grouping together utility classes would clean up the project structure but it got ktlint all upset because the moving and renaming messed up the lexicographical import-order....

I will revert this refactoring and update the PR accordingly this evening.

@dessalines
Copy link
Member

Sounds good, thx! There's no rush on it, I usually do frequent releases, so this will get in at some point.

Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@dessalines dessalines enabled auto-merge (squash) June 19, 2023 18:45
@dessalines dessalines merged commit 631c911 into LemmyNet:main Jun 19, 2023
@sockenklaus sockenklaus deleted the 733_make_blur_backwards_compatible branch June 19, 2023 19:27
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.

Blur Effect doesn't work on old Android version
2 participants