mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-22 20:18:36 +00:00
Remove appbar offset listener when call log is unbound.
This commit is contained in:
committed by
Greyson Parrelli
parent
7f1227ee19
commit
d0baf1dc95
@@ -80,8 +80,13 @@ class CallLogFragment : Fragment(R.layout.call_log_fragment), CallLogAdapter.Cal
|
|||||||
private val TAG = Log.tag(CallLogFragment::class.java)
|
private val TAG = Log.tag(CallLogFragment::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var filterViewOffsetChangeListener: AppBarLayout.OnOffsetChangedListener? = null
|
||||||
|
|
||||||
private val viewModel: CallLogViewModel by activityViewModels()
|
private val viewModel: CallLogViewModel by activityViewModels()
|
||||||
private val binding: CallLogFragmentBinding by ViewBinderDelegate(CallLogFragmentBinding::bind)
|
private val binding: CallLogFragmentBinding by ViewBinderDelegate(CallLogFragmentBinding::bind) {
|
||||||
|
binding.recyclerCoordinatorAppBar.removeOnOffsetChangedListener(filterViewOffsetChangeListener)
|
||||||
|
}
|
||||||
|
|
||||||
private val disposables = LifecycleDisposable()
|
private val disposables = LifecycleDisposable()
|
||||||
private val callLogContextMenu = CallLogContextMenu(this, this)
|
private val callLogContextMenu = CallLogContextMenu(this, this)
|
||||||
private val callLogActionMode = CallLogActionMode(CallLogActionModeCallback())
|
private val callLogActionMode = CallLogActionMode(CallLogActionModeCallback())
|
||||||
@@ -328,11 +333,14 @@ class CallLogFragment : Fragment(R.layout.call_log_fragment), CallLogAdapter.Cal
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.recyclerCoordinatorAppBar.addOnOffsetChangedListener { layout: AppBarLayout, verticalOffset: Int ->
|
filterViewOffsetChangeListener = AppBarLayout.OnOffsetChangedListener {
|
||||||
|
layout: AppBarLayout, verticalOffset: Int ->
|
||||||
val progress = 1 - verticalOffset.toFloat() / -layout.height
|
val progress = 1 - verticalOffset.toFloat() / -layout.height
|
||||||
binding.pullView.onUserDrag(progress)
|
binding.pullView.onUserDrag(progress)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.recyclerCoordinatorAppBar.addOnOffsetChangedListener(filterViewOffsetChangeListener)
|
||||||
|
|
||||||
if (viewModel.filterSnapshot != CallLogFilter.ALL) {
|
if (viewModel.filterSnapshot != CallLogFilter.ALL) {
|
||||||
binding.root.doAfterNextLayout {
|
binding.root.doAfterNextLayout {
|
||||||
binding.pullView.openImmediate()
|
binding.pullView.openImmediate()
|
||||||
|
|||||||
Reference in New Issue
Block a user