Fix lifecycle crashes

realmasync
Laurent 3 years ago
parent 7d7ae3bf82
commit 004bf5031a
  1. 6
      app/src/main/java/net/pokeranalytics/android/ui/modules/feed/FeedFragment.kt
  2. 4
      app/src/main/java/net/pokeranalytics/android/ui/modules/feed/NewDataMenuActivity.kt
  3. 2
      app/src/main/java/net/pokeranalytics/android/ui/modules/session/SessionFragment.kt

@ -603,8 +603,10 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate, PurchaseLis
} }
private fun displayBlogPostButton(newCount: Int = 0) { private fun displayBlogPostButton(newCount: Int = 0) {
context?.let { context ->
var show = false var show = false
if (Preferences.shouldShowBlogTips(requireContext()) && newCount > 0) { if (Preferences.shouldShowBlogTips(context) && newCount > 0) {
show = true show = true
this.badgeDrawable?.number = newCount this.badgeDrawable?.number = newCount
} }
@ -613,3 +615,5 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate, PurchaseLis
} }
} }
}

@ -117,6 +117,8 @@ class NewDataMenuActivity : BaseActivity() {
private fun showMenu() { private fun showMenu() {
val menuContainer = binding.menuContainer val menuContainer = binding.menuContainer
if (menuContainer.isAttachedToWindow) {
val cx = menuContainer.measuredWidth - fabSize / 2 val cx = menuContainer.measuredWidth - fabSize / 2
val cy = menuContainer.measuredHeight - fabSize / 2 val cy = menuContainer.measuredHeight - fabSize / 2
val finalRadius = max(menuContainer.width, menuContainer.height) val finalRadius = max(menuContainer.width, menuContainer.height)
@ -127,6 +129,8 @@ class NewDataMenuActivity : BaseActivity() {
anim.start() anim.start()
} }
}
/** /**
* Hide menu * Hide menu
*/ */

@ -76,7 +76,7 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRepr
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
CrashLogging.log("session (id=${this.currentSession.id}): valid=${currentSession.isValid}, managed=${currentSession.isManaged}, loaded=${currentSession.isLoaded} ") // CrashLogging.log("session (id=${this.currentSession.id}): valid=${currentSession.isValid}, managed=${currentSession.isManaged}, loaded=${currentSession.isLoaded} ")
this.refreshTimer() this.refreshTimer()
} }

Loading…
Cancel
Save