实际上我想让目前专注的Recyclerview项目比其他项目更大。所以我试着引用this question。但它无法解决我的问题,所以我想知道如何解决这个问题。
代码:
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);
}