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

Rework on media module #3967

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open

Rework on media module #3967

wants to merge 10 commits into from

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Nov 29, 2024

Content

Move code from the api module to the impl module and rearrange package organisation.
Also split code between multiple files.

Motivation and context

Improve build time and prepare work for media browser

Screenshots / GIFs

No change expected.

Tests

  • No change expected

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

import io.element.android.libraries.textcomposer.model.TextEditorState
import io.element.android.libraries.textcomposer.model.aTextEditorStateMarkdown

open class AttachmentsPreviewStateProvider : PreviewParameterProvider<AttachmentsPreviewState> {
override val values: Sequence<AttachmentsPreviewState>
get() = sequenceOf(
anAttachmentsPreviewState(),
anAttachmentsPreviewState(mediaInfo = aVideoMediaInfo()),
anAttachmentsPreviewState(mediaInfo = anAudioMediaInfo()),
anAttachmentsPreviewState(mediaInfo = anApkMediaInfo()),
Copy link
Member Author

@bmarty bmarty Nov 29, 2024

Choose a reason for hiding this comment

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

Since the content is not the real content anymore, there is no need to have multiple identical previews.

Copy link
Contributor

github-actions bot commented Nov 29, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/KpiFyP

@bmarty bmarty added Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. PR-Misc For other changes labels Nov 29, 2024
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Nov 29, 2024
@bmarty bmarty added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Nov 29, 2024
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Nov 29, 2024
@bmarty bmarty added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Nov 29, 2024
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Nov 29, 2024
@bmarty bmarty marked this pull request as ready for review November 29, 2024 11:05
@bmarty bmarty requested a review from a team as a code owner November 29, 2024 11:05
@bmarty bmarty requested review from jmartinesp and removed request for a team November 29, 2024 11:05
Remove obsolete items
Reorder items.
Copy link

sonarcloud bot commented Nov 29, 2024

Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 39.40678% with 286 lines in your changes missing coverage. Please review.

Project coverage is 82.73%. Comparing base (31f9fa2) to head (9a5d4fc).
Report is 14 commits behind head on develop.

Files with missing lines Patch % Lines
...ediaviewer/impl/local/video/ExoPlayerForPreview.kt 2.60% 187 Missing ⚠️
...ies/mediaviewer/impl/local/video/MediaVideoView.kt 51.63% 54 Missing and 5 partials ⚠️
...s/mediaviewer/impl/DefaultMediaViewerEntryPoint.kt 0.00% 21 Missing ⚠️
...ediaviewer/impl/local/DefaultLocalMediaRenderer.kt 0.00% 9 Missing ⚠️
...libraries/mediaviewer/impl/local/LocalMediaView.kt 88.88% 1 Missing and 2 partials ⚠️
...aries/mediaviewer/impl/local/file/MediaFileView.kt 95.74% 0 Missing and 2 partials ⚠️
...braries/mediaviewer/impl/local/pdf/MediaPdfView.kt 81.81% 1 Missing and 1 partial ⚠️
.../impl/util/FileExtensionExtractorWithValidation.kt 60.00% 1 Missing and 1 partial ⚠️
...ies/mediaviewer/impl/local/image/MediaImageView.kt 94.44% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3967      +/-   ##
===========================================
- Coverage    83.01%   82.73%   -0.29%     
===========================================
  Files         1795     1805      +10     
  Lines        45549    45779     +230     
  Branches      5370     5373       +3     
===========================================
+ Hits         37812    37874      +62     
- Misses        5857     6019     +162     
- Partials      1880     1886       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Misc For other changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants