當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。