Skip to content

Conversation

andresain123
Copy link
Contributor

Overview

This Pull Request adds support for the appearance prop on Web and Android.
I have also tweaked some of the styles to make it more close to the iOS one by adding shadows and the separators between the segments. Just like the iOS version if the tintColor or backgroundColor props are present, the separators dissappear.

An example of how it works:

Fixes: #95

Test Plan

The example app is updated with this new functionality.

Some previews:
Screenshot 2020-09-21 at 01 14 20
Screenshot_20200921-011513

@exotexot
Copy link

exotexot commented Sep 25, 2020

@andresain123 Tested the pull request. See image attached. After the PR the label is missing and hence also not clickable.

segemented-darkmode-issue

IMPORTANT TO ADD:
This screenshot is taken from the Windows(!) Platform (React-native-windows)

@andresain123
Copy link
Contributor Author

@exotexot ok thanks, I didn't test it on react-native-windows. Let me check it and I'll try to solve it 👍

@exotexot
Copy link

exotexot commented Sep 25, 2020

But I can confirm that it is working on Android :)

Regarding the windows Issue. I'm aware of some styling constraints for the Text component in react-native-windows. There may be some conflicting styling properties which cause the windows issue.

EDIT: Is this issue reproducable on your end?

const styles = StyleSheet.create({
segmentedControl: {
height: 28,
height: 32,
Copy link
Member

Choose a reason for hiding this comment

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

just wanted to confirm, is the height change here intended?
This only changes the looks on iOS side, which seems out of scope for this PR
(if the change is intended, theres no problem 👍)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it was intended to match the exact height of the Segmented Control on iOS and the one for web/android.

Copy link
Member

@Naturalclar Naturalclar left a comment

Choose a reason for hiding this comment

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

@andresain123 thank you!

@Naturalclar Naturalclar merged commit 2511bf9 into react-native-segmented-control:master Oct 17, 2020
@exotexot
Copy link

Just wanted to add, that in my case I had to apply this change in order for darkmode to work properly in Windows:
exotexot@e2c605b

Setting the height appread to cause the problem, which I didnt investigate any further. This fix also closes #134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants