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 committed 2024-04-25 22:56:36 +00:00
1 parent ff1a1a9e46
commit d731ba2ff1
95 files changed
+46 -626

No files matched your search

@@ -50,40 +50,10 @@ import java.util.List;
*/
public class WidgetsBottomSheet extends BaseWidgetSheet {
private static final int DEFAULT_CLOSE_DURATION = 200;
private static final long EDUCATION_TIP_DELAY_MS = 300;
private ItemInfo mOriginalItemInfo;
@Px private int mMaxHorizontalSpan;
private final OnLayoutChangeListener mLayoutChangeListenerToShowTips =
new OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
if (hasSeenEducationTip()) {
removeOnLayoutChangeListener(this);
return;
}
// Widgets are loaded asynchronously, We are adding a delay because we only want
// to show the tip when the widget preview has finished loading and rendering in
// this view.
removeCallbacks(mShowEducationTipTask);
postDelayed(mShowEducationTipTask, EDUCATION_TIP_DELAY_MS);
}
};
private final Runnable mShowEducationTipTask = () -> {
if (hasSeenEducationTip()) {
removeOnLayoutChangeListener(mLayoutChangeListenerToShowTips);
return;
}
View viewForTip = ((ViewGroup) ((TableLayout) findViewById(R.id.widgets_table))
.getChildAt(0)).getChildAt(0);
if (showEducationTipOnViewIfPossible(viewForTip) != null) {
removeOnLayoutChangeListener(mLayoutChangeListenerToShowTips);
}
};
public WidgetsBottomSheet(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
@@ -91,9 +61,6 @@ public class WidgetsBottomSheet extends BaseWidgetSheet {
public WidgetsBottomSheet(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
setWillNotDraw(false);
if (!hasSeenEducationTip()) {
addOnLayoutChangeListener(mLayoutChangeListenerToShowTips);
}
}
@Override