注意事项
1.如果一个布局中有个Button ImageButton, 很可能被抢夺焦点,导致onFocusChanged不能被执行!!
2.setNextFocusRightId 暂时需要Programly设置, 在xml中设置没有效果.
3.Animator动画的使用:
private void zoomIn() { //缩小动画 if (mAnimatorSetZoomIn == null) { mAnimatorSetZoomIn = new AnimatorSet(); 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() { //放大动画 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(); }
地址 https://github.com/sfshine/TVSelectorZoomView
时间: 2024-10-03 23:05:45