mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-26 02:25:21 +00:00
fix(onboarding): improve battery optimization screen layout and scrolling
Restructure BatteryOptimizationEnabledContent to use proper scrolling behavior and fixed button placement at the bottom. The changes ensure better usability by preventing content from being hidden behind buttons and allowing full content visibility through scrolling.
This commit is contained in:
@@ -2,6 +2,8 @@ package com.bitchat.android.onboarding
|
|||||||
|
|
||||||
import androidx.compose.animation.core.*
|
import androidx.compose.animation.core.*
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.*
|
import androidx.compose.material.icons.filled.*
|
||||||
import androidx.compose.material.icons.outlined.*
|
import androidx.compose.material.icons.outlined.*
|
||||||
@@ -75,7 +77,16 @@ private fun BatteryOptimizationEnabledContent(
|
|||||||
colorScheme: ColorScheme,
|
colorScheme: ColorScheme,
|
||||||
isLoading: Boolean
|
isLoading: Boolean
|
||||||
) {
|
) {
|
||||||
|
// -------------- Fix Start for this method(BatteryOptimizationEnabledContent)-----------
|
||||||
Column(
|
Column(
|
||||||
|
modifier = Modifier.fillMaxSize()
|
||||||
|
) {
|
||||||
|
// Scrollable content area
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(1f)
|
||||||
|
.verticalScroll(rememberScrollState())
|
||||||
|
.padding(bottom = 16.dp),
|
||||||
verticalArrangement = Arrangement.spacedBy(24.dp),
|
verticalArrangement = Arrangement.spacedBy(24.dp),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
) {
|
) {
|
||||||
@@ -141,8 +152,20 @@ private fun BatteryOptimizationEnabledContent(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
Text(
|
||||||
|
text = stringResource(R.string.battery_optimization_note),
|
||||||
|
style = MaterialTheme.typography.bodySmall.copy(
|
||||||
|
color = colorScheme.onSurfaceVariant
|
||||||
|
),
|
||||||
|
textAlign = TextAlign.Center
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fixed buttons at the bottom
|
||||||
|
Column(
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
|
) {
|
||||||
Button(
|
Button(
|
||||||
onClick = onDisableBatteryOptimization,
|
onClick = onDisableBatteryOptimization,
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
@@ -179,16 +202,10 @@ private fun BatteryOptimizationEnabledContent(
|
|||||||
Text(stringResource(R.string.battery_optimization_skip))
|
Text(stringResource(R.string.battery_optimization_skip))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Text(
|
|
||||||
text = stringResource(R.string.battery_optimization_note),
|
|
||||||
style = MaterialTheme.typography.bodySmall.copy(
|
|
||||||
color = colorScheme.onSurfaceVariant
|
|
||||||
),
|
|
||||||
textAlign = TextAlign.Center
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// -------------- Fix Ended for this method(BatteryOptimizationEnabledContent)-----------
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun BatteryOptimizationCheckingContent(
|
private fun BatteryOptimizationCheckingContent(
|
||||||
|
|||||||
Reference in New Issue
Block a user