use of android.animation.ObjectAnimator in project ViewInspector by xfumihiro.
the class EventMenu method showSubMenu.
private void showSubMenu() {
mSubmenuLayout.setVisibility(VISIBLE);
ObjectAnimator animator = ObjectAnimator.ofFloat(mSubmenuLayout, "alpha", 0f, 1f);
animator.setDuration(500).start();
}
use of android.animation.ObjectAnimator in project Hummingbird-for-Android by xiprox.
the class AnimeDetailsActivity method enableFAB.
private void enableFAB() {
if (mActionButton != null) {
mActionButton.setEnabled(true);
ObjectAnimator anim = ObjectAnimator.ofInt(mActionButton.getDrawable(), "alpha", 255);
anim.setDuration(200).start();
}
}
use of android.animation.ObjectAnimator in project LookLook by xinghongfei.
the class MeiziAdapter method bindViewHolderNormal.
private void bindViewHolderNormal(final MeiziViewHolder holder, final int position) {
final Meizi meizi = meiziItemes.get(holder.getAdapterPosition());
holder.imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startDescribeActivity(meizi, holder);
}
});
// holder.textView.setText("视频");
// holder.textView.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// startDescribeActivity(meizi,holder);
// }
// });
Glide.with(mContext).load(meizi.getUrl()).listener(new RequestListener<String, GlideDrawable>() {
@Override
public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
return false;
}
@Override
public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
if (!meizi.hasFadedIn) {
holder.imageView.setHasTransientState(true);
final ObservableColorMatrix cm = new ObservableColorMatrix();
final ObjectAnimator animator = ObjectAnimator.ofFloat(cm, ObservableColorMatrix.SATURATION, 0f, 1f);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
holder.imageView.setColorFilter(new ColorMatrixColorFilter(cm));
}
});
animator.setDuration(2000L);
animator.setInterpolator(new AccelerateInterpolator());
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
holder.imageView.clearColorFilter();
holder.imageView.setHasTransientState(false);
animator.start();
meizi.hasFadedIn = true;
}
});
}
return false;
}
}).diskCacheStrategy(DiskCacheStrategy.SOURCE).centerCrop().into(new DribbbleTarget(holder.imageView, false));
}
use of android.animation.ObjectAnimator in project LookLook by xinghongfei.
the class TopNewsAdapter method bindViewHolderNormal.
private void bindViewHolderNormal(final TopNewsViewHolder holder, final int position) {
final NewsBean newsBeanItem = topNewitems.get(holder.getAdapterPosition());
if (DBUtils.getDB(mContext).isRead(Config.TOPNEWS, newsBeanItem.getTitle(), 1)) {
holder.textView.setTextColor(Color.GRAY);
holder.sourceTextview.setTextColor(Color.GRAY);
} else {
holder.textView.setTextColor(Color.BLACK);
holder.sourceTextview.setTextColor(Color.BLACK);
}
holder.imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
DBUtils.getDB(mContext).insertHasRead(Config.ZHIHU, newsBeanItem.getTitle(), 1);
holder.textView.setTextColor(Color.GRAY);
holder.sourceTextview.setTextColor(Color.GRAY);
startTopnewsActivity(newsBeanItem, holder);
}
});
holder.textView.setText(newsBeanItem.getTitle());
holder.sourceTextview.setText(newsBeanItem.getSource());
holder.linearLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startTopnewsActivity(newsBeanItem, holder);
}
});
Glide.with(mContext).load(newsBeanItem.getImgsrc()).listener(new RequestListener<String, GlideDrawable>() {
@Override
public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
return false;
}
@Override
public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
if (!newsBeanItem.hasFadedIn) {
holder.imageView.setHasTransientState(true);
final ObservableColorMatrix cm = new ObservableColorMatrix();
final ObjectAnimator animator = ObjectAnimator.ofFloat(cm, ObservableColorMatrix.SATURATION, 0f, 1f);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
holder.imageView.setColorFilter(new ColorMatrixColorFilter(cm));
}
});
animator.setDuration(2000L);
animator.setInterpolator(new AccelerateInterpolator());
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
holder.imageView.clearColorFilter();
holder.imageView.setHasTransientState(false);
animator.start();
newsBeanItem.hasFadedIn = true;
}
});
}
return false;
}
}).diskCacheStrategy(DiskCacheStrategy.SOURCE).centerCrop().override(widthPx, heighPx).into(new DribbbleTarget(holder.imageView, false));
}
use of android.animation.ObjectAnimator in project WordPress-Android by wordpress-mobile.
the class WPNetworkImageView method fadeIn.
private void fadeIn() {
ObjectAnimator alpha = ObjectAnimator.ofFloat(this, View.ALPHA, 0.25f, 1f);
alpha.setDuration(FADE_TRANSITION);
alpha.start();
}
Aggregations