diff options
| author | JosJuice <josjuice@gmail.com> | 2022-11-16 20:47:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-16 20:47:16 +0100 |
| commit | 7ce2be93861ba741b5b415afba76e27cea71ac17 (patch) | |
| tree | 27c045675841713a481b5dfd597932d286774725 /Source/Android/app/src/main/java/org | |
| parent | 99a918d884b7fd9442e2c621e0b2fb566db6aa1c (diff) | |
| parent | 60fb151581cc562a5630c3eea2fc15404c4bedb9 (diff) | |
Merge pull request #11256 from t895/animate-focus-change
Android: Animate covers on focus change
Diffstat (limited to 'Source/Android/app/src/main/java/org')
| -rw-r--r-- | Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java | 9 |
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 01a8b9dddb..fb9fd356da 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 @@ -7,6 +7,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; @@ -86,6 +88,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 |
