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

Fix modifiers to adjust tap targets #47

Merged
merged 2 commits into from
Oct 11, 2023
Merged
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
4 changes: 2 additions & 2 deletions ccp/src/main/java/com/togitech/ccp/component/CountryDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ private fun CountryRowItem(
) {
Row(
Modifier
.clickable(onClick = { onSelect() })
.padding(
horizontal = rowPadding,
vertical = rowPadding * ROW_PADDING_VERTICAL_SCALING,
)
.fillMaxWidth()
.clickable(onClick = { onSelect() }),
.fillMaxWidth(),
horizontalArrangement = Arrangement.Start,
verticalAlignment = Alignment.CenterVertically,
) {
Expand Down
10 changes: 7 additions & 3 deletions ccp/src/main/java/com/togitech/ccp/component/TogiCodeDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ internal fun TogiCodeDialog(
showCountryCode: Boolean,
showFlag: Boolean,
textStyle: TextStyle,
modifier: Modifier = Modifier,
) {
val context = LocalContext.current

Expand All @@ -61,7 +60,7 @@ internal fun TogiCodeDialog(
}

Column(
modifier = modifier
modifier = Modifier
.clickable(
interactionSource = interactionSource,
indication = null,
Expand All @@ -70,6 +69,7 @@ internal fun TogiCodeDialog(
},
) {
CountryRow(
modifier = Modifier.padding(DEFAULT_PADDING),
showCountryCode = showCountryCode,
showFlag = showFlag,
country = country,
Expand All @@ -78,7 +78,9 @@ internal fun TogiCodeDialog(

if (isOpenDialog) {
CountryDialog(
modifier = Modifier.fillMaxWidth().clip(RoundedCornerShape(DEFAULT_ROUNDING)),
modifier = Modifier
.fillMaxWidth()
.clip(RoundedCornerShape(DEFAULT_ROUNDING)),
onDismissRequest = { isOpenDialog = false },
onSelect = { countryItem ->
onCountryChange(countryItem)
Expand All @@ -102,7 +104,9 @@ private fun CountryRow(
showFlag: Boolean,
country: CountryData,
textStyle: TextStyle,
modifier: Modifier = Modifier,
) = Row(
modifier = modifier,
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.togitech.ccp.component
import android.util.Log
import androidx.compose.foundation.focusable
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
Expand Down Expand Up @@ -204,7 +203,6 @@ fun TogiCountryCodePicker(
},
leadingIcon = {
TogiCodeDialog(
modifier = Modifier.padding(DEFAULT_PADDING),
selectedCountry = country,
includeOnly = includeOnly,
onCountryChange = { countryData ->
Expand Down