Fixing adaptive navigation, initial support for tablet/foldable UI - #464
Fixing adaptive navigation, initial support for tablet/foldable UI#464XCroatoanX wants to merge 14 commits into
Conversation
|
Still need to fix bottom bar showing when loading data for the first time from server at login. |
|
initial support for tablet/foldable UI? Are you starting to work on #379 ? Or am I just dreaming |
|
@mziedina5102 Not fully, currently I was concentrated on solving the issue with our adaptive navigation package. This will be the first step to fixing this issue. Unfortunately it does not look as good as it should be, but it is the first step to improved UI. It looks good on tablets and foldables though |
|
Bottom bar and miniplayer should be not visible in settings page. Will be fixed today |
|
App size gone from 20MB to 36MB (at least on my android 16 snapdragon) |
PR artifacts are built in debug mode so they will be less optimised |
| subtitle = Res.string.subtitle_about | ||
| ) | ||
| } | ||
| Spacer(Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars)) |
There was a problem hiding this comment.
settings screen content is beneath the camera area of the screen in landscape mode and there is also an empty area beside titles
the navigation animation is shown when the detail pane is changed, this doesn't look very good, this happens outside of settings as well and it looks even worse
Screen_recording_20260807_144424.webm
also when you navigate into a screen in settings the previous screen will get scrolled downward for some reason?
Screen_recording_20260807_150247.webm
i don't think there was a need to change settings screens padding at all, it was already working correctly in landscape mode because the bottom bar isn't shown in settings or anything
| import paige.navic.util.ui.easedVerticalGradient | ||
|
|
||
| @Composable | ||
| fun RootBottomBar( |
There was a problem hiding this comment.
the mini player has different horizontal padding compared to the bottom bar
the mini player is horizontally centered on screen but the bottom bar has some padding on the left because the camera area of the screen is there, the mini player should be inset like that as well
the unified style of the mini player demonstrates this more clearly, the cover art is now beneath the camera area of the screen
| ) | ||
| BottomBar( | ||
| containerColor = if (preferenceManager.miniPlayerStyle == MiniPlayerStyle.Detached) | ||
| NavigationBarDefaults.containerColor.copy(alpha = 0f) |
There was a problem hiding this comment.
do not change this to Color.Transparent, BottomBar animates containerColor
Color.Transparent is Color.Black (or White, i don't remember) with an alpha of 0f, so if you animate the colour going from NavigationBarDefaults.containerColor to Color.Transparent it will become somewhat black during the animation
essentially, we only want to animate the alpha, and nothing else about the colour
| import paige.navic.util.ui.easedVerticalGradient | ||
|
|
||
| @Composable | ||
| fun RootBottomBar( |
| } | ||
| } | ||
| }, | ||
| bottomBar = { |
| modifier = modifier.then( | ||
| if (preferenceManager.miniPlayerStyle == MiniPlayerStyle.Detached) | ||
| Modifier.background( | ||
| Brush.easedVerticalGradient(color = MaterialTheme.colorScheme.surface.copy(alpha = shadowFadeProgress)) | ||
| ) | ||
| else Modifier | ||
| ) |
There was a problem hiding this comment.
easedVerticalGradient was an intentional design choice, not sure why u removed it
| val selectedTabId = remember(backStack.size, backStack.lastOrNull(), tabs) { | ||
| val lastKey = backStack.lastOrNull() ?: return@remember tabs.firstOrNull()?.id | ||
| tabs.find { tab -> | ||
| val item = when (tab.id) { | ||
| NavbarTab.Id.LIBRARY -> NavItem.LIBRARY | ||
| NavbarTab.Id.ALBUMS -> NavItem.ALBUMS | ||
| NavbarTab.Id.PLAYLISTS -> NavItem.PLAYLISTS | ||
| NavbarTab.Id.ARTISTS -> NavItem.ARTISTS | ||
| NavbarTab.Id.SEARCH -> NavItem.SEARCH | ||
| NavbarTab.Id.GENRES -> NavItem.GENRES | ||
| NavbarTab.Id.SONGS -> NavItem.SONGS | ||
| NavbarTab.Id.RADIOS -> NavItem.RADIOS | ||
| } | ||
| // Use class name to match destinations even if arguments differ | ||
| val entryClassName = lastKey::class.qualifiedName | ||
| val destClassName = item.destination::class.qualifiedName | ||
| entryClassName == destClassName || (lastKey is Screen.Settings && tab.id == NavbarTab.Id.LIBRARY) | ||
| }?.id ?: tabs.firstOrNull()?.id | ||
| } |
There was a problem hiding this comment.
what is the point of this? what is it fixing? the previous logic
val selected = backStack.lastOrNull() == item.destination
seemed to work fine before
…ils.kt Co-authored-by: ssalggnikool <paigely@tuta.io>
Co-authored-by: ssalggnikool <paigely@tuta.io>
…outs/BottomBar.kt Co-authored-by: ssalggnikool <paigely@tuta.io>
… fixing-adaptive-navigation



Fixed navigation3-adaptive not working correctly after alpha 5 update. Initial support for foldable devices and tablets. Fixed #403.