本文整理汇总了Java中android.support.v4.view.ViewCompat.setScaleY方法的典型用法代码示例。如果您正苦于以下问题:Java ViewCompat.setScaleY方法的具体用法?Java ViewCompat.setScaleY怎么用?Java ViewCompat.setScaleY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.view.ViewCompat
的用法示例。
在下文中一共展示了ViewCompat.setScaleY方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showLabel
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
* Show the label
*/
private void showLabel(boolean animate) {
if (animate) {
mLabel.setVisibility(View.VISIBLE);
ViewCompat.setTranslationY(mLabel, mLabel.getHeight());
float scale = mEditText.getTextSize() / mLabel.getTextSize();
ViewCompat.setScaleX(mLabel, scale);
ViewCompat.setScaleY(mLabel, scale);
ViewCompat.animate(mLabel)
.translationY(0f)
.scaleY(1f)
.scaleX(1f)
.setDuration(ANIMATION_DURATION)
.setListener(null)
.setInterpolator(mInterpolator).start();
} else {
mLabel.setVisibility(VISIBLE);
}
mEditText.setHint(null);
}
示例2: handleLeftPage
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void handleLeftPage(View view, float position) {
ViewCompat.setTranslationX(view, -view.getWidth() * position);
ViewCompat.setPivotX(view, view.getWidth() * 0.5f);
ViewCompat.setPivotY(view, view.getHeight() * 0.5f);
ViewCompat.setScaleX(view, 1 + position);
ViewCompat.setScaleY(view, 1 + position);
if (position < -0.95f) {
ViewCompat.setAlpha(view, 0);
} else {
ViewCompat.setAlpha(view, 1);
}
}
示例3: handleRightPage
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void handleRightPage(View view, float position) {
ViewCompat.setTranslationX(view, -view.getWidth() * position);
ViewCompat.setPivotX(view, view.getWidth() * 0.5f);
ViewCompat.setPivotY(view, view.getHeight() * 0.5f);
ViewCompat.setScaleX(view, 1 - position);
ViewCompat.setScaleY(view, 1 - position);
ViewCompat.setAlpha(view, 1 - position);
}
示例4: handleRightPage
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void handleRightPage(View view, float position) {
ViewCompat.setAlpha(view, 1 - position);
ViewCompat.setTranslationX(view, -view.getWidth() * position);
float scale = mMinScale + (1 - mMinScale) * (1 - position);
ViewCompat.setScaleX(view, scale);
ViewCompat.setScaleY(view, scale);
}
示例5: handleLeftPage
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void handleLeftPage(View view, float position) {
float scale = Math.max(mMinScale, 1 + position);
float vertMargin = view.getHeight() * (1 - scale) / 2;
float horzMargin = view.getWidth() * (1 - scale) / 2;
ViewCompat.setTranslationX(view, horzMargin - vertMargin / 2);
ViewCompat.setScaleX(view, scale);
ViewCompat.setScaleY(view, scale);
ViewCompat.setAlpha(view, mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
}
示例6: applyAlphaScaleEffect
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void applyAlphaScaleEffect(@NonNull ViewGroup vg, @NonNull TransformParams params, int viewHeight) {
int j = 0;
for (int i = 0, cnt = vg.getChildCount(); i < cnt; i++) {
final View view = vg.getChildAt(i);
ViewCompat.setPivotX(view, params.pivotX);
ViewCompat.setAlpha(view, params.alphaChild);
boolean isHeaderView;
if (params.floorDiff == 1f || view.getTag(R.id.tail_header_tag) == null) {
isHeaderView = view.getY() < viewHeight;
view.setTag(R.id.tail_header_tag, isHeaderView);
} else {
isHeaderView = (Boolean) view.getTag(R.id.tail_header_tag);
}
final float scale = isHeaderView ? params.scale : params.scaleChild;
ViewCompat.setScaleX(view, scale);
ViewCompat.setScaleY(view, scale);
if (isHeaderView) {
ViewCompat.setTranslationY(view, params.offsetY);
} else {
ViewCompat.setTranslationY(view, j * params.offsetY);
j--;
}
}
}
示例7: reset
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
* reset the view to default status
*
* @param target
*/
public void reset(View target) {
ViewCompat.setAlpha(target, 1);
ViewCompat.setScaleX(target, 1);
ViewCompat.setScaleY(target, 1);
ViewCompat.setTranslationX(target, 0);
ViewCompat.setTranslationY(target, 0);
ViewCompat.setRotation(target, 0);
ViewCompat.setRotationY(target, 0);
ViewCompat.setRotationX(target, 0);
}
示例8: handleLeftPage
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void handleLeftPage(View view, float position) {
ViewCompat.setAlpha(view, 1);
ViewCompat.setTranslationX(view, 0);
ViewCompat.setScaleX(view, 1);
ViewCompat.setScaleY(view, 1);
}
示例9: onPullReleasing
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void onPullReleasing(float fraction, float maxHeadHeight, float headHeight) {
mIsBeingDragged = false;
if (fraction >= 1f) {
ViewCompat.setScaleX(mCircleView, 1f);
ViewCompat.setScaleY(mCircleView, 1f);
} else {
ViewCompat.setScaleX(mCircleView, fraction);
ViewCompat.setScaleY(mCircleView, fraction);
}
}
示例10: handleRightPage
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void handleRightPage(View view, float position) {
float scale = Math.max(mMinScale, 1 - position);
float vertMargin = view.getHeight() * (1 - scale) / 2;
float horzMargin = view.getWidth() * (1 - scale) / 2;
ViewCompat.setTranslationX(view, -horzMargin + vertMargin / 2);
ViewCompat.setScaleX(view, scale);
ViewCompat.setScaleY(view, scale);
ViewCompat.setAlpha(view, mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha));
}
示例11: startAnim
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void startAnim(float maxHeadHeight, float headHeight) {
mCircleView.setVisibility(View.VISIBLE);
mCircleView.getBackground().setAlpha(MAX_ALPHA);
mProgress.setAlpha(MAX_ALPHA);
ViewCompat.setScaleX(mCircleView, 1f);
ViewCompat.setScaleY(mCircleView, 1f);
mProgress.setArrowScale(1f);
mProgress.start();
}
示例12: prepareAnimateAdd
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
protected void prepareAnimateAdd(RecyclerView.ViewHolder holder) {
retrieveOriginalScale(holder);
ViewCompat.setScaleX(holder.itemView, 0);
ViewCompat.setScaleY(holder.itemView, 0);
}
示例13: moveSpinner
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void moveSpinner(float overscrollTop) {
mProgress.showArrow(true);
float originalDragPercent = overscrollTop / mTotalDragDistance;
float dragPercent = Math.min(1f, Math.abs(originalDragPercent));
float adjustedPercent = (float) Math.max(dragPercent - .4, 0) * 5 / 3;
float extraOS = Math.abs(overscrollTop) - mTotalDragDistance;
float slingshotDist = mUsingCustomStart ? mSpinnerOffsetEnd - mOriginalOffsetTop
: mSpinnerOffsetEnd;
float tensionSlingshotPercent = Math.max(0, Math.min(extraOS, slingshotDist * 2)
/ slingshotDist);
float tensionPercent = (float) ((tensionSlingshotPercent / 4) - Math.pow(
(tensionSlingshotPercent / 4), 2)) * 2f;
float extraMove = (slingshotDist) * tensionPercent * 2;
int targetY = mOriginalOffsetTop + (int) ((slingshotDist * dragPercent) + extraMove);
// where 1.0f is a full circle
if (mCircleView.getVisibility() != View.VISIBLE) {
mCircleView.setVisibility(View.VISIBLE);
}
if (!mScale) {
ViewCompat.setScaleX(mCircleView, 1f);
ViewCompat.setScaleY(mCircleView, 1f);
}
if (mScale) {
setAnimationProgress(Math.min(1f, overscrollTop / mTotalDragDistance));
}
if (overscrollTop < mTotalDragDistance) {
if (mProgress.getAlpha() > STARTING_PROGRESS_ALPHA
&& !isAnimationRunning(mAlphaStartAnimation)) {
// Animate the alpha
startProgressAlphaStartAnimation();
}
} else {
if (mProgress.getAlpha() < MAX_ALPHA && !isAnimationRunning(mAlphaMaxAnimation)) {
// Animate the alpha
startProgressAlphaMaxAnimation();
}
}
float strokeStart = adjustedPercent * .8f;
mProgress.setStartEndTrim(0f, Math.min(MAX_PROGRESS_ANGLE, strokeStart));
mProgress.setArrowScale(Math.min(1f, adjustedPercent));
float rotation = (-0.25f + .4f * adjustedPercent + tensionPercent * 2) * .5f;
mProgress.setProgressRotation(rotation);
setTargetOffsetTopAndBottom(targetY - mCurrentTargetOffsetTop, true /* requires update */);
}
示例14: preAnimateAddImpl
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) {
ViewCompat.setScaleX(holder.itemView, 0);
ViewCompat.setScaleY(holder.itemView, 0);
}
示例15: preAnimateAddImpl
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) {
ViewCompat.setPivotX(holder.itemView, holder.itemView.getWidth());
ViewCompat.setScaleX(holder.itemView, 0);
ViewCompat.setScaleY(holder.itemView, 0);
}