Precautions
1. If there is a button ImageButton in a layout, it is likely that the focus will be robbed, causing onfocuschanged not to be executed!!
2.setNextFocusRightId temporarily requires programly settings, and setting in XML has no effect.
Use of 3.Animator animations:
private void ZoomIn () {//Zoom Out animation if (manimatorsetzoomin = = null) {manimatorsetzoomin = new Animat Orset (); Objectanimator Animatorx = Objectanimator.offloat (This, "ScaleX", 1.2f, 1.0f); Objectanimator animatory = Objectanimator.offloat (This, "ScaleY", 1.2f, 1.0f); Animatorx.setduration (300); Animatory.setduration (300); Manimatorsetzoomin.playtogether (Animatorx, animatory); } manimatorsetzoomin.start (); } private void Zoomout () {//Magnification animation if (manimatorsetzoomout = = null) {Manimatorsetzoomout = New Animatorset (); Objectanimator Animatorx = Objectanimator.offloat (This, "ScaleX", 1.0f, 1.2f); Objectanimator animatory = Objectanimator.offloat (This, "ScaleY", 1.0f, 1.2f); Animatorx.setduration (300); Animatory.setduration (300); Manimatorsetzoomout.playtogether (Animatorx, animatory); } ManimatorsetzooMout.start (); }
Address Https://github.com/sfshine/TVSelectorZoomView
To realize the highlight of the TV main screen zoom