-
Notifications
You must be signed in to change notification settings - Fork 282
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
[AND-316] Configuration options for the System Attachment Picker #5654
Open
VelikovPetar
wants to merge
9
commits into
develop
Choose a base branch
from
feature/customization-for-system-attachments-picker
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[AND-316] Configuration options for the System Attachment Picker #5654
VelikovPetar
wants to merge
9
commits into
develop
from
feature/customization-for-system-attachments-picker
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SDK Size Comparison 📏
|
VelikovPetar
commented
Feb 25, 2025
private val mediaPickerContract = resolveMediaPickerMode(captureImageAllowed, captureVideoAllowed) | ||
/** Returns whether file attachments are allowed. */ | ||
@Deprecated(message = "Use config.filesAllowed instead.", level = DeprecationLevel.WARNING) | ||
public val filesAllowed: Boolean = config.filesAllowed |
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.
These are introduced to prevent a breaking change - the previous primary constructor:
AttachmentsPickerSystemTabFactory(
public val filesAllowed: Boolean,
public val mediaAllowed: Boolean,
public val captureImageAllowed: Boolean,
public val captureVideoAllowed: Boolean,
public val pollAllowed: Boolean,
)
Is now deprecated in favour of:
public class AttachmentsPickerSystemTabFactory(
public val config: SystemAttachmentsPickerConfig,
)
So the fields are now still public but deprecated, so they can be eventually deleted.
…nts-picker # Conflicts: # CHANGELOG.md
…nts-picker # Conflicts: # DEPRECATIONS.md
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Goal
Provide a way to customise the behaviour of the "System Attachments Picker". Initially, we are exposing a way to choose between picking single/multiple visual media attachment, and to choose the allowed visual media types - image/video/image_and_video.
Compose Usage
XML Usage
🛠 Implementation details
ui-common
VisualMediaType
enum defining the possible combinations for picking visual mediaSystemAttachmentsPickerConfig
class holding the configuration options for the "System attachments picker"compose
ChatTheme
-systemAttachmentsPickerConfig
which is read if theuseDefaultSystemMediaPicker
is set totrue
AttachmentsPickerTabFactories.systemAttachmentsPickerTabFactories
factory method accepting aSystemAttachmentsPickerConfig
AttachmentsPickerSystemTabFactory
to consider thevisualMediaAllowMultiple
andvisualMediaType
params when launching the visual media picker.AttachmentsPickerTabFactories.defaultFactoriesWithoutStoragePermissions
methods in favour ofAttachmentsPickerTabFactories.systemAttachmentsPickerTabFactories
ui-components
systemMediaPickerVisualMediaAllowMultiple
andsystemMediaPickerVisualMediaType
properties on theAttachmentsPickerDialogStyle
to allow customisation. (note: Here we are not using theSystemAttachmentsPickerConfig
model as currently all customisation options for both the regular and system attachment pickers and using theAttachmentsPickerDialogStyle
)AttachmentsPickerSystemFragment
to consider thevisualMediaAllowMultiple
andvisualMediaType
params when launching the visual media picker.🎨 UI Changes
Example where:
compose.mp4
xml.mp4
🧪 Testing
Patch for XML and Compose samples