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


Java ViewCompat.setRotation方法代码示例

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


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

示例1: bindView

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
 * binds the data of this item onto the viewHolder
 *
 * @param viewHolder the viewHolder of this item
 */
@Override
public void bindView(ViewHolder viewHolder, List<Object> payloads) {
    super.bindView(viewHolder, payloads);

    //get the context
    Context ctx = viewHolder.itemView.getContext();

    //set the background for the item
    UIUtils.setBackground(viewHolder.view, FastAdapterUIUtils.getSelectableBackground(ctx, Color.RED, true));
    //set the text for the name
    StringHolder.applyTo(name, viewHolder.name);
    //set the text for the description or hide
    StringHolder.applyToOrHide(description, viewHolder.description);

    if (isExpanded()) {
        ViewCompat.setRotation(viewHolder.icon, 0);
    } else {
        ViewCompat.setRotation(viewHolder.icon, 180);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:SimpleSubExpandableItem.java

示例2: 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:devzwy,项目名称:KUtils,代码行数:20,代码来源:BGABannerUtil.java

示例3: bindView

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void bindView(ViewHolder viewHolder, List<Object> payloads) {
    if (payloads != null && payloads.size() == 1 && payloads.contains(Definitions.PAYLOAD_UPDATE_HEADER_DECORATOR)) {
        // only the decorator needs to be updated!
        return;
    }
    super.bindView(viewHolder, payloads);
    mTitle.display(viewHolder.binding.tvTitle);

    // Util.setCompoundIconLeftOrClear(viewHolder.binding.tvTitle, mIcon, ...);

    viewHolder.binding.ivIcon.setVisibility(mExpandable && getSubItems() != null ? View.VISIBLE : View.GONE);
    if (mExpandable) {
        if (isExpanded()) {
            ViewCompat.setRotation(viewHolder.binding.ivIcon, 0);
        } else {
            ViewCompat.setRotation(viewHolder.binding.ivIcon, 180);
        }
    }
}
 
开发者ID:MFlisar,项目名称:RecyclerViewPreferences,代码行数:21,代码来源:SettingsHeaderItem.java

示例4: clear

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private static void clear(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:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:FlexibleItemAnimator.java

示例5: onPositionChange

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void onPositionChange(@SwipeToRefreshLayout.SwipeDirection int direction, @SwipeToRefreshLayout.State int state, int refreshPoint, int range, int currentX, int currentY, int lastX, int lastY, float touchX, float touchY) {
    float fraction = currentX >= refreshPoint? 1: currentX * 1.0f/refreshPoint;
    ViewCompat.setScaleX(mIndicatorView, fraction);
    ViewCompat.setScaleY(mIndicatorView, fraction);
    ViewCompat.setRotation(mIndicatorView, currentX * 1.0f/refreshPoint * 360);
    ViewCompat.setAlpha(mIndicatorView, fraction);

    if (currentX < refreshPoint){
        mText.setText("拖拽刷新");
    }else{
        mText.setText("释放刷新");
    }
}
 
开发者ID:zhouphenix,项目名称:Multi-SwipeToRefreshLayout,代码行数:15,代码来源:IndicatorsRefreshHeader.java

示例6: 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:devzwy,项目名称:KUtils,代码行数:16,代码来源:BaseViewAnimator.java

示例7: handleLeftPage

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void handleLeftPage(View view, float position) {
    float rotation = (mMaxRotation * position);
    ViewCompat.setPivotX(view, view.getMeasuredWidth() * 0.5f);
    ViewCompat.setPivotY(view, view.getMeasuredHeight());
    ViewCompat.setRotation(view, rotation);
}
 
开发者ID:devzwy,项目名称:KUtils,代码行数:8,代码来源:RotatePageTransformer.java

示例8: clear

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
public static void clear(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:angcyo,项目名称:RLibrary,代码行数:14,代码来源:ViewHelper.java

示例9: 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

示例10: handleInvisiblePage

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void handleInvisiblePage(View view, float position) {
    ViewCompat.setPivotX(view, view.getMeasuredWidth() * 0.5f);
    ViewCompat.setPivotY(view, view.getMeasuredHeight());
    ViewCompat.setRotation(view, 0);
}
 
开发者ID:devzwy,项目名称:KUtils,代码行数:7,代码来源:RotatePageTransformer.java


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