类androidx.annotation.AnimRes源码实例Demo

下面列出了怎么用androidx.annotation.AnimRes的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Twire   文件: NavigationDrawerFragment.java
private void setInstantOnClick(@IdRes int viewRes, final Class activityClass, @AnimRes final int inAnimation) {
    View view = getActivity().findViewById(viewRes);
    view.setOnClickListener(view1 -> {
        Intent intent = new Intent(getActivity(), activityClass);

        ActivityOptionsCompat searchAnim = ActivityOptionsCompat.makeCustomAnimation(getActivity(), inAnimation, R.anim.fade_out_semi_anim);
        ActivityCompat.startActivity(getActivity(), intent, searchAnim.toBundle());
        mDrawerLayout.closeDrawer(containerView);
    });
}
 
源代码2 项目: DevUtils   文件: ResourceUtils.java
/**
 * 获取 Animation
 * @param id resource identifier
 * @return XmlResourceParser
 */
public static XmlResourceParser getAnimation(@AnimatorRes @AnimRes final int id) {
    try {
        return DevUtils.getContext().getResources().getAnimation(id);
    } catch (Exception e) {
        LogPrintUtils.eTag(TAG, e, "getAnimation");
    }
    return null;
}
 
源代码3 项目: AndroidNavigation   文件: TabBarFragment.java
void showTabBarWhenPop(@AnimRes int anim) {
    if (tabBar != null) {
        tabBarHidden = false;
        setNeedsNavigationBarAppearanceUpdate();
        if (anim != R.anim.nav_none) {
            Animation animation = AnimationUtils.loadAnimation(getContext(), anim);
            animation.setAnimationListener(new TabBarAnimationListener(false));
            tabBar.startAnimation(animation);
        } else {
            tabBar.setVisibility(View.VISIBLE);
            tabBar.setTranslationY(0);
        }
    }
}
 
源代码4 项目: AndroidNavigation   文件: TabBarFragment.java
void hideTabBarWhenPush(@AnimRes int anim) {
    if (tabBar != null) {
        tabBarHidden = true;
        setNeedsNavigationBarAppearanceUpdate();
        if (anim != R.anim.nav_none) {
            Animation animation = AnimationUtils.loadAnimation(getContext(), anim);
            animation.setAnimationListener(new TabBarAnimationListener(true));
            tabBar.startAnimation(animation);
        } else {
            tabBar.setVisibility(View.GONE);
            tabBar.setTranslationY(tabBar.getHeight());
        }
    }
}
 
源代码5 项目: Matisse-Kotlin   文件: UCropMulti.java
/**
 * Send the crop Intent from animation an Activity
 *
 * @param activity Activity to receive result
 */
public void startAnimation(@NonNull Activity activity, @AnimRes int activityCropEnterAnimation) {
    if (activityCropEnterAnimation != 0) {
        start(activity, REQUEST_MULTI_CROP, activityCropEnterAnimation);
    } else {
        start(activity, REQUEST_MULTI_CROP);
    }
}
 
源代码6 项目: Matisse-Kotlin   文件: UCrop.java
/**
 * Send the crop Intent from animation an Activity
 *
 * @param activity Activity to receive result
 */
public void startAnimation(@NonNull Activity activity, @AnimRes int activityCropEnterAnimation) {
    if (activityCropEnterAnimation != 0) {
        start(activity, REQUEST_CROP, activityCropEnterAnimation);
    } else {
        start(activity, REQUEST_CROP);
    }
}
 
public PictureWindowAnimationStyle(@AnimRes int activityEnterAnimation,
                                   @AnimRes int activityExitAnimation,
                                   @AnimRes int activityPreviewEnterAnimation,
                                   @AnimRes int activityPreviewExitAnimation) {
    super();
    this.activityEnterAnimation = activityEnterAnimation;
    this.activityExitAnimation = activityExitAnimation;
    this.activityPreviewEnterAnimation = activityPreviewEnterAnimation;
    this.activityPreviewExitAnimation = activityPreviewExitAnimation;
}
 
源代码8 项目: PictureSelector   文件: UCrop.java
/**
 * Send the crop Intent from animation an Activity
 *
 * @param activity Activity to receive result
 */
public void startAnimationActivity(@NonNull Activity activity, @AnimRes int activityCropEnterAnimation) {
    if (activityCropEnterAnimation != 0) {
        start(activity, REQUEST_CROP, activityCropEnterAnimation);
    } else {
        start(activity, REQUEST_CROP);
    }
}
 
源代码9 项目: PictureSelector   文件: UCrop.java
/**
 * Send the crop Intent from animation an Multiple Activity
 *
 * @param activity Activity to receive result
 */
public void startAnimationMultipleCropActivity(@NonNull Activity activity,
                                               @AnimRes int activityCropEnterAnimation) {
    if (activityCropEnterAnimation != 0) {
        startMultiple(activity, REQUEST_MULTI_CROP, activityCropEnterAnimation);
    } else {
        startMultiple(activity, REQUEST_MULTI_CROP);
    }
}
 
源代码10 项目: AsteroidOSSync   文件: ViewTranslationWrapper.java
/**
 * Set view on error animation
 *
 * @param errorAnimation new animation
 * @return ViewTranslationWrapper object
 */
public ViewTranslationWrapper setErrorAnimation(@AnimRes int errorAnimation) {
    if (errorAnimation != 0) {
        this.errorAnimation = AnimationUtils.loadAnimation(view.getContext(), errorAnimation);
    }
    return this;
}
 
源代码11 项目: edx-app-android   文件: BaseFragmentActivityTest.java
/**
 * Generic method for asserting pending transition animation
 *
 * @param shadowActivity The shadow activity
 * @param enterAnim      The enter animation resource
 * @param exitAnim       The exit animation resource
 */
private static void assertOverridePendingTransition(ShadowActivity shadowActivity,
                                                    @AnimRes int enterAnim, @AnimRes int exitAnim) {
    assertEquals(enterAnim, shadowActivity
            .getPendingTransitionEnterAnimationResourceId());
    assertEquals(exitAnim, shadowActivity
            .getPendingTransitionExitAnimationResourceId());
}
 
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void addAnimationToMenuItem(MenuItem menuItem, @LayoutRes int layoutResource,
                                    @AnimRes int animationId) {
    LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    ImageView iv = (ImageView)inflater.inflate(layoutResource, null);
    Animation animation = AnimationUtils.loadAnimation(this, animationId);
    iv.startAnimation(animation);
    menuItem.setActionView(iv);
}
 
源代码13 项目: Telegram-FOSS   文件: CustomTabsIntent.java
/**
 * Sets the exit animations.
 *
 * @param context Application context.
 * @param enterResId Resource ID of the "enter" animation for the application.
 * @param exitResId Resource ID of the "exit" animation for the browser.
 */
public Builder setExitAnimations(
        @NonNull Context context, @AnimRes int enterResId, @AnimRes int exitResId) {
    Bundle bundle = ActivityOptionsCompat.makeCustomAnimation(
            context, enterResId, exitResId).toBundle();
    mIntent.putExtra(EXTRA_EXIT_ANIMATION_BUNDLE, bundle);
    return this;
}
 
源代码14 项目: Telegram   文件: CustomTabsIntent.java
/**
 * Sets the exit animations.
 *
 * @param context Application context.
 * @param enterResId Resource ID of the "enter" animation for the application.
 * @param exitResId Resource ID of the "exit" animation for the browser.
 */
public Builder setExitAnimations(
        @NonNull Context context, @AnimRes int enterResId, @AnimRes int exitResId) {
    Bundle bundle = ActivityOptionsCompat.makeCustomAnimation(
            context, enterResId, exitResId).toBundle();
    mIntent.putExtra(EXTRA_EXIT_ANIMATION_BUNDLE, bundle);
    return this;
}
 
源代码15 项目: mollyim-android   文件: InviteActivity.java
private Animation loadAnimation(@AnimRes int animResId) {
  final Animation animation = AnimationUtils.loadAnimation(this, animResId);
  animation.setInterpolator(new FastOutSlowInInterpolator());
  return animation;
}
 
源代码16 项目: Matisse-Kotlin   文件: UCropMulti.java
/**
 * @param activityCropExitAnimation activity exit animation
 */
public Options setCropExitAnimation(@AnimRes int activityCropExitAnimation) {
    mOptionBundle.putInt(EXTRA_WINDOW_EXIT_ANIMATION, activityCropExitAnimation);
    return this;
}
 
源代码17 项目: Matisse-Kotlin   文件: UCrop.java
/**
 * @param activityCropExitAnimation activity exit animation
 */
public Options setCropExitAnimation(@AnimRes int activityCropExitAnimation) {
    mOptionBundle.putInt(EXTRA_WINDOW_EXIT_ANIMATION, activityCropExitAnimation);
    return this;
}
 
public PictureWindowAnimationStyle(@AnimRes int activityEnterAnimation,
                                   @AnimRes int activityExitAnimation) {
    super();
    this.activityEnterAnimation = activityEnterAnimation;
    this.activityExitAnimation = activityExitAnimation;
}
 
源代码19 项目: PictureSelector   文件: UCrop.java
/**
 * @param activityCropExitAnimation activity exit animation
 */
public void setCropExitAnimation(@AnimRes int activityCropExitAnimation) {
    mOptionBundle.putInt(EXTRA_WINDOW_EXIT_ANIMATION, activityCropExitAnimation);
}
 
源代码20 项目: Alligator   文件: SimpleTransitionAnimation.java
/**
 * @param enterAnimation animation resource that will be used for an appearing activity/fragment
 * @param exitAnimation  animation resource that will be used for a disappearing activity/fragment
 */
public SimpleTransitionAnimation(@AnimRes int enterAnimation, @AnimRes int exitAnimation) {
	mEnterAnimation = enterAnimation;
	mExitAnimation = exitAnimation;
}
 
源代码21 项目: Telegram-FOSS   文件: CustomTabsIntent.java
/**
 * Sets the start animations.
 *
 * @param context Application context.
 * @param enterResId Resource ID of the "enter" animation for the browser.
 * @param exitResId Resource ID of the "exit" animation for the application.
 */
public Builder setStartAnimations(
        @NonNull Context context, @AnimRes int enterResId, @AnimRes int exitResId) {
    mStartAnimationBundle = ActivityOptionsCompat.makeCustomAnimation(
            context, enterResId, exitResId).toBundle();
    return this;
}
 
源代码22 项目: Telegram   文件: CustomTabsIntent.java
/**
 * Sets the start animations.
 *
 * @param context Application context.
 * @param enterResId Resource ID of the "enter" animation for the browser.
 * @param exitResId Resource ID of the "exit" animation for the application.
 */
public Builder setStartAnimations(
        @NonNull Context context, @AnimRes int enterResId, @AnimRes int exitResId) {
    mStartAnimationBundle = ActivityOptionsCompat.makeCustomAnimation(
            context, enterResId, exitResId).toBundle();
    return this;
}
 
源代码23 项目: Matisse-Kotlin   文件: UCropMulti.java
/**
 * Send the crop Intent from an Activity with a custom request code or animation
 *
 * @param activity    Activity to receive result
 * @param requestCode requestCode for result
 */
public void start(@NonNull Activity activity, int requestCode, @AnimRes int activityCropEnterAnimation) {
    activity.startActivityForResult(getIntent(activity), requestCode);
    activity.overridePendingTransition(activityCropEnterAnimation, R.anim.ucrop_anim_fade_in);
}
 
源代码24 项目: Matisse-Kotlin   文件: UCrop.java
/**
 * Send the crop Intent from an Activity with a custom request code or animation
 *
 * @param activity    Activity to receive result
 * @param requestCode requestCode for result
 */
public void start(@NonNull Activity activity, int requestCode, @AnimRes int activityCropEnterAnimation) {
    activity.startActivityForResult(getIntent(activity), requestCode);
    activity.overridePendingTransition(activityCropEnterAnimation, R.anim.ucrop_anim_fade_in);
}
 
源代码25 项目: PictureSelector   文件: UCrop.java
/**
 * Send the crop Intent from an Activity with a custom request code or animation
 *
 * @param activity    Activity to receive result
 * @param requestCode requestCode for result
 */
public void start(@NonNull Activity activity, int requestCode, @AnimRes int activityCropEnterAnimation) {
    activity.startActivityForResult(getIntent(activity), requestCode);
    activity.overridePendingTransition(activityCropEnterAnimation, R.anim.ucrop_anim_fade_in);
}
 
源代码26 项目: PictureSelector   文件: UCrop.java
/**
 * Send the crop Intent from an Activity with a custom request code or animation
 *
 * @param activity    Activity to receive result
 * @param requestCode requestCode for result
 */
public void startMultiple(@NonNull Activity activity, int requestCode, @AnimRes int activityCropEnterAnimation) {
    activity.startActivityForResult(getMultipleIntent(activity), requestCode);
    activity.overridePendingTransition(activityCropEnterAnimation, R.anim.ucrop_anim_fade_in);
}