fix: Context issues in fragment sheet.
All checks were successful
Check PR code / Lint (pull_request) Successful in 1m7s
Check PR code / build (pull_request) Successful in 12m15s

This commit is contained in:
Amine Bouabdallaoui 2024-12-30 22:12:38 +01:00
parent cd8b7aaf9d
commit 806e56e20b
2 changed files with 7 additions and 9 deletions

View File

@ -225,7 +225,7 @@ class ArticleFragment : Fragment(), DIAware {
} }
this@ArticleFragment.item.unread = false this@ArticleFragment.item.unread = false
Toast.makeText( Toast.makeText(
context, requireContext(),
R.string.marked_as_read, R.string.marked_as_read,
Toast.LENGTH_LONG, Toast.LENGTH_LONG,
).show() ).show()

View File

@ -52,19 +52,17 @@ class FilterSheetFragment : BottomSheetDialogFragment(), DIAware {
false, false,
) )
val context: Context? = context try {
if (context == null) {
dismiss()
Exception("FilterSheetFragment context is null").sendSilentlyWithAcraWithName("FilterSheetFragment > onCreateView")
} else {
CoroutineScope(Dispatchers.Main).launch { CoroutineScope(Dispatchers.Main).launch {
handleTagChips(context) handleTagChips(requireContext())
handleSourceChips(context) handleSourceChips(requireContext())
binding.progressBar2.visibility = GONE binding.progressBar2.visibility = GONE
binding.filterView.visibility = VISIBLE binding.filterView.visibility = VISIBLE
} }
} catch (e: IllegalStateException) {
dismiss()
e.sendSilentlyWithAcraWithName("FilterSheetFragment > onCreateView")
} }
binding.floatingActionButton2.setOnClickListener { binding.floatingActionButton2.setOnClickListener {