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


Java ViewCompat.setScaleY方法代码示例

本文整理汇总了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);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:26,代码来源:FloatLabelLayout.java

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

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

示例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--;
        }
    }
}
 
开发者ID:Ramotion,项目名称:garland-view-android,代码行数:29,代码来源:TailItemTransformer.java

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

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

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

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

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

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

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


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