Java Code Examples for android.support.annotation.AnimatorRes

The following are top voted examples for showing how to use android.support.annotation.AnimatorRes. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: GitHub   File: CircleIndicator.java   View source code 6 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
        @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
        @DrawableRes int indicatorBackgroundId,
        @DrawableRes int indicatorUnselectedBackgroundId) {

    mIndicatorWidth = indicatorWidth;
    mIndicatorHeight = indicatorHeight;
    mIndicatorMargin = indicatorMargin;

    mAnimatorResId = animatorId;
    mAnimatorReverseResId = animatorReverseId;
    mIndicatorBackgroundResId = indicatorBackgroundId;
    mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;

    checkIndicatorConfig(getContext());
}
 
Example 2
Project: XERUNG   File: CircleIndicator.java   View source code 6 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
        @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
        @DrawableRes int indicatorBackgroundId,
        @DrawableRes int indicatorUnselectedBackgroundId) {

    mIndicatorWidth = indicatorWidth;
    mIndicatorHeight = indicatorHeight;
    mIndicatorMargin = indicatorMargin;

    mAnimatorResId = animatorId;
    mAnimatorReverseResId = animatorReverseId;
    mIndicatorBackgroundResId = indicatorBackgroundId;
    mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;

    checkIndicatorConfig(getContext());
}
 
Example 3
Project: XERUNG   File: CircleIndicator.java   View source code 6 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
        @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
        @DrawableRes int indicatorBackgroundId,
        @DrawableRes int indicatorUnselectedBackgroundId) {

    mIndicatorWidth = indicatorWidth;
    mIndicatorHeight = indicatorHeight;
    mIndicatorMargin = indicatorMargin;

    mAnimatorResId = animatorId;
    mAnimatorReverseResId = animatorReverseId;
    mIndicatorBackgroundResId = indicatorBackgroundId;
    mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;

    checkIndicatorConfig(getContext());
}
 
Example 4
Project: FindX   File: CircleIndicator.java   View source code 6 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
                               @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
                               @DrawableRes int indicatorBackgroundId,
                               @DrawableRes int indicatorUnselectedBackgroundId) {

    mIndicatorWidth = indicatorWidth;
    mIndicatorHeight = indicatorHeight;
    mIndicatorMargin = indicatorMargin;

    mAnimatorResId = animatorId;
    mAnimatorReverseResId = animatorReverseId;
    mIndicatorBackgroundResId = indicatorBackgroundId;
    mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;

    checkIndicatorConfig(getContext());
}
 
Example 5
Project: RxZhiHu   File: CircleIndicator.java   View source code 6 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
                               @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
                               @DrawableRes int indicatorBackgroundId,
                               @DrawableRes int indicatorUnselectedBackgroundId) {

    mIndicatorWidth = indicatorWidth;
    mIndicatorHeight = indicatorHeight;
    mIndicatorMargin = indicatorMargin;

    mAnimatorResId = animatorId;
    mAnimatorReverseResId = animatorReverseId;
    mIndicatorBackgroundResId = indicatorBackgroundId;
    mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;

    checkIndicatorConfig(getContext());
}
 
Example 6
Project: Android-Application-ZJB   File: CircleIndicator.java   View source code 6 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
        @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
        @DrawableRes int indicatorBackgroundId,
        @DrawableRes int indicatorUnselectedBackgroundId) {

    mIndicatorWidth = indicatorWidth;
    mIndicatorHeight = indicatorHeight;
    mIndicatorMargin = indicatorMargin;

    mAnimatorResId = animatorId;
    mAnimatorReverseResId = animatorReverseId;
    mIndicatorBackgroundResId = indicatorBackgroundId;
    mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;

    checkIndicatorConfig(getContext());
}
 
Example 7
Project: SuperIndicator   File: CircleIndicator.java   View source code 6 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
        @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
        @DrawableRes int indicatorBackgroundId,
        @DrawableRes int indicatorUnselectedBackgroundId) {

    mIndicatorWidth = indicatorWidth;
    mIndicatorHeight = indicatorHeight;
    mIndicatorMargin = indicatorMargin;

    mAnimatorResId = animatorId;
    mAnimatorReverseResId = animatorReverseId;
    mIndicatorBackgroundResId = indicatorBackgroundId;
    mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;

    checkIndicatorConfig(getContext());
}
 
Example 8
Project: material-components-android   File: MotionSpec.java   View source code 6 votes vote down vote up
/** Inflates an instance of MotionSpec from the given animator resource. */
@Nullable
public static MotionSpec createFromResource(Context context, @AnimatorRes int id) {
  try {
    Animator animator = AnimatorInflater.loadAnimator(context, id);
    if (animator instanceof AnimatorSet) {
      AnimatorSet set = (AnimatorSet) animator;
      return createSpecFromAnimators(set.getChildAnimations());
    } else if (animator != null) {
      List<Animator> animators = new ArrayList<>();
      animators.add(animator);
      return createSpecFromAnimators(animators);
    } else {
      return null;
    }
  } catch (Exception e) {
    Log.w(TAG, "Can't load animation resource ID #0x" + Integer.toHexString(id), e);
    return null;
  }
}
 
Example 9
Project: XueShiShuo   File: CircleIndicator.java   View source code 6 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
                               @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
                               @DrawableRes int indicatorBackgroundId,
                               @DrawableRes int indicatorUnselectedBackgroundId) {

    mIndicatorWidth = indicatorWidth;
    mIndicatorHeight = indicatorHeight;
    mIndicatorMargin = indicatorMargin;

    mAnimatorResId = animatorId;
    mAnimatorReverseResId = animatorReverseId;
    mIndicatorBackgroundResId = indicatorBackgroundId;
    mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;

    checkIndicatorConfig(getContext());
}
 
Example 10
Project: View-Images-and-Animations   File: CircleIndicator.java   View source code 6 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
                               @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
                               @DrawableRes int indicatorBackgroundId,
                               @DrawableRes int indicatorUnselectedBackgroundId) {

    mIndicatorWidth = indicatorWidth;
    mIndicatorHeight = indicatorHeight;
    mIndicatorMargin = indicatorMargin;

    mAnimatorResId = animatorId;
    mAnimatorReverseResId = animatorReverseId;
    mIndicatorBackgroundResId = indicatorBackgroundId;
    mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;

    checkIndicatorConfig(getContext());
}
 
Example 11
Project: LefishGuide   File: CircleIndicator.java   View source code 6 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
                               @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
                               @DrawableRes int indicatorBackgroundId,
                               @DrawableRes int indicatorUnselectedBackgroundId) {

    mIndicatorWidth = indicatorWidth;
    mIndicatorHeight = indicatorHeight;
    mIndicatorMargin = indicatorMargin;

    mAnimatorResId = animatorId;
    mAnimatorReverseResId = animatorReverseId;
    mIndicatorBackgroundResId = indicatorBackgroundId;
    mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;

    checkIndicatorConfig(getContext());
}
 
Example 12
Project: DdBanner   File: DdAnimateIndicator.java   View source code 6 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
                               @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
                               @DrawableRes int indicatorBackgroundId,
                               @DrawableRes int indicatorUnselectedBackgroundId) {

    mIndicatorWidth = indicatorWidth;
    mIndicatorHeight = indicatorHeight;
    mIndicatorMargin = indicatorMargin;

    mAnimatorResId = animatorId;
    mAnimatorReverseResId = animatorReverseId;
    mIndicatorBackgroundResId = indicatorBackgroundId;
    mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;

    checkIndicatorConfig(getContext());
}
 
Example 13
Project: maketaobao   File: CircleIndicator.java   View source code 6 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
                               @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
                               @DrawableRes int indicatorBackgroundId,
                               @DrawableRes int indicatorUnselectedBackgroundId) {

    mIndicatorWidth = indicatorWidth;
    mIndicatorHeight = indicatorHeight;
    mIndicatorMargin = indicatorMargin;

    mAnimatorResId = animatorId;
    mAnimatorReverseResId = animatorReverseId;
    mIndicatorBackgroundResId = indicatorBackgroundId;
    mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;

    checkIndicatorConfig(getContext());
}
 
Example 14
Project: BiliNyan-Android   File: CircleIndicator.java   View source code 6 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
                               @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
                               @DrawableRes int indicatorBackgroundId,
                               @DrawableRes int indicatorUnselectedBackgroundId) {

	mIndicatorWidth = indicatorWidth;
	mIndicatorHeight = indicatorHeight;
	mIndicatorMargin = indicatorMargin;

	mAnimatorResId = animatorId;
	mAnimatorReverseResId = animatorReverseId;
	mIndicatorBackgroundResId = indicatorBackgroundId;
	mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;

	checkIndicatorConfig(getContext());
}
 
Example 15
Project: material   File: IndicatorView.java   View source code 5 votes vote down vote up
public void configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
                               @AnimatorRes int animatorId, @AnimatorRes int animatorReverseId,
                               @DrawableRes int indicatorBackgroundId,
                               @DrawableRes int indicatorUnselectedBackgroundId) {

    mIndicatorWidth = indicatorWidth;
    mIndicatorHeight = indicatorHeight;
    mIndicatorMargin = indicatorMargin;

    mAnimatorResId = animatorId;
    mAnimatorReverseResId = animatorReverseId;
    mIndicatorBackgroundResId = indicatorBackgroundId;
    mIndicatorUnselectedBackgroundResId = indicatorUnselectedBackgroundId;
}
 
Example 16
Project: material-components-android   File: FabTransformationSheetBehavior.java   View source code 5 votes vote down vote up
@Override
protected FabTransformationSpec onCreateMotionSpec(Context context, boolean expanded) {
  @AnimatorRes int specRes;
  if (expanded) {
    specRes = R.animator.mtrl_fab_transformation_sheet_expand_spec;
  } else {
    specRes = R.animator.mtrl_fab_transformation_sheet_collapse_spec;
  }

  FabTransformationSpec spec = new FabTransformationSpec();
  spec.timings = MotionSpec.createFromResource(context, specRes);
  spec.positioning = new Positioning(Gravity.CENTER, 0f, 0f);
  return spec;
}
 
Example 17
Project: recycler-fast-scroll   File: CustomHandleBehavior.java   View source code 5 votes vote down vote up
protected HandleAnimationManager(View handle, @AnimatorRes int grabAnimator, @AnimatorRes int releaseAnimator) {
    if (grabAnimator != -1) {
        this.grabAnimator = (AnimatorSet) AnimatorInflater.loadAnimator(handle.getContext(), grabAnimator);
        this.grabAnimator.setTarget(handle);
    }
    if (releaseAnimator != -1) {
        this.releaseAnimator = (AnimatorSet) AnimatorInflater.loadAnimator(handle.getContext(), releaseAnimator);
        this.releaseAnimator.setTarget(handle);
    }
}
 
Example 18
Project: CookieBar2   File: CookieBar.java   View source code 4 votes vote down vote up
public Builder setIconAnimation(@AnimatorRes int iconAnimation) {
    params.iconAnimator = (AnimatorSet) AnimatorInflater.loadAnimator(context, iconAnimation);
    return this;
}
 
Example 19
Project: LoadingLayout   File: LoadingLayout.java   View source code 4 votes vote down vote up
public void setLoadingAnim(@AnimatorRes int animId) {
    mLoadingAnim = AnimatorInflater.loadAnimator(getContext(), animId);
}
 
Example 20
Project: android_fragments   File: BasicFragmentTransition.java   View source code 4 votes vote down vote up
/**
 */
@Override
@AnimatorRes
public int getIncomingAnimation() {
	return mInAnimRes;
}
 
Example 21
Project: android_fragments   File: BasicFragmentTransition.java   View source code 4 votes vote down vote up
/**
 */
@Override
@AnimatorRes
public int getOutgoingAnimation() {
	return mOutAnimRes;
}
 
Example 22
Project: android_fragments   File: BasicFragmentTransition.java   View source code 4 votes vote down vote up
/**
 */
@Override
@AnimatorRes
public int getIncomingBackStackAnimation() {
	return mInBackAnimRes;
}
 
Example 23
Project: android_fragments   File: BasicFragmentTransition.java   View source code 4 votes vote down vote up
/**
 */
@Override
@AnimatorRes
public int getOutgoingBackStackAnimation() {
	return mOutBackAnimRes;
}
 
Example 24
Project: material-components-android   File: ChipDrawable.java   View source code 4 votes vote down vote up
public void setShowMotionSpecResource(@AnimatorRes int id) {
  setShowMotionSpec(MotionSpec.createFromResource(context, id));
}
 
Example 25
Project: material-components-android   File: ChipDrawable.java   View source code 4 votes vote down vote up
public void setHideMotionSpecResource(@AnimatorRes int id) {
  setHideMotionSpec(MotionSpec.createFromResource(context, id));
}
 
Example 26
Project: material-components-android   File: Chip.java   View source code 4 votes vote down vote up
public void setShowMotionSpecResource(@AnimatorRes int id) {
  if (chipDrawable != null) {
    chipDrawable.setShowMotionSpecResource(id);
  }
}
 
Example 27
Project: material-components-android   File: Chip.java   View source code 4 votes vote down vote up
public void setHideMotionSpecResource(@AnimatorRes int id) {
  if (chipDrawable != null) {
    chipDrawable.setHideMotionSpecResource(id);
  }
}
 
Example 28
Project: AndroidAssist   File: ActivityManager.java   View source code 4 votes vote down vote up
@AnimatorRes public int getInAnimationId() {
  return in;
}
 
Example 29
Project: AndroidAssist   File: ActivityManager.java   View source code 4 votes vote down vote up
@AnimatorRes public int getOutAnimationId() {
  return out;
}
 
Example 30
Project: recycler-fast-scroll   File: CustomHandleBehavior.java   View source code 4 votes vote down vote up
public Builder withGrabAnimator(@AnimatorRes int grabAnimator) {
    this.grabAnimator = grabAnimator;
    return this;
}
 
Example 31
Project: recycler-fast-scroll   File: CustomHandleBehavior.java   View source code 4 votes vote down vote up
public Builder withReleaseAnimator(@AnimatorRes int releaseAnimator) {
    this.releaseAnimator = releaseAnimator;
    return this;
}
 
Example 32
Project: recycler-fast-scroll   File: VisibilityAnimationManager.java   View source code 4 votes vote down vote up
public AbsBuilder<T> withShowAnimator(@AnimatorRes int showAnimatorResource){
    this.showAnimatorResource = showAnimatorResource;
    return this;
}
 
Example 33
Project: recycler-fast-scroll   File: VisibilityAnimationManager.java   View source code 4 votes vote down vote up
public AbsBuilder<T> withHideAnimator(@AnimatorRes int hideAnimatorResource){
    this.hideAnimatorResource = hideAnimatorResource;
    return this;
}
 
Example 34
Project: android_fragments   File: BasicFragmentTransition.java   View source code 3 votes vote down vote up
/**
 * Creates a new instance of BasicFragmentTransition with the specified animations and name.
 *
 * @param inAnim      A resource id of the animation for an incoming fragment.
 * @param outAnim     A resource id of the animation for an outgoing fragment to be added to the
 *                    back stack or to be destroyed and replaced by the incoming one.
 * @param inBackAnim  A resource id of the animation for an incoming fragment to be showed from
 *                    the back stack.
 * @param outBackAnim A resource id of the animation for an outgoing fragment to be destroyed and
 *                    replaced by the incoming one.
 * @param name        Name for the new transition.
 */
public BasicFragmentTransition(@AnimatorRes final int inAnim, @AnimatorRes final int outAnim, @AnimatorRes final int inBackAnim, @AnimatorRes final int outBackAnim, @NonNull final String name) {
	this.mInAnimRes = inAnim;
	this.mOutAnimRes = outAnim;
	this.mInBackAnimRes = inBackAnim;
	this.mOutBackAnimRes = outBackAnim;
	this.mName = name;
}
 
Example 35
Project: XinFramework   File: ExtraTransaction.java   View source code 2 votes vote down vote up
/**
 * Set specific animation resources to run for the fragments that are
 * entering and exiting in this transaction. These animations will not be
 * played when popping the back stack.
 */
public abstract ExtraTransaction setCustomAnimations(@AnimatorRes @AnimRes int targetFragmentEnter,
                                                     @AnimatorRes @AnimRes int currentFragmentPopExit);
 
Example 36
Project: XinFramework   File: ExtraTransaction.java   View source code 2 votes vote down vote up
/**
 * Set specific animation resources to run for the fragments that are
 * entering and exiting in this transaction. The <code>currentFragmentPopEnter</code>
 * and <code>targetFragmentExit</code> animations will be played for targetFragmentEnter/currentFragmentPopExit
 * operations specifically when popping the back stack.
 */
public abstract ExtraTransaction setCustomAnimations(@AnimatorRes @AnimRes int targetFragmentEnter,
                                                     @AnimatorRes @AnimRes int currentFragmentPopExit,
                                                     @AnimatorRes @AnimRes int currentFragmentPopEnter,
                                                     @AnimatorRes @AnimRes int targetFragmentExit);
 
Example 37
Project: android_fragments   File: BasicFragmentTransition.java   View source code 2 votes vote down vote up
/**
 * Same as {@link #BasicFragmentTransition(int, int, int, int)} with back-stack animations set
 * to {@link #NO_ANIMATION}.
 */
public BasicFragmentTransition(@AnimatorRes final int inAnim, @AnimatorRes final int outAnim) {
	this(inAnim, outAnim, NO_ANIMATION, NO_ANIMATION);
}
 
Example 38
Project: android_fragments   File: BasicFragmentTransition.java   View source code 2 votes vote down vote up
/**
 * Same as {@link #BasicFragmentTransition(int, int, int, int, String)} with name specified
 * as {@code "UNSPECIFIED"}.
 */
public BasicFragmentTransition(@AnimatorRes final int inAnim, @AnimatorRes final int outAnim, @AnimatorRes final int inBackAnim, @AnimatorRes final int outBackAnim) {
	this(inAnim, outAnim, inBackAnim, outBackAnim, "UNSPECIFIED");
}
 
Example 39
Project: android_fragments   File: FragmentTransition.java   View source code 2 votes vote down vote up
/**
 * Returns the animation resource for a new incoming fragment.
 *
 * @return Animation resource or {@link #NO_ANIMATION} if no animation should be played for
 * incoming fragment.
 */
@AnimatorRes
int getIncomingAnimation();
 
Example 40
Project: android_fragments   File: FragmentTransition.java   View source code 2 votes vote down vote up
/**
 * Returns the animation resource for the current outgoing fragment.
 *
 * @return Animation resource or {@link #NO_ANIMATION} if no animation should be played for
 * outgoing fragment.
 */
@AnimatorRes
int getOutgoingAnimation();