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


Java View.setPivotX方法代码示例

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


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

示例1: hideHint

import android.view.View; //导入方法依赖的package包/类
private void hideHint(final View view) {
    view.setPivotX(0);
    view.setPivotY(view.getHeight());

    Animator iconAnim = ObjectAnimator.ofPropertyValuesHolder(view,
            PropertyValuesHolder.ofFloat(View.ALPHA, 1f, 0f),
            PropertyValuesHolder.ofFloat(View.SCALE_Y, 1f, 0f));
    iconAnim.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            view.setVisibility(View.INVISIBLE);
        }
    });
    iconAnim.start();
}
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:17,代码来源:LoginActivity.java

示例2: layoutItemsOnCreate

import android.view.View; //导入方法依赖的package包/类
/**
 * 初始化的时候,layout子View
 */
private void layoutItemsOnCreate(RecyclerView.Recycler recycler) {
    int itemCount = getItemCount();
    for (int i = 0; i < itemCount; i++) {
        View childView = recycler.getViewForPosition(i);
        addView(childView);
        measureChildWithMargins(childView, View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
        layoutItem(childView, locationRects.get(i));
        attachedItems.put(i, true);
        childView.setPivotY(0);
        childView.setPivotX(childView.getMeasuredWidth() / 2);

        if (locationRects.get(i).top > getHeight()) {
            break;
        }
    }
}
 
开发者ID:goutham106,项目名称:GmArchMvvm,代码行数:20,代码来源:VegaLayoutManager.java

示例3: onAppear

import android.view.View; //导入方法依赖的package包/类
@Override
public Animator onAppear(ViewGroup sceneRoot, View view,
                         TransitionValues startValues,
                         TransitionValues endValues) {
    view.setPivotX(view.getWidth());
    view.setPivotY(view.getHeight()/2);
    return ObjectAnimator.ofFloat(view,View.SCALE_X,0,1).setDuration(400);
}
 
开发者ID:vpaliyX,项目名称:Melophile,代码行数:9,代码来源:BackgroundScale.java

示例4: onTransform

import android.view.View; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
	view.setPivotX(position < 0 ? 0 : view.getWidth());
	view.setPivotY(view.getHeight() / 2f);
	float scale = position < 0 ? 1f + position : 1f - position;
	view.setScaleX(scale);
	view.setScaleY(scale);
}
 
开发者ID:jeasinlee,项目名称:AndroidBasicLibs,代码行数:9,代码来源:ScaleInOutTransformer.java

示例5: onTransform

import android.view.View; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
	final float rotation = -180f * position;

	view.setAlpha(rotation > 90f || rotation < -90f ? 0f : 1f);
	view.setPivotX(view.getWidth() * 0.5f);
	view.setPivotY(view.getHeight() * 0.5f);
	view.setRotationX(rotation);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:FlipVerticalTransformer.java

示例6: setOn

import android.view.View; //导入方法依赖的package包/类
public void setOn(View view) {
    if (axis == AXIS_X) {
        switch (pivotPoint) {
            case PIVOT_CENTER:
                view.setPivotX(view.getWidth() * 0.5f);
                break;
            case PIVOT_MAX:
                view.setPivotX(view.getWidth());
                break;
            default:
                view.setPivotX(pivotPoint);
                break;
        }
        return;
    }

    if (axis == AXIS_Y) {
        switch (pivotPoint) {
            case PIVOT_CENTER:
                view.setPivotY(view.getHeight() * 0.5f);
                break;
            case PIVOT_MAX:
                view.setPivotY(view.getHeight());
                break;
            default:
                view.setPivotY(pivotPoint);
                break;
        }
    }
}
 
开发者ID:xieyangxuejun,项目名称:Views,代码行数:31,代码来源:Pivot.java

示例7: onTransform

import android.view.View; //导入方法依赖的package包/类
@Override
protected void onTransform(View page, float position) {
    page.setPivotX(position < 0 ? 0 : page.getWidth());
    if (position < -1) {//[-infinity,-1)
        page.setPivotX(page.getWidth());
    }else if (position < 0) {//[-1,0)
        page.setPivotX(0);
    }else {//[0,+infinity)
        page.setPivotX(page.getWidth());
    }
    page.setScaleX(position < 0 ? 1f + position : 1f - position);
}
 
开发者ID:BittleDragon,项目名称:ImageLooper,代码行数:13,代码来源:AccordionTransformer.java

示例8: onTransform

import android.view.View; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
	final float width = view.getWidth();
	final float height = view.getHeight();
	final float rotation = ROT_MOD * position * -1.25f;

	view.setPivotX(width * 0.5f);
	view.setPivotY(height);
	view.setRotation(rotation);
}
 
开发者ID:Mrqinlei,项目名称:ImitateZHRB,代码行数:11,代码来源:RotateDownTransformer.java

示例9: transformPage

import android.view.View; //导入方法依赖的package包/类
@Override
public void transformPage(View page, float position) {
    final float height = page.getHeight();
    final float width = page.getWidth();
    page.setPivotY(0.5f * height);
    page.setPivotX(0.5f * width);
    if (position >= -2 && position <= 2) {
        float mFraction = mDirection * (float) Math.abs(Math.sin(Math.PI * position));
        page.setRotationY(mFraction * mMaxRotateY);
        page.setScaleX(PAGE_SCALE);
        page.setScaleY(PAGE_SCALE);
    }
}
 
开发者ID:codeestX,项目名称:ECardFlow,代码行数:14,代码来源:CardFlowTransformer.java

示例10: transformPage

import android.view.View; //导入方法依赖的package包/类
public void transformPage(View view, float position){
    int pageWidth = view.getWidth();
    int pageHeight = view.getHeight();
    view.setPivotX((float) pageWidth / 2);
    view.setPivotY((float) (pageHeight + pageWidth * distanceToCentreFactor));


    if(position < -1){ //[-infinity,1)
        view.setRotation(0);
        view.setAlpha(0);
    }else if(position <= 1){ //[-1,1]
        view.setTranslationX((-position) * pageWidth); //shift the view over
        if(movingForward) {
            if (position >= 0) {
                view.setRotation(position * (180 - degrees)); //rotate it
                // Fade the page relative to its distance from the center
                view.setAlpha(Math.max(minAlpha, 1 - Math.abs(position) / 3));
            } else {
                Log.d("Flip", Float.toString(position));
                view.setAlpha(1 + position);
            }
        }else if(position<=0){
            view.setRotation(position * (180 - degrees)); //rotate it
            // Fade the page relative to its distance from the center
            view.setAlpha(Math.max(minAlpha, 1 - Math.abs(position) / 3));
        }else{
            Log.d("Flip", Float.toString(position));
            view.setAlpha(1 - position);
        }
    }else{ //(1, +infinity]
        view.setRotation(0);
        view.setAlpha(0);
    }
}
 
开发者ID:vpaliyX,项目名称:LoginConcept,代码行数:35,代码来源:FlipTransformer.java

示例11: onTransform

import android.view.View; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
	final float scale = 1f + Math.abs(position);
	view.setScaleX(scale);
	view.setScaleY(scale);
	view.setPivotX(view.getWidth() * 0.5f);
	view.setPivotY(view.getHeight() * 0.5f);
	view.setAlpha(position < -1f || position > 1f ? 0f : 1f - (scale - 1f));
	if(position == -1){
		view.setTranslationX(view.getWidth() * -1);
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:ZoomOutTranformer.java

示例12: onTransform

import android.view.View; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
	view.setPivotX(position < 0 ? 0 : view.getWidth());
	view.setScaleX(position < 0 ? 1f + position : 1f - position);
}
 
开发者ID:Mrqinlei,项目名称:ImitateZHRB,代码行数:6,代码来源:AccordionTransformer.java

示例13: setPivotX

import android.view.View; //导入方法依赖的package包/类
static void setPivotX(View view, float pivotX) {
    view.setPivotX(pivotX);
}
 
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:4,代码来源:ViewHelper.java

示例14: createAnimator

import android.view.View; //导入方法依赖的package包/类
private static @Nullable
ObjectAnimator createAnimator(@NonNull WXAnimationBean animation, final View target) {
  if(target == null){
    return null;
  }
  WXAnimationBean.Style style = animation.styles;
  if (style != null) {
    ObjectAnimator animator;
    List<PropertyValuesHolder> holders =style.getHolders();
    if (!TextUtils.isEmpty(style.backgroundColor)) {
      BorderDrawable borderDrawable;
      if ((borderDrawable=WXViewUtils.getBorderDrawable(target))!=null) {
        holders.add(PropertyValuesHolder.ofObject(
            WXAnimationBean.Style.BACKGROUND_COLOR, new ArgbEvaluator(),
            borderDrawable.getColor(),
            WXResourceUtils.getColor(style.backgroundColor)));
      } else if (target.getBackground() instanceof ColorDrawable) {
        holders.add(PropertyValuesHolder.ofObject(
            WXAnimationBean.Style.BACKGROUND_COLOR, new ArgbEvaluator(),
            ((ColorDrawable) target.getBackground()).getColor(),
            WXResourceUtils.getColor(style.backgroundColor)));
      }
    }
    if (style.getPivot() != null) {
      Pair<Float, Float> pair = style.getPivot();
      target.setPivotX(pair.first);
      target.setPivotY(pair.second);
    }
    animator = ObjectAnimator.ofPropertyValuesHolder(
        target, holders.toArray(new PropertyValuesHolder[holders.size()]));
    animator.setStartDelay(animation.delay);
    final IntEvaluator intEvaluator=new IntEvaluator();
    if (target.getLayoutParams() != null &&
        (!TextUtils.isEmpty(style.width) || !TextUtils.isEmpty(style.height))) {
      DimensionUpdateListener listener = new DimensionUpdateListener(target);
      ViewGroup.LayoutParams layoutParams = target.getLayoutParams();
      if (!TextUtils.isEmpty(style.width)) {
        listener.setWidth(layoutParams.width,
                          (int) WXViewUtils.getRealPxByWidth(WXUtils.getFloat(style.width)));
      }
      if (!TextUtils.isEmpty(style.height)) {
        listener.setHeight(layoutParams.height,
                           (int) WXViewUtils.getRealPxByWidth(WXUtils.getFloat(style.height)));
      }
      animator.addUpdateListener(listener);
    }
    return animator;
  } else {
    return null;
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:52,代码来源:WXAnimationModule.java


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