android.support.v4.view.ViewCompat#setScaleY ( )源码实例Demo

下面列出了android.support.v4.view.ViewCompat#setScaleY ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: standardlib   文件: FloatLabelLayout.java
/**
 * Hide the label
 */
private void hideLabel(boolean animate) {
    if (animate) {
        float scale = mEditText.getTextSize() / mLabel.getTextSize();
        ViewCompat.setScaleX(mLabel, 1f);
        ViewCompat.setScaleY(mLabel, 1f);
        ViewCompat.setTranslationY(mLabel, 0f);

        ViewCompat.animate(mLabel)
                .translationY(mLabel.getHeight())
                .setDuration(ANIMATION_DURATION)
                .scaleX(scale)
                .scaleY(scale)
                .setListener(new ViewPropertyAnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(View view) {
                        mLabel.setVisibility(INVISIBLE);
                        mEditText.setHint(mHint);
                    }
                })
                .setInterpolator(mInterpolator).start();
    } else {
        mLabel.setVisibility(INVISIBLE);
        mEditText.setHint(mHint);
    }
}
 
源代码2 项目: 365browser   文件: FloatLabelLayout.java
/**
 * Hide the label
 */
private void hideLabel(boolean animate) {
    if (animate) {
        float scale = mEditText.getTextSize() / mLabel.getTextSize();
        ViewCompat.setScaleX(mLabel, 1f);
        ViewCompat.setScaleY(mLabel, 1f);
        ViewCompat.setTranslationY(mLabel, 0f);

        ViewCompat.animate(mLabel)
                .translationY(mLabel.getHeight())
                .setDuration(ANIMATION_DURATION)
                .scaleX(scale)
                .scaleY(scale)
                .setListener(new ViewPropertyAnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(View view) {
                        mLabel.setVisibility(INVISIBLE);
                        mEditText.setHint(mHint);
                    }
                })
                .setInterpolator(mInterpolator).start();
    } else {
        mLabel.setVisibility(INVISIBLE);
        mEditText.setHint(mHint);
    }
}
 
源代码3 项目: KUtils-master   文件: BGABannerUtil.java
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);
    }
}
 
源代码4 项目: fangzhuishushenqi   文件: SwipeRefreshLayout.java
/**
 * 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);
    }
}
 
@Override
    protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) {
        // @TODO https://code.google.com/p/android/issues/detail?id=80863
        ViewCompat.setPivotY(holder.itemView, 0);
//        holder.itemView.setPivotY(0);
        ViewCompat.setScaleX(holder.itemView, 0);
        ViewCompat.setScaleY(holder.itemView, 0);
    }
 
源代码6 项目: SprintNBA   文件: MaterialHeadView.java
@Override
public void onPull(MaterialRefreshLayout materialRefreshLayout, float fraction) {
    if(materialWaveView != null)
    {
        materialWaveView.onPull(materialRefreshLayout, fraction);
    }
    if(circleProgressBar != null)
    {
        circleProgressBar.onPull(materialRefreshLayout, fraction);
        float a = Util.limitValue(1,fraction);
        ViewCompat.setScaleX(circleProgressBar, 1);
        ViewCompat.setScaleY(circleProgressBar, 1);
        ViewCompat.setAlpha(circleProgressBar, a);
    }
}
 
源代码7 项目: SprintNBA   文件: MaterialFooterView.java
@Override
public void onPull(MaterialRefreshLayout materialRefreshLayout, float fraction) {
    if (materialWaveView != null) {
        materialWaveView.onPull(materialRefreshLayout, fraction);
    }
    if (circleProgressBar != null) {
        circleProgressBar.onPull(materialRefreshLayout, fraction);
        float a = Util.limitValue(1, fraction);
        ViewCompat.setScaleX(circleProgressBar, 1);
        ViewCompat.setScaleY(circleProgressBar, 1);
        ViewCompat.setAlpha(circleProgressBar, a);
    }
}
 
源代码8 项目: styT   文件: MaterialFooterView.java
@Override
public void onPull(MaterialRefreshLayout materialRefreshLayout, float fraction) {
    if (materialWaveView != null) {
        materialWaveView.onPull(materialRefreshLayout, fraction);
    }
    if (circleProgressBar != null) {
        circleProgressBar.onPull(materialRefreshLayout, fraction);
        float a = Util.limitValue(1, fraction);
        ViewCompat.setScaleX(circleProgressBar, 1);
        ViewCompat.setScaleY(circleProgressBar, 1);
        ViewCompat.setAlpha(circleProgressBar, a);
    }
}
 
源代码9 项目: TwinklingRefreshLayout   文件: ProgressLayout.java
@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 项目: styT   文件: MaterialHeadView.java
@Override
public void onComlete(MaterialRefreshLayout materialRefreshLayout) {
    if (materialWaveView != null) {
        materialWaveView.onComlete(materialRefreshLayout);
    }
    if (circleProgressBar != null) {
        circleProgressBar.onComlete(materialRefreshLayout);
        ViewCompat.setTranslationY(circleProgressBar, 0);
        ViewCompat.setScaleX(circleProgressBar, 0);
        ViewCompat.setScaleY(circleProgressBar, 0);
    }

}
 
源代码11 项目: PrismView   文件: PrismActivity.java
private void mainViewUpdate(double currentValue) {
  float ratio =  (float) SpringUtil.mapValueFromRangeToRange(currentValue, 0, 1,
      1, smallRatio);
  ViewCompat.setScaleX(mainView, ratio);
  ViewCompat.setScaleY(mainView, ratio);
  ViewCompat.setAlpha(mainView, ratio);
}
 
源代码12 项目: LoyalNativeSlider   文件: DepthPageTransformer.java
@Override
protected void onTransform(View view, float position) {
	if (position <= 0f) {
           ViewCompat.setTranslationX(view,0f);
           ViewCompat.setScaleX(view,1f);
           ViewCompat.setScaleY(view,1f);
	} else if (position <= 1f) {
		final float scaleFactor = MIN_SCALE + (1 - MIN_SCALE) * (1 - Math.abs(position));
           ViewCompat.setAlpha(view,1-position);
           ViewCompat.setPivotY(view,0.5f * view.getHeight());
           ViewCompat.setTranslationX(view,view.getWidth() * - position);
           ViewCompat.setScaleX(view,scaleFactor);
           ViewCompat.setScaleY(view, scaleFactor);
	}
}
 
源代码13 项目: AgentWebX5   文件: ProgressLayout.java
@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);
    }
}
 
源代码14 项目: styT   文件: MaterialHeaderView.java
@Override
public void onPull(MaterialRefreshLayout materialRefreshLayout, float fraction) {
    if (materialWaveView != null) {
        materialWaveView.onPull(materialRefreshLayout, fraction);
    }
    if (circleProgressBar != null) {
        circleProgressBar.onPull(materialRefreshLayout, fraction);
        float a = Util.limitValue(1, fraction);
        ViewCompat.setScaleX(circleProgressBar, a);
        ViewCompat.setScaleY(circleProgressBar, a);
        ViewCompat.setAlpha(circleProgressBar, a);
    }
}
 
源代码15 项目: BitkyShop   文件: MaterialFooterView.java
@Override
public void onComlete(MaterialRefreshLayout materialRefreshLayout) {
    if (materialWaveView != null) {
        materialWaveView.onComlete(materialRefreshLayout);
    }
    if (circleProgressBar != null) {
        circleProgressBar.onComlete(materialRefreshLayout);
        ViewCompat.setTranslationY(circleProgressBar, 0);
        ViewCompat.setScaleX(circleProgressBar, 0);
        ViewCompat.setScaleY(circleProgressBar, 0);
    }


}
 
源代码16 项目: UltimateAndroid   文件: ScaleInOutItemAnimator.java
@Override
protected void prepareAnimateAdd(RecyclerView.ViewHolder holder) {
    retrieveOriginalScale(holder);
    ViewCompat.setScaleX(holder.itemView, mInitialScaleX);
    ViewCompat.setScaleY(holder.itemView, mInitialScaleY);
}
 
public void scaleWithKeepingAspectRatio(float scale) {
  ViewCompat.setScaleX(this, scale);
  ViewCompat.setScaleY(this, scale);
}
 
源代码18 项目: RecyclerviewAnimators   文件: ScaleInAnimator.java
@Override
protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) {
    ViewCompat.setScaleX(holder.itemView, 0);
    ViewCompat.setScaleY(holder.itemView, 0);
}
 
@Override
protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) {
    ViewCompat.setPivotX(holder.itemView, 0);
    ViewCompat.setScaleX(holder.itemView, 0);
    ViewCompat.setScaleY(holder.itemView, 0);
}
 
源代码20 项目: GearLoadingProject   文件: GearLoadingLayout.java
private void selectShowAnimation(boolean showDialog) {
    if (mActivityContentView == null || isAnimating)
        return;

    if (showDialog) {
        mActivityContentView.addView(GearLoadingLayout.this);
    }

    this.showDialog = showDialog;
    float from = 0f;
    float to = 0f;
    boolean xAxis = false;
    boolean scaleDialog = false;


    switch (mShowMode) {
        case TOP:
            from = -mDialogHeight;
            to = 0;
            break;
        case BOTTOM:
            from = mDialogHeight;
            to = 0;
            break;
        case LEFT:
            from = -mDialogWidth;
            to = 0;
            xAxis = true;
            break;
        case RIGHT:
            from = mDialogWidth;
            to = 0;
            xAxis = true;
            break;
        case CENTER:
            scaleDialog = true;
            break;
        default:
            break;
    }

    setGearLayoutWrapperGravity();
    applyStyle();
    start();
    if (scaleDialog) {
        ViewCompat.setScaleX(mGearLayoutWrapper, showDialog ? 0 : 1);
        ViewCompat.setScaleY(mGearLayoutWrapper, showDialog ? 0 : 1);
        ViewCompat.animate(mGearLayoutWrapper).scaleX(showDialog ? 1 : 0).scaleY(showDialog ? 1 : 0).setDuration(showDialogDuration).withStartAction(startAction).withEndAction(endAction).start();
    } else {
        if (!xAxis) {
            ViewCompat.setTranslationY(mGearLayoutWrapper, showDialog ? from : to);
            ViewCompat.animate(mGearLayoutWrapper).translationY(showDialog ? to : from).setDuration(showDialogDuration).withStartAction(startAction).withEndAction(endAction).start();
        } else {
            ViewCompat.setTranslationX(mGearLayoutWrapper, showDialog ? from : to);
            ViewCompat.animate(mGearLayoutWrapper).translationX(showDialog ? to : from).setDuration(showDialogDuration).withStartAction(startAction).withEndAction(endAction).start();
        }
    }

    ViewCompat.setAlpha(mMainBackground, showDialog ? 0 : isEnableBlur ? 1 : mMainBackgroundAlpha);
    ViewCompat.animate(mMainBackground).alpha(showDialog ? isEnableBlur ? 1 : mMainBackgroundAlpha : 0).setDuration(showDialogDuration).start();
}
 
 同类方法