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


Java RectEvaluator类代码示例

本文整理汇总了Java中android.animation.RectEvaluator的典型用法代码示例。如果您正苦于以下问题:Java RectEvaluator类的具体用法?Java RectEvaluator怎么用?Java RectEvaluator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onLayout

import android.animation.RectEvaluator; //导入依赖的package包/类
@Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        int width = getMeasuredWidth();
        int height = getMeasuredHeight();

        layoutSubView(mSearch, mActionGap, 0);
        layoutSubView(mShare, 2 * mActionGap + mSearch.getMeasuredWidth(), 0);
        layoutSubView(mTrans, 3 * mActionGap + mTrans.getMeasuredWidth() + mShare.getMeasuredWidth(), 0);

//        layoutSubView(mSelectAll, 2 * mActionGap + mSearch.getMeasuredWidth() , 0);
//        layoutSubView(mSelectOther, 3 * mActionGap + mTrans.getMeasuredWidth()+ mShare.getMeasuredWidth() , 0);
//
//        layoutSubView(mDrag, width - mActionGap * 2 - mShare.getMeasuredWidth() - mCopy.getMeasuredWidth(), 0);
        layoutSubView(mCopy, width - mActionGap - mCopy.getMeasuredWidth(), 0);
        layoutSubView(mClose, ((width - (this.mActionGap * 2)) - this.mCopy.getMeasuredWidth()) - this.mClose.getMeasuredHeight(), 0);

        Rect oldBounds = mBorder.getBounds();
        Rect newBounds = new Rect(0, mSearch.getMeasuredHeight() / 2, width, height);

        if (!stickHeader && !oldBounds.equals(newBounds)) {
            ObjectAnimator.ofObject(new BoundWrapper(oldBounds), "bound", new RectEvaluator(), oldBounds, newBounds).setDuration(200).start();
        }
    }
 
开发者ID:mmjang,项目名称:quiz_helper,代码行数:24,代码来源:BigBangHeader.java

示例2: startRectAnimation

import android.animation.RectEvaluator; //导入依赖的package包/类
public void startRectAnimation(View v) {
    Rect local = new Rect();
    mShowAnimIV.getLocalVisibleRect(local);
    Rect from = new Rect(local);
    Rect to = new Rect(local);

    from.right = from.left + local.width()/4;
    from.bottom = from.top + local.height()/2;

    to.left = to.right - local.width()/2;
    to.top = to.bottom - local.height()/4;

    if (Build.VERSION.SDK_INT >= 18) {
        ObjectAnimator objectAnimator = ObjectAnimator.ofObject(mShowAnimIV, "clipBounds", new RectEvaluator(), from, to);
        objectAnimator.setDuration(C.Int.ANIM_DURATION * 4);
        objectAnimator.start();
    }
}
 
开发者ID:DIY-green,项目名称:AndroidStudyDemo,代码行数:19,代码来源:ObjectPropertyAnimActivity.java

示例3: startRectAnimation

import android.animation.RectEvaluator; //导入依赖的package包/类
@SuppressLint("NewApi")
public void startRectAnimation(View view)
{    
  View someImage = findViewById(R.id.some_image);
  Rect local = new Rect();
  someImage.getLocalVisibleRect(local);
  Rect from = new Rect(local);
  Rect to = new Rect(local);
  
  from.right = from.left + local.width()/4;
  from.bottom = from.top + local.height()/2;
  
  to.left = to.right - local.width()/2;
  to.top = to.bottom - local.height()/4;
  
  if (android.os.Build.VERSION.SDK_INT >= 18)
  {
    ObjectAnimator anim = ObjectAnimator.ofObject(someImage, "clipBounds", new RectEvaluator(), from, to);
    anim.setDuration(2000);
    anim.start();
  }
  
}
 
开发者ID:mikailsheikh,项目名称:cogitolearning-examples,代码行数:24,代码来源:PropertyAnimation06.java


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