Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #1

Open
wants to merge 29 commits into
base: lineage-17.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f86fcc5
SystemShortcut: Add uninstall option
Jertlok Apr 9, 2019
0917f87
Launcher3: Ensure no divider shown in preferences
neobuddy89 Mar 8, 2020
8b1dc22
Launcher3: Use system fonts
neobuddy89 Dec 29, 2019
8f7dd05
Launcher3: Follow system color for dark style
neobuddy89 Dec 25, 2019
3b6aa95
Launcher3: Let's make the search bar on all apps round
eldainosor Nov 19, 2018
05025f0
Launcher3: double tap on home screen to turn off screen
Thecrazyskull Feb 10, 2017
f29d661
Launcher3: Make double tap to sleep gesture optional
Hikari-no-Tenshi Feb 5, 2020
ab641c7
Launcher3: use common style for recents task menu divider
maxwen Sep 1, 2018
ee37e65
disable promisse apps
gwolf2u Mar 18, 2020
f47a7f8
New Recents: add kill action to app shortcuts popup
ezio84 Nov 7, 2018
6992f83
Launcher3: new icon for kill app option
eldainosor Oct 12, 2019
3ab53fe
Revert "Launcher3: new icon for kill app option"
SirRGB Mar 30, 2023
4daac59
Revert "New Recents: add kill action to app shortcuts popup"
SirRGB Mar 30, 2023
f9d980e
Revert "Launcher3: use common style for recents task menu divider"
SirRGB Mar 30, 2023
9ed872f
Launcher3: update recent tasks header style
bvlj Aug 18, 2020
ed0808f
Fix misleading "Search apps" pt translation
th3rius Nov 11, 2021
f1bed18
Launcher3: Add AppInfo Bottom Sheet from Shade Launcher
amirzaidi Jan 9, 2020
c58fc35
Launcher3: Fix font family for App Info sheet
neobuddy89 May 27, 2020
a01c617
Launcher3: remove extra space for hotseat
maxwen Oct 22, 2019
d631b5c
Launcher3: Consider extra header content as visible elements
Nov 26, 2019
6777083
Increase all apps top padding to avoid visual glitch in recents
DennySPB Dec 6, 2019
4f319d9
[DNM] disable top shadow on statusbar
SirRGB May 24, 2023
ce83c37
Launcher3: Load backported notification icon from correct package
amirzaidi Jun 5, 2019
dd6bb24
Launcher3: Keep spring adaptive icon hidden until drag starts
amirzaidi Aug 13, 2019
65de34f
use system fonts
SirRGB Jun 4, 2023
2894ae4
Launcher3: add dark primary support
maxwen Jan 9, 2020
14d48fc
Launcher3: fix dark primary folder bg color
maxwen Jan 13, 2020
7a7f1db
Fix permission issue in legacy shortcut
pinyaoting Jun 2, 2023
af2fcd6
Fix permission bypass in legacy shortcut
pinyaoting Sep 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ else
LOCAL_MIN_SDK_VERSION := 26
endif
LOCAL_PACKAGE_NAME := TrebuchetQuickStep
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true
LOCAL_PRODUCT_MODULE := true
LOCAL_OVERRIDES_PACKAGES := Home Launcher2 Launcher3 Launcher3QuickStep
Expand Down
2 changes: 2 additions & 0 deletions AndroidManifest-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
<uses-permission android:name="android.permission.USE_BIOMETRIC" />


<uses-permission android:name="android.permission.DEVICE_POWER" />

<!--
Permissions required for read/write access to the workspace data. These permission name
should not conflict with that defined in other apps, as such an app should embed its package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ protected void onDraw(Canvas canvas) {
private Layout getAllAppsLabelLayout() {
if (mAllAppsLabelLayout == null) {
mPaint.setAntiAlias(true);
mPaint.setTypeface(Typeface.create("sans-serif-medium", Typeface.NORMAL));
mPaint.setTypeface(Typeface.create("@*android:string/config_headlineFontFamilyMedium", Typeface.NORMAL));
mPaint.setTextSize(
getResources().getDimensionPixelSize(R.dimen.all_apps_label_text_size));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,6 @@ public class TaskMenuView extends AbstractFloatingView {

private static final Rect sTempRect = new Rect();

private final OnScaleUpdateListener mTaskViewIconScaleListener = new OnScaleUpdateListener() {
@Override
public void onScaleUpdate(float scale) {
final Drawable drawable = mTaskIcon.getDrawable();
if (drawable instanceof FastBitmapDrawable) {
if (scale != ((FastBitmapDrawable) drawable).getScale()) {
mMenuIconDrawable.setScale(scale);
}
}
}
};

private final OnScaleUpdateListener mMenuIconScaleListener = new OnScaleUpdateListener() {
@Override
public void onScaleUpdate(float scale) {
Expand All @@ -86,14 +74,10 @@ public void onScaleUpdate(float scale) {
private static final int REVEAL_OPEN_DURATION = 150;
private static final int REVEAL_CLOSE_DURATION = 100;

private final float mThumbnailTopMargin;
private BaseDraggingActivity mActivity;
private TextView mTaskName;
private IconView mTaskIcon;
private AnimatorSet mOpenCloseAnimator;
private TaskView mTaskView;
private LinearLayout mOptionLayout;
private FastBitmapDrawable mMenuIconDrawable;

public TaskMenuView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
Expand All @@ -103,14 +87,11 @@ public TaskMenuView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);

mActivity = BaseDraggingActivity.fromContext(context);
mThumbnailTopMargin = getResources().getDimension(R.dimen.task_thumbnail_top_margin);
}

@Override
protected void onFinishInflate() {
super.onFinishInflate();
mTaskName = findViewById(R.id.task_name);
mTaskIcon = findViewById(R.id.task_icon);
mOptionLayout = findViewById(R.id.menu_option_layout);
}

Expand Down Expand Up @@ -141,23 +122,14 @@ public void logActionCommand(int command) {
// TODO
}

@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();

// Remove all scale listeners when menu is removed
mTaskView.getIconView().removeUpdateScaleListener(mTaskViewIconScaleListener);
mTaskIcon.removeUpdateScaleListener(mMenuIconScaleListener);
}

@Override
protected boolean isOfType(int type) {
return (type & TYPE_TASK_MENU) != 0;
}

public void setPosition(float x, float y) {
setX(x);
setY(y + mThumbnailTopMargin);
setY(y);
}

public static TaskMenuView showForTask(TaskView taskView) {
Expand All @@ -180,23 +152,6 @@ private boolean populateAndShowForTask(TaskView taskView) {
}

private void addMenuOptions(TaskView taskView) {
Drawable icon = taskView.getTask().icon.getConstantState().newDrawable();
mTaskIcon.setDrawable(icon);
mTaskIcon.setOnClickListener(v -> close(true));
mTaskName.setText(TaskUtils.getTitle(getContext(), taskView.getTask()));
mTaskName.setOnClickListener(v -> close(true));

// Set the icons to match scale by listening to each other's changes
mMenuIconDrawable = icon instanceof FastBitmapDrawable ? (FastBitmapDrawable) icon : null;
taskView.getIconView().addUpdateScaleListener(mTaskViewIconScaleListener);
mTaskIcon.addUpdateScaleListener(mMenuIconScaleListener);

// Move the icon and text up half an icon size to lay over the TaskView
LinearLayout.LayoutParams params =
(LinearLayout.LayoutParams) mTaskIcon.getLayoutParams();
params.topMargin = (int) -mThumbnailTopMargin;
mTaskIcon.setLayoutParams(params);

final BaseDraggingActivity activity = BaseDraggingActivity.fromContext(getContext());
final List<TaskSystemShortcut> shortcuts =
TaskOverlayFactory.INSTANCE.get(getContext()).getEnabledShortcuts(taskView);
Expand All @@ -221,12 +176,11 @@ private void orientAroundTaskView(TaskView taskView) {
mActivity.getDragLayer().getDescendantRectRelativeToSelf(taskView, sTempRect);
Rect insets = mActivity.getDragLayer().getInsets();
BaseDragLayer.LayoutParams params = (BaseDragLayer.LayoutParams) getLayoutParams();
params.width = taskView.getMeasuredWidth();
params.gravity = Gravity.START;
params.gravity = Gravity.END;
setLayoutParams(params);
setScaleX(taskView.getScaleX());
setScaleY(taskView.getScaleY());
setPosition(sTempRect.left - insets.left, sTempRect.top - insets.top);
setY(sTempRect.top - insets.top);
}

private void animateOpen() {
Expand Down Expand Up @@ -274,9 +228,10 @@ private void closeComplete() {
}

private RoundedRectRevealOutlineProvider createOpenCloseOutlineProvider() {
final int width = getWidth();
float radius = Themes.getDialogCornerRadius(getContext());
Rect fromRect = new Rect(0, 0, getWidth(), 0);
Rect toRect = new Rect(0, 0, getWidth(), getHeight());
Rect fromRect = new Rect(width, 0, width, 0);
Rect toRect = new Rect(0, 0, width, getHeight());
return new RoundedRectRevealOutlineProvider(radius, radius, fromRect, toRect);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
import android.view.View;
import android.view.ViewOutlineProvider;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.android.launcher3.BaseDraggingActivity;
Expand Down Expand Up @@ -80,7 +82,7 @@
/**
* A task in the Recents view.
*/
public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
public class TaskView extends LinearLayout implements PageCallbacks, Reusable {

private static final String TAG = TaskView.class.getSimpleName();

Expand Down Expand Up @@ -151,7 +153,10 @@ public void onViewDetachedFromWindow(View view) {
private Task mTask;
private TaskThumbnailView mSnapshotView;
private TaskMenuView mMenuView;
private View mTaskInfoContainer;
private IconView mIconView;
private TextView mNameView;
private ImageView mMenuIconView;
private final DigitalWellBeingToast mDigitalWellBeingToast;
private float mCurveScale;
private float mFullscreenProgress;
Expand Down Expand Up @@ -223,7 +228,10 @@ Touch.TAP, Direction.NONE, getRecentsView().indexOfChild(this),
protected void onFinishInflate() {
super.onFinishInflate();
mSnapshotView = findViewById(R.id.snapshot);
mTaskInfoContainer = findViewById(R.id.task_info_container);
mIconView = findViewById(R.id.icon);
mNameView = findViewById(R.id.name);
mMenuIconView = findViewById(R.id.menu);
}

public TaskMenuView getMenuView() {
Expand Down Expand Up @@ -350,6 +358,8 @@ public void onTaskListVisibilityChanged(boolean visible) {
mIconLoadRequest = iconCache.updateIconInBackground(mTask,
(task) -> {
setIcon(task.icon);
setName(task);
setMenu(true);
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask()) {
getRecentsView().updateLiveTileIcon(task.icon);
}
Expand All @@ -358,6 +368,8 @@ public void onTaskListVisibilityChanged(boolean visible) {
} else {
mSnapshotView.setThumbnail(null, null);
setIcon(null);
setName(null);
setMenu(false);
// Reset the task thumbnail reference as well (it will be fetched from the cache or
// reloaded next time we need it)
mTask.thumbnail = null;
Expand Down Expand Up @@ -387,17 +399,24 @@ private boolean showTaskMenu(int action) {
}

private void setIcon(Drawable icon) {
if (icon != null) {
mIconView.setDrawable(icon);
mIconView.setOnClickListener(v -> showTaskMenu(Touch.TAP));
mIconView.setOnLongClickListener(v -> {
mIconView.setDrawable(icon);
}

private void setName(Task task) {
mNameView.setText(task == null ?
"" : TaskUtils.getTitle(getContext(), task));
}

private void setMenu(boolean enable) {
if (enable) {
mMenuIconView.setOnClickListener(v -> showTaskMenu(Touch.TAP));
mMenuIconView.setOnLongClickListener(v -> {
requestDisallowInterceptTouchEvent(true);
return showTaskMenu(Touch.LONGPRESS);
});
} else {
mIconView.setDrawable(null);
mIconView.setOnClickListener(null);
mIconView.setOnLongClickListener(null);
mMenuIconView.setOnClickListener(null);
mMenuIconView.setOnLongClickListener(null);
}
}

Expand All @@ -412,8 +431,7 @@ private void setIconAndDimTransitionProgress(float progress, boolean invert) {
float upperClamp = invert ? 1 : iconScalePercentage;
float scale = Interpolators.clampToProgress(FAST_OUT_SLOW_IN, lowerClamp, upperClamp)
.getInterpolation(progress);
mIconView.setScaleX(scale);
mIconView.setScaleY(scale);
mTaskInfoContainer.setAlpha(scale);

mFooterVerticalOffset = 1.0f - scale;
for (FooterWrapper footer : mFooters) {
Expand Down Expand Up @@ -499,7 +517,8 @@ public void onPageScroll(ScrollState scrollState) {
}

if (mMenuView != null) {
mMenuView.setPosition(getX() - getRecentsView().getScrollX(), getY());
mMenuView.setPosition(getX() - getRecentsView().getScrollX() +
getWidth() - (int) mMenuView.getWidth(), getY());
mMenuView.setScaleX(getScaleX());
mMenuView.setScaleY(getScaleY());
}
Expand Down Expand Up @@ -794,7 +813,7 @@ public void setFullscreenProgress(float progress) {
}
mFullscreenProgress = progress;
boolean isFullscreen = mFullscreenProgress > 0;
mIconView.setVisibility(progress < 1 ? VISIBLE : INVISIBLE);
mTaskInfoContainer.setVisibility(progress < 1 ? VISIBLE : INVISIBLE);
setClipChildren(!isFullscreen);
setClipToPadding(!isFullscreen);

Expand Down
12 changes: 12 additions & 0 deletions quickstep/res/drawable/ic_task_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/workspaceTextColor">

<path
android:fillColor="#FFFFFFFF"
android:pathData="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z" />
</vector>
6 changes: 3 additions & 3 deletions quickstep/res/drawable/task_menu_bg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
<!-- Background -->
<shape>
<corners
android:topLeftRadius="?android:attr/dialogCornerRadius"
android:topRightRadius="?android:attr/dialogCornerRadius"
android:bottomLeftRadius="0dp"
android:bottomRightRadius="0dp" />
android:topLeftRadius="?android:attr/dialogCornerRadius"
android:bottomLeftRadius="?android:attr/dialogCornerRadius"
android:bottomRightRadius="?android:attr/dialogCornerRadius" />
<solid android:color="?attr/popupColorPrimary" />
</shape>
</item>
Expand Down
2 changes: 1 addition & 1 deletion quickstep/res/layout/digital_wellbeing_toast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/bg_wellbeing_toast"
android:fontFamily="sans-serif"
android:fontFamily="@*android:string/config_bodyFontFamily"
android:forceHasOverlappingRendering="false"
android:gravity="center"
android:importantForAccessibility="noHideDescendants"
Expand Down
55 changes: 45 additions & 10 deletions quickstep/res/layout/task.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,55 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:defaultFocusHighlightEnabled="false"
android:elevation="4dp"
android:orientation="vertical"
android:focusable="true">

<RelativeLayout
android:id="@+id/task_info_container"
android:layout_width="wrap_content"
android:layout_height="@dimen/task_thumbnail_icon_size"
android:orientation="horizontal"
android:layout_marginBottom="8dp"
android:focusable="false">

<com.android.quickstep.views.IconView
android:id="@+id/icon"
android:layout_width="@dimen/task_thumbnail_icon_size"
android:layout_height="match_parent"
android:focusable="false"
android:layout_alignParentEnd="true"
android:importantForAccessibility="no"/>

<ImageView
android:id="@+id/menu"
android:layout_width="@dimen/task_thumbnail_icon_size"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:padding="6dp"
android:background="?android:attr/selectableItemBackground"
android:src="@drawable/ic_task_menu" />

<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:layout_toStartOf="@id/icon"
android:layout_marginStart="@dimen/task_thumbnail_icon_size"
android:focusable="false"
android:singleLine="true"
android:ellipsize="end"
android:textColor="?attr/workspaceTextColor"
android:textSize="16sp"/>
</RelativeLayout>

<com.android.quickstep.views.TaskThumbnailView
android:id="@+id/snapshot"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/task_thumbnail_top_margin"/>
android:elevation="4dp" />

<com.android.quickstep.views.IconView
android:id="@+id/icon"
android:layout_width="@dimen/task_thumbnail_icon_size"
android:layout_height="@dimen/task_thumbnail_icon_size"
android:layout_gravity="top|center_horizontal"
android:focusable="false"
android:importantForAccessibility="no"/>
</com.android.quickstep.views.TaskView>
</com.android.quickstep.views.TaskView>
Loading