1.取消延长动画时间办法解决焦点问题,更改为组件发生滚动取消获取焦点即可
This commit is contained in:
@@ -880,7 +880,7 @@ public boolean onGenericMotionEvent(MotionEvent event) {
|
||||
|
||||
}
|
||||
});
|
||||
translateAnimation.setDuration(380);
|
||||
translateAnimation.setDuration(300);
|
||||
translateAnimation.setFillAfter(true);
|
||||
content_view.startAnimation(translateAnimation);
|
||||
|
||||
@@ -897,11 +897,12 @@ public boolean onGenericMotionEvent(MotionEvent event) {
|
||||
cuttentModel = MODEL_NORMAL;
|
||||
LogUtils.loge("coustom_view.getHeight():"+coustom_view.getLayoutParams().height);
|
||||
TranslateAnimation translateAnimation = new TranslateAnimation(0.0f, 0.0f,(float)(0 - coustom_view.getLayoutParams().height - gv_shortcut.getHeight()),0.0f);
|
||||
translateAnimation.setDuration(380);
|
||||
translateAnimation.setDuration(300);
|
||||
translateAnimation.setAnimationListener(new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
coustom_view.setTranslationZ(0);
|
||||
grid_coustom_apps.disScrollFocus();
|
||||
loadShortAppList();
|
||||
coustom_view.clearFocus();
|
||||
}
|
||||
|
||||
@@ -129,6 +129,10 @@ public class TvRecyclerView extends RecyclerView {
|
||||
LogUtils.loge("TvRecyclerView gainFocus="+gainFocus);
|
||||
}
|
||||
}
|
||||
//防止失去焦点还是会继续滚动再度获取焦点
|
||||
public void disScrollFocus(){
|
||||
hasResetFocus=false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasFocus() {
|
||||
|
||||
Reference in New Issue
Block a user