mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
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:
parent
13a3c6c831
commit
ff91fa87e2
7 changed files with 125 additions and 39 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue