kopia lustrzana https://github.com/ryukoposting/Signal-Android
Prevent Chats icon from animating when returning from other activity.
rodzic
0bf5f15cf9
commit
cf3dd70600
|
@ -33,6 +33,7 @@ class ConversationListTabsFragment : Fragment(R.layout.conversation_list_tabs) {
|
|||
private lateinit var chatsPill: ImageView
|
||||
private lateinit var storiesPill: ImageView
|
||||
|
||||
private var shouldBeImmediate = true
|
||||
private var pillAnimator: Animator? = null
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
@ -63,9 +64,10 @@ class ConversationListTabsFragment : Fragment(R.layout.conversation_list_tabs) {
|
|||
viewModel.onStoriesSelected()
|
||||
}
|
||||
|
||||
update(viewModel.stateSnapshot, true)
|
||||
|
||||
viewModel.state.observe(viewLifecycleOwner) { update(it, false) }
|
||||
viewModel.state.observe(viewLifecycleOwner) {
|
||||
update(it, shouldBeImmediate)
|
||||
shouldBeImmediate = false
|
||||
}
|
||||
}
|
||||
|
||||
private fun update(state: ConversationListTabsState, immediate: Boolean) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.thoughtcrime.securesms.stories.tabs
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import io.reactivex.rxjava3.core.Observable
|
||||
|
@ -15,7 +16,7 @@ class ConversationListTabsViewModel(repository: ConversationListTabRepository) :
|
|||
private val store = Store(ConversationListTabsState())
|
||||
|
||||
val stateSnapshot: ConversationListTabsState = store.state
|
||||
val state: LiveData<ConversationListTabsState> = store.stateLiveData
|
||||
val state: LiveData<ConversationListTabsState> = Transformations.distinctUntilChanged(store.stateLiveData)
|
||||
val disposables = CompositeDisposable()
|
||||
|
||||
private val internalTabClickEvents: Subject<ConversationListTab> = PublishSubject.create()
|
||||
|
|
Ładowanie…
Reference in New Issue