當前位置: 首頁>>代碼示例>>Java>>正文


Java View.getRotationX方法代碼示例

本文整理匯總了Java中android.view.View.getRotationX方法的典型用法代碼示例。如果您正苦於以下問題:Java View.getRotationX方法的具體用法?Java View.getRotationX怎麽用?Java View.getRotationX使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.View的用法示例。


在下文中一共展示了View.getRotationX方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: prepare

import android.view.View; //導入方法依賴的package包/類
/** 初始化數據 */
private void prepare(CoordinatorLayout parent, View child, View dependency) {
    mDependStartX = (int) dependency.getX();
    mDependStartY = (int) dependency.getY();
    mDependStartWidth = dependency.getWidth();
    mDependStartHeight = dependency.getHeight();
    mStartX = (int) child.getX();
    mStartY = (int) child.getY();
    mStartWidth = child.getWidth();
    mStartHeight = child.getHeight();
    mStartAlpha = child.getAlpha();
    mStartRotateX = child.getRotationX();
    mStartRotateY = child.getRotationY();

    //特殊處理y方向變化
    if (mDependTargetY == UNSPECIFIED_INT && dependency instanceof AppBarLayout) {
        mDependTargetY = ((AppBarLayout) dependency).getTotalScrollRange();
    }
    // 背景顏色漸變
    if (child.getBackground() instanceof ColorDrawable) mStartBackgroundColor = ((ColorDrawable) child.getBackground()).getColor();
    // 自定義動畫
    if (mAnimationId != 0) {
        mAnimation = AnimationUtils.loadAnimation(child.getContext(), mAnimationId);
        mAnimation.initialize(child.getWidth(), child.getHeight(), parent.getWidth(), parent.getHeight());
    }
    // 兼容5.0以上的沉浸模式
    if (Build.VERSION.SDK_INT > 16 && parent.getFitsSystemWindows() && targetY != UNSPECIFIED_INT) {
        targetY += getStatusBarHeight(parent.getContext());
    }
    isPrepared = true;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:32,代碼來源:SimpleViewBehavior.java

示例2: getRotationX

import android.view.View; //導入方法依賴的package包/類
public static float getRotationX(View view) {
    if (View10.NEED_PROXY) {
        return View10.wrap(view).getRotationX();
    } else {
        return view.getRotationX();
    }
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:8,代碼來源:ViewProxy.java

示例3: getValue

import android.view.View; //導入方法依賴的package包/類
/**
 * This method gets the value of the named property from the View object.
 *
 * @param propertyConstant The property whose value should be returned
 * @return float The value of the named property
 */
private float getValue(int propertyConstant) {
    //final View.TransformationInfo info = mView.mTransformationInfo;
    View v = mView.get();
    if (v != null) {
        switch (propertyConstant) {
            case TRANSLATION_X:
                //return info.mTranslationX;
                return v.getTranslationX();
            case TRANSLATION_Y:
                //return info.mTranslationY;
                return v.getTranslationY();
            case ROTATION:
                //return info.mRotation;
                return v.getRotation();
            case ROTATION_X:
                //return info.mRotationX;
                return v.getRotationX();
            case ROTATION_Y:
                //return info.mRotationY;
                return v.getRotationY();
            case SCALE_X:
                //return info.mScaleX;
                return v.getScaleX();
            case SCALE_Y:
                //return info.mScaleY;
                return v.getScaleY();
            case X:
                //return v.mLeft + info.mTranslationX;
                return v.getX();
            case Y:
                //return v.mTop + info.mTranslationY;
                return v.getY();
            case ALPHA:
                //return info.mAlpha;
                return v.getAlpha();
        }
    }
    return 0;
}
 
開發者ID:junchenChow,項目名稱:exciting-app,代碼行數:46,代碼來源:ViewPropertyAnimatorHC.java

示例4: getRotation

import android.view.View; //導入方法依賴的package包/類
@Override
public final float getRotation(@NonNull final Axis axis, @NonNull final AbstractItem item) {
    ensureNotNull(axis, "The axis may not be null");
    ensureNotNull(item, "The view may not be null");
    View view = item.getView();

    if (getOrientationInvariantAxis(axis) == Axis.DRAGGING_AXIS) {
        return view.getRotationY();
    } else {
        return view.getRotationX();
    }
}
 
開發者ID:michael-rapp,項目名稱:ChromeLikeTabSwitcher,代碼行數:13,代碼來源:PhoneArithmetics.java

示例5: getValue

import android.view.View; //導入方法依賴的package包/類
private float getValue(int propertyConstant) {
    View v = (View) this.mView.get();
    if (v != null) {
        switch (propertyConstant) {
            case 1:
                return v.getTranslationX();
            case 2:
                return v.getTranslationY();
            case 4:
                return v.getScaleX();
            case 8:
                return v.getScaleY();
            case 16:
                return v.getRotation();
            case 32:
                return v.getRotationX();
            case 64:
                return v.getRotationY();
            case 128:
                return v.getX();
            case 256:
                return v.getY();
            case 512:
                return v.getAlpha();
        }
    }
    return 0.0f;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:29,代碼來源:ViewPropertyAnimatorHC.java

示例6: updateView

import android.view.View; //導入方法依賴的package包/類
public void updateView(View v) {
    if (v != null) {
        this.alpha = v.getAlpha();
        this.x = v.getX();
        this.y = v.getY();
        this.z = atLeastLollipop ? v.getZ() : 0;
        this.width = v.getWidth();
        this.height = v.getHeight();
        this.expansionScaleX = v.getScaleX();
        this.expansionScaleY = v.getScaleY();
        this.dispositionAngle = v.getRotation();
        this.dispositionAngleX = v.getRotationX();
        this.dispositionAngleY = v.getRotationY();
    }
}
 
開發者ID:rjsvieira,項目名稱:morphos,代碼行數:16,代碼來源:ViewDefault.java

示例7: getRotation

import android.view.View; //導入方法依賴的package包/類
@Override
public final float getRotation(@NonNull final Axis axis, @NonNull final View view) {
    ensureNotNull(axis, "The axis may not be null");
    ensureNotNull(view, "The view may not be null");

    if (getOrientationInvariantAxis(axis) == Axis.DRAGGING_AXIS) {
        return view.getRotationY();
    } else {
        return view.getRotationX();
    }
}
 
開發者ID:NeoTerm,項目名稱:NeoTerm,代碼行數:12,代碼來源:PhoneArithmetics.java

示例8: getRotationX

import android.view.View; //導入方法依賴的package包/類
static float getRotationX(View view) {
    return view.getRotationX();
}
 
開發者ID:alibaba,項目名稱:LuaViewPlayground,代碼行數:4,代碼來源:ViewHelper.java

示例9: getRotationX

import android.view.View; //導入方法依賴的package包/類
public static float getRotationX(View view) {
    return view.getRotationX();
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:4,代碼來源:ViewCompatHC.java

示例10: getAnimationFor

import android.view.View; //導入方法依賴的package包/類
@Override
public Animator getAnimationFor(AnimationBody animationBody, View view) {

    final float startRotation = view.getRotationX();
    final float endRotation = startRotation + 180f;

    final PropertyValuesHolder rotationPVH =
            PropertyValuesHolder.ofFloat(View.ROTATION_X, startRotation, endRotation);

    final ObjectAnimator animation =
            ObjectAnimator.ofPropertyValuesHolder(view, rotationPVH);

    return animation;
}
 
開發者ID:Appolica,項目名稱:Flubber,代碼行數:15,代碼來源:FlipX.java

示例11: get

import android.view.View; //導入方法依賴的package包/類
@Override
public Float get(View target) {
    return target.getRotationX();
}
 
開發者ID:liuwei1993,項目名稱:AndroidAnimationTools,代碼行數:5,代碼來源:ViewAnimatorBuilder.java


注:本文中的android.view.View.getRotationX方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。