コード例 #1
0
 @Override
 public void onSelectionModeChange(int mode) {
   switch (mode) {
     case SelectionManager.ENTER_SELECTION_MODE:
       {
         mActionBar.disableClusterMenu(true);
         mActionModeHandler.startActionMode();
         performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
         break;
       }
     case SelectionManager.LEAVE_SELECTION_MODE:
       {
         mActionModeHandler.finishActionMode();
         if (mShowClusterMenu) {
           mActionBar.enableClusterMenu(mSelectedAction, this);
         }
         mRootPane.invalidate();
         break;
       }
     case SelectionManager.SELECT_ALL_MODE:
       {
         mActionModeHandler.updateSupportedOperation();
         mRootPane.invalidate();
         break;
       }
   }
 }
コード例 #2
0
 @Override
 public void onEyePositionChanged(float x, float y, float z) {
   mRootPane.lockRendering();
   mX = x;
   mY = y;
   mZ = z;
   mRootPane.unlockRendering();
   mRootPane.invalidate();
 }
コード例 #3
0
 public void startAnimation(CanvasAnimation animation) {
   GLRoot root = getGLRoot();
   if (root == null) throw new IllegalStateException();
   mAnimation = animation;
   if (mAnimation != null) {
     mAnimation.start();
     root.registerLaunchedAnimation(mAnimation);
   }
   invalidate();
 }
コード例 #4
0
 // Sets the visiblity of this GLView (either GLView.VISIBLE or
 // GLView.INVISIBLE).
 public void setVisibility(int visibility) {
   if (visibility == getVisibility()) return;
   if (visibility == VISIBLE) {
     mViewFlags &= ~FLAG_INVISIBLE;
   } else {
     mViewFlags |= FLAG_INVISIBLE;
   }
   onVisibilityChanged(visibility);
   invalidate();
 }
コード例 #5
0
 @Override
 public void onSelectionModeChange(int mode) {
   switch (mode) {
     case SelectionManager.ENTER_SELECTION_MODE:
       {
         mActionModeHandler.startActionMode();
         performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
         break;
       }
     case SelectionManager.LEAVE_SELECTION_MODE:
       {
         mActionModeHandler.finishActionMode();
         mRootPane.invalidate();
         break;
       }
     case SelectionManager.SELECT_ALL_MODE:
       {
         mActionModeHandler.updateSupportedOperation();
         mRootPane.invalidate();
         break;
       }
   }
 }
コード例 #6
0
 protected void render(GLCanvas canvas) {
   boolean transitionActive = false;
   if (mTransition != null && mTransition.calculate(AnimationTime.get())) {
     invalidate();
     transitionActive = mTransition.isActive();
   }
   renderBackground(canvas);
   canvas.save();
   if (transitionActive) {
     mTransition.applyContentTransform(this, canvas);
   }
   for (int i = 0, n = getComponentCount(); i < n; ++i) {
     renderChild(canvas, getComponent(i));
   }
   canvas.restore();
   if (transitionActive) {
     mTransition.applyOverlay(this, canvas);
   }
 }
コード例 #7
0
  protected void renderChild(GLCanvas canvas, GLView component) {
    if (component.getVisibility() != GLView.VISIBLE && component.mAnimation == null) return;

    int xoffset = component.mBounds.left - mScrollX;
    int yoffset = component.mBounds.top - mScrollY;

    canvas.translate(xoffset, yoffset);

    CanvasAnimation anim = component.mAnimation;
    if (anim != null) {
      canvas.save(anim.getCanvasSaveFlags());
      if (anim.calculate(AnimationTime.get())) {
        invalidate();
      } else {
        component.mAnimation = null;
      }
      anim.apply(canvas);
    }
    component.render(canvas);
    if (anim != null) canvas.restore();
    canvas.translate(-xoffset, -yoffset);
  }