本文整理汇总了Java中android.support.v4.view.ViewCompat.getScaleX方法的典型用法代码示例。如果您正苦于以下问题:Java ViewCompat.getScaleX方法的具体用法?Java ViewCompat.getScaleX怎么用?Java ViewCompat.getScaleX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.view.ViewCompat
的用法示例。
在下文中一共展示了ViewCompat.getScaleX方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startScaleDownReturnToStartAnimation
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void startScaleDownReturnToStartAnimation(int from,
Animation.AnimationListener listener) {
mFrom = from;
if (isAlphaUsedForScale()) {
mStartingScale = mRefreshView.getAlpha();
} else {
mStartingScale = ViewCompat.getScaleX(mRefreshView);
}
mScaleDownToStartAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
float targetScale = (mStartingScale + (-mStartingScale * interpolatedTime));
setAnimationProgress(targetScale);
moveToStart(interpolatedTime);
}
};
mScaleDownToStartAnimation.setDuration(SCALE_DOWN_DURATION);
if (listener != null) {
mScaleDownToStartAnimation.setAnimationListener(listener);
}
mRefreshView.clearAnimation();
mRefreshView.startAnimation(mScaleDownToStartAnimation);
}
示例2: startScaleDownReturnToStartAnimation
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void startScaleDownReturnToStartAnimation(int from,
AnimationListener listener) {
mFrom = from;
if (isAlphaUsedForScale()) {
mStartingScale = mProgress.getAlpha();
} else {
mStartingScale = ViewCompat.getScaleX(mCircleView);
}
mScaleDownToStartAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
float targetScale = (mStartingScale + (-mStartingScale * interpolatedTime));
setAnimationProgress(targetScale);
moveToStart(interpolatedTime);
}
};
mScaleDownToStartAnimation.setDuration(SCALE_DOWN_DURATION);
if (listener != null) {
mCircleView.setAnimationListener(listener);
}
mCircleView.clearAnimation();
mCircleView.startAnimation(mScaleDownToStartAnimation);
}
示例3: startScaleDownReturnToStartAnimation
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void startScaleDownReturnToStartAnimation(int from,
AnimationListener listener) {
mFrom = from;
mStartingScale = ViewCompat.getScaleX(mHeadViewContainer);
mScaleDownToStartAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime,
Transformation t) {
float targetScale = (mStartingScale + (-mStartingScale * interpolatedTime));
setAnimationProgress(targetScale);
moveToStart(interpolatedTime);
}
};
mScaleDownToStartAnimation.setDuration(SCALE_DOWN_DURATION);
if (listener != null) {
mHeadViewContainer.setAnimationListener(listener);
}
mHeadViewContainer.clearAnimation();
mHeadViewContainer.startAnimation(mScaleDownToStartAnimation);
}
示例4: startScaleDownReturnToStartAnimation
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void startScaleDownReturnToStartAnimation(final CircleImageView view, int from,
Animation.AnimationListener listener) {
mFrom = from;
if (isAlphaUsedForScale()) {
mStartingScale = view == tCircleView ? tProgress.getAlpha() : bProgress.getAlpha();
} else {
mStartingScale = ViewCompat.getScaleX(view);
}
mScaleDownToStartAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
float targetScale = (mStartingScale + (-mStartingScale * interpolatedTime));
setAnimationProgress(view, targetScale);
moveToStart(interpolatedTime);
}
};
mScaleDownToStartAnimation.setDuration(SCALE_DOWN_DURATION);
if (listener != null) {
view.setAnimationListener(listener);
}
view.clearAnimation();
view.startAnimation(mScaleDownToStartAnimation);
}
示例5: startScaleDownReturnToStartAnimation
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void startScaleDownReturnToStartAnimation(final CircleImageView view, int from,
Animation.AnimationListener listener) {
mFrom = from;
if (isAlphaUsedForScale()) {
mStartingScale = bProgress.getAlpha();
} else {
mStartingScale = ViewCompat.getScaleX(view);
}
mScaleDownToStartAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
float targetScale = (mStartingScale + (-mStartingScale * interpolatedTime));
setAnimationProgress(view, targetScale);
moveToStart(interpolatedTime);
}
};
mScaleDownToStartAnimation.setDuration(SCALE_DOWN_DURATION);
if (listener != null) {
view.setAnimationListener(listener);
}
view.clearAnimation();
view.startAnimation(mScaleDownToStartAnimation);
}
示例6: startScaleDownReturnToStartAnimation
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void startScaleDownReturnToStartAnimation(int from,
Animation.AnimationListener listener) {
mFrom = from;
if (isAlphaUsedForScale()) {
mStartingScale = mProgress.getAlpha();
} else {
mStartingScale = ViewCompat.getScaleX(mCircleView);
}
mScaleDownToStartAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
float targetScale = (mStartingScale + (-mStartingScale * interpolatedTime));
setAnimationProgress(targetScale);
moveToStart(interpolatedTime);
}
};
mScaleDownToStartAnimation.setDuration(SCALE_DOWN_DURATION);
if (listener != null) {
mCircleView.setAnimationListener(listener);
}
mCircleView.clearAnimation();
mCircleView.startAnimation(mScaleDownToStartAnimation);
}
示例7: startScaleDownReturnToStartAnimation
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void startScaleDownReturnToStartAnimation(int from,
AnimationListener listener) {
mFrom = from;
if (isAlphaUsedForScale()) {
mStartingScale = mProgress.getAlpha();
} else {
mStartingScale = ViewCompat.getScaleX(mCircleView);
}
mScaleDownToStartAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
float targetScale = (mStartingScale + (-mStartingScale * interpolatedTime));
setAnimationProgress(targetScale);
moveToStart(interpolatedTime);
}
};
mScaleDownToStartAnimation.setDuration(SCALE_DOWN_DURATION);
if (listener != null) {
mCircleView.setAnimationListener(listener);
}
mCircleView.clearAnimation();
mCircleView.startAnimation(mScaleDownToStartAnimation);
}
示例8: startScaleDownReturnToStartAnimation
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void startScaleDownReturnToStartAnimation(int from,
Animation.AnimationListener listener) {
mFrom = from;
mStartingScale = ViewCompat.getScaleX(mHeadViewContainer);
mScaleDownToStartAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime,
Transformation t) {
float targetScale = (mStartingScale + (-mStartingScale * interpolatedTime));
setAnimationProgress(targetScale);
moveToStart(interpolatedTime);
}
};
mScaleDownToStartAnimation.setDuration(SCALE_DOWN_DURATION);
if (listener != null) {
mHeadViewContainer.setAnimationListener(listener);
}
mHeadViewContainer.clearAnimation();
mHeadViewContainer.startAnimation(mScaleDownToStartAnimation);
}
示例9: startScaleDownReturnToStartAnimation
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void startScaleDownReturnToStartAnimation(int from, AnimationListener listener) {
this.mFrom = from;
if (isAlphaUsedForScale()) {
this.mStartingScale = (float) this.mProgress.getAlpha();
} else {
this.mStartingScale = ViewCompat.getScaleX(this.mCircleView);
}
this.mScaleDownToStartAnimation = new Animation() {
public void applyTransformation(float interpolatedTime, Transformation t) {
SwipeRefreshLayout.this.setAnimationProgress(SwipeRefreshLayout.this.mStartingScale + ((-SwipeRefreshLayout.this.mStartingScale) * interpolatedTime));
SwipeRefreshLayout.this.moveToStart(interpolatedTime);
}
};
this.mScaleDownToStartAnimation.setDuration(150);
if (listener != null) {
this.mCircleView.setAnimationListener(listener);
}
this.mCircleView.clearAnimation();
this.mCircleView.startAnimation(this.mScaleDownToStartAnimation);
}
示例10: getActiveCardPosition
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
* @return active card position or RecyclerView.NO_POSITION
*/
public int getActiveCardPosition() {
if (scrollRequestedPosition != RecyclerView.NO_POSITION) {
return scrollRequestedPosition;
} else {
int result = RecyclerView.NO_POSITION;
View biggestView = null;
float lastScaleX = 0f;
for (int i = 0, cnt = getChildCount(); i < cnt; i++) {
final View child = getChildAt(i);
final int viewLeft = getDecoratedLeft(child);
if (viewLeft >= activeCardRight) {
continue;
}
final float scaleX = ViewCompat.getScaleX(child);
if (lastScaleX < scaleX && viewLeft < activeCardCenter) {
lastScaleX = scaleX;
biggestView = child;
}
}
if (biggestView != null) {
result = getPosition(biggestView);
}
return result;
}
}
示例11: retrieveOriginalScale
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void retrieveOriginalScale(RecyclerView.ViewHolder holder) {
mOriginalScaleX = ViewCompat.getScaleX(holder.itemView);
mOriginalScaleY = ViewCompat.getScaleY(holder.itemView);
}
示例12: isClosed
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
public boolean isClosed() {
return ViewCompat.getScaleX(back) == SCALE_CLOSED;
}
示例13: startScaleDownReturnToStartAnimation
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void startScaleDownReturnToStartAnimation(int from,
AnimationListener listener) {
mFrom = from;
mStartingScale = ViewCompat.getScaleX(mHeadViewContainer);
mScaleDownToStartAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime,
Transformation t) {
float targetScale = (mStartingScale + (-mStartingScale * interpolatedTime));
setAnimationProgress(targetScale);
moveToStart(interpolatedTime);
}
};
mScaleDownToStartAnimation.setDuration(SCALE_DOWN_DURATION);
if (listener != null) {
mHeadViewContainer.setAnimationListener(listener);
}
mHeadViewContainer.clearAnimation();
mHeadViewContainer.startAnimation(mScaleDownToStartAnimation);
}