mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-06 02:46:57 +00:00
Merge "Fix widget reorder animations in multi-window mode." into ub-launcher3-master
This commit is contained in:
committed by
Android (Google) Code Review
commit
bf8a265deb
@@ -25,7 +25,6 @@ import android.graphics.drawable.Drawable;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherAppWidgetHostView;
|
||||
import com.android.launcher3.PreloadIconDrawable;
|
||||
@@ -120,8 +119,7 @@ public class DragPreviewProvider {
|
||||
width = bounds.width();
|
||||
height = bounds.height();
|
||||
} else if (mView instanceof LauncherAppWidgetHostView) {
|
||||
DeviceProfile profile = Launcher.getLauncher(mView.getContext()).getDeviceProfile();
|
||||
scale = Math.min(profile.appWidgetScale.x, profile.appWidgetScale.y);
|
||||
scale = ((LauncherAppWidgetHostView) mView).getScaleToFit();
|
||||
width = (int) (mView.getWidth() * scale);
|
||||
height = (int) (mView.getHeight() * scale);
|
||||
}
|
||||
@@ -158,8 +156,7 @@ public class DragPreviewProvider {
|
||||
int height = mView.getHeight();
|
||||
|
||||
if (mView instanceof LauncherAppWidgetHostView) {
|
||||
DeviceProfile profile = Launcher.getLauncher(mView.getContext()).getDeviceProfile();
|
||||
scale = Math.min(profile.appWidgetScale.x, profile.appWidgetScale.y);
|
||||
scale = ((LauncherAppWidgetHostView) mView).getScaleToFit();
|
||||
width = (int) Math.floor(mView.getWidth() * scale);
|
||||
height = (int) Math.floor(mView.getHeight() * scale);
|
||||
}
|
||||
@@ -198,11 +195,10 @@ public class DragPreviewProvider {
|
||||
public float getScaleAndPosition(Bitmap preview, int[] outPos) {
|
||||
float scale = Launcher.getLauncher(mView.getContext())
|
||||
.getDragLayer().getLocationInDragLayer(mView, outPos);
|
||||
DeviceProfile profile = Launcher.getLauncher(mView.getContext()).getDeviceProfile();
|
||||
if (mView instanceof LauncherAppWidgetHostView) {
|
||||
// App widgets are technically scaled, but are drawn at their expected size -- so the
|
||||
// app widget scale should not affect the scale of the preview.
|
||||
scale /= Math.min(profile.appWidgetScale.x, profile.appWidgetScale.y);
|
||||
scale /= ((LauncherAppWidgetHostView) mView).getScaleToFit();
|
||||
}
|
||||
|
||||
outPos[0] = Math.round(outPos[0] -
|
||||
|
||||
Reference in New Issue
Block a user