View JSXExample.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const element = <h1>JSX is cool</h1>; | |
ReactDOM.render(element, document.getElementById('root')); |
View App.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.header { | |
padding: 20px; | |
background-color: #f1f1f1; | |
text-align: center; | |
font-size: 26px; | |
} |
View RenderComponent.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ReactDOM.render( | |
<h1>Hello, world!</h1>, | |
document.getElementById('root') | |
); |
View MainComponent.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ReactDOM.render(<AppComponent name="John Cena"/>, document.getElementById('app')); |
View AppComponent.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppComponent extends React.Component { | |
render() { | |
return ( | |
<div> | |
<h1>{this.props.name}</h1> | |
</div> | |
); | |
} | |
} |
View AnimateCheeseHeight.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val anim = ValueAnimator.ofInt(pizzaCheeseImageView.measuredHeight, height) | |
anim.addUpdateListener { valueAnimator -> | |
val value = valueAnimator.animatedValue as Int | |
val layoutParams = pizzaCheeseImageView.layoutParams | |
layoutParams.height = value | |
pizzaCheeseImageView.layoutParams = layoutParams | |
} | |
anim.duration = 300 | |
anim.start() |
View AnimateCrustHeight.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val anim = ValueAnimator.ofInt(pizzaCrustImageView.measuredHeight, height) | |
anim.addUpdateListener { valueAnimator -> | |
val value = valueAnimator.animatedValue as Int | |
val layoutParams = pizzaCrustImageView.layoutParams | |
layoutParams.height = value | |
pizzaCrustImageView.layoutParams = layoutParams | |
pizzaCrustImageView.radius = value.div(2).toFloat() | |
} | |
anim.duration = 300 | |
anim.start() |
View RotateBoxAnimatorSet.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AnimatorSet().apply { play(scaleDownX).with(scaleDownY).with(rotateBox).before(translateX) } |
View RotateBoxTranslateXAnimation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val translateX = ObjectAnimator.ofFloat(backCoverImageView, "translationX", 0f, 1000f) |
View RotateBoxAnimation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val rotateBox = ObjectAnimator.ofFloat(backCoverImageView, "rotation", 0f, -45f) |
NewerOlder