Add Widget Resize Frame actions

Demos:
http://screencast/cast/NTE1NDE3NzM0MzgxNTY4MHwxYzQ2MDVlOC1mOQ
http://screencast/cast/NTcwNTM3ODE5MTkwMDY3Mnw5MDBiNzAzMS03MA

Bug: 374248904
Test: manual - activate talkback, add new widget
Flag: EXEMPT bug fix
Change-Id: I80ab0da75ec054709a28f41d9ceabce9e94866d9
This commit is contained in:
Ana Salazar Maldonado committed 2025-03-11 12:39:12 -07:00
1 parent eb808032f1
commit 71c38ab75c
3 files changed
+49 -6

No files matched your search

@@ -216,6 +216,13 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O
AppWidgetResizeFrame frame = (AppWidgetResizeFrame) launcher.getLayoutInflater()
.inflate(R.layout.app_widget_resize_frame, dl, false);
frame.setupForWidget(widget, cellLayout, dl);
// Save widget item info as tag on resize frame; so that, the accessibility delegate can
// attach actions that typically happen on widget (e.g. resize, move) also on the resize
// frame.
frame.setTag(widget.getTag());
frame.setAccessibilityDelegate(launcher.getAccessibilityDelegate());
frame.setContentDescription(launcher.asContext().getString(R.string.widget_frame_name,
widget.getContentDescription()));
((DragLayer.LayoutParams) frame.getLayoutParams()).customPosition = true;
dl.addView(frame);
@@ -235,6 +242,13 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O
}
}
/**
* Retrieves the view where accessibility actions happen.
*/
public View getViewForAccessibility() {
return mWidgetView;
}
private void setupForWidget(LauncherAppWidgetHostView widgetView, CellLayout cellLayout,
DragLayer dragLayer) {
mCellLayout = cellLayout;