Loading quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java +10 −3 Original line number Diff line number Diff line Loading @@ -81,7 +81,9 @@ public class DesktopVisibilityController { StatefulActivity<LauncherState> activity = QuickstepLauncher.ACTIVITY_TRACKER.getCreatedActivity(); View workspaceView = mLauncher.getWorkspace(); if (activity == null || workspaceView == null || !isDesktopModeSupported()) return; if (activity == null || workspaceView == null || !isDesktopModeSupported()) { return; } if (mFreeformTasksVisible) { workspaceView.setVisibility(View.INVISIBLE); Loading @@ -93,7 +95,12 @@ public class DesktopVisibilityController { } else { workspaceView.setVisibility(View.VISIBLE); // If freeform isn't visible ensure that launcher appears resumed to behave normally. // Check activity state before calling setResumed(). Launcher may have been actually // paused (eg fullscreen task moved to front). // In this case we should not mark the activity as resumed. if (activity.isResumed()) { activity.setResumed(); } } } } quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +15 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ import com.android.quickstep.util.SplitSelectStateController; import com.android.quickstep.util.SplitToWorkspaceController; import com.android.quickstep.util.SplitWithKeyboardShortcutController; import com.android.quickstep.util.TISBindHelper; import com.android.quickstep.views.DesktopTaskView; import com.android.quickstep.views.OverviewActionsView; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; Loading Loading @@ -663,6 +664,20 @@ public class QuickstepLauncher extends Launcher { } } @Override public void setResumed() { if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) { DesktopVisibilityController controller = mDesktopVisibilityController; if (controller != null && controller.areFreeformTasksVisible()) { // Return early to skip setting activity to appear as resumed // TODO(b/255649902): shouldn't be needed when we have a separate launcher state // for desktop that we can use to control other parts of launcher return; } } super.setResumed(); } @Override protected void onDeferredResumed() { super.onDeferredResumed(); Loading quickstep/src/com/android/quickstep/views/DesktopTaskView.java +5 −1 Original line number Diff line number Diff line Loading @@ -59,10 +59,14 @@ import java.util.function.Consumer; // TODO(b/249371338): TaskView needs to be refactored to have better support for N tasks. public class DesktopTaskView extends TaskView { /** Flag to indicate whether desktop windowing proto 2 is enabled */ public static final boolean DESKTOP_IS_PROTO2_ENABLED = SystemProperties.getBoolean( "persist.wm.debug.desktop_mode_2", false); /** Flags to indicate whether desktop mode is available on the device */ public static final boolean DESKTOP_MODE_SUPPORTED = SystemProperties.getBoolean("persist.wm.debug.desktop_mode", false) || SystemProperties.getBoolean("persist.wm.debug.desktop_mode_2", false); || DESKTOP_IS_PROTO2_ENABLED; private static final String TAG = DesktopTaskView.class.getSimpleName(); Loading res/layout/work_mode_fab.xml +25 −14 Original line number Diff line number Diff line Loading @@ -12,24 +12,35 @@ See the License for the specific language governing permissions and limitations under the License. --> <com.android.launcher3.allapps.WorkModeSwitch xmlns:android="http://schemas.android.com/apk/res/android" style="@style/TextHeadline" <com.android.launcher3.allapps.WorkModeSwitch xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/work_mode_toggle" android:layout_alignParentBottom="true" android:layout_alignParentEnd="true" android:layout_height="@dimen/work_fab_height" android:layout_width="wrap_content" android:gravity="center" android:includeFontPadding="false" android:textDirection="locale" android:drawableTint="@color/all_apps_tab_text" android:textColor="@color/all_apps_tab_text" android:textSize="14sp" android:minHeight="@dimen/work_fab_height" android:gravity="center_vertical" android:background="@drawable/work_apps_toggle_background" android:forceHasOverlappingRendering="false" android:drawablePadding="8dp" android:drawableStart="@drawable/ic_corp_off" android:layout_marginBottom="@dimen/work_fab_margin_bottom" android:paddingLeft="@dimen/work_mode_fab_padding" android:paddingRight="@dimen/work_mode_fab_padding" android:text="@string/work_apps_pause_btn_text" /> No newline at end of file android:contentDescription="@string/work_apps_pause_btn_text" android:animateLayoutChanges="true"> <ImageView android:id="@+id/work_icon" android:layout_width="@dimen/work_fab_icon_size" android:layout_height="@dimen/work_fab_icon_size" android:importantForAccessibility="no" android:src="@drawable/ic_corp_off" android:scaleType="center"/> <TextView android:id="@+id/pause_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/all_apps_tab_text" android:textSize="14sp" android:includeFontPadding="false" android:textDirection="locale" android:text="@string/work_apps_pause_btn_text" android:layout_marginStart="@dimen/work_fab_text_start_margin" style="@style/TextHeadline"/> </com.android.launcher3.allapps.WorkModeSwitch> res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,8 @@ <!-- Floating action button inside work tab to toggle work profile --> <dimen name="work_fab_height">56dp</dimen> <dimen name="work_fab_radius">16dp</dimen> <dimen name="work_fab_icon_size">24dp</dimen> <dimen name="work_fab_text_start_margin">8dp</dimen> <dimen name="work_card_padding_horizontal">10dp</dimen> <dimen name="work_card_button_height">52dp</dimen> <dimen name="work_fab_margin">16dp</dimen> Loading Loading
quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java +10 −3 Original line number Diff line number Diff line Loading @@ -81,7 +81,9 @@ public class DesktopVisibilityController { StatefulActivity<LauncherState> activity = QuickstepLauncher.ACTIVITY_TRACKER.getCreatedActivity(); View workspaceView = mLauncher.getWorkspace(); if (activity == null || workspaceView == null || !isDesktopModeSupported()) return; if (activity == null || workspaceView == null || !isDesktopModeSupported()) { return; } if (mFreeformTasksVisible) { workspaceView.setVisibility(View.INVISIBLE); Loading @@ -93,7 +95,12 @@ public class DesktopVisibilityController { } else { workspaceView.setVisibility(View.VISIBLE); // If freeform isn't visible ensure that launcher appears resumed to behave normally. // Check activity state before calling setResumed(). Launcher may have been actually // paused (eg fullscreen task moved to front). // In this case we should not mark the activity as resumed. if (activity.isResumed()) { activity.setResumed(); } } } }
quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +15 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ import com.android.quickstep.util.SplitSelectStateController; import com.android.quickstep.util.SplitToWorkspaceController; import com.android.quickstep.util.SplitWithKeyboardShortcutController; import com.android.quickstep.util.TISBindHelper; import com.android.quickstep.views.DesktopTaskView; import com.android.quickstep.views.OverviewActionsView; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; Loading Loading @@ -663,6 +664,20 @@ public class QuickstepLauncher extends Launcher { } } @Override public void setResumed() { if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) { DesktopVisibilityController controller = mDesktopVisibilityController; if (controller != null && controller.areFreeformTasksVisible()) { // Return early to skip setting activity to appear as resumed // TODO(b/255649902): shouldn't be needed when we have a separate launcher state // for desktop that we can use to control other parts of launcher return; } } super.setResumed(); } @Override protected void onDeferredResumed() { super.onDeferredResumed(); Loading
quickstep/src/com/android/quickstep/views/DesktopTaskView.java +5 −1 Original line number Diff line number Diff line Loading @@ -59,10 +59,14 @@ import java.util.function.Consumer; // TODO(b/249371338): TaskView needs to be refactored to have better support for N tasks. public class DesktopTaskView extends TaskView { /** Flag to indicate whether desktop windowing proto 2 is enabled */ public static final boolean DESKTOP_IS_PROTO2_ENABLED = SystemProperties.getBoolean( "persist.wm.debug.desktop_mode_2", false); /** Flags to indicate whether desktop mode is available on the device */ public static final boolean DESKTOP_MODE_SUPPORTED = SystemProperties.getBoolean("persist.wm.debug.desktop_mode", false) || SystemProperties.getBoolean("persist.wm.debug.desktop_mode_2", false); || DESKTOP_IS_PROTO2_ENABLED; private static final String TAG = DesktopTaskView.class.getSimpleName(); Loading
res/layout/work_mode_fab.xml +25 −14 Original line number Diff line number Diff line Loading @@ -12,24 +12,35 @@ See the License for the specific language governing permissions and limitations under the License. --> <com.android.launcher3.allapps.WorkModeSwitch xmlns:android="http://schemas.android.com/apk/res/android" style="@style/TextHeadline" <com.android.launcher3.allapps.WorkModeSwitch xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/work_mode_toggle" android:layout_alignParentBottom="true" android:layout_alignParentEnd="true" android:layout_height="@dimen/work_fab_height" android:layout_width="wrap_content" android:gravity="center" android:includeFontPadding="false" android:textDirection="locale" android:drawableTint="@color/all_apps_tab_text" android:textColor="@color/all_apps_tab_text" android:textSize="14sp" android:minHeight="@dimen/work_fab_height" android:gravity="center_vertical" android:background="@drawable/work_apps_toggle_background" android:forceHasOverlappingRendering="false" android:drawablePadding="8dp" android:drawableStart="@drawable/ic_corp_off" android:layout_marginBottom="@dimen/work_fab_margin_bottom" android:paddingLeft="@dimen/work_mode_fab_padding" android:paddingRight="@dimen/work_mode_fab_padding" android:text="@string/work_apps_pause_btn_text" /> No newline at end of file android:contentDescription="@string/work_apps_pause_btn_text" android:animateLayoutChanges="true"> <ImageView android:id="@+id/work_icon" android:layout_width="@dimen/work_fab_icon_size" android:layout_height="@dimen/work_fab_icon_size" android:importantForAccessibility="no" android:src="@drawable/ic_corp_off" android:scaleType="center"/> <TextView android:id="@+id/pause_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/all_apps_tab_text" android:textSize="14sp" android:includeFontPadding="false" android:textDirection="locale" android:text="@string/work_apps_pause_btn_text" android:layout_marginStart="@dimen/work_fab_text_start_margin" style="@style/TextHeadline"/> </com.android.launcher3.allapps.WorkModeSwitch>
res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,8 @@ <!-- Floating action button inside work tab to toggle work profile --> <dimen name="work_fab_height">56dp</dimen> <dimen name="work_fab_radius">16dp</dimen> <dimen name="work_fab_icon_size">24dp</dimen> <dimen name="work_fab_text_start_margin">8dp</dimen> <dimen name="work_card_padding_horizontal">10dp</dimen> <dimen name="work_card_button_height">52dp</dimen> <dimen name="work_fab_margin">16dp</dimen> Loading