Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3cefcc69 authored by Yorke Lee's avatar Yorke Lee
Browse files

Add drag to remove for favorites in Dialer

* Add remove view in dialtacts_activity.xml, and rearrange layout slightly
so that it takes up the same position in the layout as the search view
container. Contacts that are dragged to this remove view will be unstarred
and unpinned.

* Add drag event logic to the Remove View, so that when the user hovers a
contact over it, the UI will continue to respond. Previously, only the
PhoneFavoritesListView would detect touch events.

* Refactor DragDropController and OnDragDropListener into separate classes.
DragDropController performs the work of receiving drag/drop events from
multiple views, combining them, and then firing off callbacks as appropriate
to OnDragDropListeners. Each OnDragDropListener can then update their UI
or internal data model as necessary in response to the callbacks.

OnDragDropListener <----------------------------------------
       ^                                                    |
       |                                                    |
DialtactsActivity  --------------->   RemoveView            |
       |                                  |                 |
       v                                  |                 | callbacks
PhoneFavoriteListFragment                 |drag events      |
       |                                  |                 |
       v                                  v                 |
PhoneFavoriteListView ------------>   DragController--------
                       drag events        |
                                          |  callbacks
                                          v
PhoneFavoritesTileAdapter --> OnDragDropListener

* While in here, add a content description for the clear search button
Change-Id: I044ad1c5aa42c7686bde6bf5074095a4fe879bde
parent 28ded60d
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