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

Android: Apply slider padding from css #170

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BlackJohnny
Copy link

Summary:

This PR applies the padding information from the CSS style associated to the Slider component.

This can be useful when you need to add some overlay on the slider.

NOTE: I did not add the support for IOS. Maybe someone could help with this.

Test Plan:

<Slider
    ...
    style={{paddingLeft: 10, paddingRight: 10}}
    />

or

<Slider
    ...
    style={{padding: 10}}
    />

@BlackJohnny
Copy link
Author

Boss, will you merge, reject or request to update this feature? :)

@wojteg1337
Copy link
Contributor

Since its java only, we will wait for iOS impl

@HITESH122
Copy link

Please fix for ios also

pft-developers added a commit to pft-developers/react-native-slider that referenced this pull request Feb 22, 2021
Copy link
Member

@BartoszKlonowski BartoszKlonowski left a comment

Choose a reason for hiding this comment

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

Thank you for this 👍

return (int) (dp * Resources.getSystem().getDisplayMetrics().density);
}

public static int pxToDp(int px) {
Copy link
Member

Choose a reason for hiding this comment

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

Why not just using PixelUtil, instead of implementing both conversions on your own?

@BartoszKlonowski
Copy link
Member

@BlackJohnny & @wojteg1337 I believe that this could solve the #258, how do you think?

@brycnguyen
Copy link

Any news on this?

@tastafur
Copy link

It would be nice if we could fix the padding issue #258

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.

6 participants