For #10204 - Address viewLifecycleOwner IllegalStateException crashes
This commit is contained in:
parent
a16bfb27ef
commit
a9692d9bce
|
@ -98,10 +98,10 @@ class AddonsManagementFragment : Fragment(R.layout.fragment_add_ons_management),
|
||||||
private fun bindRecyclerView(view: View) {
|
private fun bindRecyclerView(view: View) {
|
||||||
val recyclerView = view.add_ons_list
|
val recyclerView = view.add_ons_list
|
||||||
recyclerView.layoutManager = LinearLayoutManager(requireContext())
|
recyclerView.layoutManager = LinearLayoutManager(requireContext())
|
||||||
viewLifecycleOwner.lifecycleScope.launch(IO) {
|
lifecycleScope.launch(IO) {
|
||||||
try {
|
try {
|
||||||
val addons = requireContext().components.addonManager.getAddons()
|
val addons = requireContext().components.addonManager.getAddons()
|
||||||
viewLifecycleOwner.lifecycleScope.launch(Dispatchers.Main) {
|
lifecycleScope.launch(Dispatchers.Main) {
|
||||||
runIfFragmentIsAttached {
|
runIfFragmentIsAttached {
|
||||||
val adapter = AddonsManagerAdapter(
|
val adapter = AddonsManagerAdapter(
|
||||||
requireContext().components.addonCollectionProvider,
|
requireContext().components.addonCollectionProvider,
|
||||||
|
@ -117,7 +117,7 @@ class AddonsManagementFragment : Fragment(R.layout.fragment_add_ons_management),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: AddonManagerException) {
|
} catch (e: AddonManagerException) {
|
||||||
viewLifecycleOwner.lifecycleScope.launch(Dispatchers.Main) {
|
lifecycleScope.launch(Dispatchers.Main) {
|
||||||
runIfFragmentIsAttached {
|
runIfFragmentIsAttached {
|
||||||
showSnackBar(
|
showSnackBar(
|
||||||
view,
|
view,
|
||||||
|
|
|
@ -51,7 +51,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
||||||
private val accountObserver = object : AccountObserver {
|
private val accountObserver = object : AccountObserver {
|
||||||
private fun updateAccountUi(profile: Profile? = null) {
|
private fun updateAccountUi(profile: Profile? = null) {
|
||||||
val context = context ?: return
|
val context = context ?: return
|
||||||
viewLifecycleOwner.lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
updateAccountUIState(
|
updateAccountUIState(
|
||||||
context = context,
|
context = context,
|
||||||
profile = profile
|
profile = profile
|
||||||
|
@ -377,7 +377,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
||||||
preferenceSignIn?.isVisible = false
|
preferenceSignIn?.isVisible = false
|
||||||
|
|
||||||
profile?.avatar?.url?.let { avatarUrl ->
|
profile?.avatar?.url?.let { avatarUrl ->
|
||||||
viewLifecycleOwner.lifecycleScope.launch(Main) {
|
lifecycleScope.launch(Main) {
|
||||||
val roundedDrawable =
|
val roundedDrawable =
|
||||||
avatarUrl.toRoundedDrawable(context, requireComponents.core.client)
|
avatarUrl.toRoundedDrawable(context, requireComponents.core.client)
|
||||||
preferenceFirefoxAccount?.icon =
|
preferenceFirefoxAccount?.icon =
|
||||||
|
|
|
@ -21,7 +21,7 @@ object Versions {
|
||||||
const val androidx_legacy = "1.0.0"
|
const val androidx_legacy = "1.0.0"
|
||||||
const val androidx_annotation = "1.1.0"
|
const val androidx_annotation = "1.1.0"
|
||||||
const val androidx_lifecycle = "2.2.0"
|
const val androidx_lifecycle = "2.2.0"
|
||||||
const val androidx_fragment = "1.2.1"
|
const val androidx_fragment = "1.2.4"
|
||||||
const val androidx_navigation = "2.2.1"
|
const val androidx_navigation = "2.2.1"
|
||||||
const val androidx_recyclerview = "1.1.0"
|
const val androidx_recyclerview = "1.1.0"
|
||||||
const val androidx_core = "1.2.0"
|
const val androidx_core = "1.2.0"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user