List of usage examples for android.animation Animator start
public void start()
From source file:com.taobao.weex.ui.animation.WXAnimationModule.java
public static void startAnimation(WXSDKInstance mWXSDKInstance, WXComponent component, @NonNull WXAnimationBean animationBean, @Nullable String callback) { if (component == null) { return;/*from w w w . ja v a 2 s . c o m*/ } if (component.getHostView() == null) { AnimationHolder holder = new AnimationHolder(animationBean, callback); component.postAnimation(holder); return; } try { Animator animator = createAnimator(animationBean, component.getHostView(), mWXSDKInstance.getViewPortWidth()); if (animator != null) { Animator.AnimatorListener animatorCallback = createAnimatorListener(mWXSDKInstance, callback); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) { component.getHostView().setLayerType(View.LAYER_TYPE_HARDWARE, null); } Interpolator interpolator = createTimeInterpolator(animationBean); if (animatorCallback != null) { animator.addListener(animatorCallback); } if (interpolator != null) { animator.setInterpolator(interpolator); } animator.setDuration(animationBean.duration); animator.start(); } } catch (RuntimeException e) { e.printStackTrace(); WXLogUtils.e("", e); } }
From source file:com.angelatech.yeyelive.view.PeriscopeLayout.java
public void addHeart() { ImageView imageView = new ImageView(getContext()); //?/*from w w w . j a v a2 s . c om*/ imageView.setImageDrawable(drawables[random.nextInt(7)]); imageView.setLayoutParams(lp); addView(imageView); Animator set = getAnimator(imageView); set.addListener(new AnimEndListener(imageView)); set.start(); }
From source file:nu.yona.app.customview.graph.TimeFrameGraph.java
public void startAnimation() { Animator anim = ObjectAnimator.ofFloat(this, "endPoint", 0, 1); anim.setDuration(animationDuration); anim.start(); }
From source file:com.yahoo.mobile.client.android.yodel.ui.ImageGalleryActivity.java
@SuppressLint("NewApi") public void showSystemUi() { getWindow().getDecorView()/*w w w.j av a2 s. c o m*/ .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_FULLSCREEN // keep status bar hidden | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); Animator anim = AnimatorInflater.loadAnimator(this, R.animator.fade_show); anim.setTarget(mCaptionPagerIndicator); anim.start(); getSupportActionBar().show(); }
From source file:com.yahoo.mobile.client.android.yodel.ui.ImageGalleryActivity.java
@SuppressLint("NewApi") public void hideSystemUi() { getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); Animator anim = AnimatorInflater.loadAnimator(this, R.animator.fade_hide); anim.setTarget(mCaptionPagerIndicator); anim.start(); getSupportActionBar().hide();//from w w w . ja va 2 s .c om }
From source file:org.hawkular.client.android.util.ViewTransformer.java
@UiThread public void rotate() { Animator animator = ObjectAnimator.ofFloat(view, View.ROTATION, view.getRotation(), view.getRotation() + 180);/*from w ww . java 2 s . c o m*/ animator.setInterpolator(new FastOutSlowInInterpolator()); animator.setDuration(Durations.MEDIUM); animator.start(); }
From source file:com.unipiazza.material2stepslogin.fragments.SecondStepFragment.java
private void createReveal(final View myView) { // get the center for the clipping circle int cx = (myView.getWidth()) / 2; int cy = (myView.getHeight()) / 2; // get the final radius for the clipping circle int finalRadius = Math.max(myView.getWidth(), myView.getHeight()); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { Animator animator = android.view.ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);//from w ww .j a v a 2 s. com animator.setDuration(800); animator.start(); } else { SupportAnimator animator = ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius); animator.setInterpolator(new AccelerateDecelerateInterpolator()); animator.setDuration(800); animator.start(); } }
From source file:io.vit.vitio.StartScreens.DetailFragment.java
@TargetApi(Build.VERSION_CODES.LOLLIPOP) void circularRevealSchoolImage() { // previously invisible view displayImage.setVisibility(View.INVISIBLE); final View myView = displayImage; // get the center for the clipping circle int cx = myView.getMeasuredWidth() / 2; int cy = myView.getMeasuredHeight() / 2; // get the final radius for the clipping circle int finalRadius = Math.max(myView.getWidth(), myView.getHeight()) / 2; // create the animator for this view (the start radius is zero) Animator anim = ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius); // make the view visible and start the animation myView.setVisibility(View.VISIBLE); anim.start(); }
From source file:com.hippo.widget.ProgressView.java
private void startAnimationActually() { ArrayList<Animator> animators = mAnimators; int N = animators.size(); for (int i = 0; i < N; i++) { Animator animator = animators.get(i); if (!animator.isRunning()) { animator.start(); }//from www. j a v a 2s. co m } }
From source file:com.rks.musicx.ui.adapters.AlbumListAdapter.java
@Override public void onBindViewHolder(AlbumListAdapter.AlbumViewHolder holder, int position) { Album albums = getItem(position);//from w w w . j a va 2s. com if (layoutID == R.layout.item_grid_view || layoutID == R.layout.recent_list) { int pos = holder.getAdapterPosition(); if (lastpos < pos) { for (Animator animator : Helper.getAnimator(holder.backgroundColor)) { animator.setDuration(duration); animator.setInterpolator(interpolator); animator.start(); } } holder.AlbumArtwork.setTransitionName("TransitionArtwork" + position); holder.AlbumName.setText(albums.getAlbumName()); holder.ArtistName.setText(albums.getArtistName()); ArtworkUtils.ArtworkLoader(getContext(), 300, 600, albums.getAlbumName(), albums.getId(), new palette() { @Override public void palettework(Palette palette) { final int[] colors = Helper.getAvailableColor(getContext(), palette); holder.backgroundColor.setBackgroundColor(colors[0]); holder.AlbumName.setTextColor(Helper.getTitleTextColor(colors[0])); holder.ArtistName.setTextColor(Helper.getTitleTextColor(colors[0])); Helper.animateViews(getContext(), holder.backgroundColor, colors[0]); } }, holder.AlbumArtwork); holder.menu.setVisibility(View.GONE); } if (layoutID == R.layout.item_list_view) { holder.AlbumListName.setText(albums.getAlbumName()); holder.ArtistListName.setText(albums.getArtistName()); ArtworkUtils.ArtworkLoader(getContext(), 300, 600, albums.getAlbumName(), albums.getId(), new palette() { @Override public void palettework(Palette palette) { } }, holder.AlbumListArtwork); if (Extras.getInstance().getDarkTheme() || Extras.getInstance().getBlackTheme()) { holder.AlbumListName.setTextColor(Color.WHITE); holder.ArtistListName .setTextColor(ContextCompat.getColor(getContext(), R.color.darkthemeTextColor)); } } }