@Override public void setClipBounds(@NonNull View v, @Nullable Rect clipBounds) { v.setClipBounds(clipBounds); }
@Override public void onAnimationEnd(Animator animation) { view.setClipBounds(terminalClip); } };
@Override public void set(@NonNull View object, @NonNull State value) { final Rect tempRect = mTempRect; if (object.getClipBounds(tempRect)) { if (mTargetDimension == TARGET_X) { tempRect.left = value.lower - (int) value.trans; tempRect.right = value.upper - (int) value.trans; } else { tempRect.top = value.lower - (int) value.trans; tempRect.bottom = value.upper - (int) value.trans; } object.setClipBounds(tempRect); } // if (mTargetDimension == TARGET_X) { // object.setTranslationX(value.trans); // } else { // object.setTranslationY(value.trans); // } } }
clippingRect.bottom += delta; view.setTranslationY(Math.round(offset)); if (isAPI18) view.setClipBounds(clippingRect); lastScrollY = originalScrollY; if (isAPI18) {
@Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { int mGridHeight = qsHooks.getGridHeight(); if (mGridHeight == 0) return; View view = (View) param.thisObject; float height = view.getHeight(); height += (int) (mGridHeight * mExpansion); mClipBounds.set(view.getPaddingLeft(), 0, view.getWidth() - view.getPaddingRight(), (int) height); view.setClipBounds(mClipBounds); view.invalidateOutline(); } };
@NonNull @Override public Animator onDisappear(@NonNull ViewGroup sceneRoot, @NonNull View view, @Nullable TransitionValues startValues, @NonNull TransitionValues endValues) { if (startValues == null) { return null; } final Rect startBounds = (Rect) endValues.values.get(PROPNAME_BOUNDS); final Rect endBounds = startBounds; // getEpicenterOrCenter(startBounds); final float endX = endBounds.centerX() - startBounds.centerX(); final float endY = endBounds.centerY() - startBounds.centerY(); final float endZ = 0 - (float) startValues.values.get(PROPNAME_Z); final float startX = (float) endValues.values.get(PROPNAME_TRANSLATE_X); final float startY = (float) endValues.values.get(PROPNAME_TRANSLATE_Y); final float startZ = (float) endValues.values.get(PROPNAME_TRANSLATE_Z); final Rect startClip = getBestRect(startValues); final Rect endClip = getEpicenterOrCenter(startClip); // Prepare the view. view.setClipBounds(startClip); final State startStateX = new State(startClip.left, startClip.right, startX); final State endStateX = new State(endClip.left, endClip.right, endX); final State startStateY = new State(startClip.top, startClip.bottom, startY); final State endStateY = new State(endClip.top, endClip.bottom, endY); return createRectAnimator(view, startStateX, startStateY, startZ, endStateX, endStateY, endZ, endValues, mInterpolatorX, mInterpolatorY, mInterpolatorZ); }
view.setClipBounds(startClip);