fix crashes

This commit is contained in:
Phillip Thelen 2023-01-25 13:22:21 +01:00
parent 8bf5467551
commit d440f6e3d7
6 changed files with 22 additions and 11 deletions

View file

@ -3,6 +3,6 @@
<gradient
android:angle="90"
android:endColor="@color/content_80_alpha"
android:startColor="?attr/colorContentBackground"
android:startColor="@color/content_background"
android:type="linear" />
</shape>

View file

@ -3,7 +3,7 @@
<gradient
android:angle="90"
android:centerColor="@color/transparent_white"
android:centerColor="?attr/colorWindowBackground"
android:endColor="?attr/colorContentBackground"
android:startColor="?attr/colorContentBackground"
android:type="linear"

View file

@ -8,6 +8,7 @@ import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import okhttp3.internal.http2.ConnectionShutdownException
import okhttp3.internal.http2.StreamResetException
import retrofit2.HttpException
import java.io.EOFException
import java.io.IOException
@ -42,7 +43,9 @@ class ExceptionHandler {
!retrofit2.HttpException::class.java.isAssignableFrom(throwable.javaClass) &&
!EOFException::class.java.isAssignableFrom(throwable.javaClass) &&
throwable !is ConnectionShutdownException &&
throwable !is CancellationException
throwable !is CancellationException &&
throwable !is StreamResetException &&
throwable !is ConnectionShutdownException
) {
instance.analyticsManager?.logException(throwable)
}

View file

@ -5,8 +5,8 @@ import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import com.habitrpg.android.habitica.databinding.OverlayTutorialBinding
import com.habitrpg.common.habitica.extensions.layoutInflater
import com.habitrpg.android.habitica.models.TutorialStep
import com.habitrpg.common.habitica.extensions.layoutInflater
class TutorialView(
context: Context,
@ -69,12 +69,16 @@ class TutorialView(
private fun completeButtonClicked() {
onReaction.onTutorialCompleted(step)
(parent as? ViewGroup)?.removeView(this)
post {
(parent as? ViewGroup)?.removeView(this)
}
}
private fun dismissButtonClicked() {
onReaction.onTutorialDeferred(step)
(parent as? ViewGroup)?.removeView(this)
post {
(parent as? ViewGroup)?.removeView(this)
}
}
private fun backgroundClicked() {

View file

@ -108,9 +108,9 @@ object ToolbarColorHelper {
if (outViews.isEmpty()) {
return@waitForLayout
}
val overflowViewParent = outViews[0].parent as ActionMenuView
overflowViewParent.overflowIcon?.setTint(color)
overflowViewParent.overflowIcon?.setTintMode(PorterDuff.Mode.SRC_ATOP)
val overflowViewParent = outViews[0].parent as? ActionMenuView
overflowViewParent?.overflowIcon?.setTint(color)
overflowViewParent?.overflowIcon?.setTintMode(PorterDuff.Mode.SRC_ATOP)
}
}
}

View file

@ -77,12 +77,16 @@ abstract class BaseActivity<B: ViewBinding, VM: BaseViewModel> : ComponentActivi
fun stopAnimatingProgress() {
if (progressView != null) {
progressView?.stopAnimation()
wrapperBinding.root.removeView(progressView)
progressView?.post {
wrapperBinding.root.removeView(progressView)
}
progressView = null
} else {
wrapperBinding.root.children.forEach {
if (it is IndeterminateProgressView) {
wrapperBinding.root.removeView(it)
it.post {
wrapperBinding.root.removeView(it)
}
}
}
}