Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,11 @@ class ConversationReactionOverlay : FrameLayout {
updateBoundsOnLayoutChanged()
revealAnimatorSet.start()

val maxMenuY = maxOf(
systemInsets.top.toFloat(),
(height - systemInsets.bottom - actualMenuHeight).toFloat()
)

if (isWideLayout) {
val menuXInOverlay = if (isMessageOnLeft) {
// Menu to the RIGHT of the scrubber
Expand All @@ -359,8 +364,7 @@ class ConversationReactionOverlay : FrameLayout {
scrubberX - contextMenu.getMaxWidth() - menuPadding
}

val maxMenuYInOverlay = (height - systemInsets.bottom - actualMenuHeight).toFloat()
val menuYInOverlay = minOf(backgroundView.y, maxMenuYInOverlay)
val menuYInOverlay = minOf(backgroundView.y, maxMenuY)

// Convert overlay-local to anchor relative as expected by ConversationContextMenu.show()
val (xOffset, yOffset) = toAnchorOffsets(menuXInOverlay, menuYInOverlay)
Expand All @@ -377,7 +381,7 @@ class ConversationReactionOverlay : FrameLayout {
val menuYInOverlay = (menuTop + menuPadding)
.coerceIn(
systemInsets.top.toFloat(),
(height - systemInsets.bottom - actualMenuHeight).toFloat()
maxMenuY
)

val (xOffset, yOffset) = toAnchorOffsets(menuXInOverlay, menuYInOverlay)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import org.session.libsession.utilities.getGroup
import org.session.libsession.utilities.recipients.Recipient
import org.session.libsession.utilities.withUserConfigs
import org.session.libsignal.utilities.AccountId
import org.session.libsignal.utilities.Log
import org.thoughtcrime.securesms.auth.LoginStateRepository
import org.thoughtcrime.securesms.database.GroupDatabase
import org.thoughtcrime.securesms.database.ThreadDatabase
Expand Down Expand Up @@ -93,9 +94,15 @@ class ConversationOptionsBottomSheet() : BottomSheetDialogFragment(), View.OnCli
requireNotNull(args.getLong(ARG_THREAD_ID))
val addressString = requireNotNull(args.getString(ARG_ADDRESS))
val address = Address.fromSerialized(addressString)
thread = requireNotNull(
threadDatabase.getThreads(listOf(address)).firstOrNull()
) { "Thread not found for address: $addressString" }
val threadFromDb = threadDatabase.getThreads(listOf(address)).firstOrNull()

if(threadFromDb == null){
Log.w("", "Home conversation bottom sheet: Thread not found for address: $addressString" )
dismiss()
return
}

thread = threadFromDb
group = groupDatabase.getGroup(thread.recipient.address.toString())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
new Data(outState).writeModel(imageEditorView.getModel());
if (imageEditorView != null) {
new Data(outState).writeModel(imageEditorView.getModel());
} else if (restoredModel != null) {
new Data(outState).writeModel(restoredModel);
}
}

@Override
Expand Down