切换字体颜色的代码
private int evaluate(float progress, int startValue, int endValue) {
int startA = (startValue >> 24) & 0xff;
int startR = (startValue >> 16) & 0xff;
int startG = (startValue >> 8) & 0xff;
int startB = startValue & 0xff;
int endA = (endValue >> 24) & 0xff;
int endR = (endValue >> 16) & 0xff;
int endG = (endValue >> 8) & 0xff;
int endB = endValue & 0xff;
return (int)((startA + (int) progress * (endA - startA))) << 24 |
(int)((startR + (int) progress * (endR - startR))) << 16 |
(int)((startG + (int) progress * (endG - startG))) << 8 |
(int) ((startB + (int) progress * (endB - startB)));
}
if (positionOffset > 0) {
TabView left = mTabs.get(position);
TabView right = mTabs.get(position + 1);
left.setProgress((1 - positionOffset));
right.setProgress(positionOffset);
}