@Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { if (v.isInTouchMode()) { v.performClick(); } int[] location = new int[2]; v.getLocationOnScreen(location); /* * if (location[0] - v.getWidth() < mRecyclerView.getLeft() ) { * mRecyclerView.smoothScrollBy(- 400, 0); } */ if (location[0] + (v.getWidth() * 1.3) > mRecyclerView.getRight()) { mRecyclerView.smoothScrollBy(300, 0); } if (v.getId() == R.id.more_game) { panel.getMore_game_shadow().setImageResource(R.drawable.white_focus); panel.getMore_game_content().setScaleX(1.1f); panel.getMore_game_content().setScaleY(1.1f); panel.getMore_game().setNextFocusUpId(R.id.tab_gamecenter); panel.getMore_game().setNextFocusDownId(panel.getMore_game().getId()); if (adInfo != null) { if (adInfo.getVideoUrl() != null && !adInfo.getVideoUrl().isEmpty()) { panel.getMore_game_video().setVisibility(View.VISIBLE); } } } } else { if (v.getId() == R.id.more_game) { panel.getMore_game_shadow().setImageResource(android.R.color.transparent); panel.getMore_game_content().setScaleX(1.0f); panel.getMore_game_content().setScaleY(1.0f); panel.getMore_game_video().setVisibility(View.INVISIBLE); } } }