Few minor UI fixes (#343)

- Keep the currently selected nav drawer item in view and focus on when
entering
- Adjust star rating height so that the row is consistent preventing
resizing when moving between episodes with & without a rating
- Simplify checks when switching to a new server and use more specific
keys to prevent needing to switch servers twice
This commit is contained in:
damontecres 2025-11-28 21:31:02 -05:00 committed by GitHub
parent 13a3c6c831
commit ff91fa87e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 125 additions and 39 deletions

View file

@ -110,15 +110,15 @@ class MainActivity : AppCompatActivity() {
}
isRestoringSession = false
}
val server by serverRepository.currentServer.observeAsState()
val user by serverRepository.currentUser.observeAsState()
val userDto by serverRepository.currentUserDto.observeAsState()
val current by serverRepository.current.observeAsState()
val preferences =
UserPreferences(
appPreferences,
userDto?.configuration ?: DefaultUserConfiguration,
)
remember(current) {
UserPreferences(
appPreferences,
current?.userDto?.configuration ?: DefaultUserConfiguration,
)
}
if (isRestoringSession) {
Box(
@ -131,9 +131,9 @@ class MainActivity : AppCompatActivity() {
)
}
} else {
key(server, user) {
key(current) {
val initialDestination =
if (server != null && user != null) {
if (current != null) {
Destination.Home()
} else {
Destination.ServerList
@ -150,16 +150,16 @@ class MainActivity : AppCompatActivity() {
}
}
val deviceProfile =
remember(server, appPreferences) {
remember(current, appPreferences) {
createDeviceProfile(
this@MainActivity,
preferences,
server?.serverVersion,
current?.server?.serverVersion,
)
}
ApplicationContent(
user = user,
server = server,
user = current?.user,
server = current?.server,
navigationManager = navigationManager,
preferences = preferences,
deviceProfile = deviceProfile,