Skip to content
Commit fb748b35 authored by Petar Šegina's avatar Petar Šegina
Browse files

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
parent e9d43530
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment