Fix widget animation truncated at drop if a widget is resized
Set the widget outline to DragView rather than the content view hosting a Picture record of AppWidgetHostView at drop. Bug: 191646816 Test: Manual Change-Id: I901743f8ba392de37f3ef69ca386c4b36bfebd7f Merged-In: I901743f8ba392de37f3ef69ca386c4b36bfebd7f
This commit is contained in:
@@ -447,12 +447,12 @@ public abstract class DragView<T extends Context & ActivityContext> extends Fram
|
|||||||
mContent.draw(picture.beginRecording(mWidth, mHeight));
|
mContent.draw(picture.beginRecording(mWidth, mHeight));
|
||||||
picture.endRecording();
|
picture.endRecording();
|
||||||
View view = new View(mActivity);
|
View view = new View(mActivity);
|
||||||
view.setClipToOutline(mContent.getClipToOutline());
|
|
||||||
view.setOutlineProvider(mContent.getOutlineProvider());
|
|
||||||
view.setBackground(new PictureDrawable(picture));
|
view.setBackground(new PictureDrawable(picture));
|
||||||
view.measure(makeMeasureSpec(mWidth, EXACTLY), makeMeasureSpec(mHeight, EXACTLY));
|
view.measure(makeMeasureSpec(mWidth, EXACTLY), makeMeasureSpec(mHeight, EXACTLY));
|
||||||
view.layout(mContent.getLeft(), mContent.getTop(),
|
view.layout(mContent.getLeft(), mContent.getTop(),
|
||||||
mContent.getRight(), mContent.getBottom());
|
mContent.getRight(), mContent.getBottom());
|
||||||
|
setClipToOutline(mContent.getClipToOutline());
|
||||||
|
setOutlineProvider(mContent.getOutlineProvider());
|
||||||
addViewInLayout(view, indexOfChild(mContent), mContent.getLayoutParams(), true);
|
addViewInLayout(view, indexOfChild(mContent), mContent.getLayoutParams(), true);
|
||||||
|
|
||||||
removeViewInLayout(mContent);
|
removeViewInLayout(mContent);
|
||||||
|
|||||||
Reference in New Issue
Block a user