mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 02:38:20 +00:00
Merge "Add logs around hotseat suggested apps" into udc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
41d269a43b
@@ -27,6 +27,7 @@ import android.animation.Animator;
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.ComponentName;
|
||||
import android.util.Log;
|
||||
import android.view.HapticFeedbackConstants;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -74,6 +75,7 @@ public class HotseatPredictionController implements DragController.DragListener,
|
||||
SystemShortcut.Factory<QuickstepLauncher>, DeviceProfile.OnDeviceProfileChangeListener,
|
||||
DragSource, ViewGroup.OnHierarchyChangeListener {
|
||||
|
||||
private static final String TAG = "HotseatPredictionController";
|
||||
private static final int FLAG_UPDATE_PAUSED = 1 << 0;
|
||||
private static final int FLAG_DRAG_IN_PROGRESS = 1 << 1;
|
||||
private static final int FLAG_FILL_IN_PROGRESS = 1 << 2;
|
||||
@@ -183,6 +185,7 @@ public class HotseatPredictionController implements DragController.DragListener,
|
||||
}
|
||||
|
||||
private void fillGapsWithPrediction(boolean animate) {
|
||||
Log.d(TAG, "fillGapsWithPrediction");
|
||||
if (mPauseFlags != 0) {
|
||||
return;
|
||||
}
|
||||
@@ -207,12 +210,16 @@ public class HotseatPredictionController implements DragController.DragListener,
|
||||
View child = mHotseat.getChildAt(
|
||||
mHotseat.getCellXFromOrder(rank),
|
||||
mHotseat.getCellYFromOrder(rank));
|
||||
Log.d(TAG, "Hotseat app child is: " + child + " and isPredictedIcon() evaluates to"
|
||||
+ ": " + isPredictedIcon(child));
|
||||
|
||||
if (child != null && !isPredictedIcon(child)) {
|
||||
continue;
|
||||
}
|
||||
if (mPredictedItems.size() <= predictionIndex) {
|
||||
// Remove predicted apps from the past
|
||||
Log.d(TAG, "Remove predicted apps from the past\nPrediction Index: "
|
||||
+ predictionIndex);
|
||||
if (isPredictedIcon(child)) {
|
||||
mHotseat.removeView(child);
|
||||
}
|
||||
@@ -220,6 +227,11 @@ public class HotseatPredictionController implements DragController.DragListener,
|
||||
}
|
||||
WorkspaceItemInfo predictedItem =
|
||||
(WorkspaceItemInfo) mPredictedItems.get(predictionIndex++);
|
||||
Log.d(TAG, "Predicted item is: " + predictedItem);
|
||||
if (child != null) {
|
||||
Log.d(TAG, "Predicted item is enabled: " + child.isEnabled());
|
||||
}
|
||||
|
||||
if (isPredictedIcon(child) && child.isEnabled()) {
|
||||
PredictedAppIcon icon = (PredictedAppIcon) child;
|
||||
boolean animateIconChange = icon.shouldAnimateIconChange(predictedItem);
|
||||
@@ -239,6 +251,7 @@ public class HotseatPredictionController implements DragController.DragListener,
|
||||
}
|
||||
|
||||
private void bindItems(List<WorkspaceItemInfo> itemsToAdd, boolean animate) {
|
||||
Log.d(TAG, "bindItems to hotseat: " + itemsToAdd);
|
||||
AnimatorSet animationSet = new AnimatorSet();
|
||||
for (WorkspaceItemInfo item : itemsToAdd) {
|
||||
PredictedAppIcon icon = PredictedAppIcon.createIcon(mHotseat, item);
|
||||
@@ -292,8 +305,10 @@ public class HotseatPredictionController implements DragController.DragListener,
|
||||
public void setPredictedItems(FixedContainerItems items) {
|
||||
mPredictedItems = new ArrayList(items.items);
|
||||
if (mPredictedItems.isEmpty()) {
|
||||
Log.d(TAG, "Predicted items is initially empty");
|
||||
HotseatRestoreHelper.restoreBackup(mLauncher);
|
||||
}
|
||||
Log.d(TAG, "Predicted items: " + mPredictedItems);
|
||||
fillGapsWithPrediction();
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.SystemProperties;
|
||||
import android.os.Trace;
|
||||
import android.util.Log;
|
||||
import android.view.Display;
|
||||
import android.view.HapticFeedbackConstants;
|
||||
import android.view.View;
|
||||
@@ -190,6 +191,8 @@ public class QuickstepLauncher extends Launcher {
|
||||
private static final String TRACE_RELAYOUT_CLASS =
|
||||
SystemProperties.get("persist.debug.trace_request_layout_class", null);
|
||||
|
||||
private static final String TAG = "QuickstepLauncher";
|
||||
|
||||
public static final boolean GO_LOW_RAM_RECENTS_ENABLED = false;
|
||||
|
||||
protected static final String RING_APPEAR_ANIMATION_PREFIX = "RingAppearAnimation\t";
|
||||
@@ -434,6 +437,7 @@ public class QuickstepLauncher extends Launcher {
|
||||
|
||||
@Override
|
||||
public void bindExtraContainerItems(FixedContainerItems item) {
|
||||
Log.d(TAG, "Bind extra container items");
|
||||
if (item.containerId == Favorites.CONTAINER_PREDICTION) {
|
||||
mAllAppsPredictions = item;
|
||||
PredictionRowView<?> predictionRowView =
|
||||
@@ -441,6 +445,7 @@ public class QuickstepLauncher extends Launcher {
|
||||
PredictionRowView.class);
|
||||
predictionRowView.setPredictedApps(item.items);
|
||||
} else if (item.containerId == Favorites.CONTAINER_HOTSEAT_PREDICTION) {
|
||||
Log.d(TAG, "Bind extra container item is hotseat prediction");
|
||||
mHotseatPredictionController.setPredictedItems(item);
|
||||
} else if (item.containerId == Favorites.CONTAINER_WIDGETS_PREDICTION) {
|
||||
getPopupDataProvider().setRecommendedWidgets(item.items);
|
||||
|
||||
@@ -55,6 +55,7 @@ public interface WorkspaceLayoutManager {
|
||||
int y = presenterPos.cellY;
|
||||
if (info.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT
|
||||
|| info.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION) {
|
||||
Log.d(TAG, "add predicted icon " + child.getTag().toString() + " to home screen");
|
||||
int screenId = presenterPos.screenId;
|
||||
x = getHotseat().getCellXFromOrder(screenId);
|
||||
y = getHotseat().getCellYFromOrder(screenId);
|
||||
|
||||
Reference in New Issue
Block a user