-
Notifications
You must be signed in to change notification settings - Fork 136
[HACK][Woo POS] Make WooPosSpacing automatically adaptive #15060
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
base: trunk
Are you sure you want to change the base?
Conversation
Changed WooPosSpacing enum so that .value is now a composable getter that automatically applies toAdaptivePadding(). This makes all spacing adaptive by default without requiring manual calls. For ConstraintLayout usages, extracted margin values before the constrainAs lambda since it's not a composable context.
Since WooPosSpacing.value is now adaptive by default, removed redundant .toAdaptivePadding() calls on WooPosSpacing values and cleaned up unused imports across WooPos screens.
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #15060 +/- ##
============================================
- Coverage 38.66% 38.66% -0.01%
+ Complexity 10362 10361 -1
============================================
Files 2168 2168
Lines 123004 123015 +11
Branches 16977 16978 +1
============================================
- Hits 47561 47560 -1
- Misses 70638 70649 +11
- Partials 4805 4806 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# Conflicts: # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/orders/WooPosOrdersDetails.kt
Description
Makes
WooPosSpacing.valueautomatically return adaptive padding based on screen size, eliminating the need for manual.toAdaptivePadding()calls throughout the codebase.Changes:
WooPosSpacingenum to have a composable getter that automatically applies adaptive scalingXXSmall(2dp),XXLarge(40dp),XXXLarge(48dp),Huge(80dp),Gigantic(104dp)WooPosSpacingvalues.toAdaptivePadding()calls and cleaned up unused importsNote: Some spacing values are mapped to the closest available enum value (e.g., 56dp → 48dp, 96dp → 80dp), so minor visual differences may be visible compared to before.
Test Steps
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.