android.animation.RectEvaluator Java Examples
The following examples show how to use
android.animation.RectEvaluator.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BigBangHeader.java From ankihelper with GNU General Public License v3.0 | 6 votes |
@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(); } }
Example #2
Source File: ObjectPropertyAnimActivity.java From AndroidStudyDemo with GNU General Public License v2.0 | 6 votes |
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(); } }
Example #3
Source File: PropertyAnimation06.java From cogitolearning-examples with MIT License | 6 votes |
@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(); } }