I'm trying to make an horizontal list with a RecyclerView
, that when I put the focus on an item, increase the size of this. I want to make this effect:
Do you have any ideas to accomplish this?
itemView. setOnClickListener(new View. OnClickListener() { @Override public void onClick(View v) { mExpandedPosition = isExpanded ? -1:position; TransitionManager. beginDelayedTransition(recyclerView); notifyDataSetChanged(); } });
I'm imagining something like this:
FocusChangeListener
to the root view of the itemstatic class ViewHolder extends RecyclerView.ViewHolder { public ViewHolder(View root) { // bind views // ... // bind focus listener root.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { // run scale animation and make it bigger } else { // run scale animation and make it smaller } } }); } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With