From 60fb151581cc562a5630c3eea2fc15404c4bedb9 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Thu, 3 Nov 2022 16:51:51 -0400 Subject: [PATCH] Android: Animate covers on focus change Co-Authored-By: JosJuice --- .../dolphinemu/adapters/GameAdapter.java | 9 +++++++++ .../app/src/main/res/anim/anim_card_game_in.xml | 14 ++++++++++++++ .../app/src/main/res/anim/anim_card_game_out.xml | 14 ++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 Source/Android/app/src/main/res/anim/anim_card_game_in.xml create mode 100644 Source/Android/app/src/main/res/anim/anim_card_game_out.xml diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java index 21470269a9..2c92dc76ea 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java @@ -6,6 +6,8 @@ import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; import androidx.annotation.NonNull; import androidx.fragment.app.FragmentActivity; @@ -83,6 +85,13 @@ public final class GameAdapter extends RecyclerView.Adapter + holder.binding.cardGameArt.startAnimation(hasFocus ? animateIn : animateOut)); } public static class GameViewHolder extends RecyclerView.ViewHolder diff --git a/Source/Android/app/src/main/res/anim/anim_card_game_in.xml b/Source/Android/app/src/main/res/anim/anim_card_game_in.xml new file mode 100644 index 0000000000..ff9e052ecc --- /dev/null +++ b/Source/Android/app/src/main/res/anim/anim_card_game_in.xml @@ -0,0 +1,14 @@ + + + + + + diff --git a/Source/Android/app/src/main/res/anim/anim_card_game_out.xml b/Source/Android/app/src/main/res/anim/anim_card_game_out.xml new file mode 100644 index 0000000000..2d8cbd1711 --- /dev/null +++ b/Source/Android/app/src/main/res/anim/anim_card_game_out.xml @@ -0,0 +1,14 @@ + + + + + +