-
Notifications
You must be signed in to change notification settings - Fork 4
GT-2990 Localization Settings Box (Tools Layout) #4422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tjohnson009
wants to merge
22
commits into
develop
Choose a base branch
from
GT-2990-Localization-Settings-Box
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6c80a05
Add Surface box to end of tools layout for personalization
tjohnson009 395a54f
Create and insert localizations settings box for tools and lessons pa…
tjohnson009 7a21b48
Add string resources for lessons layout personalization
tjohnson009 2c19b7d
Add UiEvent for going to localization settings from lesson layout
tjohnson009 36181b3
Add locationSettingsBox to lessons layout; Make padding similar to to…
tjohnson009 5494846
Remove unused imports
tjohnson009 8a9b2c8
Remove unnecessary Row composable for center alignment; Remove unused…
tjohnson009 4bf1afe
Remove unused imports
tjohnson009 361f267
Gate the localization settings banner based on the isPersonalizationE…
tjohnson009 6efb509
Minor lint fix
tjohnson009 020a67c
Make localizationSettingsBox internal following lessons and tools lay…
tjohnson009 8ef1933
Revert erroneous padding changes and correct personalization if state…
tjohnson009 9054ca1
Correct personalization if statement for personalization settings box
tjohnson009 4b9b9b4
Add snapshot tests for lessons and tools localization settings box
tjohnson009 dfdbc53
Record updated snapshots
tjohnson009 6b2b9b4
Retrigger CI
tjohnson009 f83b562
Update modifier line to single line
tjohnson009 41ac74e
Add a custom vertical arrangement to LazyColumn to pin localization t…
tjohnson009 5c49967
Record updated snapshots
tjohnson009 ee5daf1
Retrigger CI
tjohnson009 13f52e6
Bring in rememberPinLastArrangement composable to both tools and lessons
tjohnson009 3843f36
Create rememberPinLastItemBottomArrangement composable for reuse in t…
tjohnson009 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
app/src/main/kotlin/org/cru/godtools/ui/dashboard/LocalizationSettingsBox.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| package org.cru.godtools.ui.dashboard | ||
|
|
||
| import androidx.annotation.StringRes | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.material3.Button | ||
| import androidx.compose.material3.MaterialTheme | ||
| import androidx.compose.material3.Surface | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.stringResource | ||
| import androidx.compose.ui.text.font.FontWeight | ||
| import androidx.compose.ui.unit.dp | ||
| import org.cru.godtools.R | ||
|
|
||
| @Composable | ||
| internal fun LocalizationSettingsBox( | ||
| @StringRes title: Int, | ||
| @StringRes description: Int, | ||
| onClickSettings: () -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| Surface( | ||
| color = MaterialTheme.colorScheme.primaryContainer, | ||
| modifier = modifier.fillMaxWidth(), | ||
| ) { | ||
| Column(modifier = Modifier.padding(16.dp)) { | ||
| Text( | ||
| text = stringResource(title), | ||
| fontWeight = FontWeight.Bold, | ||
| style = MaterialTheme.typography.bodyLarge | ||
| ) | ||
| Text( | ||
| text = stringResource(description), | ||
| style = MaterialTheme.typography.bodySmall | ||
| ) | ||
| Button( | ||
| onClick = onClickSettings, | ||
| modifier = Modifier | ||
| .align(Alignment.CenterHorizontally) | ||
| .padding(top = 8.dp) | ||
| ) { | ||
| Text(stringResource(R.string.dashboard_section_localization_box_button)) | ||
| } | ||
| } | ||
| } | ||
| } |
23 changes: 23 additions & 0 deletions
23
app/src/main/kotlin/org/cru/godtools/ui/dashboard/PinLastItemBottomArrangement.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package org.cru.godtools.ui.dashboard | ||
|
|
||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.remember | ||
| import androidx.compose.ui.unit.Density | ||
|
|
||
| @Composable | ||
| internal fun rememberPinLastItemBottomArrangement(items: Int): Arrangement.Vertical = remember(items) { | ||
| object : Arrangement.Vertical { | ||
| override fun Density.arrange(totalSize: Int, sizes: IntArray, outPositions: IntArray) { | ||
| var currentOffset = 0 | ||
| sizes.forEachIndexed { index, size -> | ||
| if (index == sizes.lastIndex) { | ||
| outPositions[index] = maxOf(currentOffset, totalSize - size) | ||
| } else { | ||
| outPositions[index] = currentOffset | ||
| currentOffset += size | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...ion_-_Localization_Settings_Box[Nexus_5,locale=null,NIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...ion_-_Localization_Settings_Box[Nexus_5,locale=null,NOTNIGHT,ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
..._-_Localization_Settings_Box[Nexus_5,locale=null,NOTNIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...-_Localization_Settings_Box[Pixel_6_Pro,locale=null,NIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...ocalization_Settings_Box[Pixel_6_Pro,locale=null,NOTNIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...ion_-_Localization_Settings_Box[Nexus_5,locale=null,NIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...ion_-_Localization_Settings_Box[Nexus_5,locale=null,NOTNIGHT,ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
..._-_Localization_Settings_Box[Nexus_5,locale=null,NOTNIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...-_Localization_Settings_Box[Pixel_6_Pro,locale=null,NIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...ocalization_Settings_Box[Pixel_6_Pro,locale=null,NOTNIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
..._Personalization_-_No_Tools[Pixel_6_Pro,locale=null,NIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...rsonalization_-_No_Tools[Pixel_6_Pro,locale=null,NOTNIGHT,NO_ACCESSIBILITY].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.