Category : android-animation

I tested motionLayout with this article : https://medium.com/bumble-tech/swipe-right-on-motion-layout-641c1452d6a5, you can find the github link here The mainActivity : override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_b) val viewModel = ViewModelProvider(this) .get(SwipeViewModel::class.java) viewModel .modelStream .observe(this, Observer { bindCard(it) }) motionLayout.setTransitionListener(object : TransitionAdapter() { override fun onTransitionCompleted(motionLayout: MotionLayout, currentId: Int) { when (currentId) { R.id.offScreenPass, R.id.offScreenLike -> { ..

Read more

I have an issue with animations. I have defined two simple layouts: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/root" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:id="@+id/player1" android:layout_width="50dp" android:layout_height="77dp" android:layout_marginStart="32dp" android:layout_marginTop="16dp" android:src="@drawable/two_hearts" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout> looking like this: fragment_game_hidden.xml and <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/root" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:id="@+id/player1" android:layout_width="50dp" android:layout_height="77dp" android:layout_marginStart="32dp" android:layout_marginTop="16dp" android:src="@drawable/two_hearts" android:translationY="-60dp" app:layout_constraintStart_toStartOf="parent" ..

Read more

class DialFragment: DialogFragment() { private lateinit var image001: ImageView private val caller = object: FingerprintManager.AuthenticationCallback() { override fun onAuthenticationError(errorCode: Int, errString: CharSequence?) { super.onAuthenticationError(errorCode, errString) listener.onDialClick(errString.toString(), "2") dismiss() } override fun onAuthenticationSucceeded(result: FingerprintManager.AuthenticationResult?) { super.onAuthenticationSucceeded(result) listener.onDialClick("yes","1") var avp = image001.drawable as AnimatedVectorDrawable avp.start() dismiss() } override fun onAuthenticationFailed() { super.onAuthenticationFailed() listener.onDialClick("no","3") dismiss() } The animation ..

Read more

I’m trying to add multiple animations in my MotionLayout. The scene currently has two Transitions but will eventually have four. First transition is kind of a mix between YouTube Player and Netflix Player where controllers disappear either by dropping down or shrinking. The second transition is a simple rotation applied on the rewindButton. Layout Hierarchy: ..

Read more