Skip to content

Commit

Permalink
Get ctx instead of this
Browse files Browse the repository at this point in the history
  • Loading branch information
validcube committed Jan 30, 2024
1 parent d34d194 commit 7ab6ca8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public PopupContainerWithArrow<BaseTaskbarContext> showForIcon(BubbleTextView ic
.filter(Objects::nonNull)
.collect(Collectors.toList());

if (FeatureFlags.showMaterialUPopup(this)) {
if (FeatureFlags.showMaterialUPopup(getContext())) {
container = (PopupContainerWithArrow) context.getLayoutInflater().inflate(
R.layout.popup_container_material_u, context.getDragLayer(), false);
container.populateAndShowRowsMaterialU(icon, deepShortcutCount, systemShortcuts);
Expand Down
12 changes: 6 additions & 6 deletions src/com/android/launcher3/popup/ArrowPopup.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public ArrowPopup(Context context, AttributeSet attrs, int defStyleAttr) {

mIterateChildrenTag = getContext().getString(R.string.popup_container_iterate_children);

if (!FeatureFlags.showMaterialUPopup(this) && mActivityContext.canUseMultipleShadesForPopup()) {
if (!FeatureFlags.showMaterialUPopup(getContext()) && mActivityContext.canUseMultipleShadesForPopup()) {
mColors = new int[] {
ColorTokens.PopupShadeFirst.resolveColor(context),
ColorTokens.PopupShadeSecond.resolveColor(context),
Expand Down Expand Up @@ -267,18 +267,18 @@ protected void assignMarginsAndBackgrounds(ViewGroup viewGroup, int backgroundCo
mlp.bottomMargin = 0;

if (colors != null) {
if (!FeatureFlags.showMaterialUPopup(this)) {
if (!FeatureFlags.showMaterialUPopup(getContext())) {
backgroundColor = colors[numVisibleChild % colors.length];
}

if (FeatureFlags.showMaterialUPopup(this) && isShortcutContainer(view)) {
if (FeatureFlags.showMaterialUPopup(getContext()) && isShortcutContainer(view)) {
setChildColor(view, colors[0], colorAnimator);
mArrowColor = colors[0];
}
}

// Arrow color matches the first child or the last child.
if (!FeatureFlags.showMaterialUPopup(this)
if (!FeatureFlags.showMaterialUPopup(getContext())
&& (mIsAboveIcon || (numVisibleChild == 0 && viewGroup == this))) {
mArrowColor = backgroundColor;
}
Expand Down Expand Up @@ -592,7 +592,7 @@ protected View getAccessibilityInitialFocusView() {

protected void animateOpen() {
setVisibility(View.VISIBLE);
mOpenCloseAnimator = FeatureFlags.showMaterialUPopup(this)
mOpenCloseAnimator = FeatureFlags.showMaterialUPopup(getContext())
? getMaterialUOpenCloseAnimator(
true,
OPEN_DURATION_U,
Expand Down Expand Up @@ -692,7 +692,7 @@ protected void animateClose() {
}
mIsOpen = false;

mOpenCloseAnimator = FeatureFlags.showMaterialUPopup(this)
mOpenCloseAnimator = FeatureFlags.showMaterialUPopup(getContext())
? getMaterialUOpenCloseAnimator(
false,
CLOSE_DURATION_U,
Expand Down
4 changes: 2 additions & 2 deletions src/com/android/launcher3/popup/PopupContainerWithArrow.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public static PopupContainerWithArrow<Launcher> showForIcon(BubbleTextView icon)
.map(s -> s.getShortcut(launcher, item, icon))
.filter(Objects::nonNull)
.collect(Collectors.toList());
if (FeatureFlags.showMaterialUPopup(getContext())) {
if (FeatureFlags.showMaterialUPopup(launcher)) {
container = (PopupContainerWithArrow) launcher.getLayoutInflater().inflate(
R.layout.popup_container_material_u, launcher.getDragLayer(), false);
container.configureForLauncher(launcher);
Expand Down Expand Up @@ -505,7 +505,7 @@ private void addSystemShortcutsIconsOnly(List<SystemShortcut> systemShortcuts) {
return;
}

mSystemShortcutContainer = FeatureFlags.showMaterialUPopup(this)
mSystemShortcutContainer = FeatureFlags.showMaterialUPopup(getContext())
? inflateAndAdd(R.layout.system_shortcut_icons_container_material_u, this)
: inflateAndAdd(R.layout.system_shortcut_icons_container, this, 0);

Expand Down
2 changes: 1 addition & 1 deletion src/com/android/launcher3/views/OptionsPopupView.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected void getTargetObjectLocation(Rect outPos) {

@Override
public void assignMarginsAndBackgrounds(ViewGroup viewGroup) {
if (FeatureFlags.showMaterialUPopup(this)) {
if (FeatureFlags.showMaterialUPopup(getContext())) {
assignMarginsAndBackgrounds(viewGroup,
mColors[0]);
} else {
Expand Down

0 comments on commit 7ab6ca8

Please sign in to comment.