diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/MainActivity.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/MainActivity.kt index d26a4cea5..6cf0b8613 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/MainActivity.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/MainActivity.kt @@ -30,6 +30,7 @@ import android.os.Build import android.os.Bundle import android.util.Log import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge import androidx.activity.result.contract.ActivityResultContracts import androidx.annotation.RequiresApi import androidx.appcompat.app.AppCompatActivity @@ -72,6 +73,7 @@ class MainActivity : AppCompatActivity() { @RequiresApi(Build.VERSION_CODES.R) override fun onCreate(savedInstanceState: Bundle?) { + enableEdgeToEdge() super.onCreate(savedInstanceState) Log.d("Lifetime Event", "MainActivity.onCreate") diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppBottomBar.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppBottomBar.kt index c67ca00e0..38800a848 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppBottomBar.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppBottomBar.kt @@ -27,6 +27,10 @@ import androidx.compose.foundation.Canvas import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.RowScope +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.windowInsetsPadding +import androidx.compose.material3.BottomAppBarDefaults.windowInsets import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme @@ -43,11 +47,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.painterResource +import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavBackStackEntry import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.stringRes -import com.vitorpamplona.amethyst.ui.theme.BottomTopHeight import com.vitorpamplona.amethyst.ui.theme.DividerThickness import com.vitorpamplona.amethyst.ui.theme.Size0dp import com.vitorpamplona.amethyst.ui.theme.Size10Modifier @@ -126,11 +130,17 @@ private fun RenderBottomMenu( navEntryState: State, nav: (Route, Boolean) -> Unit, ) { - Column(modifier = BottomTopHeight) { + Column( + modifier = + Modifier + .fillMaxWidth() + .windowInsetsPadding(windowInsets) + .height(50.dp), + ) { HorizontalDivider( thickness = DividerThickness, ) - NavigationBar(tonalElevation = Size0dp, containerColor = Color.Transparent) { + NavigationBar(tonalElevation = Size0dp) { bottomNavigationItems.forEach { item -> HasNewItemsIcon(item, accountViewModel, navEntryState, nav) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppNavigation.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppNavigation.kt index 7debedfc5..294146dae 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppNavigation.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppNavigation.kt @@ -114,8 +114,8 @@ fun AppNavigation( NavHost( navController, startDestination = Route.Home.route, - enterTransition = { fadeIn(animationSpec = tween(200)) }, - exitTransition = { fadeOut(animationSpec = tween(200)) }, + enterTransition = { fadeIn(animationSpec = tween(400)) }, + exitTransition = { fadeOut(animationSpec = tween(400)) }, ) { Route.Home.let { route -> composable( @@ -219,7 +219,6 @@ fun AppNavigation( composable(Route.BlockedUsers.route, content = { HiddenUsersScreen(accountViewModel, nav) }) composable(Route.Bookmarks.route, content = { BookmarkListScreen(accountViewModel, nav) }) - composable(Route.Drafts.route, content = { DraftListScreen(accountViewModel, nav) }) Route.ContentDiscovery.let { route -> diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppTopBar.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppTopBar.kt index 34868d7e4..0d062381a 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppTopBar.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppTopBar.kt @@ -130,7 +130,6 @@ import com.vitorpamplona.amethyst.ui.stringRes import com.vitorpamplona.amethyst.ui.theme.BottomTopHeight import com.vitorpamplona.amethyst.ui.theme.DividerThickness import com.vitorpamplona.amethyst.ui.theme.DoubleHorzSpacer -import com.vitorpamplona.amethyst.ui.theme.HalfVertSpacer import com.vitorpamplona.amethyst.ui.theme.HeaderPictureModifier import com.vitorpamplona.amethyst.ui.theme.Size20Modifier import com.vitorpamplona.amethyst.ui.theme.Size22Modifier @@ -987,7 +986,6 @@ fun FlexibleTopBarWithBackButton( navigationIcon = { IconButton(onClick = popBack) { ArrowBackIcon() } }, actions = {}, ) - Spacer(modifier = HalfVertSpacer) HorizontalDivider(thickness = DividerThickness) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/MainScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/MainScreen.kt index e1deea68b..27ff5c064 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/MainScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/MainScreen.kt @@ -485,13 +485,7 @@ private fun MainScaffold( } }, ) { - Column( - modifier = - Modifier.padding( - top = it.calculateTopPadding(), - bottom = it.calculateBottomPadding(), - ), - ) { + Column(modifier = Modifier.padding(it)) { AppNavigation( homeFeedViewModel = homeFeedViewModel, repliesFeedViewModel = repliesFeedViewModel, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt index 4fedca007..f874715a0 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt @@ -65,8 +65,8 @@ private val DarkColorPalette = primary = Purple200, secondary = Teal200, tertiary = Teal200, - background = Color(0xFF000000), - surface = Color(0xFF000000), + background = Color(red = 0, green = 0, blue = 0), + surface = Color(red = 0, green = 0, blue = 0), surfaceVariant = Color(red = 29, green = 26, blue = 34), ) @@ -451,14 +451,13 @@ fun AmethystTheme( if (!view.isInEditMode) { SideEffect { val window = (view.context as Activity).window - val insetsController = WindowCompat.getInsetsController(window, view) - if (darkTheme) { - window.statusBarColor = colors.background.toArgb() - } else { - window.statusBarColor = colors.primary.toArgb() - } + val insets = WindowCompat.getInsetsController(window, view) + + insets.isAppearanceLightNavigationBars = !darkTheme + insets.isAppearanceLightStatusBars = !darkTheme + + window.statusBarColor = colors.background.toArgb() window.navigationBarColor = colors.background.toArgb() - insetsController.isAppearanceLightNavigationBars = !darkTheme } } } diff --git a/amethyst/src/main/res/values-night/themes.xml b/amethyst/src/main/res/values-night/themes.xml index 5eca20165..cd2b306ab 100644 --- a/amethyst/src/main/res/values-night/themes.xml +++ b/amethyst/src/main/res/values-night/themes.xml @@ -1,6 +1,6 @@ -