diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-04-30 12:04:37 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-05-02 10:59:28 -0700 |
commit | ae6e318711239601fdd11a14c3cf8c542b808f19 (patch) | |
tree | cc648803791d551f80202267b1c05ca6f1084517 /src/com/android/launcher3/folder | |
parent | c2803ec5b272c902b6ab314d782afe852163b4ff (diff) | |
download | android_packages_apps_Trebuchet-ae6e318711239601fdd11a14c3cf8c542b808f19.tar.gz android_packages_apps_Trebuchet-ae6e318711239601fdd11a14c3cf8c542b808f19.tar.bz2 android_packages_apps_Trebuchet-ae6e318711239601fdd11a14c3cf8c542b808f19.zip |
Initial changes to creating a fake landscape Launcher UI
Workspace and hotseat are drawn in rotated UI giving the impression that the
device is in Portrait, even though it is in landscape
Bug: 131360075
Change-Id: I29c4068af25fd4dcf7039b9a45886e864a137977
Diffstat (limited to 'src/com/android/launcher3/folder')
-rw-r--r-- | src/com/android/launcher3/folder/Folder.java | 5 | ||||
-rw-r--r-- | src/com/android/launcher3/folder/FolderIcon.java | 7 | ||||
-rw-r--r-- | src/com/android/launcher3/folder/PreviewBackground.java | 3 |
3 files changed, 7 insertions, 8 deletions
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index 4dbff1c61..f2eae17da 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -869,7 +869,7 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo DeviceProfile grid = mLauncher.getDeviceProfile(); DragLayer.LayoutParams lp = (DragLayer.LayoutParams) getLayoutParams(); - DragLayer parent = (DragLayer) mLauncher.findViewById(R.id.drag_layer); + DragLayer parent = mLauncher.getDragLayer(); int width = getFolderWidth(); int height = getFolderHeight(); @@ -881,8 +881,7 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo // We need to bound the folder to the currently visible workspace area if (mLauncher.getStateManager().getState().overviewUi) { - mLauncher.getDragLayer().getDescendantRectRelativeToSelf(mLauncher.getOverviewPanel(), - sTempRect); + parent.getDescendantRectRelativeToSelf(mLauncher.getOverviewPanel(), sTempRect); } else { mLauncher.getWorkspace().getPageAreaRelativeToDragLayer(sTempRect); } diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index 02242a3ec..6fa9ba9ae 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -159,7 +159,7 @@ public class FolderIcon extends FrameLayout implements FolderListener { "is dependent on this"); } - DeviceProfile grid = launcher.getDeviceProfile(); + DeviceProfile grid = launcher.getWallpaperDeviceProfile(); FolderIcon icon = (FolderIcon) LayoutInflater.from(group.getContext()) .inflate(resId, group, false); @@ -174,7 +174,7 @@ public class FolderIcon extends FrameLayout implements FolderListener { icon.setOnClickListener(ItemClickHandler.INSTANCE); icon.mInfo = folderInfo; icon.mLauncher = launcher; - icon.mDotRenderer = launcher.getDeviceProfile().mDotRenderer; + icon.mDotRenderer = grid.mDotRenderer; icon.setContentDescription(launcher.getString(R.string.folder_name_format, folderInfo.title)); Folder folder = Folder.fromXml(launcher); folder.setDragController(launcher.getDragController()); @@ -508,7 +508,8 @@ public class FolderIcon extends FrameLayout implements FolderListener { public void drawDot(Canvas canvas) { if ((mDotInfo != null && mDotInfo.hasDot()) || mDotScale > 0) { Rect iconBounds = mDotParams.iconBounds; - BubbleTextView.getIconBounds(this, iconBounds, mLauncher.getDeviceProfile().iconSizePx); + BubbleTextView.getIconBounds(this, iconBounds, + mLauncher.getWallpaperDeviceProfile().iconSizePx); // If we are animating to the accepting state, animate the dot out. mDotParams.scale = Math.max(0, mDotScale - mBackground.getScaleProgress()); diff --git a/src/com/android/launcher3/folder/PreviewBackground.java b/src/com/android/launcher3/folder/PreviewBackground.java index ac908f4ad..46df77a42 100644 --- a/src/com/android/launcher3/folder/PreviewBackground.java +++ b/src/com/android/launcher3/folder/PreviewBackground.java @@ -42,7 +42,6 @@ import android.view.View; import com.android.launcher3.CellLayout; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; -import com.android.launcher3.util.Themes; import com.android.launcher3.views.ActivityContext; /** @@ -135,7 +134,7 @@ public class PreviewBackground { mBgColor = ta.getColor(R.styleable.FolderIconPreview_android_colorPrimary, 0); ta.recycle(); - DeviceProfile grid = activity.getDeviceProfile(); + DeviceProfile grid = activity.getWallpaperDeviceProfile(); previewSize = grid.folderIconSizePx; basePreviewOffsetX = (availableSpaceX - previewSize) / 2; |