Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 931845fc authored by Winson's avatar Winson
Browse files

Dev preview changes for incompatible apps.

- Disable drop targets when picking up a task that can’t be docked, and
  show toast notifying user (for now)
- When a task is docked, update the task headers for non-dockable tasks
  to indicate that they don’t support multi window.  Update these 
  headers every time the multi window state changes.

Bug: 26774190
Change-Id: I020dcbac9b1230dba166eecaa12366986e684f9e
parent fbb584df
Loading
Loading
Loading
Loading
+31 −11
Original line number Diff line number Diff line
@@ -30,21 +30,41 @@
        android:paddingBottom="8dp"
        android:paddingStart="12dp"
        android:paddingEnd="16dp" />
    <TextView
        android:id="@+id/title"
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical|start"
        android:layout_marginStart="56dp"
        android:layout_marginEnd="112dp"
        android:layout_marginEnd="56dp"
        android:orientation="vertical">
        <TextView
            android:id="@+id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="start"
            android:textSize="16sp"
            android:textColor="#ffffffff"
            android:text="@string/recents_empty_message"
            android:fontFamily="sans-serif-medium"
            android:singleLine="true"
        android:maxLines="2"
            android:maxLines="1"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal" />
        <TextView
            android:id="@+id/sub_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="start"
            android:textSize="11sp"
            android:textColor="#ffffffff"
            android:text="@string/recents_launch_non_dockable_task_label"
            android:fontFamily="sans-serif-medium"
            android:singleLine="true"
            android:maxLines="1"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal"
            android:visibility="gone" />
    </LinearLayout>
    <com.android.systemui.recents.views.FixedSizeImageView
        android:id="@+id/move_task"
        android:layout_width="@dimen/recents_task_view_header_button_width"
+4 −0
Original line number Diff line number Diff line
@@ -722,6 +722,10 @@
    <string name="recents_history_button_label">History</string>
    <!-- Recents: History clear all string. [CHAR LIMIT=NONE] -->
    <string name="recents_history_clear_all_button_label">Clear</string>
    <!-- Recents: Non-dockable task drag message. [CHAR LIMIT=NONE] -->
    <string name="recents_drag_non_dockable_task_message">This app does not support multi-window</string>
    <!-- Recents: Non-dockable task launch sub header. [CHAR LIMIT=NONE] -->
    <string name="recents_launch_non_dockable_task_label">App does not support multi-window</string>

    <!-- Recents: MultiStack add stack split horizontal radio button. [CHAR LIMIT=NONE] -->
    <string name="recents_multistack_add_stack_dialog_split_horizontal">Split Horizontal</string>
+10 −11
Original line number Diff line number Diff line
@@ -528,7 +528,6 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
    @Override
    public void onMultiWindowChanged(boolean inMultiWindow) {
        super.onMultiWindowChanged(inMultiWindow);
        if (!inMultiWindow) {
        RecentsTaskLoader loader = Recents.getTaskLoader();
        RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options();
        launchOpts.loadIcons = false;
@@ -537,8 +536,8 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
        RecentsTaskLoadPlan loadPlan = loader.createLoadPlan(this);
        loader.preloadTasks(loadPlan, -1, false);
        loader.loadTasks(this, loadPlan, launchOpts);
            EventBus.getDefault().send(new TaskStackUpdatedEvent(loadPlan.getTaskStack()));
        }
        EventBus.getDefault().send(new TaskStackUpdatedEvent(loadPlan.getTaskStack(),
                inMultiWindow));
    }

    @Override
+3 −1
Original line number Diff line number Diff line
@@ -28,8 +28,10 @@ public class TaskStackUpdatedEvent extends EventBus.AnimatedEvent {
     * A new TaskStack instance representing the latest stack state.
     */
    public final TaskStack stack;
    public final boolean inMultiWindow;

    public TaskStackUpdatedEvent(TaskStack stack) {
    public TaskStackUpdatedEvent(TaskStack stack, boolean inMultiWindow) {
        this.stack = stack;
        this.inMultiWindow = inMultiWindow;
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -198,8 +198,8 @@ public class RecentsTaskLoadPlan {
            // Add the task to the stack
            Task task = new Task(taskKey, t.affiliatedTaskId, t.affiliatedTaskColor, icon,
                    thumbnail, title, contentDescription, dismissDescription, activityColor,
                    backgroundColor, !isStackTask, isLaunchTarget, isSystemApp, t.bounds,
                    t.taskDescription);
                    backgroundColor, !isStackTask, isLaunchTarget, isSystemApp, t.isDockable,
                    t.bounds, t.taskDescription);

            allTasks.add(task);
            affiliatedTaskCounts.put(taskKey.id, affiliatedTaskCounts.get(taskKey.id, 0) + 1);
Loading