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

Commit 876e462f authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Removing separate hotseat widget, instead using a QSB acroll all UI.

The QSB is responsible for updating its UI according to various states.

Bug: 109828640
Change-Id: Ic8cbf3d404d5870de0f6b8fe25a332b8d21bae20
parent 08584e18
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -26,7 +26,9 @@
    android:focusable="false"
    android:saveEnabled="false" >

    <include layout="@layout/all_apps_rv_layout" />
    <include
        layout="@layout/all_apps_rv_layout"
        android:visibility="gone" />

    <include layout="@layout/all_apps_floating_header" />

res/layout/hotseat.xml

deleted100644 → 0
+0 −28
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<com.android.launcher3.Hotseat
    android:theme="@style/HomeScreenElementTheme"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:launcher="http://schemas.android.com/apk/res-auto">

    <com.android.launcher3.CellLayout
        android:id="@+id/layout"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        launcher:containerType="hotseat"
        android:importantForAccessibility="no" />
</com.android.launcher3.Hotseat>
+9 −6
Original line number Diff line number Diff line
@@ -56,22 +56,25 @@
            android:id="@+id/drop_target_bar"
            layout="@layout/drop_target_bar" />

        <include android:id="@+id/scrim_view"
        <include
            android:id="@+id/scrim_view"
            layout="@layout/scrim_view" />

        <include
            android:id="@+id/apps_view"
            layout="@layout/all_apps"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="invisible" />
            android:layout_height="match_parent" />

        <!-- DO NOT CHANGE THE ID -->
        <include
        <com.android.launcher3.Hotseat
            android:id="@+id/hotseat"
            layout="@layout/hotseat"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
            android:layout_height="match_parent"
            android:theme="@style/HomeScreenElementTheme"
            android:importantForAccessibility="no"
            launcher:containerType="hotseat" />

    </com.android.launcher3.dragndrop.DragLayer>

</com.android.launcher3.LauncherRootView>
+0 −1
Original line number Diff line number Diff line
@@ -131,7 +131,6 @@

<!-- QSB IDs. DO not change -->
    <item type="id" name="search_container_workspace" />
    <item type="id" name="search_container_hotseat" />
    <item type="id" name="search_container_all_apps" />

<!-- Recents -->
+11 −26
Original line number Diff line number Diff line
@@ -27,13 +27,12 @@ import android.view.ViewGroup;
import android.widget.FrameLayout;

import com.android.launcher3.logging.StatsLogUtils.LogContainerProvider;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;

public class Hotseat extends FrameLayout implements LogContainerProvider, Insettable {
public class Hotseat extends CellLayout implements LogContainerProvider, Insettable {

    private final Launcher mLauncher;
    private CellLayout mContent;

    @ViewDebug.ExportedProperty(category = "launcher")
    private boolean mHasVerticalHotseat;
@@ -51,38 +50,23 @@ public class Hotseat extends FrameLayout implements LogContainerProvider, Insett
        mLauncher = Launcher.getLauncher(context);
    }

    public CellLayout getLayout() {
        return mContent;
    }

    /* Get the orientation invariant order of the item in the hotseat for persistence. */
    int getOrderInHotseat(int x, int y) {
        return mHasVerticalHotseat ? (mContent.getCountY() - y - 1) : x;
    }

    /* Get the orientation specific coordinates given an invariant order in the hotseat. */
    int getCellXFromOrder(int rank) {
        return mHasVerticalHotseat ? 0 : rank;
    }

    int getCellYFromOrder(int rank) {
        return mHasVerticalHotseat ? (mContent.getCountY() - (rank + 1)) : 0;
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        mContent = findViewById(R.id.layout);
        return mHasVerticalHotseat ? (getCountY() - (rank + 1)) : 0;
    }

    void resetLayout(boolean hasVerticalHotseat) {
        mContent.removeAllViewsInLayout();
        removeAllViewsInLayout();
        mHasVerticalHotseat = hasVerticalHotseat;
        InvariantDeviceProfile idp = mLauncher.getDeviceProfile().inv;
        if (hasVerticalHotseat) {
            mContent.setGridSize(1, idp.numHotseatIcons);
            setGridSize(1, idp.numHotseatIcons);
        } else {
            mContent.setGridSize(idp.numHotseatIcons, 1);
            setGridSize(idp.numHotseatIcons, 1);
        }
    }

@@ -90,15 +74,16 @@ public class Hotseat extends FrameLayout implements LogContainerProvider, Insett
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        // We don't want any clicks to go through to the hotseat unless the workspace is in
        // the normal state or an accessible drag is in progress.
        return !mLauncher.getWorkspace().workspaceIconsCanBeDragged() &&
                !mLauncher.getAccessibilityDelegate().isInAccessibleDrag();
        return (!mLauncher.getWorkspace().workspaceIconsCanBeDragged()
                && !mLauncher.getAccessibilityDelegate().isInAccessibleDrag())
                || super.onInterceptTouchEvent(ev);
    }

    @Override
    public void fillInLogContainerData(View v, ItemInfo info, Target target, Target targetParent) {
        target.gridX = info.cellX;
        target.gridY = info.cellY;
        targetParent.containerType = ContainerType.HOTSEAT;
        targetParent.containerType = LauncherLogProto.ContainerType.HOTSEAT;
    }

    @Override
@@ -121,7 +106,7 @@ public class Hotseat extends FrameLayout implements LogContainerProvider, Insett
            lp.height = grid.hotseatBarSizePx + insets.bottom;
        }
        Rect padding = grid.getHotseatLayoutPadding();
        getLayout().setPadding(padding.left, padding.top, padding.right, padding.bottom);
        setPadding(padding.left, padding.top, padding.right, padding.bottom);

        setLayoutParams(lp);
        InsettableFrameLayout.dispatchInsets(this, insets);
Loading