/*
* Copyright (C) 2008 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.
*/
package com.android.launcher3;
import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS;
import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_DELAY;
import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_TRANSITION_MS;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.SPRING_LOADED;
import static com.android.launcher3.config.FeatureFlags.ADAPTIVE_ICON_WINDOW_ANIM;
import static com.android.launcher3.dragndrop.DragLayer.ALPHA_INDEX_OVERLAY;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.LayoutTransition;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.annotation.SuppressLint;
import android.app.WallpaperManager;
import android.appwidget.AppWidgetHostView;
import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.Parcelable;
import android.os.UserHandle;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.Toast;
import com.android.launcher3.Launcher.LauncherOverlay;
import com.android.launcher3.LauncherAppWidgetHost.ProviderChangedListener;
import com.android.launcher3.LauncherStateManager.AnimationConfig;
import com.android.launcher3.accessibility.AccessibleDragListenerAdapter;
import com.android.launcher3.accessibility.WorkspaceAccessibilityHelper;
import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.dot.FolderDotInfo;
import com.android.launcher3.compat.AppWidgetManagerCompat;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.dragndrop.DragView;
import com.android.launcher3.dragndrop.SpringLoadedDragController;
import com.android.launcher3.folder.Folder;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.folder.PreviewBackground;
import com.android.launcher3.graphics.DragPreviewProvider;
import com.android.launcher3.graphics.PreloadIconDrawable;
import com.android.launcher3.graphics.RotationMode;
import com.android.launcher3.pageindicators.WorkspacePageIndicator;
import com.android.launcher3.popup.PopupContainerWithArrow;
import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.touch.WorkspaceTouchListener;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.IntSparseArrayMap;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.util.Thunk;
import com.android.launcher3.util.WallpaperOffsetInterpolator;
import com.android.launcher3.widget.LauncherAppWidgetHostView;
import com.android.launcher3.widget.PendingAddShortcutInfo;
import com.android.launcher3.widget.PendingAddWidgetInfo;
import com.android.launcher3.widget.PendingAppWidgetHostView;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.function.Predicate;
/**
* The workspace is a wide area with a wallpaper and a finite number of pages.
* Each page contains a number of icons, folders or widgets the user can
* interact with. A workspace is meant to be used with a fixed width only.
*/
public class Workspace extends PagedView<WorkspacePageIndicator>
implements DropTarget, DragSource, View.OnTouchListener,
DragController.DragListener, Insettable, LauncherStateManager.StateHandler,
WorkspaceLayoutManager {
/** The value that {@link #mTransitionProgress} must be greater than for
* {@link #transitionStateShouldAllowDrop()} to return true. */
private static final float ALLOW_DROP_TRANSITION_PROGRESS = 0.25f;
/** The value that {@link #mTransitionProgress} must be greater than for
* {@link #isFinishedSwitchingState()} ()} to return true. */
private static final float FINISHED_SWITCHING_STATE_TRANSITION_PROGRESS = 0.5f;
private static final boolean ENFORCE_DRAG_EVENT_ORDER = false;
private static final int SNAP_OFF_EMPTY_SCREEN_DURATION = 400;
private static final int FADE_EMPTY_SCREEN_DURATION = 150;
private static final int ADJACENT_SCREEN_DROP_DURATION = 300;
private static final int DEFAULT_PAGE = 0;
public static final boolean MAP_NO_RECURSE = false;
public static final boolean MAP_RECURSE = true;
private LayoutTransition mLayoutTransition;
@Thunk final WallpaperManager mWallpaperManager;
private ShortcutAndWidgetContainer mDragSourceInternal;
@Thunk final IntSparseArrayMap<CellLayout> mWorkspaceScreens = new IntSparseArrayMap<>();
@Thunk final IntArray mScreenOrder = new IntArray();
@Thunk Runnable mRemoveEmptyScreenRunnable;
@Thunk boolean mDeferRemoveExtraEmptyScreen = false;
/**
* CellInfo for the cell that is currently being dragged
*/
private CellLayout.CellInfo mDragInfo;
/**
* Target drop area calculated during last acceptDrop call.
*/
@Thunk int[] mTargetCell = new int[2];
private int mDragOverX = -1;
private int mDragOverY = -1;
/**
* The CellLayout that is currently being dragged over
*/
@Thunk CellLayout mDragTargetLayout = null;
/**
* The CellLayout that we will show as highlighted
*/
private CellLayout mDragOverlappingLayout = null;
/**
* The CellLayout which will be dropped to
*/
private CellLayout mDropToLayout = null;
@Thunk final Launcher mLauncher;
@Thunk DragController mDragController;
private final Rect mTempRect = new Rect();
private final int[] mTempXY = new int[2];
private final float[] mTempFXY = new float[2];
@Thunk float[] mDragViewVisualCenter = new float[2];
private final float[] mTempTouchCoordinates = new float[2];
private SpringLoadedDragController mSpringLoadedDragController;
private boolean mIsSwitchingState = false;
boolean mChildrenLayersEnabled = true;
private boolean mStripScreensOnPageStopMoving = false;
private DragPreviewProvider mOutlineProvider = null;
private boolean m
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
本项目为基于Java语言的Launcher3手机桌面启动器设计源码,总计包含1148个文件,其中包括600个Java源文件、474个XML配置文件、40个PNG图片文件,以及少量mk、gradle、proto、bp、md、py、properties等辅助文件。该源码集成了Java和Python两种编程语言,适用于移动设备桌面界面开发领域。
资源推荐
资源详情
资源评论
收起资源包目录
基于Java语言的Launcher3手机桌面启动器设计源码 (1148个子文件)
aardwolf_dummy_app.apk 74KB
Android.bp 1KB
Android.bp 1KB
proguard.flags 2KB
.gitignore 207B
build.gradle 6KB
build.gradle 875B
settings.gradle 93B
launcher_protos.jar 57KB
plugin_core.jar 5KB
Workspace.java 136KB
CellLayout.java 109KB
Launcher.java 100KB
WindowTransformSwipeHandler.java 66KB
RecentsView.java 66KB
PagedView.java 59KB
Folder.java 55KB
LauncherProvider.java 43KB
GridSizeMigrationTask.java 43KB
LoaderTask.java 43KB
IconRecentsView.java 41KB
ColorExtractionAlgorithm.java 38KB
QuickstepAppTransitionManagerImpl.java 38KB
FloatingIconView.java 34KB
TaskView.java 33KB
LauncherInstrumentation.java 31KB
OverScroller.java 31KB
TouchInteractionService.java 31KB
Utilities.java 31KB
InstallShortcutReceiver.java 29KB
DragLayer.java 29KB
WidgetPreviewLoader.java 28KB
AutoInstallsLayout.java 27KB
DeviceProfile.java 25KB
FocusHelper.java 25KB
PopupContainerWithArrow.java 25KB
LauncherStateManager.java 25KB
AbstractStateChangeTouchController.java 24KB
FolderIcon.java 24KB
BubbleTextView.java 24KB
DragController.java 24KB
FolderPagedView.java 24KB
LauncherModel.java 23KB
InvariantDeviceProfile.java 23KB
AllAppsContainerView.java 23KB
DragView.java 22KB
AppWidgetResizeFrame.java 22KB
BaseIconCache.java 22KB
LauncherActivityControllerHelper.java 22KB
RaceConditionReproducer.java 21KB
FocusLogic.java 21KB
BaseDragLayer.java 19KB
ModelWriter.java 19KB
ArrowPopup.java 19KB
OtherActivityInputConsumer.java 19KB
ImportDataTask.java 19KB
UserEventDispatcher.java 18KB
ClipAnimationHelper.java 18KB
LauncherAccessibilityDelegate.java 18KB
PackageUpdatedTask.java 17KB
LoaderCursor.java 17KB
IconShape.java 17KB
AlphabeticalAppsList.java 16KB
TaskThumbnailView.java 16KB
NotificationListener.java 16KB
AllAppsRecyclerView.java 16KB
ScrimView.java 16KB
FolderAnimationManager.java 16KB
BgDataModel.java 16KB
IconNormalizer.java 15KB
PreviewItemManager.java 15KB
AbstractLauncherUiTest.java 15KB
FallbackNoButtonInputConsumer.java 14KB
LauncherAppWidgetHostView.java 14KB
SwipeDetector.java 14KB
TaskSystemShortcut.java 14KB
RecyclerViewFastScroller.java 14KB
PredictionRowView.java 14KB
LauncherState.java 14KB
PreviewBackground.java 14KB
BaseIconFactory.java 14KB
PortraitStatesTouchController.java 14KB
FloatingHeaderView.java 14KB
TaplTestsLauncher3.java 14KB
AnimatorPlaybackController.java 14KB
BindWidgetTest.java 13KB
ButtonDropTarget.java 13KB
AllAppsGridAdapter.java 13KB
DefaultLayoutParser.java 13KB
BaseLoaderResults.java 13KB
GridSizeMigrationTaskTest.java 13KB
AddItemActivity.java 12KB
AssistantTouchConsumer.java 12KB
PageIndicatorDots.java 12KB
TaskViewTouchController.java 12KB
PredictionUiStateManager.java 12KB
QsbContainerView.java 12KB
IconCacheUpdateHandler.java 12KB
ItemClickHandler.java 12KB
FastBitmapDrawable.java 12KB
共 1148 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
xyq2024
- 粉丝: 2421
- 资源: 5455
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- electron-v32.2.5-win32-x64资源包
- 日历组件使用········
- java班级管理系统(java毕业设计源码).zip
- bochb_assist_2.0.0.apk
- java无线点餐系统源码数据库 MySQL源码类型 WebForm
- 简历模板嵌入式常用知识&面试题库200M
- 常用基础元件的PCB封装库SchLib/IntLib通用原理图库接插件-脚距3.96
- 常用基础元件的PCB封装库SchLib/IntLib通用原理图库STM32 F2系列单片机
- 常用基础元件的PCB封装库SchLib/IntLib通用原理图库PIC系列单片机
- java通用后台管理系统源码数据库 MySQL源码类型 WebForm
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功