mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
This cl adds the unpin option by tracking the hotseat/taskbar state. The option shown is determined by the following conditions: 1. If the target non-predicted item is on the taskbar, shows "Unpin from taskbar" 2. If the taskbar is not full, that is, reaching the limit of the available spaces, and the target item is anywhere outside of the taskbar, including All apps, shows "Pin to taskbar". 3. If the taskbar is full, simply don't show any shortcut option. This cl also removes the option that will be shown on Launcher homescreen or hotseat, as further UX alignment is needed. One note about why the pin shortcut is not implemented in the getShortcuts(). The reason is that getShortcuts does not have the ItemInfo of the triggered item, while the SystemShortcut.Factory doesn't have the hotseat/taskbar information. The simplest way at this point is to check all the conditions in the controller and then manually add the shortcut into the list. Bug: 375648361 Test: Manual, Recording uploaded to buganizer Flag: com.android.launcher3.enable_pinning_app_with_context_menu Change-Id: I7d048bcb1b00f78651e909fbfcd911052a4cd4ef
29 lines
1.2 KiB
XML
29 lines
1.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?><!--
|
|
~ Copyright (C) 2025 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.
|
|
-->
|
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
android:width="24dp"
|
|
android:height="24dp"
|
|
android:viewportWidth="24"
|
|
android:viewportHeight="24">
|
|
<group>
|
|
<clip-path
|
|
android:pathData="M0,0h24v24h-24z"/>
|
|
<path
|
|
android:pathData="M17,3V5H16V13.175L14,11.175V5H10V7.175L7.825,5L7,4.175V3H17ZM12,23L11,22V16H6V14L8,12V10.85L1.4,4.2L2.8,2.8L21.2,21.2L19.75,22.6L13.15,16H13V22L12,23ZM8.85,14H11.15L10.05,12.9L10,12.85L8.85,14Z"
|
|
android:fillColor="#FF000000"/>
|
|
</group>
|
|
</vector>
|