summaryrefslogtreecommitdiff
path: root/Source/Android/app/src/main/java
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2022-11-03 16:51:51 -0400
committerCharles Lombardo <clombardo169@gmail.com>2022-11-06 15:52:19 -0500
commit60fb151581cc562a5630c3eea2fc15404c4bedb9 (patch)
tree840122837055151b6137b722c92c945d29bc5791 /Source/Android/app/src/main/java
parent1a5110791c577e3490812837bffede2fd0708888 (diff)
Android: Animate covers on focus change
Co-Authored-By: JosJuice <josjuice@gmail.com>
Diffstat (limited to 'Source/Android/app/src/main/java')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java9
1 files changed, 9 insertions, 0 deletions
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<GameAdapter.GameView
}
holder.gameFile = gameFile;
+
+ Animation animateIn = AnimationUtils.loadAnimation(context, R.anim.anim_card_game_in);
+ animateIn.setFillAfter(true);
+ Animation animateOut = AnimationUtils.loadAnimation(context, R.anim.anim_card_game_out);
+ animateOut.setFillAfter(true);
+ holder.binding.getRoot().setOnFocusChangeListener((v, hasFocus) ->
+ holder.binding.cardGameArt.startAnimation(hasFocus ? animateIn : animateOut));
}
public static class GameViewHolder extends RecyclerView.ViewHolder