-
Notifications
You must be signed in to change notification settings - Fork 136
[Shipping Labels] Make selected hazmat box tappable #14576
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
Changes from all commits
096570c
95f3732
3c1f1a1
30982e1
ba5afe7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||||
| package com.woocommerce.android.ui.orders.wooshippinglabels.hazmat | ||||||
|
|
||||||
| import androidx.compose.foundation.background | ||||||
| import androidx.compose.foundation.clickable | ||||||
| import androidx.compose.foundation.layout.Box | ||||||
| import androidx.compose.foundation.layout.Spacer | ||||||
| import androidx.compose.foundation.layout.fillMaxWidth | ||||||
|
|
@@ -11,6 +12,7 @@ import androidx.compose.material3.MaterialTheme | |||||
| import androidx.compose.material3.Text | ||||||
| import androidx.compose.runtime.Composable | ||||||
| import androidx.compose.ui.Modifier | ||||||
| import androidx.compose.ui.draw.clip | ||||||
| import androidx.compose.ui.res.colorResource | ||||||
| import androidx.compose.ui.res.dimensionResource | ||||||
| import androidx.compose.ui.res.stringResource | ||||||
|
|
@@ -21,17 +23,17 @@ import com.woocommerce.android.ui.orders.shippinglabels.creation.ShippingLabelHa | |||||
| @Composable | ||||||
| fun HazmatSelectionCard( | ||||||
| selectedCategory: ShippingLabelHazmatCategory, | ||||||
| modifier: Modifier = Modifier | ||||||
| modifier: Modifier = Modifier, | ||||||
| onClick: OnClick? = null, | ||||||
| ) { | ||||||
| Spacer(modifier = Modifier.height(4.dp)) | ||||||
| Box(modifier = modifier) { | ||||||
| Box( | ||||||
| modifier = Modifier | ||||||
| .fillMaxWidth() | ||||||
| .background( | ||||||
| color = colorResource(R.color.light_colored_button_background), | ||||||
| shape = RoundedCornerShape(dimensionResource(R.dimen.corner_radius_large)) | ||||||
| ) | ||||||
| .clip(RoundedCornerShape(dimensionResource(R.dimen.corner_radius_large))) | ||||||
| .then(if (onClick == null) Modifier else Modifier.clickable { onClick() }) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. np, I would suggest changing the modifiers a bit to improve the click ripple effect, the following patch achieves a better effect: patchIndex: WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/wooshippinglabels/hazmat/HazmatSelectionCard.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/wooshippinglabels/hazmat/HazmatSelectionCard.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/wooshippinglabels/hazmat/HazmatSelectionCard.kt
--- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/wooshippinglabels/hazmat/HazmatSelectionCard.kt (revision 95f3732633abe38fc6ec987e84d512a469a741a8)
+++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/wooshippinglabels/hazmat/HazmatSelectionCard.kt (date 1757341157252)
@@ -12,6 +12,7 @@
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.stringResource
@@ -30,11 +31,9 @@
Box(
modifier = Modifier
.fillMaxWidth()
+ .clip(RoundedCornerShape(dimensionResource(R.dimen.corner_radius_large)))
.then(if (onClick == null) Modifier else Modifier.clickable { onClick() })
- .background(
- color = colorResource(R.color.light_colored_button_background),
- shape = RoundedCornerShape(dimensionResource(R.dimen.corner_radius_large))
- )
+ .background(color = colorResource(R.color.light_colored_button_background))
.padding(16.dp)
) {
Text(
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice catch, thank you! Applied your patch: 30982e1 |
||||||
| .background(color = colorResource(R.color.light_colored_button_background)) | ||||||
| .padding(16.dp) | ||||||
| ) { | ||||||
| Text( | ||||||
|
|
||||||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@irfano it seems we both missed this and the release note was included in
23.2(as noted by Huong here p1757419135627609/1757414420.859729-slack-C03L1NF1EA3).Can you create a small PR to fix the release notes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes 🤦🏻♂️. I've opened a PR.