Skip to content

Instantly share code, notes, and snippets.

@Enselic
Created March 28, 2020 15:33
Show Gist options
  • Save Enselic/467b809c98c2cb146925edc29eb0f281 to your computer and use it in GitHub Desktop.
Save Enselic/467b809c98c2cb146925edc29eb0f281 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#000">
<View
android:id="@+id/shouldBeExcludedFromWrapContent"
android:layout_width="400dp"
android:layout_height="400dp"
android:translationX="-400dp"
android:translationY="-400dp"
app:layout_constraintLeft_toLeftOf="@id/partOfWrapContent"
app:layout_constraintTop_toTopOf="@id/partOfWrapContent"
android:background="@android:drawable/star_big_on" />
<View
android:id="@+id/partOfWrapContent"
android:layout_width="300dp"
android:layout_height="300dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:background="@android:drawable/sym_action_call" />
</androidx.constraintlayout.widget.ConstraintLayout>
setContentView(R.layout.content_main)
findViewById<View>(R.id.shouldBeExcludedFromWrapContent)
.animate()
.setStartDelay(1_000L)
.rotationBy(5 * 360f)
.translationXBy(1800f)
.translationYBy(1800f)
.setDuration(5_000L)
.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment