mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-11-06 02:40:58 +01:00
Fixes for error handling, UI padding, & more (#1759)
## Description Another collection of small individual fixes that don't warrant a full PR: - Better error handling for series and collection detail pages - Better error handling on Discover search tab - Fix issues when changing view options on card grid without reloading the page - Better error handling when changing the refresh rate or resolution - Fix some nav drawer items disappearing briefly when restarting the app - Fix that the discover search row would not clear when the query is cleared And some UI tweaks: - Use consistent padding for the different customize home page sections - Convert the "Continue watching click behavior" setting from a toggle to choice dialog (the options & behaviors have not changed) ### Related issues I think the error handling when changing the refresh rate might help with #1737 ### Testing Emulator mostly ## Screenshots N/A, UI changes are minor ## AI or LLM usage None
This commit is contained in:
parent
2463841663
commit
8bae9c7f23
18 changed files with 149 additions and 96 deletions
|
|
@ -6,6 +6,7 @@ import android.content.res.Configuration
|
|||
import android.os.Bundle
|
||||
import android.view.KeyEvent
|
||||
import android.view.WindowManager
|
||||
import android.widget.Toast
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
|
@ -391,10 +392,17 @@ class MainActivity : AppCompatActivity() {
|
|||
|
||||
fun changeDisplayMode(modeId: Int) {
|
||||
lifecycleScope.launch(WholphinDispatchers.Main + ExceptionHandler(autoToast = true)) {
|
||||
val attrs = window.attributes
|
||||
if (attrs.preferredDisplayModeId != modeId) {
|
||||
Timber.d("Switch preferredDisplayModeId to %s", modeId)
|
||||
window.attributes = attrs.apply { preferredDisplayModeId = modeId }
|
||||
try {
|
||||
val attrs = window.attributes
|
||||
if (attrs.preferredDisplayModeId != modeId) {
|
||||
Timber.d("Switch preferredDisplayModeId to %s", modeId)
|
||||
window.attributes = attrs.apply { preferredDisplayModeId = modeId }
|
||||
}
|
||||
} catch (ex: Exception) {
|
||||
Timber.e(ex, "Error switching preferredDisplayModeId to %s", modeId)
|
||||
Toast
|
||||
.makeText(this@MainActivity, "Error changing display mode", Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue