本文整理匯總了Java中com.nineoldandroids.animation.ArgbEvaluator類的典型用法代碼示例。如果您正苦於以下問題:Java ArgbEvaluator類的具體用法?Java ArgbEvaluator怎麽用?Java ArgbEvaluator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ArgbEvaluator類屬於com.nineoldandroids.animation包,在下文中一共展示了ArgbEvaluator類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import com.nineoldandroids.animation.ArgbEvaluator; //導入依賴的package包/類
/**
* 控件初始化
**/
private void init() {
LayoutInflater.from(mContext).inflate(R.layout.layout_vertical_notication_scroll_bar, this);
mSwitchViewGroup = (SwitchViewGroup) findViewById(R.id.switchViewGroup);
ll_vertical_notication_scroll_bar_container = (LinearLayout) findViewById(R.id.ll_vertical_notication_scroll_bar_container);
iv_layout_vertical_notication_scroll_bar_close = (ImageView) findViewById(R.id.iv_layout_vertical_notication_scroll_bar_close);
iv_layout_vertical_notication_scroll_bar_close.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
closeScrollBar();
}
});
mDatas = new ArrayList<>();
tempArgbEvaluator = new ArgbEvaluator();
mMhandler = new Handler();
}
示例2: initView
import com.nineoldandroids.animation.ArgbEvaluator; //導入依賴的package包/類
private void initView() {
removeAllViews();
addView(LayoutInflater.from(getContext()).inflate(R.layout.layout_check_header, null),
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
ivLight = findViewById(R.id.iv_light);
tvStatus = (TextView) findViewById(R.id.tv_check_status);
btnCheck = (Button) findViewById(R.id.btn_check);
llPoints = (LinearLayout) findViewById(R.id.ll_points);
tvPoints = (TextView) findViewById(R.id.tv_points);
btnCheck.setOnClickListener(checkClick);
bgBeginColor = getResources().getColor(R.color.check_points_begin);
bgEndColor = getResources().getColor(R.color.check_points_end);
bgMiddleColor = getResources().getColor(R.color.check_points_middle);
bgEvaluator = new ArgbEvaluator();
setPassedCheckCount(0);
}
示例3: initView
import com.nineoldandroids.animation.ArgbEvaluator; //導入依賴的package包/類
private void initView() {
removeAllViews();
addView(LayoutInflater.from(getContext()).inflate(R.layout.layout_r_check_header, null),
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
ivLight = findViewById(R.id.iv_light);
tvStatus = (TextView) findViewById(R.id.tv_check_status);
ibtnCheck = (ImageButton) findViewById(R.id.ibtn_check);
llPoints = (LinearLayout) findViewById(R.id.ll_points);
tvPoints = (TextView) findViewById(R.id.tv_points);
flBottom = (FrameLayout) findViewById(R.id.fl_bottom);
findViewById(R.id.ibtn_rcheck_info).setOnClickListener(infoClick);
ibtnCheck.setOnClickListener(checkClick);
bgBeginColor = getResources().getColor(R.color.check_points_begin);
bgEndColor = getResources().getColor(R.color.rcheck_end);
bgMiddleColor = getResources().getColor(R.color.check_points_middle);
bgEvaluator = new ArgbEvaluator();
setPassedCheckCount(0);
}
示例4: onFlagChanged
import com.nineoldandroids.animation.ArgbEvaluator; //導入依賴的package包/類
private void onFlagChanged(final CardFlag oldFlag, final CardFlag newFlag) {
int flagColor = CARD_BACKGROUND_COLOR_NOFLAG;
if (newFlag != null) {
flagColor = newFlag.getColor();
}
ValueAnimator fade = ObjectAnimator.ofInt(mCardPaint,
"color", mCardPaint.getColor(), flagColor);
fade.setDuration(500);
fade.setEvaluator(new ArgbEvaluator());
fade.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator value) {
onFlagChangedUpdate(oldFlag, newFlag, value);
invalidate();
}
});
fade.start();
}
示例5: backgroundColor
import com.nineoldandroids.animation.ArgbEvaluator; //導入依賴的package包/類
/**
* Background color animation builder.
*
* @param colors the colors
* @return the animation builder
*/
public AnimationBuilder backgroundColor(int... colors) {
for (View view : views) {
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "backgroundColor", colors);
objectAnimator.setEvaluator(new ArgbEvaluator());
this.animatorList.add(objectAnimator);
}
return this;
}
示例6: textColor
import com.nineoldandroids.animation.ArgbEvaluator; //導入依賴的package包/類
/**
* Text color animation builder.
*
* @param colors the colors
* @return the animation builder
*/
public AnimationBuilder textColor(int... colors) {
for (View view : views) {
if (view instanceof TextView) {
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "textColor", colors);
objectAnimator.setEvaluator(new ArgbEvaluator());
this.animatorList.add(objectAnimator);
}
}
return this;
}
示例7: backgroundColor
import com.nineoldandroids.animation.ArgbEvaluator; //導入依賴的package包/類
public AnimationBuilder backgroundColor(int... colors) {
for (View view : this.views) {
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "backgroundColor", colors);
objectAnimator.setEvaluator(new ArgbEvaluator());
this.animatorList.add(objectAnimator);
}
return this;
}
示例8: textColor
import com.nineoldandroids.animation.ArgbEvaluator; //導入依賴的package包/類
public AnimationBuilder textColor(int... colors) {
for (View view : this.views) {
if (view instanceof TextView) {
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "textColor", colors);
objectAnimator.setEvaluator(new ArgbEvaluator());
this.animatorList.add(objectAnimator);
}
}
return this;
}
示例9: MyAnimationView
import com.nineoldandroids.animation.ArgbEvaluator; //導入依賴的package包/類
public MyAnimationView(Context context) {
super(context);
// Animate background color
// Note that setting the background color will automatically invalidate the
// view, so that the animated color, and the bouncing balls, get redisplayed on
// every frame of the animation.
ValueAnimator colorAnim = ObjectAnimator.ofInt(this, "backgroundColor", RED, BLUE);
colorAnim.setDuration(3000);
colorAnim.setEvaluator(new ArgbEvaluator());
colorAnim.setRepeatCount(ValueAnimator.INFINITE);
colorAnim.setRepeatMode(ValueAnimator.REVERSE);
colorAnim.start();
}
示例10: init
import com.nineoldandroids.animation.ArgbEvaluator; //導入依賴的package包/類
private void init() {
mColorEvaluator = new ArgbEvaluator();
}
示例11: createAnimation
import com.nineoldandroids.animation.ArgbEvaluator; //導入依賴的package包/類
/**
* 根據指定的顏色來創建顏色動畫
* @param colors 指定的顏色
*/
private void createAnimation(int... colors) {
colorAnim = ObjectAnimator.ofInt(this, "backgroundColor", colors);
colorAnim.setEvaluator(new ArgbEvaluator());
colorAnim.setDuration(DURATION);
}
示例12: buildAnimator
import com.nineoldandroids.animation.ArgbEvaluator; //導入依賴的package包/類
@Override
protected void buildAnimator() {
ObjectAnimator animator = (ObjectAnimator) getAnimator();
if (animator == null) {
if (mPropertyType == PropertyDataType.UNKNOWN) {
Log.w(TAG, "Property data type unknown, cannot animate.");
return;
}
Object target = getTarget();
String propertyName = AnimationUtils.translatePropertyName(target,
mPropertyName);
Object actualObject = target;
if (target instanceof TiViewProxy) {
TiUIView intermediateObject = ((TiViewProxy) target).peekView();
if (intermediateObject != null) {
actualObject = intermediateObject.getNativeView();
if (actualObject != null
&& propertyName.equals(PROPERTY_BACKGROUND_COLOR)
&& mIntValues.length == 1) {
// There is no "getBackgroundColor" on Android views,
// so we wrap it.
actualObject = new ViewWrapper((View) actualObject);
}
} else {
Log.w(TAG, "View not available for animation.");
}
}
if (actualObject == null) {
Log.w(TAG, "Object not available for animation (null).");
return;
}
switch (mPropertyType) {
case FLOAT:
animator = ObjectAnimator.ofFloat(actualObject,
propertyName, mFloatValues);
break;
case INT:
animator = ObjectAnimator.ofInt(actualObject, propertyName,
mIntValues);
break;
case UNKNOWN:
break;
}
}
if (mRepeatCount != AndroidAnimation.NO_INT_VALUE) {
animator.setRepeatCount(mRepeatCount);
}
if (mRepeatMode != AndroidAnimation.NO_INT_VALUE) {
animator.setRepeatMode(mRepeatMode);
}
if (mEvaluator != AndroidAnimation.NO_INT_VALUE) {
switch (mEvaluator) {
case AndroidAnimation.INT_EVALUATOR:
animator.setEvaluator(new IntEvaluator());
break;
case AndroidAnimation.FLOAT_EVALUATOR:
animator.setEvaluator(new FloatEvaluator());
break;
case AndroidAnimation.ARGB_EVALUATOR:
animator.setEvaluator(new ArgbEvaluator());
break;
default:
Log.w(TAG, "Evaluator set to unknown value: " + mEvaluator);
}
}
setAnimator(animator);
super.setCommonAnimatorProperties();
}
示例13: color
import com.nineoldandroids.animation.ArgbEvaluator; //導入依賴的package包/類
@NonNull
public Animator color(int from, int to, float duration, @Nullable Interpolator interpolator, boolean isText) {
ObjectAnimator animator;
if (mView instanceof TextView && isText) {
TextView tv = (TextView) mView;
tv.setTextColor(from);
animator = ObjectAnimator.ofInt(mView, "textColor", from, to);
} else {
mView.setBackgroundColor(from);
animator = ObjectAnimator.ofInt(mView, "backgroundColor", from, to);
}
setProperties(animator, duration, interpolator);
animator.setEvaluator(new ArgbEvaluator());
return animator;
}