Add a button for floating tasks to taskbar (behind a flag)

Test: manual - build launcher3, enable the feature flag on tablet with
               a valid app installed, open an app, observe that there
               is NO button in taskbar because launcher3 doesn't have
               populated config
Bug: 237678727
Change-Id: Ic261608898eb9a9220cffacd0c6060a32c10a74f
This commit is contained in:
Mady Mellor
2022-08-16 12:13:50 -07:00
parent af2fe7fd12
commit 78c899314e
8 changed files with 250 additions and 4 deletions

View File

@@ -24,6 +24,7 @@ import static com.android.launcher3.taskbar.TaskbarManager.isPhoneMode;
import static com.android.quickstep.AnimatedFloat.VALUE;
import android.annotation.NonNull;
import android.content.Intent;
import android.graphics.Rect;
import android.util.FloatProperty;
import android.util.Log;
@@ -51,6 +52,7 @@ import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.LauncherBindableItemsContainer;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.SystemUiProxy;
import java.io.PrintWriter;
import java.util.function.Predicate;
@@ -427,6 +429,13 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
};
}
public View.OnClickListener getFloatingTaskButtonListener(@NonNull Intent intent) {
return v -> {
SystemUiProxy proxy = SystemUiProxy.INSTANCE.get(v.getContext());
proxy.showFloatingTask(intent);
};
}
public View.OnLongClickListener getIconOnLongClickListener() {
return mControllers.taskbarDragController::startDragOnLongClick;
}