mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Fix observer not added in a specific case
This commit is contained in:
@@ -89,6 +89,13 @@ public class AudioView extends FrameLayout {
|
||||
}
|
||||
|
||||
private void setupControls() {
|
||||
// Set up observer in a very specific case when the view is detached and then re-attached,
|
||||
// but binding from adapter has not happened yet
|
||||
if (viewModel != null) {
|
||||
viewModel.getPlaybackState().removeObserver(stateObserver);
|
||||
viewModel.getPlaybackState().observeForever(stateObserver);
|
||||
}
|
||||
|
||||
playPauseButton.setOnClickListener(v -> {
|
||||
Log.w(TAG, "playPauseButton onClick");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user