Created
February 4, 2019 18:52
-
-
Save ssindher11/dc76181623ee4085c920d8ec590dc3a0 to your computer and use it in GitHub Desktop.
activity_main.xml
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
<?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" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@android:color/white" | |
tools:context=".MainActivity"> | |
<!-- Custom Action Bar --> | |
<com.airbnb.lottie.LottieAnimationView | |
android:id="@+id/lav_actionBar" | |
android:layout_width="match_parent" | |
android:layout_height="75dp" | |
android:layout_marginStart="0dp" | |
android:layout_marginTop="0dp" | |
android:layout_marginEnd="0dp" | |
android:scaleType="centerCrop" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toTopOf="parent" | |
app:lottie_autoPlay="true" | |
app:lottie_fileName="gradient_bg.json" | |
app:lottie_loop="true" /> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginStart="8dp" | |
android:layout_marginTop="8dp" | |
android:layout_marginEnd="8dp" | |
android:text="@string/activity_name" | |
android:textColor="@android:color/white" | |
android:textSize="30sp" | |
app:layout_constraintBottom_toBottomOf="@+id/lav_actionBar" | |
app:layout_constraintEnd_toEndOf="@+id/lav_actionBar" | |
app:layout_constraintHorizontal_bias="0.0" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toTopOf="@+id/lav_actionBar" /> | |
<!-- Thumbs Up Button --> | |
<com.airbnb.lottie.LottieAnimationView | |
android:id="@+id/lav_thumbUp" | |
android:layout_width="100dp" | |
android:layout_height="100dp" | |
android:layout_marginStart="80dp" | |
android:layout_marginTop="8dp" | |
android:layout_marginBottom="8dp" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toTopOf="parent" | |
app:lottie_autoPlay="false" | |
app:lottie_fileName="thumb_up.json" | |
app:lottie_loop="false" | |
app:lottie_speed="1.25" /> | |
<!-- Thumbs Down Button (We just rotate the previous one by 180 deg ;) )--> | |
<com.airbnb.lottie.LottieAnimationView | |
android:id="@+id/lav_thumbDown" | |
android:layout_width="100dp" | |
android:layout_height="100dp" | |
android:layout_marginTop="8dp" | |
android:layout_marginEnd="80dp" | |
android:layout_marginBottom="8dp" | |
android:rotation="180" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintTop_toTopOf="parent" | |
app:lottie_autoPlay="false" | |
app:lottie_fileName="thumb_up.json" | |
app:lottie_loop="false" | |
app:lottie_speed="1.25" /> | |
<!-- Toggle Switch --> | |
<com.airbnb.lottie.LottieAnimationView | |
android:id="@+id/lav_toggle" | |
android:layout_width="wrap_content" | |
android:layout_height="100dp" | |
android:layout_marginStart="8dp" | |
android:layout_marginTop="8dp" | |
android:layout_marginEnd="8dp" | |
android:layout_marginBottom="8dp" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toBottomOf="@+id/lav_thumbUp" | |
app:layout_constraintVertical_bias="0.4" | |
app:lottie_autoPlay="false" | |
app:lottie_fileName="toggle_switch.json" | |
app:lottie_loop="false" | |
app:lottie_speed="1.75" /> | |
</androidx.constraintlayout.widget.ConstraintLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment