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-hdpi/ic_remove.png | Bin 0 -> 884 bytes res/drawable-hdpi/ic_remove_highlight.png | Bin 0 -> 717 bytes res/drawable-mdpi/ic_remove.png | Bin 0 -> 728 bytes res/drawable-mdpi/ic_remove_highlight.png | Bin 0 -> 587 bytes res/drawable-xhdpi/ic_remove.png | Bin 0 -> 1237 bytes res/drawable-xhdpi/ic_remove_highlight.png | Bin 0 -> 974 bytes res/drawable-xxhdpi/ic_remove.png | Bin 0 -> 1942 bytes res/drawable-xxhdpi/ic_remove_highlight.png | Bin 0 -> 1590 bytes res/layout/dialtacts_activity.xml | 44 +++++++++++++++++++++------- res/values/colors.xml | 16 +++++++--- res/values/dimens.xml | 20 +++++++++---- res/values/strings.xml | 5 ++++ 12 files changed, 65 insertions(+), 20 deletions(-) create mode 100644 res/drawable-hdpi/ic_remove.png create mode 100644 res/drawable-hdpi/ic_remove_highlight.png create mode 100644 res/drawable-mdpi/ic_remove.png create mode 100644 res/drawable-mdpi/ic_remove_highlight.png create mode 100644 res/drawable-xhdpi/ic_remove.png create mode 100644 res/drawable-xhdpi/ic_remove_highlight.png create mode 100644 res/drawable-xxhdpi/ic_remove.png create mode 100644 res/drawable-xxhdpi/ic_remove_highlight.png (limited to 'res') diff --git a/res/drawable-hdpi/ic_remove.png b/res/drawable-hdpi/ic_remove.png new file mode 100644 index 000000000..1ee6adf8d Binary files /dev/null and b/res/drawable-hdpi/ic_remove.png differ diff --git a/res/drawable-hdpi/ic_remove_highlight.png b/res/drawable-hdpi/ic_remove_highlight.png new file mode 100644 index 000000000..435ee36b0 Binary files /dev/null and b/res/drawable-hdpi/ic_remove_highlight.png differ diff --git a/res/drawable-mdpi/ic_remove.png b/res/drawable-mdpi/ic_remove.png new file mode 100644 index 000000000..2c134ea10 Binary files /dev/null and b/res/drawable-mdpi/ic_remove.png differ diff --git a/res/drawable-mdpi/ic_remove_highlight.png b/res/drawable-mdpi/ic_remove_highlight.png new file mode 100644 index 000000000..6a961cbb2 Binary files /dev/null and b/res/drawable-mdpi/ic_remove_highlight.png differ 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 diff --git a/res/drawable-xxhdpi/ic_remove.png b/res/drawable-xxhdpi/ic_remove.png new file mode 100644 index 000000000..2722f23aa Binary files /dev/null and b/res/drawable-xxhdpi/ic_remove.png differ diff --git a/res/drawable-xxhdpi/ic_remove_highlight.png b/res/drawable-xxhdpi/ic_remove_highlight.png new file mode 100644 index 000000000..23ee8f6da Binary files /dev/null and b/res/drawable-xxhdpi/ic_remove_highlight.png differ diff --git a/res/layout/dialtacts_activity.xml b/res/layout/dialtacts_activity.xml index e2c385364..5a886e226 100644 --- a/res/layout/dialtacts_activity.xml +++ b/res/layout/dialtacts_activity.xml @@ -28,20 +28,20 @@ android:layout_height="match_parent" android:clipChildren="false" android:orientation="vertical" > - + android:gravity="center_vertical" + > - - + android:layout_height="56dp" + android:id="@+id/remove_view_container" + android:orientation="horizontal" + android:gravity="center" + android:visibility="gone"> + + + + + +--> @@ -27,8 +27,10 @@ #33b5e5 - + #cecece @@ -38,7 +40,7 @@ #660099cc - #cecece + #eeeeee #eeeeee @@ -71,6 +73,12 @@ #777777 + + #555555 + + + #FF3F3B + #555555 diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 3c856d2e6..fb74e9748 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -13,7 +13,7 @@ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License - --> +--> @@ -29,9 +29,15 @@ 74dp - + 14sp + + 16dp + 32dip 48dip @@ -51,9 +57,11 @@ the main area of a call log entry and the secondary action button. --> 1dp - + ratio. + --> 15 65 @@ -63,14 +71,14 @@ 15dp 25dp 41dp - - 60dp 56dp 12dp + + 3dp 36dp 67% 6dp diff --git a/res/values/strings.xml b/res/values/strings.xml index a61e0bc4a..3f2157712 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -539,6 +539,9 @@ --> Unheard voicemail + + Clear search + Start voice search @@ -726,6 +729,8 @@ Dismiss + + Remove Speed Dial -- cgit v1.2.3