Search in sources :

Example 21 with Hotseat

use of com.android.launcher3.Hotseat in project android_packages_apps_Launcher3 by AOSPA.

the class Workspace method isPointInSelfOverHotseat.

boolean isPointInSelfOverHotseat(int x, int y) {
    mTempFXY[0] = x;
    mTempFXY[1] = y;
    mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(this, mTempFXY, true);
    View hotseat = mLauncher.getHotseat();
    return mTempFXY[0] >= hotseat.getLeft() && mTempFXY[0] <= hotseat.getRight() && mTempFXY[1] >= hotseat.getTop() && mTempFXY[1] <= hotseat.getBottom();
}
Also used : DraggableView(com.android.launcher3.dragndrop.DraggableView) LauncherAppWidgetHostView(com.android.launcher3.widget.LauncherAppWidgetHostView) AppWidgetHostView(android.appwidget.AppWidgetHostView) View(android.view.View) PendingAppWidgetHostView(com.android.launcher3.widget.PendingAppWidgetHostView) DragView(com.android.launcher3.dragndrop.DragView)

Example 22 with Hotseat

use of com.android.launcher3.Hotseat in project android_packages_apps_Launcher3 by AOSPA.

the class DefaultLayoutProviderTest method testCustomProfileLoaded_with_icon_on_hotseat.

@Test
public void testCustomProfileLoaded_with_icon_on_hotseat() throws Exception {
    writeLayoutAndLoad(new LauncherLayoutBuilder().atHotseat(0).putApp(TEST_PACKAGE, TEST_ACTIVITY));
    // Verify one item in hotseat
    assertEquals(1, mModelHelper.getBgDataModel().workspaceItems.size());
    ItemInfo info = mModelHelper.getBgDataModel().workspaceItems.get(0);
    assertEquals(LauncherSettings.Favorites.CONTAINER_HOTSEAT, info.container);
    assertEquals(LauncherSettings.Favorites.ITEM_TYPE_APPLICATION, info.itemType);
}
Also used : LauncherLayoutBuilder(com.android.launcher3.util.LauncherLayoutBuilder) ItemInfo(com.android.launcher3.model.data.ItemInfo) SmallTest(androidx.test.filters.SmallTest) Test(org.junit.Test)

Example 23 with Hotseat

use of com.android.launcher3.Hotseat in project android_packages_apps_Launcher3 by AOSPA.

the class BubbleTextView method shouldTextBeVisible.

public boolean shouldTextBeVisible() {
    // Text should be visible everywhere but the hotseat.
    Object tag = getParent() instanceof FolderIcon ? ((View) getParent()).getTag() : getTag();
    ItemInfo info = tag instanceof ItemInfo ? (ItemInfo) tag : null;
    return info == null || (info.container != LauncherSettings.Favorites.CONTAINER_HOTSEAT && info.container != LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION);
}
Also used : ItemInfo(com.android.launcher3.model.data.ItemInfo) SearchActionItemInfo(com.android.launcher3.model.data.SearchActionItemInfo) PackageItemInfo(com.android.launcher3.model.data.PackageItemInfo) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) FolderIcon(com.android.launcher3.folder.FolderIcon)

Example 24 with Hotseat

use of com.android.launcher3.Hotseat in project android_packages_apps_Launcher3 by AOSPA.

the class UnfoldMoveFromCenterHotseatAnimator method onPrepareViewsForAnimation.

@Override
protected void onPrepareViewsForAnimation() {
    Hotseat hotseat = mLauncher.getHotseat();
    ViewGroup hotseatIcons = hotseat.getShortcutsAndWidgets();
    disableClipping(hotseat);
    for (int i = 0; i < hotseatIcons.getChildCount(); i++) {
        View child = hotseatIcons.getChildAt(i);
        registerViewForAnimation(child);
    }
}
Also used : Hotseat(com.android.launcher3.Hotseat) ViewGroup(android.view.ViewGroup) View(android.view.View)

Example 25 with Hotseat

use of com.android.launcher3.Hotseat in project android_packages_apps_Launcher3 by AOSPA.

the class LauncherUnfoldAnimationController method onResume.

/**
 * Called when launcher is resumed
 */
public void onResume() {
    Hotseat hotseat = mLauncher.getHotseat();
    if (hotseat != null && hotseat.getQsb() instanceof HorizontalInsettableView) {
        mQsbInsettable = (HorizontalInsettableView) hotseat.getQsb();
    }
    OneShotPreDrawListener.add(mLauncher.getWorkspace(), () -> mProgressProvider.setReadyToHandleTransition(true));
}
Also used : Hotseat(com.android.launcher3.Hotseat) HorizontalInsettableView(com.android.launcher3.util.HorizontalInsettableView)

Aggregations

ItemInfo (com.android.launcher3.model.data.ItemInfo)67 View (android.view.View)66 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)46 Point (android.graphics.Point)27 ArrayList (java.util.ArrayList)27 CellLayout (com.android.launcher3.CellLayout)26 ViewGroup (android.view.ViewGroup)23 BubbleTextView (com.android.launcher3.BubbleTextView)23 FolderInfo (com.android.launcher3.model.data.FolderInfo)23 ArrowTipView (com.android.launcher3.views.ArrowTipView)22 FolderIcon (com.android.launcher3.folder.FolderIcon)20 SuppressLint (android.annotation.SuppressLint)19 LauncherAppWidgetHostView (com.android.launcher3.widget.LauncherAppWidgetHostView)19 Hotseat (com.android.launcher3.Hotseat)16 Intent (android.content.Intent)15 IntArray (com.android.launcher3.util.IntArray)13 Workspace (com.android.launcher3.Workspace)12 DraggableView (com.android.launcher3.dragndrop.DraggableView)12 HashSet (java.util.HashSet)12 AppWidgetHostView (android.appwidget.AppWidgetHostView)11