Skip to content

Conversation

@jbsession
Copy link
Collaborator

This PR removes portrait lock.

This PR also adds some new composables for different orientations.

TODO: Full end to end testing for landscape.

@jbsession jbsession self-assigned this Sep 22, 2025
@damajor damajor mentioned this pull request Sep 29, 2025
val address = Address.fromSerialized(addressStr)

// Fetch the current ThreadRecord for this address
val thread = threadDb.getThreads(listOf(address)).firstOrNull() ?: return
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doing db access on the main thread should be a massive red flag.
There shouldn't be a need to calculate anything in the activity anyway as the VM should hold all the required information

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will update this to get the ThreadRecord from data in the viewmodel then.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is a situation where you need to look at who is using this and ask yourself: Do we really need to pass a threadRecord everywhere?
Most of the places using this are probably only using an address, which you already have from the sheet's arguments

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the threadRecord is fine here. Most of the methods rely on the Recipient rather than just the address itself. If we get the recipient from the address, wouldn't that require additional repo and suspend calls?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if this fragment can be handled in a more intelligent way. Currently it gets destroyed and recreated every time we rotate. Don't we have legitimate ways to handle the rotation internally in the fragment without recreating it? Essentially like the forced portrait was doing, but in a way that works for the new rules of Android 16?

modifier: Modifier = Modifier
) {
Column(
modifier = modifier.widthIn(max = 420.dp),
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use your smallMaximumImgClamp which maybe can be renamed to something more meaningful since it doesn't apply only to images, but to content. maxContentSizeSmall ? Which means the other ones would need to be renamed as well

@ThomasSession
Copy link
Collaborator

Some issues from the latest changes:

  • App crashes when going from landscape to portrait in the camera screen
  • Media rail is now disappeared when opening a set of images inside a conversation, in landscape

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.

2 participants