use of com.nineoldandroids.animation.ObjectAnimator in project XhsEmoticonsKeyboard by w446108264.
the class AnimEmoticonsIndicatorView method playBy.
public void playBy(int startPosition, int nextPosition, PageSetEntity pageSetEntity) {
if (!checkPageSetEntity(pageSetEntity)) {
return;
}
updateIndicatorCount(pageSetEntity.getPageCount());
boolean isShowInAnimOnly = false;
if (startPosition < 0 || nextPosition < 0 || nextPosition == startPosition) {
startPosition = nextPosition = 0;
}
if (startPosition < 0) {
isShowInAnimOnly = true;
startPosition = nextPosition = 0;
}
final ImageView imageViewStrat = mImageViews.get(startPosition);
final ImageView imageViewNext = mImageViews.get(nextPosition);
ObjectAnimator anim1 = ObjectAnimator.ofFloat(imageViewStrat, "scaleX", 1.0f, 0.25f);
ObjectAnimator anim2 = ObjectAnimator.ofFloat(imageViewStrat, "scaleY", 1.0f, 0.25f);
if (mPlayByOutAnimatorSet != null && mPlayByOutAnimatorSet.isRunning()) {
mPlayByOutAnimatorSet.cancel();
mPlayByOutAnimatorSet = null;
}
mPlayByOutAnimatorSet = new AnimatorSet();
mPlayByOutAnimatorSet.play(anim1).with(anim2);
mPlayByOutAnimatorSet.setDuration(100);
ObjectAnimator animIn1 = ObjectAnimator.ofFloat(imageViewNext, "scaleX", 0.25f, 1.0f);
ObjectAnimator animIn2 = ObjectAnimator.ofFloat(imageViewNext, "scaleY", 0.25f, 1.0f);
if (mPlayByInAnimatorSet != null && mPlayByInAnimatorSet.isRunning()) {
mPlayByInAnimatorSet.cancel();
mPlayByInAnimatorSet = null;
}
mPlayByInAnimatorSet = new AnimatorSet();
mPlayByInAnimatorSet.play(animIn1).with(animIn2);
mPlayByInAnimatorSet.setDuration(100);
if (isShowInAnimOnly) {
mPlayByInAnimatorSet.start();
return;
}
anim1.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
imageViewStrat.setImageDrawable(mDrawableNomal);
ObjectAnimator animFil1l = ObjectAnimator.ofFloat(imageViewStrat, "scaleX", 1.0f);
ObjectAnimator animFill2 = ObjectAnimator.ofFloat(imageViewStrat, "scaleY", 1.0f);
AnimatorSet mFillAnimatorSet = new AnimatorSet();
mFillAnimatorSet.play(animFil1l).with(animFill2);
mFillAnimatorSet.start();
imageViewNext.setImageDrawable(mDrawableSelect);
mPlayByInAnimatorSet.start();
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
mPlayByOutAnimatorSet.start();
}
use of com.nineoldandroids.animation.ObjectAnimator in project ActionBarSherlock by JakeWharton.
the class MainActivity method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) {
case android.R.id.home:
// TODO handle clicking the app icon/logo
return false;
case R.id.menu_refresh:
// switch to a progress animation
item.setActionView(R.layout.indeterminate_progress_action);
return true;
case R.id.menu_both:
// rotation animation of green fragment
rotateLeftFrag();
return true;
case R.id.menu_text:
// alpha animation of blue fragment
ObjectAnimator alpha = ObjectAnimator.ofFloat(rightFrag.getView(), "alpha", 1f, 0f);
alpha.setRepeatMode(ObjectAnimator.REVERSE);
alpha.setRepeatCount(1);
alpha.setDuration(800);
alpha.start();
return true;
case R.id.menu_logo:
useLogo = !useLogo;
item.setChecked(useLogo);
getSupportActionBar().setDisplayUseLogoEnabled(useLogo);
return true;
case R.id.menu_up:
showHomeUp = !showHomeUp;
item.setChecked(showHomeUp);
getSupportActionBar().setDisplayHomeAsUpEnabled(showHomeUp);
return true;
case R.id.menu_nav_tabs:
item.setChecked(true);
showTabsNav();
return true;
case R.id.menu_nav_label:
item.setChecked(true);
showStandardNav();
return true;
case R.id.menu_nav_drop_down:
item.setChecked(true);
showDropDownNav();
return true;
case R.id.menu_bak_none:
item.setChecked(true);
getSupportActionBar().setBackgroundDrawable(null);
return true;
case R.id.menu_bak_gradient:
item.setChecked(true);
getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ad_action_bar_gradient_bak));
return true;
default:
return super.onOptionsItemSelected(item);
}
}
use of com.nineoldandroids.animation.ObjectAnimator in project NineOldAndroids by JakeWharton.
the class PathAnimationActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pathanimator);
mButton = (Button) findViewById(R.id.button);
mButtonProxy = AnimatorProxy.wrap(mButton);
// Set up the path we're animating along
AnimatorPath path = new AnimatorPath();
path.moveTo(0, 0);
path.lineTo(0, 300);
path.curveTo(100, 0, 300, 900, 400, 500);
// Set up the animation
final ObjectAnimator anim = ObjectAnimator.ofObject(this, "buttonLoc", new PathEvaluator(), path.getPoints().toArray());
anim.setDuration(1000);
mButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
anim.start();
}
});
}
use of com.nineoldandroids.animation.ObjectAnimator in project MaterialCalendar by Haoxiqiang.
the class MemoFragment method upRed.
void upRed() {
startRedX = ViewHelper.getX(mRed);
startRedY = ViewHelper.getY(mRed);
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mRed, "y", ViewHelper.getY(mRed), mBluePair.getBottom() - mRed.getHeight() / 2);
objectAnimator.addListener(new SimpleListener() {
@Override
public void onAnimationEnd(Animator animation) {
disappearRed();
}
});
objectAnimator.setDuration(650);
objectAnimator.setInterpolator(ACCELERATE_DECELERATE);
objectAnimator.start();
}
use of com.nineoldandroids.animation.ObjectAnimator in project MaterialCalendar by Haoxiqiang.
the class MemoFragment method raise.
void raise() {
startBluePairBottom = mBluePair.getBottom();
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(mBluePair, "bottom", mBluePair.getBottom(), mBluePair.getTop() + dpToPx(100));
objectAnimator.addListener(new SimpleListener() {
@Override
public void onAnimationEnd(Animator animation) {
appearRed();
}
});
objectAnimator.setInterpolator(ACCELERATE_DECELERATE);
objectAnimator.start();
}
Aggregations