question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for Rotated elements

See original GitHub issue

Hi, Thank you for this library and the React Navigation binding.

Currently the library supports transition when element was scaled. Could it also support transition when element was rotated ?

Current behavior: The element jumps from a rotated position to the next position without any transition.

Expected behavior: During the transition, the element rotates to its new position, then on back button pressed, the element rotates back to its previous position.

Example:

// Main Screen

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#C14534',
  },
  paper: {
    backgroundColor: '#EC806E',
    position: 'absolute',
    left: 10,
    top: Dimensions.get('window').height * 0.5 - 150,
    width: Dimensions.get('window').width * 0.65,
    height: Dimensions.get('window').height * 0.45,

    transform: [{ rotate: '-20deg' }],

    shadowColor: '#000',
    shadowRadius: 5,
    shadowOffset: { width: 0, height: 5 },
    shadowOpacity: 0.4,
  },
});

export const MainScreen = (props: IMainProps) => {
  return(
    <TouchableOpacity activeOpacity={1} style={styles.container}  
      onPress={()=> props.navigation.navigate('Details')}>

      <SharedElement id='paper' style={styles.paper}>
        <View />
      </SharedElement >

    </TouchableOpacity>
  );
}

// Details Screen

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#C14534',
  },
  paper: {
    backgroundColor: '#FFFFFF',
    position: 'absolute',
    left: 0,
    top: Dimensions.get('window').height * 0.5,
    bottom: 0,
    right: 0,
    alignItems: 'center',
    justifyContent: 'flex-start',
    paddingTop: 70,
    padding: 10,
  },
});

export const DetailsScreen = (props: IMainProps) => {
  return (
    <TouchableOpacity activeOpacity={1} style={styles.container} 
      onPress={()=> props.navigation.goBack()}>

      <SharedElement id='paper' style={styles.paper}>
        <View />
      </SharedElement >

    </TouchableOpacity>
  );
}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
IjzerenHeincommented, Mar 30, 2020

Yup I’m seeing it. This one will be a bit tricky to implement. Will try to take it into consideration for the next update.

1reaction
josh0707commented, Mar 30, 2020

Here is the expected result: expected

Read more comments on GitHub >

github_iconTop Results From Across the Web

rotate() - CSS: Cascading Style Sheets - MDN Web Docs
The rotate() CSS function defines a transformation that rotates an element around a fixed point on the 2D plane, without deforming it.
Read more >
"rotate" | Can I use... Support tables for HTML5, CSS3, etc
Method of applying filter effects using the filter property to elements, matching filters available in SVG. Filter functions include blur, ...
Read more >
Element Properties - Rotating Elements - Flexitive Support
Until then, we recommend you rotate images using a third-party application such as LunaPic and then import the rotated asset into Flexitive. Did...
Read more >
rotate | CSS-Tricks
The rotate property in CSS turns an element around one or more axes. Think of it like poking one or more pins into...
Read more >
Rotate Elements | Revit 2021 - Autodesk Knowledge Network
Use the Rotate tool to rotate elements around an axis. In floor plan, reflected ceiling plan, elevation, and section views, elements rotate ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found