This repository was archived by the owner on Jun 7, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
app/src/main/java/chat/rocket/android/chatroom/adapter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import android.view.View
66import android.view.ViewGroup
77import androidx.appcompat.app.AppCompatActivity
88import androidx.core.view.children
9+ import androidx.lifecycle.Lifecycle
910import androidx.recyclerview.widget.RecyclerView
1011import chat.rocket.android.R
1112import chat.rocket.android.chatroom.ui.bottomsheet.MessageActionsBottomSheet
@@ -94,9 +95,11 @@ abstract class BaseViewHolder<T : BaseUiModel<*>>(
9495 view.context?.let {
9596 if (it is ContextThemeWrapper && it.baseContext is AppCompatActivity ) {
9697 with (it.baseContext as AppCompatActivity ) {
97- val actionsBottomSheet = MessageActionsBottomSheet ()
98- actionsBottomSheet.addItems(menuItems, this @BaseViewHolder)
99- actionsBottomSheet.show(supportFragmentManager, null )
98+ if (this .lifecycle.currentState.isAtLeast(Lifecycle .State .RESUMED )) {
99+ val actionsBottomSheet = MessageActionsBottomSheet ()
100+ actionsBottomSheet.addItems(menuItems, this @BaseViewHolder)
101+ actionsBottomSheet.show(supportFragmentManager, null )
102+ }
100103 }
101104 }
102105 }
You can’t perform that action at this time.
0 commit comments