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
package com.example.daman.swipefragmentdemo; | |
import android.support.design.widget.FloatingActionButton; | |
import android.support.design.widget.Snackbar; | |
import android.support.v7.app.AppCompatActivity; | |
import android.support.v7.widget.Toolbar; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentPagerAdapter; |
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) } |
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) |
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) |
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 scaleDownY = ObjectAnimator.ofFloat(backCoverImageView, "scaleY", 1f, 0.6f) |
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 scaleDownX = ObjectAnimator.ofFloat(backCoverImageView, "scaleX", 1f, 0.6f) |
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
frontCoverImageView | |
.animate() | |
.translationY(790f) | |
.setDuration(300) | |
.setListener(object : Animator.AnimatorListener { | |
override fun onAnimationEnd(animation: Animator?) { | |
backCoverImageView.visibility = VISIBLE | |
backCoverImageView.alpha = 1f | |
pizzaImageView.visibility = GONE | |
frontCoverImageView.visibility = GONE |
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() |
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() |
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
ObjectAnimator.ofFloat(toppingsLayout,"translationY", 0f, toppingsLayout.height.toFloat() - 12f).apply { | |
interpolator = AccelerateInterpolator() | |
duration = 600 | |
start() | |
} |
OlderNewer