Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae6e3187 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

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
parent c2803ec5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
        } else {
            workspaceView = null;
        }
        final Rect iconLocation = new Rect();
        final RectF iconLocation = new RectF();
        boolean canUseWorkspaceView = workspaceView != null && workspaceView.isAttachedToWindow();
        final FloatingIconView floatingView = canUseWorkspaceView
                ? FloatingIconView.getFloatingIconView(activity, workspaceView,
@@ -138,7 +138,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
                final float targetCenterY = dp.availableHeightPx - dp.hotseatBarSizePx;

                if (canUseWorkspaceView) {
                    return new RectF(iconLocation);
                    return iconLocation;
                } else {
                    // Fallback to animate to center of screen.
                    return new RectF(targetCenterX - halfIconSize, targetCenterY - halfIconSize,
+2 −2
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ public class TaskViewDrawable extends Drawable {

    private final RecentsView mParent;
    private final View mIconView;
    private final int[] mIconPos;
    private final float[] mIconPos;
    private final TaskView mTaskView;

    private final TaskThumbnailView mThumbnailView;
@@ -68,7 +68,7 @@ public class TaskViewDrawable extends Drawable {
        mParent = parent;
        mTaskView = tv;
        mIconView = tv.getIconView();
        mIconPos = new int[2];
        mIconPos = new float[2];
        mIconScale = mIconView.getScaleX();
        Utilities.getDescendantCoordRelativeToAncestor(mIconView, parent, mIconPos, true);

+3 −3
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
     */
    private ValueAnimator getOpeningWindowAnimators(View v, RemoteAnimationTargetCompat[] targets,
            Rect windowTargetBounds, boolean toggleVisibility) {
        Rect bounds = new Rect();
        RectF bounds = new RectF();
        mFloatingView = FloatingIconView.getFloatingIconView(mLauncher, v, toggleVisibility,
                bounds, true /* isOpening */, mFloatingView);
        Rect crop = new Rect();
@@ -423,8 +423,8 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
        // Scale the app icon to take up the entire screen. This simplifies the math when
        // animating the app window position / scale.
        float smallestSize = Math.min(windowTargetBounds.height(), windowTargetBounds.width());
        float maxScaleX = smallestSize / (float) bounds.width();
        float maxScaleY = smallestSize / (float) bounds.height();
        float maxScaleX = smallestSize / bounds.width();
        float maxScaleY = smallestSize / bounds.height();
        float scale = Math.max(maxScaleX, maxScaleY);
        float startScale = 1f;
        if (v instanceof BubbleTextView && !(v.getParent() instanceof DeepShortcutView)) {
+4 −4
Original line number Diff line number Diff line
@@ -123,12 +123,12 @@ public abstract class BaseRecyclerView extends RecyclerView {
     * @param ev MotionEvent in {@param eventSource}
     */
    public boolean shouldContainerScroll(MotionEvent ev, View eventSource) {
        int[] point = new int[2];
        point[0] = (int) ev.getX();
        point[1] = (int) ev.getY();
        float[] point = new float[2];
        point[0] = ev.getX();
        point[1] = ev.getY();
        Utilities.mapCoordInSelfToDescendant(mScrollbar, eventSource, point);
        // IF the MotionEvent is inside the thumb, container should not be pulled down.
        if (mScrollbar.shouldBlockIntercept(point[0], point[1])) {
        if (mScrollbar.shouldBlockIntercept((int) point[0], (int) point[1])) {
            return false;
        }

+7 −2
Original line number Diff line number Diff line
@@ -142,7 +142,6 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
    public BubbleTextView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        mActivity = ActivityContext.lookupContext(context);
        DeviceProfile grid = mActivity.getDeviceProfile();
        mSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();

        TypedArray a = context.obtainStyledAttributes(attrs,
@@ -150,18 +149,24 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
        mLayoutHorizontal = a.getBoolean(R.styleable.BubbleTextView_layoutHorizontal, false);

        int display = a.getInteger(R.styleable.BubbleTextView_iconDisplay, DISPLAY_WORKSPACE);
        int defaultIconSize = grid.iconSizePx;
        final int defaultIconSize;
        if (display == DISPLAY_WORKSPACE) {
            DeviceProfile grid = mActivity.getWallpaperDeviceProfile();
            setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.iconTextSizePx);
            setCompoundDrawablePadding(grid.iconDrawablePaddingPx);
            defaultIconSize = grid.iconSizePx;
        } else if (display == DISPLAY_ALL_APPS) {
            DeviceProfile grid = mActivity.getDeviceProfile();
            setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.allAppsIconTextSizePx);
            setCompoundDrawablePadding(grid.allAppsIconDrawablePaddingPx);
            defaultIconSize = grid.allAppsIconSizePx;
        } else if (display == DISPLAY_FOLDER) {
            DeviceProfile grid = mActivity.getDeviceProfile();
            setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.folderChildTextSizePx);
            setCompoundDrawablePadding(grid.folderChildDrawablePaddingPx);
            defaultIconSize = grid.folderChildIconSizePx;
        } else {
            defaultIconSize = mActivity.getDeviceProfile().iconSizePx;
        }
        mCenterVertically = a.getBoolean(R.styleable.BubbleTextView_centerVertically, false);

Loading