android: align top bar offsets across main pages
Some checks failed
Android CI / android (push) Has been cancelled
Android Release / release (push) Has been cancelled
CI / test (push) Has been cancelled

This commit is contained in:
Codex
2026-03-09 21:18:15 +03:00
parent fdd877b49a
commit 6328a74c23
4 changed files with 57 additions and 30 deletions

View File

@@ -499,3 +499,9 @@
- Added top app bars for all 4 main pages (`Chats`, `Contacts`, `Settings`, `Profile`) to make them feel like proper standalone sections. - Added top app bars for all 4 main pages (`Chats`, `Contacts`, `Settings`, `Profile`) to make them feel like proper standalone sections.
- Moved chats management toggle action into chats app bar. - Moved chats management toggle action into chats app bar.
- Kept safe-area handling and bottom insets consistent with shared floating tabs bar to avoid overlap. - Kept safe-area handling and bottom insets consistent with shared floating tabs bar to avoid overlap.
### Step 80 - Top bar offset consistency fix
- Unified top bar alignment across `Chats`, `Contacts`, `Settings`, and `Profile`:
- removed extra outer paddings that shifted headers down/right on some pages,
- separated content padding from top app bar container.
- Result: consistent title baseline and horizontal alignment between main pages.

View File

@@ -87,12 +87,18 @@ private fun ContactsScreen(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.then(if (isTabletLayout) Modifier.widthIn(max = 820.dp) else Modifier) .then(if (isTabletLayout) Modifier.widthIn(max = 820.dp) else Modifier)
.padding(start = 16.dp, top = 16.dp, end = 16.dp, bottom = 96.dp), .padding(bottom = 96.dp),
verticalArrangement = Arrangement.spacedBy(12.dp), verticalArrangement = Arrangement.spacedBy(12.dp),
) { ) {
TopAppBar( TopAppBar(
title = { Text("Contacts") }, title = { Text("Contacts") },
) )
Column(
modifier = Modifier
.fillMaxSize()
.padding(horizontal = 16.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
OutlinedTextField( OutlinedTextField(
value = query, value = query,
onValueChange = { query = it }, onValueChange = { query = it },
@@ -121,4 +127,5 @@ private fun ContactsScreen(
} }
} }
} }
}
} }

View File

@@ -127,13 +127,19 @@ fun ProfileScreen(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.then(if (isTabletLayout) Modifier.widthIn(max = 720.dp) else Modifier) .then(if (isTabletLayout) Modifier.widthIn(max = 720.dp) else Modifier)
.verticalScroll(scrollState) .padding(bottom = 96.dp),
.padding(start = 16.dp, top = 16.dp, end = 16.dp, bottom = 96.dp),
verticalArrangement = Arrangement.spacedBy(12.dp), verticalArrangement = Arrangement.spacedBy(12.dp),
) { ) {
TopAppBar( TopAppBar(
title = { Text("Profile") }, title = { Text("Profile") },
) )
Column(
modifier = Modifier
.fillMaxWidth()
.verticalScroll(scrollState)
.padding(start = 16.dp, end = 16.dp, bottom = 16.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
if (!avatarUrl.isBlank()) { if (!avatarUrl.isBlank()) {
Box( Box(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
@@ -231,6 +237,7 @@ fun ProfileScreen(
} }
} }
} }
}
} }
private fun Uri.toSquareJpeg(context: Context): ByteArray? { private fun Uri.toSquareJpeg(context: Context): ByteArray? {

View File

@@ -107,13 +107,19 @@ fun SettingsScreen(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.then(if (isTabletLayout) Modifier.widthIn(max = 720.dp) else Modifier) .then(if (isTabletLayout) Modifier.widthIn(max = 720.dp) else Modifier)
.verticalScroll(scrollState) .padding(bottom = 96.dp),
.padding(start = 16.dp, top = 16.dp, end = 16.dp, bottom = 96.dp),
verticalArrangement = Arrangement.spacedBy(12.dp), verticalArrangement = Arrangement.spacedBy(12.dp),
) { ) {
TopAppBar( TopAppBar(
title = { Text("Settings") }, title = { Text("Settings") },
) )
Column(
modifier = Modifier
.fillMaxWidth()
.verticalScroll(scrollState)
.padding(start = 16.dp, end = 16.dp, bottom = 16.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
Text("Appearance", style = MaterialTheme.typography.titleMedium) Text("Appearance", style = MaterialTheme.typography.titleMedium)
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) { Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
OutlinedButton( OutlinedButton(
@@ -342,4 +348,5 @@ fun SettingsScreen(
} }
} }
} }
}
} }