Add animation to overview media
This commit is contained in:
parent
dc031812b2
commit
b7feaf44df
7 changed files with 33 additions and 10 deletions
12
app/src/main/res/anim/item_animation_slide_in.xml
Normal file
12
app/src/main/res/anim/item_animation_slide_in.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:interpolator="@android:anim/decelerate_interpolator"
|
||||
android:shareInterpolator="true"
|
||||
android:duration="@integer/recyclerview_animation_duration">
|
||||
<translate
|
||||
android:fromXDelta="20%"
|
||||
android:toXDelta="0" />
|
||||
<alpha
|
||||
android:fromAlpha="0"
|
||||
android:toAlpha="1" />
|
||||
</set>
|
5
app/src/main/res/anim/overview_media_animation.xml
Normal file
5
app/src/main/res/anim/overview_media_animation.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:animation="@anim/item_animation_slide_in"
|
||||
android:animationOrder="normal"
|
||||
android:delay="15%" />
|
|
@ -19,16 +19,16 @@
|
|||
android:id="@+id/loading_incicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:indeterminate="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:trackCornerRadius="10dp"
|
||||
android:indeterminate="true"/>
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:trackCornerRadius="10dp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/views_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".fragments.MediaFragment">
|
||||
tools:context=".fragments.MediaFragment"
|
||||
android:animateLayoutChanges="true">
|
||||
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/loading_incicator"
|
||||
|
@ -28,7 +29,7 @@
|
|||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/views_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:clipToPadding="false"
|
||||
android:paddingHorizontal="12dp"
|
||||
|
|
|
@ -39,14 +39,17 @@
|
|||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/items_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:paddingHorizontal="12dp"
|
||||
android:clipToPadding="false"
|
||||
android:layoutAnimation="@anim/overview_media_animation"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="12dp"
|
||||
app:items="@{view.items}"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_name"
|
||||
tools:listitem="@layout/base_item" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
@ -3,4 +3,5 @@
|
|||
<dimen name="setup_container_width">400dp</dimen>
|
||||
<item name="server_colums" type="integer">6</item>
|
||||
<item name="collection_colums" type="integer">3</item>
|
||||
<item name="recyclerview_animation_duration" type="integer">450</item>
|
||||
</resources>
|
|
@ -5,4 +5,5 @@
|
|||
<dimen name="setup_container_width">@dimen/match_parent</dimen>
|
||||
<item name="server_colums" type="integer">3</item>
|
||||
<item name="collection_colums" type="integer">1</item>
|
||||
<item name="recyclerview_animation_duration" type="integer">250</item>
|
||||
</resources>
|
Loading…
Reference in a new issue