예제 #1
0
  /**
   * 描述:TODO
   *
   * @see com.ab.view.carousel.CarouselAdapter#setSelectedPositionInt(int)
   * @author: zhaoqp
   * @date:2013-11-28 上午11:14:35
   * @version v1.0
   */
  @Override
  void setSelectedPositionInt(int position) {
    super.setSelectedPositionInt(position);
    super.setNextSelectedPositionInt(position);

    // Updates any metadata we keep about the selected item.
    updateSelectedItemMetadata();
  }
예제 #2
0
  /** Called when rotation is finished. */
  private void onFinishedMovement() {
    if (mSuppressSelectionChanged) {
      mSuppressSelectionChanged = false;

      // We haven't been callbacking during the fling, so do it now
      super.selectionChanged();
    }
    checkSelectionChanged();
    invalidate();
  }
예제 #3
0
  /**
   * Setting up images after layout changed.
   *
   * @param changed the changed
   * @param l the l
   * @param t the t
   * @param r the r
   * @param b the b
   */
  @Override
  protected void onLayout(boolean changed, int l, int t, int r, 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;
  }
예제 #4
0
  /**
   * 描述:TODO
   *
   * @see android.view.View#onFocusChanged(boolean, int, android.graphics.Rect)
   * @author: zhaoqp
   * @date:2013-11-28 上午11:14:35
   * @version v1.0
   */
  @Override
  protected void onFocusChanged(boolean gainFocus, int direction, 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);
    }
  }
예제 #5
0
 /**
  * 描述:TODO
  *
  * @see com.ab.view.carousel.CarouselAdapter#selectionChanged()
  * @author: zhaoqp
  * @date:2013-11-28 上午11:14:35
  * @version v1.0
  */
 @Override
 void selectionChanged() {
   if (!mSuppressSelectionChanged) {
     super.selectionChanged();
   }
 }