mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Add animation in DiscoverSongAdapter image
This commit is contained in:
parent
5eb61ecde6
commit
a692862b02
2 changed files with 18 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ import android.util.Log;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
|
@ -63,6 +64,12 @@ public class DiscoverSongAdapter extends RecyclerView.Adapter<DiscoverSongAdapte
|
|||
.into(holder.cover);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewAttachedToWindow(@NonNull ViewHolder holder) {
|
||||
super.onViewAttachedToWindow(holder);
|
||||
startAnimation(holder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return songs.size();
|
||||
|
|
@ -114,4 +121,14 @@ public class DiscoverSongAdapter extends RecyclerView.Adapter<DiscoverSongAdapte
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void startAnimation(ViewHolder holder) {
|
||||
holder.cover.animate()
|
||||
.setDuration(20000)
|
||||
.setStartDelay(10)
|
||||
.setInterpolator(new AccelerateDecelerateInterpolator())
|
||||
.scaleX(1.4f)
|
||||
.scaleY(1.4f)
|
||||
.start();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.cappielloantonio.play.ui.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue