mirror of
https://github.com/ProtonMail/android-mail.git
synced 2026-05-15 09:50:40 +00:00
Disable body height restriction in EntireMessageBody flow
- Prevent full-message screen from inheriting preview height caps, which blocks
scrolling in EntireMessageBodyScreen
- pass forceDisableHeightRestriction=true when mapping body UI model in EntireMessageBodyViewModel
- keep preview restriction behavior unchanged for conversation detail flow
ET-6187
This commit is contained in:
+5
-2
@@ -45,10 +45,13 @@ class MessageBodyUiModelMapper @Inject constructor(
|
|||||||
suspend fun toUiModel(
|
suspend fun toUiModel(
|
||||||
decryptedMessageBody: DecryptedMessageBody,
|
decryptedMessageBody: DecryptedMessageBody,
|
||||||
attachmentListExpandCollapseMode: AttachmentListExpandCollapseMode?,
|
attachmentListExpandCollapseMode: AttachmentListExpandCollapseMode?,
|
||||||
existingMessageBodyUiModel: MessageBodyUiModel? = null
|
existingMessageBodyUiModel: MessageBodyUiModel? = null,
|
||||||
|
forceDisableHeightRestriction: Boolean = false
|
||||||
): MessageBodyUiModel {
|
): MessageBodyUiModel {
|
||||||
val shouldRestrictWebViewHeight =
|
val shouldRestrictWebViewHeight =
|
||||||
hasMessageBodyWebViewCrashed() && restrictMessageWebViewHeightEnabled.get()
|
!forceDisableHeightRestriction &&
|
||||||
|
hasMessageBodyWebViewCrashed() &&
|
||||||
|
restrictMessageWebViewHeightEnabled.get()
|
||||||
|
|
||||||
val decryptedMessageBodyWithType = MessageBodyWithType(
|
val decryptedMessageBodyWithType = MessageBodyWithType(
|
||||||
decryptedMessageBody.value,
|
decryptedMessageBody.value,
|
||||||
|
|||||||
+6
-1
@@ -167,7 +167,12 @@ class EntireMessageBodyViewModel @Inject constructor(
|
|||||||
ifRight = {
|
ifRight = {
|
||||||
mutableState.value = mutableState.value.copy(
|
mutableState.value = mutableState.value.copy(
|
||||||
messageBodyState = MessageBodyState.Data(
|
messageBodyState = MessageBodyState.Data(
|
||||||
messageBodyUiModel = messageBodyUiModelMapper.toUiModel(it, null)
|
messageBodyUiModel = messageBodyUiModelMapper.toUiModel(
|
||||||
|
decryptedMessageBody = it,
|
||||||
|
attachmentListExpandCollapseMode = null,
|
||||||
|
existingMessageBodyUiModel = null,
|
||||||
|
forceDisableHeightRestriction = true
|
||||||
|
)
|
||||||
),
|
),
|
||||||
requestPhishingLinkConfirmation = it.banners.contains(MessageBanner.PhishingAttempt)
|
requestPhishingLinkConfirmation = it.banners.contains(MessageBanner.PhishingAttempt)
|
||||||
)
|
)
|
||||||
|
|||||||
+18
-3
@@ -128,7 +128,12 @@ class EntireMessageBodyViewModelTest {
|
|||||||
getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any())
|
getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any())
|
||||||
} returns decryptedMessageBody.right()
|
} returns decryptedMessageBody.right()
|
||||||
coEvery {
|
coEvery {
|
||||||
messageBodyUiModelMapper.toUiModel(decryptedMessageBody, null)
|
messageBodyUiModelMapper.toUiModel(
|
||||||
|
decryptedMessageBody = decryptedMessageBody,
|
||||||
|
attachmentListExpandCollapseMode = null,
|
||||||
|
existingMessageBodyUiModel = null,
|
||||||
|
forceDisableHeightRestriction = true
|
||||||
|
)
|
||||||
} returns messageBodyUiModel
|
} returns messageBodyUiModel
|
||||||
|
|
||||||
// When
|
// When
|
||||||
@@ -224,7 +229,12 @@ class EntireMessageBodyViewModelTest {
|
|||||||
getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any())
|
getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any())
|
||||||
} returns decryptedMessageBody.right()
|
} returns decryptedMessageBody.right()
|
||||||
coEvery {
|
coEvery {
|
||||||
messageBodyUiModelMapper.toUiModel(decryptedMessageBody, null)
|
messageBodyUiModelMapper.toUiModel(
|
||||||
|
decryptedMessageBody = decryptedMessageBody,
|
||||||
|
attachmentListExpandCollapseMode = null,
|
||||||
|
existingMessageBodyUiModel = null,
|
||||||
|
forceDisableHeightRestriction = true
|
||||||
|
)
|
||||||
} returns messageBodyUiModel
|
} returns messageBodyUiModel
|
||||||
|
|
||||||
// When
|
// When
|
||||||
@@ -247,7 +257,12 @@ class EntireMessageBodyViewModelTest {
|
|||||||
getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any())
|
getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any())
|
||||||
} returns decryptedMessageBody.right()
|
} returns decryptedMessageBody.right()
|
||||||
coEvery {
|
coEvery {
|
||||||
messageBodyUiModelMapper.toUiModel(decryptedMessageBody, null)
|
messageBodyUiModelMapper.toUiModel(
|
||||||
|
decryptedMessageBody = decryptedMessageBody,
|
||||||
|
attachmentListExpandCollapseMode = null,
|
||||||
|
existingMessageBodyUiModel = null,
|
||||||
|
forceDisableHeightRestriction = true
|
||||||
|
)
|
||||||
} returns messageBodyUiModel
|
} returns messageBodyUiModel
|
||||||
|
|
||||||
// When
|
// When
|
||||||
|
|||||||
Reference in New Issue
Block a user