当前位置: 首页>>代码示例>>Java>>正文


Java AnimatorListenerAdapter类代码示例

本文整理汇总了Java中android.animation.AnimatorListenerAdapter的典型用法代码示例。如果您正苦于以下问题:Java AnimatorListenerAdapter类的具体用法?Java AnimatorListenerAdapter怎么用?Java AnimatorListenerAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AnimatorListenerAdapter类属于android.animation包,在下文中一共展示了AnimatorListenerAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hideProgressBar

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
/**
 */
@Override
void hideProgressBar(SearchView searchView) {
	final CircularProgressBar progressBar = searchView.mProgressBar;
	final ViewPropertyAnimator progressBarAnimator = progressBar.animate();
	progressBarAnimator.setListener(null);
	progressBarAnimator.cancel();
	progressBarAnimator
			.alpha(0.0f)
			.setDuration(UiConfig.ANIMATION_DURATION_SHORT)
			.setListener(new AnimatorListenerAdapter() {
				@Override
				public void onAnimationEnd(Animator animation) {
					progressBar.setVisibility(View.INVISIBLE);
				}
			})
			.start();
	final View icon = searchView.mButtonIcon;
	final ViewPropertyAnimator iconAnimator = icon.animate();
	iconAnimator.setListener(null);
	iconAnimator.cancel();
	icon.setVisibility(View.VISIBLE);
	icon.setScaleX(0.5f);
	icon.setScaleY(0.5f);
	icon.setAlpha(0.0f);
	iconAnimator
			.scaleX(1.0f)
			.scaleY(1.0f)
			.alpha(1.0f)
			.setDuration(UiConfig.ANIMATION_DURATION_SHORT)
			.setInterpolator(iconInterpolator)
			.setListener(null)
			.start();
}
 
开发者ID:universum-studios,项目名称:android_ui,代码行数:36,代码来源:SearchView.java

示例2: createHideItemAnimator

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private Animator createHideItemAnimator(final View item) {
  final float dx = centerItem.getX() - item.getX();
  final float dy = centerItem.getY() - item.getY();

  Animator anim = ObjectAnimator.ofPropertyValuesHolder(
      item,
      AnimatorUtils.scaleX(1f, 0f),
      AnimatorUtils.scaleY(1f, 0f),
      AnimatorUtils.translationX(0f, dx),
      AnimatorUtils.translationY(0f, dy)
  );

  anim.setInterpolator(new DecelerateInterpolator());
  anim.addListener(new AnimatorListenerAdapter() {
    @Override
    public void onAnimationEnd(Animator animation) {
      super.onAnimationEnd(animation);
      item.setTranslationX(0f);
      item.setTranslationY(0f);
    }
  });
  anim.setDuration(50);
  return anim;
}
 
开发者ID:xzg8023,项目名称:ArcLayout-master,代码行数:25,代码来源:DemoLikeTumblrActivity.java

示例3: startTwoLevel

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
@Override
public RefreshKernel startTwoLevel(boolean open) {
    if (open) {
        AnimatorListenerAdapter listener = new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                SmartRefreshLayout.this.notifyStateChanged(RefreshState.TwoLevel);
            }
        };
        ValueAnimator animator = SmartRefreshLayout.this.animSpinner(SmartRefreshLayout.this.getMeasuredHeight());
        if (animator != null && animator == SmartRefreshLayout.this.reboundAnimator) {
            animator.setDuration(SmartRefreshLayout.this.mFloorDuration);
            animator.addListener(listener);
        } else {
            listener.onAnimationEnd(null);
        }
    } else {
        if (animSpinner(0) == null) {
            SmartRefreshLayout.this.notifyStateChanged(RefreshState.None);
        }
    }
    return this;
}
 
开发者ID:scwang90,项目名称:SmartRefreshLayout,代码行数:24,代码来源:SmartRefreshLayout.java

示例4: doStart

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void doStart(long delay) {
    ObjectAnimator topMaskAnimator = ObjectAnimator.ofFloat(topMaskView, "translationY", topMaskView.getTranslationY(), -halfHitBlockHeight);
    ObjectAnimator bottomMaskAnimator = ObjectAnimator.ofFloat(bottomMaskView, "translationY", bottomMaskView.getTranslationY(), halfHitBlockHeight);
    ObjectAnimator maskShadowAnimator = ObjectAnimator.ofFloat(maskReLayout, "alpha", maskReLayout.getAlpha(), 0);

    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(topMaskAnimator).with(bottomMaskAnimator).with(maskShadowAnimator);
    animatorSet.setDuration(800);
    animatorSet.setStartDelay(delay);
    animatorSet.start();

    animatorSet.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            topMaskView.setVisibility(View.GONE);
            bottomMaskView.setVisibility(View.GONE);
            maskReLayout.setVisibility(View.GONE);
            onGameStart();
        }
    });
}
 
开发者ID:Brave-wan,项目名称:SmartRefresh,代码行数:22,代码来源:FunGameHeader.java

示例5: toolbarAnimateHide

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void toolbarAnimateHide() {
    if (mIsActionBarVisible) {
        mCommonToolbar.animate()
                .translationY(-mCommonToolbar.getHeight())
                .setInterpolator(new LinearInterpolator())
                .setDuration(180)
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        toolbarSetElevation(0);
                        hideStatusBar();
                        if (mTocListPopupWindow != null && mTocListPopupWindow.isShowing()) {
                            mTocListPopupWindow.dismiss();
                        }
                    }
                });
        mIsActionBarVisible = false;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:ReadEPubActivity.java

示例6: reset

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void reset() {
    //Animate mobile view back to original position
    final View view = getViewByPosition(mobileViewCurrentPos);
    if (view != null && mobileView != null) {
        float y = getViewRawCoords(view)[1];
        mobileView.animate().y(y).setDuration(MOVE_DURATION).setListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                view.setVisibility(View.VISIBLE);
                if (mobileView != null) {
                    ViewGroup parent = (ViewGroup) mobileView.getParent();
                    parent.removeView(mobileView);
                    mobileView = null;
                }

            }
        });

    }

    dragging = false;
    mobileViewStartY = -1;
    mobileViewCurrentPos = -1;

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:DragDropTouchListener.java

示例7: loadMore

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
public void loadMore() {
    if (mPullLoadMoreListener != null && hasMore) {
        mFooterView.animate()
                .translationY(0)
                .setDuration(300)
                .setInterpolator(new AccelerateDecelerateInterpolator())
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationStart(Animator animation) {
                        mprogressBar.setVisibility(View.VISIBLE);
                        loadMoreText.setText(mContext.getString(R.string.load_more_text));
                        mFooterView.setVisibility(View.VISIBLE);
                    }
                })
                .start();
        invalidate();
        mPullLoadMoreListener.onLoadMore();

    }
}
 
开发者ID:dufangyu1990,项目名称:JKApp,代码行数:21,代码来源:PullLoadMoreRecyclerView.java

示例8: animateRevealHide

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void animateRevealHide(final View viewRoot) {
    int cx = (viewRoot.getLeft() + viewRoot.getRight()) / 2;
    int cy = (viewRoot.getTop() + viewRoot.getBottom()) / 2;
    int initialRadius = viewRoot.getWidth();

    Animator anim = ViewAnimationUtils.createCircularReveal(viewRoot, cx, cy, initialRadius, 0);
    anim.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            viewRoot.setVisibility(View.INVISIBLE);
        }
    });
    anim.setDuration(getResources().getInteger(R.integer.anim_duration_medium));
    anim.start();
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:17,代码来源:RevealActivity.java

示例9: showSharePicker

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void showSharePicker() {
    final boolean hasSubView = presentView != null;
    if (hasSubView) {
        final View focusedChild = ShareView.this.getFocusedChild();
        UiUtils.hideKeyBoard(focusedChild);

        final Animator appearAnimator = animatorFactory.createDisappearAnimator(presentView);
        appearAnimator.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                removeSubViews();
                sharePickerView.setVisibility(VISIBLE);
            }
        });
        appearAnimator.start();
    }
    shareContext = null;
}
 
开发者ID:roshakorost,项目名称:Phial,代码行数:19,代码来源:ShareView.java

示例10: showContent

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
@Override public void showContent() {

    if (adapter.getItemCount() == 0) {
      if (isRestoringViewState()) {
        emptyView.setVisibility(View.VISIBLE);
      } else {
        ObjectAnimator anim = ObjectAnimator.ofFloat(emptyView, "alpha", 0f, 1f).setDuration(300);
        anim.setStartDelay(250);
        anim.addListener(new AnimatorListenerAdapter() {

          @Override public void onAnimationStart(Animator animation) {
            emptyView.setVisibility(View.VISIBLE);
          }
        });
        anim.start();
      }
    } else {
      emptyView.setVisibility(View.GONE);
    }

    super.showContent();
  }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:AuthRefreshRecyclerFragment.java

示例11: animateDragViewToOriginalPosition

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void animateDragViewToOriginalPosition() {
    if (mDragView != null) {
        Animator anim = new LauncherViewPropertyAnimator(mDragView)
                .translationX(0)
                .translationY(0)
                .scaleX(1)
                .scaleY(1)
                .setDuration(REORDERING_DROP_REPOSITION_DURATION);
        anim.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                onPostReorderingAnimationCompleted();
            }
        });
        anim.start();
    }
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:18,代码来源:PagedView.java

示例12: unRevealActivity

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void unRevealActivity(final View revealView, int endCenterX, int endCenterY) {
    int startCenterX = revealView.getWidth() / 2;
    int startCenterY = revealView.getHeight() / 2;
    float startRadius = Math.max(revealView.getWidth(), revealView.getHeight()) * 1.1f;
    float finalRadius = 0;
    Animator circularReveal = ViewAnimationCompatUtils.createCircularReveal(revealView, startCenterX, startCenterY, startRadius, endCenterX, endCenterY, finalRadius);
    circularReveal.setDuration(500);
    circularReveal.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            revealView.setVisibility(View.INVISIBLE);
            finish();
        }
    });
    circularReveal.start();
}
 
开发者ID:yangwencan2002,项目名称:CircularRevealCompat,代码行数:17,代码来源:SecondActivity.java

示例13: createExpandValueAnimator

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private ValueAnimator createExpandValueAnimator() {
    ValueAnimator animator = ValueAnimator.ofFloat(0f, 1f);
    animator.setDuration(DEFAULT_ANIMATION_DURATION_EXPAND);
    animator.setInterpolator(new AccelerateInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            mExpandedScaleFactor[0] = (float) valueAnimator.getAnimatedValue();
            invalidateSelf();
        }
    });
    animator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            notifyExpanded();
        }
    });
    return animator;
}
 
开发者ID:dewarder,项目名称:HoldingButton,代码行数:20,代码来源:HoldingDrawable.java

示例14: animateDragViewToOriginalPosition

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void animateDragViewToOriginalPosition() {
    if (mDragView != null) {
        Animator anim = LauncherAnimUtils.ofPropertyValuesHolder(mDragView,
                new PropertyListBuilder()
                        .scale(1)
                        .translationX(0)
                        .translationY(0)
                        .build())
                .setDuration(REORDERING_DROP_REPOSITION_DURATION);
        anim.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                onPostReorderingAnimationCompleted();
            }
        });
        anim.start();
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:19,代码来源:PagedView.java

示例15: snapChild

import android.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void snapChild(final View animView, final float targetLeft, float velocity) {
    final boolean canBeDismissed = mCallback.canChildBeDismissed(animView);
    AnimatorUpdateListener updateListener = new AnimatorUpdateListener() {
        public void onAnimationUpdate(ValueAnimator animation) {
            onTranslationUpdate(animView, (float) animation.getAnimatedValue(), canBeDismissed);
        }
    };

    Animator anim = getViewTranslationAnimator(animView, targetLeft, updateListener);
    if (anim == null) {
        return;
    }
    int duration = SNAP_ANIM_LEN;
    anim.setDuration(duration);
    anim.addListener(new AnimatorListenerAdapter() {
        public void onAnimationEnd(Animator animator) {
            mSnappingChild = false;
            updateSwipeProgressFromOffset(animView, canBeDismissed);
            mCallback.onChildSnappedBack(animView, targetLeft);
        }
    });
    prepareSnapBackAnimation(animView, anim);
    mSnappingChild = true;
    anim.start();
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:26,代码来源:SwipeHelper.java


注:本文中的android.animation.AnimatorListenerAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。