diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-10-10 20:59:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-10-10 20:59:34 +0000 |
commit | 51e15402faabf708fa707cefcbb28d7883fed1d0 (patch) | |
tree | 4b10f0e2af990d55a0a6025dba98367bfe747ba5 /src/com/android/launcher3/dragndrop | |
parent | cc88b5bc94d32740e605a1795e91ad11d0664567 (diff) | |
parent | 08ca40f97670ad56ea01a81a439e89a484f9fdb5 (diff) | |
download | android_packages_apps_Trebuchet-51e15402faabf708fa707cefcbb28d7883fed1d0.tar.gz android_packages_apps_Trebuchet-51e15402faabf708fa707cefcbb28d7883fed1d0.tar.bz2 android_packages_apps_Trebuchet-51e15402faabf708fa707cefcbb28d7883fed1d0.zip |
Merge "Refactoring AppWidgetResizeFrame" into ub-launcher3-master
Diffstat (limited to 'src/com/android/launcher3/dragndrop')
-rw-r--r-- | src/com/android/launcher3/dragndrop/DragLayer.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java index ef9c9652d..1bbbd4615 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -38,6 +38,7 @@ import android.os.Build; import android.util.AttributeSet; import android.view.DragEvent; import android.view.KeyEvent; +import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; @@ -621,12 +622,12 @@ public class DragLayer extends InsettableFrameLayout { public void addResizeFrame(LauncherAppWidgetHostView widget, CellLayout cellLayout) { clearResizeFrame(); - mCurrentResizeFrame = new AppWidgetResizeFrame(getContext(), widget, cellLayout, this); + mCurrentResizeFrame = (AppWidgetResizeFrame) LayoutInflater.from(mLauncher) + .inflate(R.layout.app_widget_resize_frame, this, false); + mCurrentResizeFrame.setupForWidget(widget, cellLayout, this); + ((LayoutParams) mCurrentResizeFrame.getLayoutParams()).customPosition = true; - LayoutParams lp = new LayoutParams(-1, -1); - lp.customPosition = true; - - addView(mCurrentResizeFrame, lp); + addView(mCurrentResizeFrame); mCurrentResizeFrame.snapToWidget(false); } |