Remove widget education tip dialog

This change removes the widget education tip dialog, and the arrow
tip view. These are no longer needed now that taps are handled by
showing an add button.

Bug: 335318980
Test: `pm clear com.google.android.apps.nexuslauncher` and open widget
 picker
Flag: ACONFIG com.android.launcher3.enable_widget_tap_to_add NEXTFOOD
Change-Id: I9b24a41604880f5f94939c02b94f1a9f6a6c83d5
This commit is contained in:
Willie Koomson
2024-04-24 22:50:58 +00:00
parent ff1a1a9e46
commit d731ba2ff1
95 changed files with 46 additions and 626 deletions
@@ -17,7 +17,6 @@ package com.android.launcher3.widget;
import static com.android.app.animation.Interpolators.EMPHASIZED;
import static com.android.launcher3.Flags.enableWidgetTapToAdd;
import static com.android.launcher3.LauncherPrefs.WIDGETS_EDUCATION_TIP_SEEN;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WIDGET_ADD_BUTTON_TAP;
import android.content.Context;
@@ -35,17 +34,14 @@ import android.view.animation.Interpolator;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Px;
import androidx.core.view.ViewCompat;
import com.android.launcher3.BaseActivity;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
import com.android.launcher3.Insettable;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.PendingAddItemInfo;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.TestProtocol;
@@ -53,7 +49,6 @@ import com.android.launcher3.util.SystemUiController;
import com.android.launcher3.util.Themes;
import com.android.launcher3.util.window.WindowManagerProxy;
import com.android.launcher3.views.AbstractSlideInView;
import com.android.launcher3.views.ArrowTipView;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -366,31 +361,6 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<BaseActivity>
return mActivityContext.getSystemUiController();
}
/** Shows education tip on top center of {@code view} if view is laid out. */
@Nullable
protected ArrowTipView showEducationTipOnViewIfPossible(@Nullable View view) {
if (view == null || !ViewCompat.isLaidOut(view)) {
return null;
}
int[] coords = new int[2];
view.getLocationOnScreen(coords);
ArrowTipView arrowTipView =
new ArrowTipView(mActivityContext, /* isPointingUp= */ false).showAtLocation(
getContext().getString(R.string.long_press_widget_to_add),
/* arrowXCoord= */coords[0] + view.getWidth() / 2,
/* yCoord= */coords[1]);
if (arrowTipView != null) {
LauncherPrefs.get(getContext()).put(WIDGETS_EDUCATION_TIP_SEEN, true);
}
return arrowTipView;
}
/** Returns {@code true} if tip has previously been shown on any of {@link BaseWidgetSheet}. */
protected boolean hasSeenEducationTip() {
return LauncherPrefs.get(getContext()).get(WIDGETS_EDUCATION_TIP_SEEN)
|| Utilities.isRunningInTestHarness();
}
@Override
protected void setTranslationShift(float translationShift) {
super.setTranslationShift(translationShift);