TabLayoutMediator has been re-instantiated, hopefully in a form that is less crash-prone. Crashes will also be handled now in StwParser.kt

This commit is contained in:
denizk0461
2023-04-29 10:56:52 +02:00
parent 8fb41d6520
commit 2bf340bdff
13 changed files with 158 additions and 214 deletions
@@ -8,10 +8,9 @@ import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.lifecycle.ViewModelProvider
import com.denizk0461.studip.R
import com.denizk0461.studip.data.getThemedColor
import com.denizk0461.studip.data.showErrorSnackBar
import com.denizk0461.studip.databinding.ActivityFetcherBinding
import com.denizk0461.studip.viewmodel.FetcherViewModel
import com.google.android.material.snackbar.Snackbar
import java.io.IOException
import java.net.URLDecoder
@@ -90,18 +89,8 @@ class FetcherActivity : Activity() {
// finish()
// }
} catch (e: IOException) {
// Let the user know that an error occurred
Snackbar
.make(
binding.rootView,
getString(R.string.fetch_error_snack),
Snackbar.LENGTH_SHORT
)
// Set colours to signify an error
.setBackgroundTint(theme.getThemedColor(R.attr.colorErrorContainer))
.setTextColor(theme.getThemedColor(R.attr.colorOnErrorContainer))
.show()
theme.showErrorSnackBar(binding.rootView, getString(R.string.fetch_error_snack))
}
}
}