@RequiresApi(11) public ChartAnimator(AnimatorUpdateListener listener) { mListener = listener; }
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private class OutlineProvider extends ViewOutlineProvider { @Override public void getOutline(View view, Outline outline) { Rect bounds = new Rect(); mBorderRect.roundOut(bounds); outline.setRoundRect(bounds, bounds.width() / 2.0f); } }
/** * Notifies that the processor was paused. * * @param processor The processor being paused. * @see IconicsAnimationProcessor#pause() */ @RequiresApi(Build.VERSION_CODES.KITKAT) default void onAnimationPause(IconicsAnimationProcessor processor) { }
/** * Notifies that the processor was resumed, after being * previously paused. * * @param processor The processor being resumed. * @see IconicsAnimationProcessor#resume() */ @RequiresApi(Build.VERSION_CODES.KITKAT) default void onAnimationResume(IconicsAnimationProcessor processor) { } }
@RequiresApi(11) private ObjectAnimator yAnimator(int duration, EasingFunction easing) { ObjectAnimator animatorY = ObjectAnimator.ofFloat(this, "phaseY", 0f, 1f); animatorY.setInterpolator(easing); animatorY.setDuration(duration); return animatorY; }
@RequiresApi(11) private ObjectAnimator xAnimator(int duration, EasingFunction easing) { ObjectAnimator animatorX = ObjectAnimator.ofFloat(this, "phaseX", 0f, 1f); animatorX.setInterpolator(easing); animatorX.setDuration(duration); return animatorX; }
/** * Animates values along the X axis, in a linear fashion. * * @param durationMillis animation duration */ @RequiresApi(11) public void animateX(int durationMillis) { animateX(durationMillis, Easing.Linear); }
/** * Animates the rendering of the chart on the x-axis with the specified * animation time. If animate(...) is called, no further calling of * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR * API LEVEL 11 (Android 3.0.x) AND HIGHER. * * @param durationMillis */ @RequiresApi(11) public void animateX(int durationMillis) { mAnimator.animateX(durationMillis); }
/** * Animates values along both the X and Y axes, in a linear fashion. * * @param durationMillisX animation duration along the X axis * @param durationMillisY animation duration along the Y axis */ @RequiresApi(11) public void animateXY(int durationMillisX, int durationMillisY) { animateXY(durationMillisX, durationMillisY, Easing.Linear, Easing.Linear); }
/** * Animates values along the Y axis, in a linear fashion. * * @param durationMillis animation duration */ @RequiresApi(11) public void animateY(int durationMillis) { animateY(durationMillis, Easing.Linear); }
/** * Animates the rendering of the chart on the y-axis with the specified * animation time. If animate(...) is called, no further calling of * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR * API LEVEL 11 (Android 3.0.x) AND HIGHER. * * @param durationMillis */ @RequiresApi(11) public void animateY(int durationMillis) { mAnimator.animateY(durationMillis); }
/** * Animates the rendering of the chart on the x-axis with the specified * animation time. If animate(...) is called, no further calling of * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR * API LEVEL 11 (Android 3.0.x) AND HIGHER. * * @param durationMillis * @param easing a custom easing function to be used on the animation phase */ @RequiresApi(11) public void animateX(int durationMillis, EasingFunction easing) { mAnimator.animateX(durationMillis, easing); }
/** * Animates the drawing / rendering of the chart on both x- and y-axis with * the specified animation time. If animate(...) is called, no further * calling of invalidate() is necessary to refresh the chart. ANIMATIONS * ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER. * * @param durationMillisX * @param durationMillisY */ @RequiresApi(11) public void animateXY(int durationMillisX, int durationMillisY) { mAnimator.animateXY(durationMillisX, durationMillisY); }
/** * Animates the rendering of the chart on the y-axis with the specified * animation time. If animate(...) is called, no further calling of * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR * API LEVEL 11 (Android 3.0.x) AND HIGHER. * * @param durationMillis * @param easing a custom easing function to be used on the animation phase */ @RequiresApi(11) public void animateY(int durationMillis, EasingFunction easing) { mAnimator.animateY(durationMillis, easing); }
/** * Animates the drawing / rendering of the chart on both x- and y-axis with * the specified animation time. If animate(...) is called, no further * calling of invalidate() is necessary to refresh the chart. ANIMATIONS * ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER. * * @param durationMillisX * @param durationMillisY * @param easing a custom easing function to be used on the animation phase */ @RequiresApi(11) public void animateXY(int durationMillisX, int durationMillisY, EasingFunction easing) { mAnimator.animateXY(durationMillisX, durationMillisY, easing); }
/** * Animates the drawing / rendering of the chart on both x- and y-axis with * the specified animation time. If animate(...) is called, no further * calling of invalidate() is necessary to refresh the chart. ANIMATIONS * ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER. * * @param durationMillisX * @param durationMillisY * @param easingX a custom easing function to be used on the animation phase * @param easingY a custom easing function to be used on the animation phase */ @RequiresApi(11) public void animateXY(int durationMillisX, int durationMillisY, EasingFunction easingX, EasingFunction easingY) { mAnimator.animateXY(durationMillisX, durationMillisY, easingX, easingY); }
@RequiresApi(Build.VERSION_CODES.LOLLIPOP) public GifTextureView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); init(attrs, defStyleAttr, defStyleRes); }
@RequiresApi(28) private static Bitmap decodeImageSource(ImageDecoder.Source imageSource, final Request request) throws IOException { return ImageDecoder.decodeBitmap(imageSource, new ImageDecoder.OnHeaderDecodedListener() { @Override public void onHeaderDecoded(@NonNull ImageDecoder imageDecoder, @NonNull ImageDecoder.ImageInfo imageInfo, @NonNull ImageDecoder.Source source) { if (request.hasSize()) { Size size = imageInfo.getSize(); if (shouldResize(request.onlyScaleDown, size.getWidth(), size.getHeight(), request.targetWidth, request.targetHeight)) { imageDecoder.setTargetSize(request.targetWidth, request.targetHeight); } } } }); }
/** * Animates values along the Y axis. * * @param durationMillis animation duration * @param easing EasingFunction */ @RequiresApi(11) public void animateY(int durationMillis, EasingFunction easing) { ObjectAnimator animatorY = yAnimator(durationMillis, easing); animatorY.addUpdateListener(mListener); animatorY.start(); }
/** * Animates values along the X axis. * * @param durationMillis animation duration * @param easing EasingFunction */ @RequiresApi(11) public void animateX(int durationMillis, EasingFunction easing) { ObjectAnimator animatorX = xAnimator(durationMillis, easing); animatorX.addUpdateListener(mListener); animatorX.start(); }