Fix bottom bar state handling and active state when menu is open.

This commit is contained in:
Alex Hart
2023-03-21 16:06:15 -03:00
committed by Greyson Parrelli
parent ca21ab667a
commit c26cc56f20
2 changed files with 5 additions and 1 deletions

View File

@@ -19,8 +19,10 @@ class CallLogContextMenu(
private val callbacks: Callbacks private val callbacks: Callbacks
) { ) {
fun show(anchor: View, call: CallLogRow.Call) { fun show(anchor: View, call: CallLogRow.Call) {
anchor.isSelected = true
SignalContextMenu.Builder(anchor, anchor.parent as ViewGroup) SignalContextMenu.Builder(anchor, anchor.parent as ViewGroup)
.preferredVerticalPosition(SignalContextMenu.VerticalPosition.BELOW) .preferredVerticalPosition(SignalContextMenu.VerticalPosition.BELOW)
.onDismiss { anchor.isSelected = false }
.show( .show(
listOfNotNull( listOfNotNull(
getVideoCallActionItem(call), getVideoCallActionItem(call),

View File

@@ -15,7 +15,9 @@ import org.thoughtcrime.securesms.util.livedata.Store
class ConversationListTabsViewModel(repository: ConversationListTabRepository) : ViewModel() { class ConversationListTabsViewModel(repository: ConversationListTabRepository) : ViewModel() {
private val store = Store(ConversationListTabsState()) private val store = Store(ConversationListTabsState())
val stateSnapshot: ConversationListTabsState = store.state val stateSnapshot: ConversationListTabsState
get() = store.state
val state: LiveData<ConversationListTabsState> = Transformations.distinctUntilChanged(store.stateLiveData) val state: LiveData<ConversationListTabsState> = Transformations.distinctUntilChanged(store.stateLiveData)
val disposables = CompositeDisposable() val disposables = CompositeDisposable()