mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Add more education tips for widgets. (3/3)
Show tip on reconfigurable widget in launcher. Bug: 185354491 Test: Manually tested tips in widget picker, all apps, and reconfigurable widgets tip. Change-Id: I08154c944285cac6a21c3ef4aafd878bbbccf44b
This commit is contained in:
@@ -207,16 +207,18 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<Launcher>
|
||||
if (view == null || !ViewCompat.isLaidOut(view)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
mActivityContext.getSharedPrefs().edit()
|
||||
.putBoolean(KEY_WIDGETS_EDUCATION_TIP_SEEN, true).apply();
|
||||
int[] coords = new int[2];
|
||||
view.getLocationOnScreen(coords);
|
||||
ArrowTipView arrowTipView = new ArrowTipView(mActivityContext);
|
||||
return arrowTipView.showAtLocation(
|
||||
getContext().getString(R.string.long_press_widget_to_add),
|
||||
/* arrowXCoord= */coords[0] + view.getWidth() / 2,
|
||||
/* yCoord= */coords[1]);
|
||||
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) {
|
||||
mActivityContext.getSharedPrefs().edit()
|
||||
.putBoolean(KEY_WIDGETS_EDUCATION_TIP_SEEN, true).apply();
|
||||
}
|
||||
return arrowTipView;
|
||||
}
|
||||
|
||||
/** Returns {@code true} if tip has previously been shown on any of {@link BaseWidgetSheet}. */
|
||||
|
||||
Reference in New Issue
Block a user