Skip to content

Commit

Permalink
fix: Add missing nested scroll connection in goal card settings (#135)
Browse files Browse the repository at this point in the history
---------
Signed-off-by: starry-shivam <[email protected]>
  • Loading branch information
starry-shivam authored May 17, 2024
1 parent a2ad63b commit a236dad
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 28 deletions.
123 changes: 123 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ fun GoalItemCompact(
color = MaterialTheme.colorScheme.onSecondaryContainer
)

if (savedAmount.length >= 12) {
if (savedAmount.length > 10) {
Text(
text = savedAmount,
modifier = Modifier.padding(start = 4.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
Expand Down Expand Up @@ -102,32 +103,37 @@ fun GoalCardStyle(navController: NavController) {
val currentStyle = settingsVM.goalCardStyle.observeAsState().value!!
val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior()

Scaffold(modifier = Modifier.fillMaxSize(), topBar = {
LargeTopAppBar(
modifier = Modifier.fillMaxWidth(),
title = {
Text(
text = stringResource(id = R.string.goal_card_settings_header),
maxLines = 1,
overflow = TextOverflow.Ellipsis,
fontFamily = greenstashFont,
)
}, navigationIcon = {
IconButton(onClick = {
view.weakHapticFeedback()
navController.navigateUp()
}) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = null
Scaffold(
modifier = Modifier
.fillMaxSize()
.nestedScroll(scrollBehavior.nestedScrollConnection),
topBar = {
LargeTopAppBar(
modifier = Modifier.fillMaxWidth(),
title = {
Text(
text = stringResource(id = R.string.goal_card_settings_header),
maxLines = 1,
overflow = TextOverflow.Ellipsis,
fontFamily = greenstashFont,
)
}
}, scrollBehavior = scrollBehavior, colors = TopAppBarDefaults.largeTopAppBarColors(
containerColor = MaterialTheme.colorScheme.surface,
scrolledContainerColor = MaterialTheme.colorScheme.surface,
}, navigationIcon = {
IconButton(onClick = {
view.weakHapticFeedback()
navController.navigateUp()
}) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = null
)
}
}, scrollBehavior = scrollBehavior, colors = TopAppBarDefaults.largeTopAppBarColors(
containerColor = MaterialTheme.colorScheme.surface,
scrolledContainerColor = MaterialTheme.colorScheme.surface,
)
)
)
}) { paddingValues ->
}
) { paddingValues ->
Column(
modifier = Modifier
.fillMaxSize()
Expand Down

0 comments on commit a236dad

Please sign in to comment.