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

[Style] Support backface-visibility style property on views. #1973

Closed
chirag04 opened this issue Jul 13, 2015 · 18 comments
Closed

[Style] Support backface-visibility style property on views. #1973

chirag04 opened this issue Jul 13, 2015 · 18 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@chirag04
Copy link
Contributor

For 3d animations with perspective, it is important to have backface-visibility.

Reference:
https://developer.mozilla.org/en-US/docs/Web/CSS/backface-visibility

cc @vjeux @sahrens

@sahrens
Copy link
Contributor

sahrens commented Jul 13, 2015

Can you PR it?

@chirag04
Copy link
Contributor Author

I can def try this one. :D

Adding rotateX, rotateY, rotateZ first.

@chirag04
Copy link
Contributor Author

done.

@syaau
Copy link
Contributor

syaau commented Aug 24, 2016

The backface-visibility: hidden does't work in Android.

@card-b
Copy link

card-b commented Aug 25, 2016

Same here, backface-visibility: hidden has no effect on Android. It's definitely defined in ViewStylePropTypes.js, it just isn't doing anything.

@evollu
Copy link

evollu commented Nov 16, 2016

any update?

@vnil
Copy link

vnil commented Nov 20, 2016

Not working on Android for me either. Any working workaround at the moment?

@chirag04
Copy link
Contributor Author

backface visibility is not supported on android. There was a PR for this: #6695. Feel free to send a new one based off of that PR.

@vnil
Copy link

vnil commented Nov 21, 2016

Unfortunately I don't know Java, but thanks for the information and the link to the PR!

@zaoky
Copy link

zaoky commented Nov 21, 2016

Any working workaround for this ?

@vnil
Copy link

vnil commented Nov 21, 2016

I'm using Animated.Views and I've been playing with the idea of animating the opacity as well. It seems to work ok for my use case, and the only thing Im doing is this:

this.backOpacity = this.animatedValue.interpolate({ inputRange: [89, 90], outputRange: [0, 1] })

and then use this for the animation

const backAnimatedStyle = { opacity: this.backOpacity,...}

The Animated.Value in my case goes from 0-180 (symbolising degrees).
When I flip them back I go from 180 to 0, so thats why this solution is enough for my case.

So if your situation is similar to mine, maybe this will help for now.

@romanenko
Copy link

Thanks, @vnil! Your workaround works amazingly well! It should become canonical, until backfaceVisibility is implemented in Android.

@elribonazo
Copy link

I got the same issue and the workarround is excelent... Thanks!!

@charpeni
Copy link
Contributor

A PR for backface-visibility is here #15970!

@abdennour
Copy link

Great! @charpeni . but PR is failed by CI . Try to fix conflicts!

@abdennour
Copy link

abdennour commented Sep 24, 2017

Thanks @vnil . I will expand your solution : You explained the backOpacity, still now frontOpacity .. And it will be :

    this.frontOpacity = this.animatedValue.interpolate({
      inputRange: [89, 90],
      outputRange: [1, 0]
    });

    this.backOpacity = this.animatedValue.interpolate({
      inputRange: [89, 90],
      outputRange: [0, 1]
    });

Then: style={opacity: this.frontOpacity} goes with Card Face, and style={opacity: this.backOpacity} goes with Card Back.

@Gringox
Copy link

Gringox commented Oct 8, 2017

Thanks @vnil works perfectly

@aaronksaunders
Copy link

@vnil @Gringox - does anyone have a complete example? I am trying to integrate this with multiple sequenced animations and i cannot get it all to work, thanks in advance

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests