Actually I wanna make the current focused recyclerview item bigger than others . So I tried to refer this question .But it couldn't solve my issue so I wonder how to solve this issue.
Code:
public MyViewHolder(final View root) {
super(root);
root.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
// run scale animation and make it bigger
Animation anim = AnimationUtils.loadAnimation(root.getContext(), R.anim.scale_in_tv);
root.startAnimation(anim);
anim.setFillAfter(true);
} else {
// run scale animation and make it smaller
Animation anim = AnimationUtils.loadAnimation(root.getContext(), R.anim.scale_out_tv);
root.startAnimation(anim);
anim.setFillAfter(true);
}
}
});
ButterKnife.bind(this, root);
}