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

DerpLauncher: Add zh-rTW translations #21

Open
wants to merge 20 commits into
base: 14
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5618f90
DerpLauncher: Bring back QuickSpace events
neobuddy89 Sep 17, 2022
7300cba
DerpLauncher: Bring back 4x4 grid option
Kapp509840 Dec 24, 2022
ce88ea2
DerpLauncher: Set app drawer opacity to 91
clarencelol Feb 2, 2024
0f80d2b
DerpLauncher: Allow the blur to be completely disabled
nivlafx Nov 2, 2023
e81f8ae
DerpLauncher: Follow all apps background for taskbar slide in view
neobuddy89 Apr 9, 2023
d2cc698
DerpLauncher: QuickstepAtomicAnimationFactory: Add null checks to pre…
idoybh Apr 5, 2024
aa6547c
DerpLauncher: Don't create work space for parallel users
Dhina17 Apr 5, 2024
43b0aa7
DerpLauncher: Launch apps in freeform mode system shortcut
minaripenguin Sep 16, 2023
22305d0
DerpLauncher: Hide freeform shortcut if app doesnt support freeform
minaripenguin Sep 17, 2023
57a391c
DerpLauncher: freeform: Launch tasks as tasks overlays
minaripenguin Sep 17, 2023
d39bca3
Merge tag 'android-14.0.0_r31' of https://android.googlesource.com/pl…
NurKeinNeid Apr 7, 2024
c0409e0
DerpLauncher: Bump version to AP1A.240405.002
NurKeinNeid Apr 7, 2024
70d344f
Revert "DerpLauncher: Add support for toggling taskbar"
NurKeinNeid Apr 7, 2024
883a854
DerpLauncher: Add support for toggling taskbar
kdrag0n Apr 11, 2022
7752f2f
DerpLauncher: Derp more quickspace strings
NurKeinNeid Apr 7, 2024
289e66d
DerpLauncher: Set about app version to untranslatable
NurKeinNeid Apr 8, 2024
876e7a1
DerpLauncher: Fix spit drawable gravity in recents
iKeramat Apr 9, 2024
9c20730
fixup! DerpLauncher: allow disabling overview action chips
iKeramat Apr 9, 2024
e32f7af
DerpLauncher: Restart on disabling overview action chips
iKeramat Apr 9, 2024
020243b
DerpLauncher: Add zh-rTW translations
nnn950711 Apr 11, 2024
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
6 changes: 6 additions & 0 deletions AndroidManifest-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
<!-- AppLock -->
<uses-permission android:name="com.android.permission.MANAGE_APP_LOCK" />

<!-- OmniWeather -->
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL" />
<uses-permission android:name="org.omnirom.omnijaws.READ_WEATHER" />
<uses-permission android:name="android.permission.GET_INTENT_SENDER_INTENT" />
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />

<!--
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
3 changes: 3 additions & 0 deletions privapp_whitelist_com.android.launcher3-ext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
<permission name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
<permission name="android.permission.MANAGE_USERS"/>
<permission name="android.permission.MEDIA_CONTENT_CONTROL"/>
<permission name="android.permission.GET_INTENT_SENDER_INTENT"/>
<permission name="com.android.alarm.permission.SET_ALARM"/>
</privapp-permissions>
</permissions>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.graphics.Outline;
Expand All @@ -37,14 +38,16 @@
import com.android.launcher3.util.Executors;
import com.android.launcher3.util.MultiPropertyFactory;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.quickstep.NavHandle;
import com.android.systemui.shared.navigationbar.RegionSamplingHelper;

import java.io.PrintWriter;

/**
* Handles properties/data collection, then passes the results to our stashed handle View to render.
*/
public class StashedHandleViewController implements TaskbarControllers.LoggableTaskbarController {
public class StashedHandleViewController implements TaskbarControllers.LoggableTaskbarController,
NavHandle {

public static final int ALPHA_INDEX_STASHED = 0;
public static final int ALPHA_INDEX_HOME_DISABLED = 1;
Expand Down Expand Up @@ -302,4 +305,24 @@ public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "\tmStashedHandleHeight=" + mStashedHandleHeight);
mRegionSamplingHelper.dump(prefix, pw);
}

@Override
public void animateNavBarLongPress(boolean isTouchDown, boolean shrink, long durationMs) {
// TODO(b/308693847): Animate similarly to NavigationHandle.java (SysUI).
}

@Override
public boolean isNavHandleStashedTaskbar() {
return true;
}

@Override
public boolean canNavHandleBeLongPressed() {
return isStashedHandleVisible();
}

@Override
public int getNavHandleWidth(Context context) {
return mStashedHandleWidth;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
import com.android.launcher3.util.VibratorWrapper;
import com.android.launcher3.util.ViewCache;
import com.android.launcher3.views.ActivityContext;
import com.android.quickstep.NavHandle;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.Task;
Expand Down Expand Up @@ -580,6 +581,11 @@ public BubbleControllers getBubbleControllers() {
return mControllers.bubbleControllers.orElse(null);
}

@NonNull
public NavHandle getNavHandle() {
return mControllers.stashedHandleViewController;
}

@Override
public ViewCache getViewCache() {
return mViewCache;
Expand Down
23 changes: 20 additions & 3 deletions quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider;
import com.android.wm.shell.Flags;

import android.provider.Settings;

import java.io.PrintWriter;
import java.util.StringJoiner;

Expand Down Expand Up @@ -105,6 +107,9 @@ public class TaskbarManager {
private static final Uri NAV_BAR_KIDS_MODE = Settings.Secure.getUriFor(
Settings.Secure.NAV_BAR_KIDS_MODE);

private static final Uri ENABLE_TASKBAR_URI = Settings.System.getUriFor(
Settings.System.ENABLE_TASKBAR);

private final Context mContext;
private final @Nullable Context mNavigationBarPanelContext;
private WindowManager mWindowManager;
Expand Down Expand Up @@ -137,6 +142,7 @@ public class TaskbarManager {
*/
private final OnIDPChangeListener mIdpChangeListener = c -> recreateTaskbar();
private final SettingsCache.OnChangeListener mOnSettingsChangeListener = c -> recreateTaskbar();
private final SettingsCache.OnChangeListener mEnableTaskBarListener;

private boolean mUserUnlocked = false;

Expand Down Expand Up @@ -276,6 +282,18 @@ public void onLowMemory() { }
SettingsCache.INSTANCE.get(mContext)
.register(NAV_BAR_KIDS_MODE, mOnSettingsChangeListener);
Log.d(TASKBAR_NOT_DESTROYED_TAG, "registering component callbacks from constructor.");
mEnableTaskBarListener = c -> {
// Create the illusion of this taking effect immediately
// Also needed because TaskbarManager inits before SystemUiProxy on start
boolean enabled = Settings.System.getInt(mContext.getContentResolver(),
Settings.System.ENABLE_TASKBAR, 0) == 1;
SystemUiProxy.INSTANCE.get(mContext).setTaskbarEnabled(enabled);

// Restart launcher
System.exit(0);
};
SettingsCache.INSTANCE.get(mContext)
.register(ENABLE_TASKBAR_URI, mEnableTaskBarListener);
mContext.registerComponentCallbacks(mComponentCallbacks);
mShutdownReceiver.register(mContext, Intent.ACTION_SHUTDOWN);
UI_HELPER_EXECUTOR.execute(() -> {
Expand Down Expand Up @@ -428,13 +446,12 @@ public void recreateTaskbar() {
destroyExistingTaskbar();

boolean isTaskbarEnabled = dp != null && isTaskbarPresent(dp);

SystemUiProxy sysui = SystemUiProxy.INSTANCE.get(mContext);
sysui.setTaskbarEnabled(isTaskbarEnabled);
debugWhyTaskbarNotDestroyed("recreateTaskbar: isTaskbarEnabled=" + isTaskbarEnabled
+ " [dp != null (i.e. mUserUnlocked)]=" + (dp != null)
+ " FLAG_HIDE_NAVBAR_WINDOW=" + ENABLE_TASKBAR_NAVBAR_UNIFICATION
+ " dp.isTaskbarPresent=" + (dp == null ? "null" : dp.isTaskbarPresent));
SystemUiProxy sysui = SystemUiProxy.INSTANCE.get(mContext);
sysui.setTaskbarEnabled(isTaskbarEnabled);
if (!isTaskbarEnabled) {
sysui.notifyTaskbarStatus(/* visible */ false, /* stashed */ false);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.Utilities;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ public static Map<UserHandle, UserIconInfo> queryAllUsers(Context context) {
UserManager um = context.getSystemService(UserManager.class);
Map<UserHandle, UserIconInfo> users = new ArrayMap<>();
List<UserHandle> usersActual = um.getUserProfiles();
usersActual.addAll(ParallelSpaceManager.getInstance().getParallelUserHandles());
List<UserHandle> parallelUsers =
ParallelSpaceManager.getInstance().getParallelUserHandles();
usersActual.addAll(parallelUsers);
if (usersActual != null) {
for (UserHandle user : usersActual) {
if (android.os.Flags.allowPrivateProfile() && Flags.enablePrivateSpace()) {
Expand All @@ -93,7 +95,10 @@ public static Map<UserHandle, UserIconInfo> queryAllUsers(Context context) {
// Simple check to check if the provided user is work profile
// TODO: Migrate to a better platform API
NoopDrawable d = new NoopDrawable();
boolean isWork = (d != context.getPackageManager().getUserBadgedIcon(d, user));
// Parallel users also have badge so don't consider it as work profile
boolean isParallelUser = parallelUsers.contains(user);
boolean isWork = !isParallelUser &&
d != context.getPackageManager().getUserBadgedIcon(d, user);
UserIconInfo info = new UserIconInfo(
user,
isWork ? UserIconInfo.TYPE_WORK : UserIconInfo.TYPE_MAIN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.popup.QuickstepSystemShortcut.getSplitSelectShortcutByPosition;
import static com.android.launcher3.popup.SystemShortcut.APP_INFO;
import static com.android.launcher3.popup.SystemShortcut.FREE_FORM;
import static com.android.launcher3.popup.SystemShortcut.INSTALL;
import static com.android.launcher3.popup.SystemShortcut.WIDGETS;
import static com.android.launcher3.taskbar.LauncherTaskbarUIController.ALL_APPS_PAGE_PROGRESS_INDEX;
Expand Down Expand Up @@ -443,6 +444,7 @@ public Stream<SystemShortcut.Factory> getSupportedShortcuts() {
List<SystemShortcut.Factory> shortcuts = new ArrayList(Arrays.asList(
APP_INFO, WellbeingModel.SHORTCUT_FACTORY, mHotseatPredictionController));
shortcuts.addAll(getSplitShortcuts());
shortcuts.add(FREE_FORM);
shortcuts.add(WIDGETS);
shortcuts.add(INSTALL);
return shortcuts.stream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,21 @@ public void prepareForAtomicAnimation(LauncherState fromState, LauncherState toS

Workspace<?> workspace = mActivity.getWorkspace();
// Start from a higher workspace scale, but only if we're invisible so we don't jump.
boolean isWorkspaceVisible = workspace.getVisibility() == VISIBLE;
boolean isWorkspaceVisible = workspace != null && workspace.getVisibility() == VISIBLE;
if (isWorkspaceVisible) {
CellLayout currentChild = (CellLayout) workspace.getChildAt(
workspace.getCurrentPage());
isWorkspaceVisible = currentChild.getVisibility() == VISIBLE
isWorkspaceVisible = currentChild != null && currentChild.getVisibility() == VISIBLE
&& currentChild.getShortcutsAndWidgets().getAlpha() > 0;
}
if (!isWorkspaceVisible) {
if (!isWorkspaceVisible && workspace != null) {
workspace.setScaleX(WORKSPACE_PREPARE_SCALE);
workspace.setScaleY(WORKSPACE_PREPARE_SCALE);
}
Hotseat hotseat = mActivity.getHotseat();
boolean isHotseatVisible = hotseat.getVisibility() == VISIBLE && hotseat.getAlpha() > 0;
if (!isHotseatVisible) {
boolean isHotseatVisible = hotseat != null
&& hotseat.getVisibility() == VISIBLE && hotseat.getAlpha() > 0;
if (!isHotseatVisible && hotseat != null) {
hotseat.setScaleX(WORKSPACE_PREPARE_SCALE);
hotseat.setScaleY(WORKSPACE_PREPARE_SCALE);
}
Expand All @@ -184,7 +185,7 @@ public void prepareForAtomicAnimation(LauncherState fromState, LauncherState toS
config.setInterpolator(ANIM_OVERVIEW_FADE, OVERSHOOT_1_2);

// Scale up the recents, if it is not coming from the side
if (overview.getVisibility() != VISIBLE || overview.getContentAlpha() == 0) {
if (overview != null && overview.getVisibility() != VISIBLE || overview.getContentAlpha() == 0) {
RECENTS_SCALE_PROPERTY.set(overview, RECENTS_PREPARE_SCALE);
}
}
Expand Down
54 changes: 54 additions & 0 deletions quickstep/src/com/android/quickstep/NavHandle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright (C) 2024 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.quickstep;

import android.content.Context;

import com.android.launcher3.R;

/**
* Control and get information about the gesture nav bar at the bottom of the screen, which has
* historically been drawn by SysUI, but is also emulated by the stashed Taskbar on large screens.
*/
public interface NavHandle {

/**
* Animate the nav bar being long-pressed.
*
* @param isTouchDown {@code true} if the button is starting to be pressed ({@code false} if
* released or canceled)
* @param shrink {@code true} if the handle should shrink, {@code false} if it should grow
* @param durationMs how long the animation should take (for the {@code isTouchDown} case, this
* should be the same as the amount of time to trigger a long-press)
*/
void animateNavBarLongPress(boolean isTouchDown, boolean shrink, long durationMs);

/** @return {@code true} if this nav handle is actually the stashed taskbar */
default boolean isNavHandleStashedTaskbar() {
return false;
}

/** @return {@code true} if this nav handle can currently accept long presses */
default boolean canNavHandleBeLongPressed() {
return true;
}

/** @return the width of this nav handle, in pixels */
default int getNavHandleWidth(Context context) {
return context.getResources().getDimensionPixelSize(R.dimen.navigation_home_handle_width);
}
}
2 changes: 1 addition & 1 deletion quickstep/src/com/android/quickstep/SystemUiProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
/**
* Holds the reference to SystemUI.
*/
public class SystemUiProxy implements ISystemUiProxy {
public class SystemUiProxy implements ISystemUiProxy, NavHandle {
private static final String TAG = SystemUiProxy.class.getSimpleName();

public static final MainThreadInitializedObject<SystemUiProxy> INSTANCE =
Expand Down
16 changes: 12 additions & 4 deletions quickstep/src/com/android/quickstep/TouchInteractionService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1002,14 +1002,22 @@ private InputConsumer newConsumer(
base = new TaskbarUnstashInputConsumer(this, base, mInputMonitorCompat, tac,
mOverviewCommandHelper);
}
} else if (canStartSystemGesture && !previousGestureState.isRecentsAnimationRunning()) {
}

NavHandle navHandle = tac != null ? tac.getNavHandle()
: SystemUiProxy.INSTANCE.get(this);
if (canStartSystemGesture && !previousGestureState.isRecentsAnimationRunning()
&& navHandle.canNavHandleBeLongPressed()) {
reasonString.append(NEWLINE_PREFIX)
.append(reasonPrefix)
.append(SUBSTRING_PREFIX)
.append("Not running recents animation, ")
.append("using NavHandleLongPressInputConsumer");
.append("Not running recents animation, ");
if (tac != null && tac.getNavHandle().canNavHandleBeLongPressed()) {
reasonString.append("stashed handle is long-pressable, ");
}
reasonString.append("using NavHandleLongPressInputConsumer");
base = new NavHandleLongPressInputConsumer(this, base, mInputMonitorCompat,
mDeviceState);
mDeviceState, navHandle);
}

if (mDeviceState.isBubblesExpanded()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.android.launcher3.R;
import com.android.launcher3.util.ResourceBasedOverride;
import com.android.quickstep.NavHandle;

/**
* Class for extending nav handle long press behavior
Expand All @@ -42,19 +43,26 @@ public static NavHandleLongPressHandler newInstance(Context context) {
* A Runnable is returned here to ensure the InputConsumer can call
* {@link android.view.InputMonitor#pilferPointers()} before invoking the long press behavior
* since pilfering can break the long press behavior.
*
* @param navHandle to handle this long press
*/
public @Nullable Runnable getLongPressRunnable() {
public @Nullable Runnable getLongPressRunnable(NavHandle navHandle) {
return null;
}

/**
* Called when nav handle gesture starts.
*
* @param navHandle to handle the animation for this touch
*/
public void onTouchStarted() {}
public void onTouchStarted(NavHandle navHandle) {}

/**
* Called when nav handle gesture is finished by the user lifting their finger or the system
* cancelling the touch for some other reason.
*
* @param navHandle to handle the animation for this touch
* @param reason why the touch ended
*/
public void onTouchFinished(String reason) {}
public void onTouchFinished(NavHandle navHandle, String reason) {}
}
Loading