diff options
| author | Mark Renouf <mrenouf@google.com> | 2019-08-12 16:22:15 -0400 |
|---|---|---|
| committer | Mark Renouf <mrenouf@google.com> | 2019-09-18 14:47:03 -0400 |
| commit | e574ad09ee145a65ec2340395c275b21a538312f (patch) | |
| tree | 4538f64be03f55de043c06a52cae14bd575e9a39 /core/java/android/app/ActivityView.java | |
| parent | df0f3bce7ef4568c8408204b01e61e4166d07a97 (diff) | |
Support frame-synchronized clipping on SurfaceView
Bug: 123306815
Test: See ag/9384030, manual test of bubbles expand collapse animation
Change-Id: I5350501667fe729a0c668e8f6edaf30070a2e1ec
Diffstat (limited to 'core/java/android/app/ActivityView.java')
| -rw-r--r-- | core/java/android/app/ActivityView.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityView.java b/core/java/android/app/ActivityView.java index e8918285777b..b56c00e44d3f 100644 --- a/core/java/android/app/ActivityView.java +++ b/core/java/android/app/ActivityView.java @@ -29,6 +29,7 @@ import android.content.Context; import android.content.Intent; import android.graphics.Insets; import android.graphics.Matrix; +import android.graphics.Rect; import android.graphics.Region; import android.hardware.display.DisplayManager; import android.hardware.display.VirtualDisplay; @@ -101,6 +102,8 @@ public class ActivityView extends ViewGroup { private Insets mForwardedInsets; + private float mCornerRadius; + public ActivityView(Context context) { this(context, null /* attrs */); } @@ -204,6 +207,45 @@ public class ActivityView extends ViewGroup { } /** + * @hide + */ + public float getCornerRadius() { + return mSurfaceView.getCornerRadius(); + } + + /** + * Control whether the surface is clipped to the same bounds as the View. If true, then + * the bounds set by {@link #setSurfaceClipBounds(Rect)} are applied to the surface as + * window-crop. + * + * @param clippingEnabled whether to enable surface clipping + * @hide + */ + public void setSurfaceClippingEnabled(boolean clippingEnabled) { + mSurfaceView.setEnableSurfaceClipping(clippingEnabled); + } + + /** + * Sets an area on the contained surface to which it will be clipped + * when it is drawn. Setting the value to null will remove the clip bounds + * and the surface will draw normally, using its full bounds. + * + * @param clipBounds The rectangular area, in the local coordinates of + * this view, to which future drawing operations will be clipped. + * @hide + */ + public void setSurfaceClipBounds(Rect clipBounds) { + mSurfaceView.setClipBounds(clipBounds); + } + + /** + * @hide + */ + public boolean getSurfaceClipBounds(Rect outRect) { + return mSurfaceView.getClipBounds(outRect); + } + + /** * Launch a new activity into this container. * <p>Activity resolved by the provided {@link Intent} must have * {@link android.R.attr#resizeableActivity} attribute set to {@code true} in order to be |
