-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Using cached thumbnails for images in messages view #89
Conversation
android/app/build.gradle
Outdated
implementation 'com.github.getlantern:libsignal-protocol-java:5c7d676' | ||
implementation 'com.github.getlantern:libsignal-metadata-java:2aed184' | ||
implementation 'com.github.getlantern:messaging-android:890f2897ae' | ||
implementation 'com.github.getlantern:messaging-android:caa2fbcf5f' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above dependencies are no longer necessary because they're exported by the messaging-android dependency.
cf18c72
to
cb8f8c7
Compare
Orientation issue is fixed, thumbnail quality is improved (though I'm not 100% happy with it yet). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested this, looks good! Some comments:
- I made the thumbnails as wide as possible and resolution looks great.
- How will this handle GIFs and videos? I tested with both: GIF goes through but is thumbnailed as a static image, video doesn't go through (gets posted as an empty message).
- I totally agree we need to have some sort of UX on double tap/long tap: a full screen attachment viewer but maybe also a way to save the file in a directory of their choice?
I think we can merge this and I will create a separate PR for the wechat
example changes.
I have a unit test that uses an H.264 video but maybe there's a problem with other formats. Do you have a branch with video detection enabled where I could debug this? |
The Filepicker we are using in this branch can detect videos: |
In attachment.dart, I don't see an implementation of Video attachments.
|
Oh I see - no haven't managed to get to that part yet! |
I think that might explain why videos show up as an empty message :) |
🤦♀️ 🤦♀️ 🤦♀️ (sorry!) |
No worries! I'll go ahead and merge this PR. Once we have video thumbnail support in the UI, if there's any issues we can address them then. |
This incorporates the latest messaging-android that generates thumbnails and uses those thumbnails in the messages view.
The thumbnails are cached in an in-memory LRU cache.
Note - on debug builds, scrolling will still seem kind of slow (Flutter performance in debug builds is very slow in general) but it should be fine in release builds. We can (and should) do release builds periodically to try out the performance.
BTW - the thumbnail generation seems to mess up the orientation of some images, I'll look into that.
Note - I did not add functionality to open the image in full screen on tap, but I think that would be a useful behavior.
Oh also, the images are pretty pixelated, I'll bump up the resolution of the thumbnails generated in the messaging-android library.