mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user