Better UX for separate SDR vs HDR subtitle styles (#1622)
## Description This PR moves the separated HDR subtitle style behind a toggle. This means users must now opt-in to using separated SDR vs HDR subtitle styles. This is a better UX for users who want to customize the style but use the same styles for both. Users who have changed the HDR subtitles previously will have the toggle enabled automatically. If the user hasn't changed HDR style or their SDR & HDR styles are the the same, the toggle will be disabled. Also, fixes a bug where when playback switched between SDR or HDR, the subtitle styles might not be updated. ### Related issues Closes #1603 ### Testing Emulator & unit tests for migration ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
8a684545ac
commit
e5887dfa15
8 changed files with 239 additions and 114 deletions
|
|
@ -29,6 +29,7 @@ import com.github.damontecres.wholphin.preferences.updateSearchPreferences
|
|||
import com.github.damontecres.wholphin.preferences.updateSubtitlePreferences
|
||||
import com.github.damontecres.wholphin.ui.preferences.PreferencesViewModel
|
||||
import com.github.damontecres.wholphin.ui.preferences.subtitle.SubtitleSettings
|
||||
import com.github.damontecres.wholphin.ui.preferences.subtitle.shouldEnableSeparateHdrToggle
|
||||
import com.github.damontecres.wholphin.ui.setup.seerr.migrateSeerrUrl
|
||||
import com.github.damontecres.wholphin.util.Version
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
|
|
@ -409,5 +410,13 @@ class AppUpgradeHandler
|
|||
Timber.e(ex, "Error saving migrated tabs")
|
||||
}
|
||||
}
|
||||
|
||||
if (previous.isEqualOrBefore(Version.fromString("1.0.2-8-g0"))) {
|
||||
appPreferences.updateData {
|
||||
it.updateSubtitlePreferences {
|
||||
useSeparateHdr = it.interfacePreferences.shouldEnableSeparateHdrToggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue