@Override void setSelectedPositionInt(final int position) { super.setSelectedPositionInt(position); // Updates any metadata we keep about the selected item. updateSelectedItemMetadata(); }
/** * @see android.view.View#onLayout(boolean,int,int,int,int) * <p>Creates and positions all views */ @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); mInLayout = true; layout(0, false); mInLayout = false; }
// CHECKSTYLE:OFF unmodified private void onFinishedMovement() { if (mSuppressSelectionChanged) { mSuppressSelectionChanged = false; // We haven't been callbacking during the fling, so do it now super.selectionChanged(); } invalidate(); }
@Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (mPopup != null && mPopup.isShowing()) { mPopup.dismiss(); mPopup = null; } }
@Override protected void onLayout( final boolean changed, final int l, final int t, final int r, final int b) { super.onLayout(changed, l, t, r, b); /* * Remember that we are in layout to prevent more layout request from * being generated. */ mInLayout = true; layout(0, false); mInLayout = false; }
@Override protected void onFocusChanged( final boolean gainFocus, final int direction, final Rect previouslyFocusedRect) { super.onFocusChanged(gainFocus, direction, previouslyFocusedRect); /* * The Gallery shows focus by focusing the selected item. So, give * focus to our selected item instead. We steal keys from our * selected item elsewhere. */ if (gainFocus && mSelectedChild != null) { mSelectedChild.requestFocus(direction); mSelectedChild.setSelected(true); } }
@Override void selectionChanged() { if (!mSuppressSelectionChanged) { super.selectionChanged(); } }