Skip to content
Snippets Groups Projects
Commit 8070eecf authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Do not show context menus if activity is paused

parent 7c8ac8c9
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ import android.widget.FrameLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.bottomsheet.BottomSheetBehavior
......@@ -148,6 +149,7 @@ interface CtxActionReceiver {
}
fun showContext(activity: FragmentActivity, receiver: CtxActionReceiver, position: Int, title: String, flags: Int) {
if (!activity.lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) return
val ctxDialog = ContextSheet()
ctxDialog.arguments = Bundle(3).apply {
putString(CTX_TITLE_KEY, title)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment