remove change bounds animation

This commit is contained in:
darthpaul 2022-09-22 00:51:58 +01:00
parent 58bf7fded0
commit 67566eeea6

View File

@ -11,7 +11,6 @@ import android.os.Handler
import android.os.Looper import android.os.Looper
import android.provider.MediaStore import android.provider.MediaStore
import android.view.* import android.view.*
import android.view.animation.OvershootInterpolator
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.appcompat.content.res.AppCompatResources import androidx.appcompat.content.res.AppCompatResources
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
@ -703,7 +702,7 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
if (media_size_toggle_group.isVisible() || if (media_size_toggle_group.isVisible() ||
flash_toggle_group.isVisible() flash_toggle_group.isVisible()
) { ) {
val transitionSet = createTransition(isClosing = true) val transitionSet = createTransition()
TransitionManager.go(defaultScene, transitionSet) TransitionManager.go(defaultScene, transitionSet)
media_size_toggle_group.beGone() media_size_toggle_group.beGone()
flash_toggle_group.beGone() flash_toggle_group.beGone()
@ -768,15 +767,9 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
media_size_toggle_group.children.map { it as MaterialButton }.forEach(::setButtonColors) media_size_toggle_group.children.map { it as MaterialButton }.forEach(::setButtonColors)
} }
private fun createTransition(isClosing: Boolean = false): Transition { private fun createTransition(): Transition {
val fadeTransition = Fade() val fadeTransition = Fade()
val changeBounds = ChangeBounds().apply {
interpolator = OvershootInterpolator()
}
return TransitionSet().apply { return TransitionSet().apply {
if (!isClosing) {
addTransition(changeBounds)
}
addTransition(fadeTransition) addTransition(fadeTransition)
this.duration = resources.getInteger(R.integer.icon_anim_duration).toLong() this.duration = resources.getInteger(R.integer.icon_anim_duration).toLong()
} }