onDraw override.
If animation is "on", view is invalidated after each redraw,
to perform recalculation on every loop of UI redraw
552544
@Override
    public void onDraw(Canvas canvas) {
        if (animationOn) {
            if (angleRecalculate(new Date().getTime())) {
                this.setRotation(angle1);
            }
        } else {
            this.setRotation(angle1);
        }
        super.onDraw(canvas);
        if (animationOn) {
            this.invalidate();
        }
    }
304985
function onActivateEvent() {
         if (this.animatedTilesets === undefined) {
           this.animatedTilesets = [];
         }

         if (this.tilesets) {
           var tileset = this.tilesets.tilesets;

           for (var i = 0; i < tileset.length; i++) {
             if (tileset[i].isAnimated) {
               this.animatedTilesets.push(tileset[i]);
             }
           }
         }

         this.isAnimated = this.animatedTilesets.length > 0; // Force pre-render off when tileset animation is used

         if (this.isAnimated) {
           this.preRender = false;
         } // Resize the bounding rect


         this.getBounds().resize(this.width, this.height);
       }
31153
function invalidate(chart) {
	if (chart.animating) {
		return;
	}

	// `chart.animating` can be `false` even if there is animation in progress,
	// so let's iterate all animations to find if there is one for the `chart`.
	var animations = Chart.animationService.animations;
	for (var i = 0, ilen = animations.length; i < ilen; ++i) {
		if (animations[i].chart === chart) {
			return;
		}
	}

	// No render scheduled: trigger a "lazy" render that can be canceled in case
	// of hover interactions. The 1ms duration is a workaround to make sure an
	// animation is created so the controller can stop it before any transition.
	chart.render({duration: 1, lazy: true});
}
454735
@Override
    protected void onSizeChanged(int newWidth, int newHeight, int oldWidth, int oldHeight) {
        super.onSizeChanged(newWidth, newHeight, oldWidth, oldHeight);
        if(!isInEditMode()) {
            totalWidth = newWidth;
            drawAll();
            postDelayed(new Runnable() {
                @Override
                public void run() {
                    drawPrimaryProgress();
                    drawSecondaryProgress();
                }
            }, 5);
        }
    }
88484
protected void onPreTransform(View view, float position) {
        final float width = view.getWidth();

        ViewHelper.setRotationX(view,0);
        ViewHelper.setRotationY(view,0);
        ViewHelper.setRotation(view,0);
        ViewHelper.setScaleX(view,1);
        ViewHelper.setScaleY(view,1);
        ViewHelper.setPivotX(view,0);
        ViewHelper.setPivotY(view,0);
        ViewHelper.setTranslationY(view,0);
        ViewHelper.setTranslationX(view,isPagingEnabled() ? 0f : -width * position);

        if (hideOffscreenPages()) {
            ViewHelper.setAlpha(view,position <= -1f || position >= 1f ? 0f : 1f);
        } else {
            ViewHelper.setAlpha(view,1f);
        }
        if(mCustomAnimationInterface != null){
            if(h.containsKey(view) == false || h.get(view).size() == 1){
                if(position > -1 && position < 1){
                    if(h.get(view) == null){
                        h.put(view,new ArrayList<Float>());
                    }
                    h.get(view).add(position);
                    if(h.get(view).size() == 2){
                        float zero = h.get(view).get(0);
                        float cha = h.get(view).get(1) - h.get(view).get(0);
                        if(zero > 0){
                            if(cha > -1 && cha < 0){
                                //in
                                mCustomAnimationInterface.onPrepareNextItemShowInScreen(view);
                            }else{
                                //out
                                mCustomAnimationInterface.onPrepareCurrentItemLeaveScreen(view);
                            }
                        }else{
                            if(cha > -1 && cha < 0){
                                //out
                                mCustomAnimationInterface.onPrepareCurrentItemLeaveScreen(view);
                            }else{
                                //in
                                mCustomAnimationInterface.onPrepareNextItemShowInScreen(view);
                            }
                        }
                    }
                }
            }
        }
    }
411357
def __redraw_loop(self):
        """"""
        self.queue_draw() # this will trigger do_expose_event when the current events have been flushed

        self.__drawing_queued = self.tweener and self.tweener.has_tweens()
        return self.__drawing_queued
205602
function (newMin, newMax, redraw, animation, eventArguments) {
		var axis = this,
			chart = axis.chart;

		redraw = pick(redraw, true); // defaults to true

		// Extend the arguments with min and max
		eventArguments = extend(eventArguments, {
			min: newMin,
			max: newMax
		});

		// Fire the event
		fireEvent(axis, 'setExtremes', eventArguments, function () { // the default event handler

			axis.userMin = newMin;
			axis.userMax = newMax;
			axis.eventArgs = eventArguments;

			// Mark for running afterSetExtremes
			axis.isDirtyExtremes = true;

			// redraw
			if (redraw) {
				chart.redraw(animation);
			}
		});
	}
219362
@Override public void onViewPositionChanged(View changedView, int left, int top, int dx, int dy) {
    if (draggableView.isDragViewAtBottom()) {
      draggableView.changeDragViewViewAlpha();
    } else {
      draggableView.restoreAlpha();
      draggableView.changeDragViewScale();
      draggableView.changeDragViewPosition();
      draggableView.changeSecondViewAlpha();
      draggableView.changeSecondViewPosition();
      draggableView.changeBackgroundAlpha();
    }
  }
1299713
function animateSelection(element, fromSelection, toSelection) {

  resetAnimations(element);

  // Calculate the animation timings.
  const items = element.items;
  const keyframes = element.selectionAnimationKeyframes;
  element[playingAnimationSymbol] = true;
  const timings = mixin.helpers.effectTimingsForSelectionAnimation(element, fromSelection, toSelection);

  // Figure out which item will be the one *after* the one we're selecting.
  const itemCount = items.length;
  const selectionWraps = element.selectionWraps;
  const selectionIndex = FractionalSelectionMixin.helpers.selectionParts(toSelection, itemCount, selectionWraps).index;
  const totalSteps = stepsToIndex(itemCount, selectionWraps, fromSelection, toSelection);
  const forward = totalSteps >= 0;
  let nextUpIndex = selectionIndex + (forward ? 1 : - 1);
  if (selectionWraps) {
    nextUpIndex = FractionalSelectionMixin.helpers.wrappedSelection(nextUpIndex, itemCount);
  } else if (!isItemIndexInBounds(element, nextUpIndex)) {
    nextUpIndex = null; // At start/end of list; don't have a next item to show.
  }

  // Play the animations using those timings.
  let lastAnimationDetails;
  timings.forEach((timing, index) => {
    const item = items[index];
    if (timing) {
      showItem(item, true);
      const animation = item.animate(keyframes, timing);
      element[animationSymbol][index] = animation;
      if (index === nextUpIndex) {
        // This item will be animated, so will already be in the desired state
        // after the animation completes.
        nextUpIndex = null;
      }
      if (timing.endDelay !== 0) {
        // This is the animation for the item that will be left selected.
        // We want to clean up when this animation completes.
        lastAnimationDetails = { animation, index, timing, forward };
      }
    } else {
      // This item doesn't participate in the animation.
      showItem(item, false);
    }
  });

  if (lastAnimationDetails != null) {
    // Arrange for clean-up work to be performed.
    lastAnimationDetails.nextUpIndex = nextUpIndex;
    lastAnimationDetails.animation.onfinish = event => selectionAnimationFinished(element, lastAnimationDetails);
    element[lastAnimationSymbol] = lastAnimationDetails.animation;
  } else {
    // Shouldn't happen -- we should always have at least one animation.
    element[playingAnimationSymbol] = false;
  }
}
698536
private void refreshDrawable() {
        if (isWeakReferenceValid()) {
            TextView textView = getTextView().get();
            textView.setBackgroundDrawable(getBadgeDrawable(textView.getContext()));
        }
    }
1318612
@Override
    public void onNextItemAppear(View view) {

        View descriptionLayout = view.findViewById(R.id.description_layout);
        if(descriptionLayout!=null){
            float layoutY = ViewHelper.getY(descriptionLayout);
            view.findViewById(R.id.description_layout).setVisibility(View.VISIBLE);
            ValueAnimator animator = ObjectAnimator.ofFloat(
                    descriptionLayout,"y",layoutY + descriptionLayout.getHeight(),
                    layoutY).setDuration(500);
            animator.start();
        }

    }
652477
function onResizeEnd() {
            utils.dragInfo.inDragging = false;
            utils.dragInfo.justResized = true; // if winJustDragged, should force children re-render
            setTimeout(function () {
              utils.dragInfo.justResized = false;
            }, 1200);

            refreshFrame();
          }
451219
@Override
    protected void onGraphDraw(Canvas _Canvas) {
        super.onGraphDraw(_Canvas);

        if (!mPieData.isEmpty()) {

            float innerStartAngle = 0;
            float innerSweepAngle = 0;
            int   amountOfPieSlices = mPieData.size();

            for (int pieIndex = 0; pieIndex < amountOfPieSlices; pieIndex++) {
                PieModel model = mPieData.get(pieIndex);

                mGraphPaint.setColor(model.getColor());

                // TODO: put calculation in the animation onUpdate method and provide an animated value
                float startAngle;
                float sweepAngle = (model.getEndAngle() - model.getStartAngle()) * mRevealValue;

                if (mOpenClockwise) {
                    startAngle = model.getStartAngle() * mRevealValue;
                }
                else {
                    startAngle = 360 - model.getEndAngle() * mRevealValue;
                }

                if(pieIndex == 0) {
                    innerStartAngle = startAngle +  (mOpenClockwise ? 0 : (float) Math.ceil(sweepAngle));
                }

                if (mOpenClockwise)
                    innerSweepAngle += sweepAngle;
                else
                    innerSweepAngle -= (float) Math.ceil(sweepAngle);

                _Canvas.drawArc(mGraphBounds,
                        startAngle,
                        sweepAngle,
                        true, mGraphPaint);

                // Draw the highlighted inner edges if an InnerPadding is selected
                if (mUseInnerPadding) {
                    mGraphPaint.setColor(model.getHighlightedColor());

                    _Canvas.drawArc(mInnerBounds,
                            startAngle,
                            sweepAngle,
                            true, mGraphPaint);
                }
            }

            // Draw inner white circle
            if (mUseInnerPadding) {
                mGraphPaint.setColor(mInnerPaddingColor);

                _Canvas.drawArc(mInnerOutlineBounds,
                        innerStartAngle,
                        innerSweepAngle,
                        true,
                        mGraphPaint);
            }
        }
        else {
            // No Data available
            mGraphPaint.setColor(0xFFB6B6B6);
            _Canvas.drawArc(mGraphBounds,
                    0,
                    360,
                    true, mGraphPaint);

            // Draw inner white circle
            if (mUseInnerPadding) {
                mGraphPaint.setColor(0xFFC6C6C6);

                _Canvas.drawArc(mInnerBounds,
                        0,
                        360,
                        true, mGraphPaint);

                mGraphPaint.setColor(mInnerPaddingColor);

                _Canvas.drawArc(mInnerOutlineBounds,
                        0,
                        360,
                        true,
                        mGraphPaint);
            }
        }
    }
49118
public void viewUpdated() {
		BufferedImage active = null;
		if( controls.selectedView == 0 ) {
			active = original;
		} else if( controls.selectedView == 1 ) {
			synchronized (lockProcessing) {
				VisualizeBinaryData.renderBinary(detector.getBinary(), false, work);
			}
			active = work;
			work.setRGB(0, 0, work.getRGB(0, 0)); // hack so that Swing knows it's been modified
		} else {
			Graphics2D g2 = work.createGraphics();
			g2.setColor(Color.BLACK);
			g2.fillRect(0,0,work.getWidth(),work.getHeight());
			active = work;
		}

		guiImage.setBufferedImage(active);
		guiImage.setScale(controls.zoom);

		guiImage.repaint();
	}
456514
def recalculate(self):
        
        if not (self.isVisible() and self.renderer()):
            return
        
        # update dynamic range
        if self._dataChanged:
            for axis in self.axes():
                if axis.useDynamicRange():
                    axis.calculateRange(self.values(axis.name()))
            
            self._dataChanged = False
        
        # recalculate the main grid
        xaxis = self.horizontalAxis()
        yaxis = self.verticalAxis()
        renderer = self.renderer()
        
        xvisible = xaxis is not None and self.showXAxis() and renderer.showXAxis()
        yvisible = yaxis is not None and self.showYAxis() and renderer.showYAxis()
        
        self.uiXAxisVIEW.setVisible(xvisible)
        self.uiYAxisVIEW.setVisible(yvisible)
        
        # calculate the main view
        view = self.uiChartVIEW
        chart_scene = view.scene()
        chart_scene.setSceneRect(0, 0, view.width() - 2, view.height() - 2)
        rect = renderer.calculate(chart_scene, xaxis, yaxis)
        
        # recalculate the xaxis
        if xaxis and self.showXAxis() and renderer.showXAxis():
            view = self.uiXAxisVIEW
            scene = view.scene()
            scene.setSceneRect(0, 0, rect.width(), view.height())
            scene.invalidate()
        
        # render the yaxis
        if yaxis and self.showYAxis() and renderer.showYAxis():
            view = self.uiYAxisVIEW
            scene = view.scene()
            scene.setSceneRect(0, 0, view.width(), rect.height())
            scene.invalidate()
        
        # recalculate the items
        renderer.calculateDatasets(chart_scene,
                                   self.axes(),
                                   self.datasets())
        
        chart_scene.invalidate()
378338
private void resetAnimation(){		
		mLastUpdateTime = SystemClock.uptimeMillis();
		mLastProgressStateTime = mLastUpdateTime;
		if(mProgressMode == ProgressView.MODE_INDETERMINATE){
			mStartLine = mReverse ? getBounds().width() : 0;
			mStrokeColorIndex = 0;
			mLineWidth = mReverse ? -mMinLineWidth : mMinLineWidth;
			mProgressState = PROGRESS_STATE_STRETCH;
		}
		else if(mProgressMode == ProgressView.MODE_BUFFER){
			mStartLine = 0;
		}	
		else if(mProgressMode == ProgressView.MODE_QUERY){
			mStartLine = !mReverse ? getBounds().width() : 0;
			mStrokeColorIndex = 0;
			mLineWidth = !mReverse ? -mMaxLineWidth : mMaxLineWidth;
		}		
	}
216799
function()
	{
		if(this._isRunning && !this._isSuspended)
		{
			var shouldRefresh = true;
			if(typeof this.shouldRefresh === 'function') shouldRefresh = this.shouldRefresh();
			if(shouldRefresh)
			{
				if(typeof this.refresh === 'function') this.refresh();
				if(this._collectionBinder)
				{
					this._collectionBinder.refreshBoundViews();
					this._collectionBinder.refreshAll();
				}
				else
				{
					this._rebindCursors();
					this._refreshOwnBinders();
					if(this.subviews !== null)
					{
						for(var i = 0, l = this.subviews.length; i < l; i++) this.subviews[i].refreshAll();
					}
				}
			}
			this._pendingRefresh = false;
		}
	}