Exemple #1
0
  @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;
 }
Exemple #3
0
  // 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;
    }
  }
Exemple #5
0
  @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;
  }
Exemple #6
0
  @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);
    }
  }
Exemple #7
0
 @Override
 void selectionChanged() {
   if (!mSuppressSelectionChanged) {
     super.selectionChanged();
   }
 }