Skip to content

Conversation

@jbsession
Copy link
Owner

@jbsession jbsession commented Dec 19, 2025

Moved the old Fragment XMLs to Compose.

New ComposeFragments are created to replace the old fragments for the MediaSendActivity.

Part 2 in progress : MediaSendFragment UI to compose.

@jbsession jbsession self-assigned this Dec 19, 2025
) {

// span logic: screenWidth / media_picker_folder_width
val folderWidth = dimensionResource(R.dimen.media_picker_folder_width)

Choose a reason for hiding this comment

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

You probably want to port this into our compose Dimension.kt instead. You can remove media_picker_folder_width and other related xml dimensions if they are not needed or moved to the kt file instead.

modifier = Modifier
.align(Alignment.BottomCenter)
.fillMaxWidth()
.height(50.dp)

This comment was marked as resolved.

import java.util.ArrayList;
import java.util.List;

@Deprecated

Choose a reason for hiding this comment

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

One thing to be mindful of if you decide to keep all the old stuff, is to not forget to clean it out later.
With git history you can easily access old files you should be ok deleting and cleaning everything you don't need anymore.
Don't forget to clean out the layout.xml files, and possibly unused views.xml, dimensions, etc...

.clickable(onClick = onClick)
) {
Box(modifier = Modifier.aspectRatio(1f)) {
GlideImage(

This comment was marked as resolved.

modifier = Modifier.fillMaxSize(),
contentScale = ContentScale.Crop
)
// Bottom shade overlay

Choose a reason for hiding this comment

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

Do you think it could be achieved more easily with the innerShadow modifier?

selected.indexOfFirst { it.uri == media.uri }
}

// Matches adapter rules:

This comment was marked as resolved.

.padding(end = 2.dp, bottom = 2.dp)
.aspectRatio(1f)
.combinedClickable(
onClick = {

This comment was marked as resolved.


Box(
modifier = modifier
.padding(end = 2.dp, bottom = 2.dp)

This comment was marked as resolved.

)

// Border overlay (replaces @drawable/mediapicker_item_border_dark View)
Box(

This comment was marked as resolved.

painter = painterResource(R.drawable.triangle_right),
contentDescription = null,
modifier = Modifier
.size(width = 15.dp, height = 18.dp)

This comment was marked as resolved.


val context = LocalContext.current
val activity = context as? FragmentActivity
val showManage = remember(activity) {

This comment was marked as resolved.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I moved a few functions into the VM and added the flag to the UiState as an initial change. Maybe we can separate permission checking from the AttachmentManager. I copied some of the permission checks into the VM for now but I can do the separate file if we find that suitable for the modern structure.

.fillMaxSize()
.background(LocalColors.current.background)
) {
items(folders) { folder ->

This comment was marked as resolved.

val mediaItemGridSpacing : Dp = 2.dp,
val mediaPlayOverlay : Dp = 36.dp,

val smallRadius : Dp = 26.dp

This comment was marked as resolved.

.padding(LocalDimensions.current.xxsSpacing),
contentAlignment = Alignment.Center
) {
IndicatorOn(size = LocalDimensions.current.smallRadius)

This comment was marked as resolved.

import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi
import com.bumptech.glide.integration.compose.GlideImage

This comment was marked as resolved.

.aspectRatio(1f)
.border(
width = LocalDimensions.current.borderStroke,
color = Color.White.copy(alpha = 0.20f)

Choose a reason for hiding this comment

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

A new color is suspicious here. Shouldn't it be our LocalColors.current.borders color instead?

Choose a reason for hiding this comment

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

@jbsession You added the new color but you left the alpha. Is that needed? The border colour alone should be enough?

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.

3 participants