From 3cefcc69c10ab12bd782a0b53779dbd1cc0e2aa1 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Thu, 16 Jan 2014 11:26:46 -0800 Subject: 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 --- res/drawable-xhdpi/ic_remove.png | Bin 0 -> 1237 bytes res/drawable-xhdpi/ic_remove_highlight.png | Bin 0 -> 974 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 res/drawable-xhdpi/ic_remove.png create mode 100644 res/drawable-xhdpi/ic_remove_highlight.png (limited to 'res/drawable-xhdpi') diff --git a/res/drawable-xhdpi/ic_remove.png b/res/drawable-xhdpi/ic_remove.png new file mode 100644 index 000000000..be81592ef Binary files /dev/null and b/res/drawable-xhdpi/ic_remove.png differ diff --git a/res/drawable-xhdpi/ic_remove_highlight.png b/res/drawable-xhdpi/ic_remove_highlight.png new file mode 100644 index 000000000..57949e317 Binary files /dev/null and b/res/drawable-xhdpi/ic_remove_highlight.png differ -- cgit v1.2.3