Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix part of #140: Topic play animation #486

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated test cases
  • Loading branch information
Rajat Talesra committed Dec 2, 2019
commit f288b1b9d73dee54ae4fa25c8e5507474a3b3558
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class StorySummaryAdapter(
collapse(binding.chapterListContainer)
}

binding.root.setOnClickListener {
binding.storyContainer.setOnClickListener {
val previousItem = currentExpandedChapterListIndex
if (binding.chapterListContainer.isVisible) {
currentExpandedChapterListIndex = null
Expand Down Expand Up @@ -163,7 +163,7 @@ class StorySummaryAdapter(
return true
}
}
expandAnimation.duration = context.resources.getInteger(R.integer.topic_play_animation_duration).toLong()
expandAnimation.duration = context.resources.getInteger(R.integer.topic_play_animation_time_ms).toLong()
chapterListContainer.startAnimation(expandAnimation)
}

Expand All @@ -186,7 +186,7 @@ class StorySummaryAdapter(
return true
}
}
collapseAnimation.duration = context.resources.getInteger(R.integer.topic_play_animation_duration).toLong()
collapseAnimation.duration = context.resources.getInteger(R.integer.topic_play_animation_time_ms).toLong()
chapterListContainer.startAnimation(collapseAnimation)
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/anim/rotation_anti_clockwise_180.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:fillEnabled="true"
android:interpolator="@android:anim/linear_interpolator">
<rotate
android:duration="@integer/topic_play_animation_duration"
android:duration="@integer/topic_play_animation_time_ms"
android:fromDegrees="180"
android:pivotX="50%"
android:pivotY="50%"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/anim/rotation_clockwise_180.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:fillEnabled="true"
android:interpolator="@android:anim/linear_interpolator">
<rotate
android:duration="@integer/topic_play_animation_duration"
android:duration="@integer/topic_play_animation_time_ms"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/anim/slide_out_left.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<set xmlns:android="https://schemas.android.com/apk/res/android">
<translate
android:duration="@integer/duration_anim_300_ms"
android:duration="@integer/default_fade_anim_time_ms"
android:fromXDelta="0"
android:toXDelta="-100%" />
<alpha
android:duration="@integer/duration_anim_300_ms"
android:duration="@integer/default_fade_anim_time_ms"
android:fromAlpha="1.0"
android:toAlpha="0.0" />
</set>
4 changes: 2 additions & 2 deletions app/src/main/res/anim/slide_right_in.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<set xmlns:android="https://schemas.android.com/apk/res/android">
<translate
android:duration="@integer/duration_anim_300_ms"
android:duration="@integer/default_fade_anim_time_ms"
android:fromXDelta="100%"
android:interpolator="@android:interpolator/accelerate_decelerate"
android:toXDelta="0" />
<alpha
android:duration="@integer/duration_anim_300_ms"
android:duration="@integer/default_fade_anim_time_ms"
android:fromAlpha="0.0"
android:toAlpha="1.0" />
</set>
1 change: 1 addition & 0 deletions app/src/main/res/layout/topic_play_story_summary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
</data>

<com.google.android.material.card.MaterialCardView
android:id="@+id/story_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-v21/integers.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="duration_anim_300_ms">300</integer>
<integer name="default_fade_anim_time_ms">300</integer>
</resources>
4 changes: 2 additions & 2 deletions app/src/main/res/values/integers.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="duration_anim_300_ms">300</integer>
<integer name="topic_play_animation_duration">400</integer>
<integer name="default_fade_anim_time_ms">300</integer>
<integer name="topic_play_animation_time_ms">400</integer>
</resources>
Loading