Skip to content

[Compound] Implement platform components (Switch, RadioButton, Checkbox) #982

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

Merged
merged 9 commits into from
Jul 27, 2023

Conversation

jmartinesp
Copy link
Member

@jmartinesp jmartinesp commented Jul 27, 2023

Also, fix a padding issue in ReplyToContent.

Closes element-hq/compound#168.

@jmartinesp jmartinesp requested a review from a team as a code owner July 27, 2023 10:10
@jmartinesp jmartinesp requested review from bmarty and removed request for a team July 27, 2023 10:10
@github-actions
Copy link
Contributor

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link:

@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Patch coverage: 59.59% and project coverage change: +0.03% 🎉

Comparison is base (cc8b61c) 56.63% compared to head (ef41b3d) 56.67%.
Report is 23 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #982      +/-   ##
===========================================
+ Coverage    56.63%   56.67%   +0.03%     
===========================================
  Files          980      981       +1     
  Lines        24801    24886      +85     
  Branches      5033     5054      +21     
===========================================
+ Hits         14046    14104      +58     
- Misses        8527     8544      +17     
- Partials      2228     2238      +10     
Files Changed Coverage Δ
...nsystem/components/preferences/PreferenceSwitch.kt 82.35% <ø> (ø)
...aries/designsystem/theme/components/RadioButton.kt 56.66% <50.00%> (+9.04%) ⬆️
...ibraries/designsystem/theme/components/Checkbox.kt 60.93% <58.82%> (+18.08%) ⬆️
.../libraries/designsystem/theme/components/Switch.kt 63.63% <63.63%> (ø)
...s/impl/timeline/components/TimelineItemEventRow.kt 55.50% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some remark about parameters exhaustivity, but nothing blocking.

@@ -26,14 +26,17 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import io.element.android.libraries.designsystem.preview.ElementThemedPreview
import io.element.android.libraries.designsystem.preview.PreviewGroup
import io.element.android.libraries.theme.ElementTheme

// Designs in https://www.figma.com/file/G1xy0HDZKJf5TCRFmKb5d5/Compound-Android-Components?type=design&mode=design&t=qb99xBP5mwwCtGkN-1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 (I have sent a request to access this file)

disabledUncheckedColor = ElementTheme.colors.borderDisabled,
disabledCheckedColor = ElementTheme.colors.iconDisabled,
disabledIndeterminateColor = ElementTheme.colors.iconDisabled,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use all the possible parameters here? checkedColor and checkmarkColor are missing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those will use the default tokens. We can be explicit and set those too though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks. Maybe keep it like this, that's fine.

return RadioButtonDefaults.colors(
unselectedColor = ElementTheme.colors.borderInteractivePrimary,
disabledUnselectedColor = ElementTheme.colors.borderDisabled,
disabledSelectedColor = ElementTheme.colors.iconDisabled,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark about the parameter, selectedColor is missing.

disabledUncheckedThumbColor = ElementTheme.colors.iconDisabled,
disabledCheckedTrackColor = ElementTheme.colors.iconDisabled,
disabledCheckedBorderColor = ElementTheme.colors.iconDisabled,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same remark, hence more params are missing here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR, this is the previous preview:

image

and with the switch on, which was missing:

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add some dark previews too, I won't add the icon version though, as it's not needed according to the Compound team.

@jmartinesp jmartinesp force-pushed the chore/jme/compound-platform-components-toggles branch from d48b63c to f770507 Compare July 27, 2023 11:39
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@jmartinesp jmartinesp merged commit 9142352 into develop Jul 27, 2023
@jmartinesp jmartinesp deleted the chore/jme/compound-platform-components-toggles branch July 27, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Toggles (Radio, Checkbox, Switch) on Android
2 participants