Merge "Use TaskbarAllAppsButtonContainer and TaskbarDividerContainer in TaskbarView" into main

This commit is contained in:
Jagrut Desai
2024-08-29 21:44:04 +00:00
committed by Android (Google) Code Review
7 changed files with 148 additions and 193 deletions
@@ -72,7 +72,6 @@ import com.android.launcher3.util.LauncherBindableItemsContainer;
import com.android.launcher3.util.MultiPropertyFactory;
import com.android.launcher3.util.MultiTranslateDelegate;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.launcher3.views.IconButtonView;
import com.android.quickstep.util.GroupTask;
import com.android.systemui.shared.recents.model.Task;
@@ -299,7 +298,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
@Nullable
public View getAllAppsButtonView() {
return mTaskbarView.getAllAppsButtonView();
return mTaskbarView.getAllAppsButtonContainer();
}
public AnimatedFloat getTaskbarIconScaleForStash() {
@@ -366,9 +365,9 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
View[] iconViews = mTaskbarView.getIconViews();
float scale = mTaskbarIconTranslationXForPinning.value;
float transientTaskbarAllAppsOffset = mActivity.getResources().getDimension(
mTaskbarView.getAllAppsButtonTranslationXOffset(true));
mTaskbarView.getAllAppsButtonContainer().getAllAppsButtonTranslationXOffset(true));
float persistentTaskbarAllAppsOffset = mActivity.getResources().getDimension(
mTaskbarView.getAllAppsButtonTranslationXOffset(false));
mTaskbarView.getAllAppsButtonContainer().getAllAppsButtonTranslationXOffset(false));
float allAppIconTranslateRange = mapRange(scale, transientTaskbarAllAppsOffset,
persistentTaskbarAllAppsOffset);
@@ -383,7 +382,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
}
if (mActivity.isThreeButtonNav()) {
((IconButtonView) mTaskbarView.getAllAppsButtonView())
mTaskbarView.getAllAppsButtonContainer()
.setTranslationXForTaskbarAllAppsIcon(allAppIconTranslateRange);
return;
}
@@ -408,8 +407,8 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
-finalMarginScale * (iconIndex - halfIconCount));
}
if (iconView.equals(mTaskbarView.getAllAppsButtonView())) {
((IconButtonView) iconView).setTranslationXForTaskbarAllAppsIcon(
if (iconView.equals(mTaskbarView.getAllAppsButtonContainer())) {
mTaskbarView.getAllAppsButtonContainer().setTranslationXForTaskbarAllAppsIcon(
allAppIconTranslateRange);
}
}
@@ -537,7 +536,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
}
public View getTaskbarDividerView() {
return mTaskbarView.getTaskbarDividerView();
return mTaskbarView.getTaskbarDividerViewContainer();
}
/**
@@ -753,8 +752,8 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
int firstRecentTaskIndex = -1;
for (int i = 0; i < mTaskbarView.getChildCount(); i++) {
View child = mTaskbarView.getChildAt(i);
boolean isAllAppsButton = child == mTaskbarView.getAllAppsButtonView();
boolean isTaskbarDividerView = child == mTaskbarView.getTaskbarDividerView();
boolean isAllAppsButton = child == mTaskbarView.getAllAppsButtonContainer();
boolean isTaskbarDividerView = child == mTaskbarView.getTaskbarDividerViewContainer();
boolean isRecentTask = child.getTag() instanceof GroupTask;
// TODO(b/343522351): show recents on the home screen.
final boolean isRecentsInHotseat = false;