Skip to content
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

Added values in dimens.xml #2937

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.Font
Expand Down Expand Up @@ -70,14 +71,16 @@
verticalArrangement = Arrangement.Center,
) {
DetailColumn()
Spacer(modifier = Modifier.height(24.dp))
Spacer(modifier = Modifier.height(dimensionResource(R.dimen.spacing_xlarge)))

Check warning on line 74 in ground/src/main/java/com/google/android/ground/ui/datacollection/DataSubmissionConfirmationDialog.kt

View check run for this annotation

Codecov / codecov/patch

ground/src/main/java/com/google/android/ground/ui/datacollection/DataSubmissionConfirmationDialog.kt#L74

Added line #L74 was not covered by tests
CloseButton(modifier = Modifier.align(Alignment.CenterHorizontally), onDismiss = onDismiss)
}
}
} else {
Column(modifier = Modifier.fillMaxSize().background(MaterialTheme.colorScheme.background)) {
Spacer(modifier = Modifier.height(150.dp))
DataCollectionThumbnail(modifier = Modifier.padding(horizontal = 8.dp))
DataCollectionThumbnail(
modifier = Modifier.padding(horizontal = dimensionResource(R.dimen.spacing_medium))
)
Spacer(modifier = Modifier.height(100.dp))
DetailColumn()
Spacer(modifier = Modifier.height(32.dp))
Expand Down Expand Up @@ -107,9 +110,9 @@
fontSize = 22.sp,
fontWeight = FontWeight(400),
)
Spacer(modifier = Modifier.height(8.dp))
Spacer(modifier = Modifier.height(dimensionResource(R.dimen.spacing_medium)))
Text(
modifier = Modifier.padding(horizontal = 28.dp),
modifier = Modifier.padding(horizontal = dimensionResource(R.dimen.spacing_xxlarge)),
text = stringResource(R.string.data_collection_complete_details),
fontSize = 14.sp,
lineHeight = 20.sp,
Expand All @@ -129,7 +132,11 @@
onClick = { onDismiss() },
) {
Text(
modifier = Modifier.padding(horizontal = 16.dp, vertical = 4.dp),
modifier =
Modifier.padding(
horizontal = dimensionResource(R.dimen.spacing_large),
vertical = dimensionResource(R.dimen.spacing_small),
),
text = stringResource(id = R.string.close),
fontSize = 14.sp,
lineHeight = 20.sp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.google.android.ground.ExcludeFromJacocoGeneratedReport
import com.google.android.ground.R
Expand All @@ -52,21 +52,28 @@ fun OfflineAreaListItem(
modifier =
modifier
.fillMaxWidth()
.padding(start = 16.dp, top = 4.dp, end = 24.dp, bottom = 4.dp)
.padding(
start = dimensionResource(R.dimen.spacing_large),
top = dimensionResource(R.dimen.spacing_small),
end = dimensionResource(R.dimen.spacing_xlarge),
bottom = dimensionResource(R.dimen.spacing_small),
)
.clickable { itemClicked(offlineAreaDetails.id) },
horizontalArrangement = Arrangement.spacedBy(16.dp, Alignment.CenterHorizontally),
horizontalArrangement =
Arrangement.spacedBy(
dimensionResource(R.dimen.spacing_large),
Alignment.CenterHorizontally,
),
verticalAlignment = Alignment.CenterVertically,
) {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_offline_pin),
contentDescription = stringResource(id = R.string.offline_area_list_item_icon),
tint = MaterialTheme.colorScheme.primary,
modifier = Modifier.size(24.dp),
)

OfflinePinImage()
Column(
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(0.dp, Alignment.CenterVertically),
verticalArrangement =
Arrangement.spacedBy(
dimensionResource(R.dimen.spacing_empty),
Alignment.CenterVertically,
),
horizontalAlignment = Alignment.Start,
) {
Text(
Expand All @@ -79,7 +86,6 @@ fun OfflineAreaListItem(
color = MaterialTheme.colorScheme.onSurface,
),
)

Text(
text =
stringResource(
Expand All @@ -99,6 +105,16 @@ fun OfflineAreaListItem(
}
}

@Composable
private fun OfflinePinImage() {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_offline_pin),
contentDescription = stringResource(id = R.string.offline_area_list_item_icon),
tint = MaterialTheme.colorScheme.primary,
modifier = Modifier.size(dimensionResource(R.dimen.spacing_xlarge)),
)
}

@Composable
@Preview(showBackground = true, showSystemUi = true)
@ExcludeFromJacocoGeneratedReport
Expand Down
8 changes: 8 additions & 0 deletions ground/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@
<dimen name="job_card_corner_radius">16dp</dimen>
<dimen name="job_card_start_end_margin">8dp</dimen>
<dimen name="zoom_on_cluster_click_padding">50dp</dimen>

<!-- Standard Spacing -->
<dimen name="spacing_empty">0dp</dimen>
<dimen name="spacing_small">4dp</dimen>
anandwana001 marked this conversation as resolved.
Show resolved Hide resolved
<dimen name="spacing_medium">8dp</dimen>
<dimen name="spacing_large">16dp</dimen>
<dimen name="spacing_xlarge">24dp</dimen>
<dimen name="spacing_xxlarge">28dp</dimen>
</resources>
Loading