Add getSelection(..., RectangleConsumer) to Layout
In order to generate the Smart Select animation, we need a list of rectangles which represent a given selection. The current getSelectionPath code can only fill out a Path, which loses the rectangle information in the process. Instead of working directly with a Path, a RectangleConsumer is introduced, which is an abstraction over an element that can accept rectangles (for example, a Path or a List<Rect>). getSelectionPath is now implemented with this new method using a simple consumer which takes the rectangles and feeds them to the path. Test: cts-tradefed run cts-dev -m CtsWidgetTestCases -d -t android.widget.cts.TextViewTest#testGetFocusedRect Test: manual - verify text selection still works Change-Id: I32a24f237a4b1b89df23c982fe06566f30fec464
Loading
Please register or sign in to comment