I'm imagining something like this:
- Create the horizontal RV
- When binding the ViewHolder, attach a
FocusChangeListener to the root view of the item
- When the item gains focus, scale it to make it slightly bigger; when the focus is lost, revert the animation.
static 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
}
}
});
}
}