Adds more logging when a crash occurs

blinds
Laurent 5 years ago
parent 5f675d9f67
commit 6c6cf9a60f
  1. 21
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/editor/EditorFragment.kt
  2. 5
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/EditorViewModel.kt

@ -33,6 +33,7 @@ import net.pokeranalytics.android.ui.modules.handhistory.model.*
import net.pokeranalytics.android.ui.modules.handhistory.views.KeyboardListener
import net.pokeranalytics.android.ui.view.RowRepresentable
import net.pokeranalytics.android.ui.view.SmoothScrollLinearLayoutManager
import net.pokeranalytics.android.util.CrashLogging
import net.pokeranalytics.android.util.extensions.findById
import timber.log.Timber
@ -160,14 +161,22 @@ class EditorFragment : RealmFragment(), RowRepresentableDelegate, KeyboardListen
// At first, the selection is defined before the holder is bound,
// so we retrieve the editText inputConnection once the recycler view has been rendered
this.binding.recyclerView.viewTreeObserver.addOnGlobalLayoutListener {
when (this.model.currentKeyboard) {
HHKeyboard.AMOUNT -> {
val selection = this.model.currentSelection
retrieveEditTextInputConnection(selection)
}
else -> {
try {
when (this.model.currentKeyboard) {
HHKeyboard.AMOUNT -> {
val selection = this.model.currentSelection
retrieveEditTextInputConnection(selection)
}
else -> {
}
}
} catch (e: Exception) {
val actions = this.model.actionListLogs
CrashLogging.log(actions)
throw e
}
}
initKeyboardDefaultHeight()

@ -557,8 +557,7 @@ class EditorViewModel : ViewModel(), RowRepresentableDataSource, CardCentralizer
else -> {}
}
} catch (e: Exception) {
val actions = this.sortedActions.joinToString("\n") { it.logRepresentation }
CrashLogging.log(actions)
CrashLogging.log(this.actionListLogs)
throw e
}
@ -1058,4 +1057,6 @@ class EditorViewModel : ViewModel(), RowRepresentableDataSource, CardCentralizer
this.createRowRepresentation()
}
val actionListLogs: String = this.sortedActions.joinToString("\n") { it.logRepresentation }
}
Loading…
Cancel
Save