当前位置: 首页>>代码示例>>Java>>正文


Java ViewCompat.setScaleX方法代码示例

本文整理汇总了Java中android.support.v4.view.ViewCompat.setScaleX方法的典型用法代码示例。如果您正苦于以下问题:Java ViewCompat.setScaleX方法的具体用法?Java ViewCompat.setScaleX怎么用?Java ViewCompat.setScaleX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.view.ViewCompat的用法示例。


在下文中一共展示了ViewCompat.setScaleX方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resetPageTransformer

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
public static void resetPageTransformer(List<? extends View> views) {
    if (views == null) {
        return;
    }

    for (View view : views) {
        view.setVisibility(View.VISIBLE);
        ViewCompat.setAlpha(view, 1);
        ViewCompat.setPivotX(view, view.getMeasuredWidth() * 0.5f);
        ViewCompat.setPivotY(view, view.getMeasuredHeight() * 0.5f);
        ViewCompat.setTranslationX(view, 0);
        ViewCompat.setTranslationY(view, 0);
        ViewCompat.setScaleX(view, 1);
        ViewCompat.setScaleY(view, 1);
        ViewCompat.setRotationX(view, 0);
        ViewCompat.setRotationY(view, 0);
        ViewCompat.setRotation(view, 0);
    }
}
 
开发者ID:weileng11,项目名称:KUtils-master,代码行数:20,代码来源:BGABannerUtil.java

示例2: 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));
}
 
开发者ID:liu-xiao-dong,项目名称:JD-Test,代码行数:11,代码来源:ZoomPageTransformer.java

示例3: setAnimationProgress

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
 * Pre API 11, this does an alpha animation.
 * @param progress
 */
private void setAnimationProgress(float progress) {
    if (isAlphaUsedForScale()) {
        setColorViewAlpha((int) (progress * MAX_ALPHA));
    } else {
        ViewCompat.setScaleX(mCircleView, progress);
        ViewCompat.setScaleY(mCircleView, progress);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:SwipeRefreshLayout.java

示例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);
}
 
开发者ID:devzwy,项目名称:NeiHanDuanZiTV,代码行数:9,代码来源:DepthPageTransformer.java

示例5: scaleOvershootView

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
 * 从0.5放大...
 */
public static void scaleOvershootView(View view) {
    ViewCompat.setScaleX(view, 0.5f);
    ViewCompat.setScaleY(view, 0.5f);
    view.animate()
            .scaleX(1)
            .scaleY(1)
            .setInterpolator(new OvershootInterpolator(2))
            .setDuration(300)
            .start();
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:14,代码来源:AnimUtil.java

示例6: clearAnimator

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
 * clear the animator of the target view.
 * @param v the target view
 */
public static void clearAnimator(View v){
    ViewCompat.setAlpha(v, 1);
    ViewCompat.setScaleY(v, 1);
    ViewCompat.setScaleX(v, 1);
    ViewCompat.setTranslationY(v, 0);
    ViewCompat.setTranslationX(v, 0);
    ViewCompat.setRotation(v, 0);
    ViewCompat.setRotationY(v, 0);
    ViewCompat.setRotationX(v, 0);
    ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2);
    ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2);
    ViewCompat.animate(v).setInterpolator(null).setStartDelay(0);
}
 
开发者ID:LightSun,项目名称:android-util2,代码行数:18,代码来源:AnimUtils.java

示例7: 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);
}
 
开发者ID:weileng11,项目名称:KUtils-master,代码行数:8,代码来源:DepthPageTransformer.java

示例8: setTitleScale

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void setTitleScale(float scale) {
    if (type == Type.TABLET) {
        return;
    }

    ViewCompat.setScaleX(titleView, scale);
    ViewCompat.setScaleY(titleView, scale);
}
 
开发者ID:A-Miracle,项目名称:QiangHongBao,代码行数:9,代码来源:BottomBarTab.java

示例9: 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);
}
 
开发者ID:weileng11,项目名称:KUtils-master,代码行数:11,代码来源:ZoomFadePageTransformer.java

示例10: 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);
    }
}
 
开发者ID:Justson,项目名称:AgentWebX5,代码行数:12,代码来源:ProgressLayout.java

示例11: moveSpinner

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void moveSpinner(float overscrollTop) {
    float slingshotDist;
    this.mProgress.showArrow(true);
    float dragPercent = Math.min(1.0f, Math.abs(overscrollTop / this.mTotalDragDistance));
    float adjustedPercent = (((float) Math.max(((double) dragPercent) - 0.4d, 0.0d)) * 5.0f) / 3.0f;
    float extraOS = Math.abs(overscrollTop) - this.mTotalDragDistance;
    if (this.mUsingCustomStart) {
        slingshotDist = this.mSpinnerFinalOffset - ((float) this.mOriginalOffsetTop);
    } else {
        slingshotDist = this.mSpinnerFinalOffset;
    }
    float tensionSlingshotPercent = Math.max(0.0f, Math.min(extraOS, DECELERATE_INTERPOLATION_FACTOR * slingshotDist) / slingshotDist);
    float tensionPercent = ((float) (((double) (tensionSlingshotPercent / 4.0f)) - Math.pow((double) (tensionSlingshotPercent / 4.0f), 2.0d))) * DECELERATE_INTERPOLATION_FACTOR;
    int targetY = this.mOriginalOffsetTop + ((int) ((slingshotDist * dragPercent) + ((slingshotDist * tensionPercent) * DECELERATE_INTERPOLATION_FACTOR)));
    if (this.mCircleView.getVisibility() != 0) {
        this.mCircleView.setVisibility(0);
    }
    if (!this.mScale) {
        ViewCompat.setScaleX(this.mCircleView, 1.0f);
        ViewCompat.setScaleY(this.mCircleView, 1.0f);
    }
    if (this.mScale) {
        setAnimationProgress(Math.min(1.0f, overscrollTop / this.mTotalDragDistance));
    }
    if (overscrollTop < this.mTotalDragDistance) {
        if (this.mProgress.getAlpha() > STARTING_PROGRESS_ALPHA) {
            if (!isAnimationRunning(this.mAlphaStartAnimation)) {
                startProgressAlphaStartAnimation();
            }
        }
    } else if (this.mProgress.getAlpha() < 255) {
        if (!isAnimationRunning(this.mAlphaMaxAnimation)) {
            startProgressAlphaMaxAnimation();
        }
    }
    this.mProgress.setStartEndTrim(0.0f, Math.min(MAX_PROGRESS_ANGLE, adjustedPercent * MAX_PROGRESS_ANGLE));
    this.mProgress.setArrowScale(Math.min(1.0f, adjustedPercent));
    this.mProgress.setProgressRotation(((-0.25f + (0.4f * adjustedPercent)) + (DECELERATE_INTERPOLATION_FACTOR * tensionPercent)) * DRAG_RATE);
    setTargetOffsetTopAndBottom(targetY - this.mCurrentTargetOffsetTop, true);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:41,代码来源:SwipeRefreshLayout.java

示例12: 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);
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:7,代码来源:ScaleInRightAnimator.java

示例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 */);
}
 
开发者ID:unixzii,项目名称:android-source-codes,代码行数:49,代码来源:SwipeRefreshLayout.java

示例14: TouchActionMove

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private boolean TouchActionMove(MotionEvent ev) {
    final int pointerIndex = MotionEventCompat.findPointerIndex(ev, mActivePointerId);
    if (pointerIndex < 0) return true;
    final float y = MotionEventCompat.getY(ev, pointerIndex);
    float overScrollTop;
    switch (mType) {
        case BOTTOM:
            overScrollTop = (mInitialMotionY - y) * 0.5f;
            break;
        case TOP:
        default:
            overScrollTop = (y - mInitialMotionY) * 0.5f;
            break;
    }
    if (isReady) {
        mProgress.showArrow(true);
        float originalDragPercent = overScrollTop / mTotalDragDistance;
        if (originalDragPercent < 0) return true;
        float dragPercent = Math.min(1f, Math.abs(originalDragPercent));
        float adjustedPercent = (float) Math.max(dragPercent - 0.4, 0) * 5 / 3;
        float extraOS = Math.abs(overScrollTop) - mTotalDragDistance;
        float slingshotDist = mSpinnerFinalOffset;
        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;
        if (mType == SwipeToRefreshLayoutType.TOP) {
            targetY = mOriginalOffsetTop + (int) ((slingshotDist * dragPercent) + extraMove);
        } else {
            targetY = mOriginalOffsetTop - (int) ((slingshotDist * dragPercent) + extraMove);
        }
        if (mLoadingView.getVisibility() != View.VISIBLE) {
            mLoadingView.setVisibility(View.VISIBLE);
        }
        ViewCompat.setScaleX(mLoadingView, 1f);
        ViewCompat.setScaleY(mLoadingView, 1f);
        if (overScrollTop < mTotalDragDistance) {
            if (mProgress.getAlpha() > (int) (0.3f * 255) && !isAnimationRunning(mAlphaStartAnimation)) {
                startProgressAlphaStartAnimation();
            }
            float strokeStart = adjustedPercent * 0.8f;
            mProgress.setStartEndTrim(0f, Math.min(0.8f, strokeStart));
            mProgress.setArrowScale(Math.min(1f, adjustedPercent));
        } else {
            if (mProgress.getAlpha() < 255 && !isAnimationRunning(mAlphaMaxAnimation)) {
                startProgressAlphaMaxAnimation();
            }
        }
        float rotation = (-0.25f + 0.4f * adjustedPercent + tensionPercent * 2) * 0.5f;
        mProgress.setProgressRotation(rotation);
        setTargetOffsetTopAndBottom(targetY - mCurrentTargetOffsetTop, true);
    }
    return false;
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:55,代码来源:SwipeToRefreshLayout.java

示例15: handleScale

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
public void handleScale(float scale) {
    scale = 0.1f + 0.9f * scale;
    ViewCompat.setScaleX(mPullDownView, scale);
    ViewCompat.setPivotY(mPullDownView, mPullDownView.getHeight());
    ViewCompat.setScaleY(mPullDownView, scale);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:BGAMeiTuanRefreshView.java


注:本文中的android.support.v4.view.ViewCompat.setScaleX方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。