diff options
author | Yvonne Wong <ywong@cyngn.com> | 2016-05-11 14:02:12 -0700 |
---|---|---|
committer | Stephen Bird <sbird@cyngn.com> | 2016-09-22 16:13:17 -0700 |
commit | 787095bf88505b4a7204aa3feaf1117deaf16ba1 (patch) | |
tree | 093641756d35d4e71580ba45e9527aba91ebda6b /res | |
parent | 7288298b040d21289af199da7af999c8dffcd82c (diff) | |
download | android_packages_apps_Messaging-787095bf88505b4a7204aa3feaf1117deaf16ba1.tar.gz android_packages_apps_Messaging-787095bf88505b4a7204aa3feaf1117deaf16ba1.tar.bz2 android_packages_apps_Messaging-787095bf88505b4a7204aa3feaf1117deaf16ba1.zip |
Add maps preview for addresses and integrate ridesharing request into Messaging
- Uses the first map link found in a message to get a static map view
- The static map view is shown as a preview and can be clicked to go into
the default maps app
- Clicking on request ride will lead the user to RideCoreUI with pickup
location prefilled based on the address in the map link
- Clicking on the directions button will lead the user to google maps's
navigation
- Display placeholder background when map is loading or offline with no cached
image
- Use RoundedCornerTransformation to transform the map into a bitmap with rounded
corners
- Show brand bitmap from ridesharing services if an active provider is chosen,
otherwise display the generic ridesharing icon
Change-Id: I8e74c6d9beeaa58f01f0a51e5a831c6697c890ea
Issue-Id: RIDE-75, RIDE-76, RIDE-77
Diffstat (limited to 'res')
-rw-r--r-- | res/drawable-hdpi/ic_map_placeholder.png | bin | 0 -> 9727 bytes | |||
-rw-r--r-- | res/drawable-mdpi/ic_map_placeholder.png | bin | 0 -> 5747 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/ic_map_placeholder.png | bin | 0 -> 15806 bytes | |||
-rw-r--r-- | res/drawable-xxhdpi/ic_map_placeholder.png | bin | 0 -> 31660 bytes | |||
-rw-r--r-- | res/drawable/directions_button_background.xml | 6 | ||||
-rw-r--r-- | res/drawable/ic_generic_transport_icon.xml | 32 | ||||
-rwxr-xr-x | res/drawable/ic_get_directions.xml | 7 | ||||
-rw-r--r-- | res/drawable/maps_button_container_background.xml | 6 | ||||
-rw-r--r-- | res/drawable/request_ride_button_background.xml | 6 | ||||
-rw-r--r-- | res/layout/attachment_maps.xml | 81 | ||||
-rw-r--r-- | res/layout/conversation_message_view.xml | 4 | ||||
-rwxr-xr-x | res/values/cm_colors.xml | 5 | ||||
-rw-r--r-- | res/values/cm_dimens.xml | 19 | ||||
-rw-r--r-- | res/values/cm_strings.xml | 3 | ||||
-rw-r--r-- | res/values/google_maps_api.xml | 3 |
15 files changed, 172 insertions, 0 deletions
diff --git a/res/drawable-hdpi/ic_map_placeholder.png b/res/drawable-hdpi/ic_map_placeholder.png Binary files differnew file mode 100644 index 0000000..4b40b16 --- /dev/null +++ b/res/drawable-hdpi/ic_map_placeholder.png diff --git a/res/drawable-mdpi/ic_map_placeholder.png b/res/drawable-mdpi/ic_map_placeholder.png Binary files differnew file mode 100644 index 0000000..bd551a5 --- /dev/null +++ b/res/drawable-mdpi/ic_map_placeholder.png diff --git a/res/drawable-xhdpi/ic_map_placeholder.png b/res/drawable-xhdpi/ic_map_placeholder.png Binary files differnew file mode 100644 index 0000000..b6d5bf9 --- /dev/null +++ b/res/drawable-xhdpi/ic_map_placeholder.png diff --git a/res/drawable-xxhdpi/ic_map_placeholder.png b/res/drawable-xxhdpi/ic_map_placeholder.png Binary files differnew file mode 100644 index 0000000..8bba6c2 --- /dev/null +++ b/res/drawable-xxhdpi/ic_map_placeholder.png diff --git a/res/drawable/directions_button_background.xml b/res/drawable/directions_button_background.xml new file mode 100644 index 0000000..a40b30f --- /dev/null +++ b/res/drawable/directions_button_background.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <corners android:bottomRightRadius="2dp" android:topRightRadius="2dp" /> + <solid android:color="@color/white_54" /> +</shape>
\ No newline at end of file diff --git a/res/drawable/ic_generic_transport_icon.xml b/res/drawable/ic_generic_transport_icon.xml new file mode 100644 index 0000000..7bd5e2e --- /dev/null +++ b/res/drawable/ic_generic_transport_icon.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) 2016 The CyanogenMod Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + + <path + android:fillColor="#000000" + android:pathData="M18.9,6c-0.2-0.6-0.8-1-1.4-1h-11C5.8,5,5.3,5.4,5.1,6L3,12v8c0,0.5,0.5,1,1,1h1c0.6,0,1-0.5,1-1v-1h12v1c0,0.5,0.5,1,1,1h1 +c0.5,0,1-0.5,1-1v-8L18.9,6z +M6.5,16C5.7,16,5,15.3,5,14.5S5.7,13,6.5,13S8,13.7,8,14.5S7.3,16,6.5,16z M17.5,16 +c-0.8,0-1.5-0.7-1.5-1.5s0.7-1.5,1.5-1.5s1.5,0.7,1.5,1.5S18.3,16,17.5,16z +M5,11l1.5-4.5h11L19,11H5z M11,9.5 +c0,0.8-0.7,1.5-1.5,1.5S8,10.3,8,9.5S8.7,8,9.5,8S11,8.7,11,9.5z +M16,9.5c0,0.8-0.7,1.5-1.5,1.5S13,10.3,13,9.5S13.7,8,14.5,8 S16,8.7,16,9.5z" /> +</vector>
\ No newline at end of file diff --git a/res/drawable/ic_get_directions.xml b/res/drawable/ic_get_directions.xml new file mode 100755 index 0000000..46c6fb6 --- /dev/null +++ b/res/drawable/ic_get_directions.xml @@ -0,0 +1,7 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path android:fillColor="#000000" android:fillAlpha=".54" android:pathData="M14,14.5V12H10V15H8V11A1,1 0 0,1 9,10H14V7.5L17.5,11M21.71,11.29L12.71,2.29H12.7C12.31,1.9 11.68,1.9 11.29,2.29L2.29,11.29C1.9,11.68 1.9,12.32 2.29,12.71L11.29,21.71C11.68,22.09 12.31,22.1 12.71,21.71L21.71,12.71C22.1,12.32 22.1,11.68 21.71,11.29Z" />
+</vector>
\ No newline at end of file diff --git a/res/drawable/maps_button_container_background.xml b/res/drawable/maps_button_container_background.xml new file mode 100644 index 0000000..6e3a3a1 --- /dev/null +++ b/res/drawable/maps_button_container_background.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <corners android:radius="2dp" /> + <solid android:color="@android:color/transparent" /> +</shape>
\ No newline at end of file diff --git a/res/drawable/request_ride_button_background.xml b/res/drawable/request_ride_button_background.xml new file mode 100644 index 0000000..ff3ba2e --- /dev/null +++ b/res/drawable/request_ride_button_background.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <corners android:bottomLeftRadius="2dp" android:topLeftRadius="2dp" /> + <solid android:color="@color/white_54" /> +</shape>
\ No newline at end of file diff --git a/res/layout/attachment_maps.xml b/res/layout/attachment_maps.xml new file mode 100644 index 0000000..4cb691f --- /dev/null +++ b/res/layout/attachment_maps.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2016 The CyanogenMod Project (DvTonder) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + 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. +--> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:visibility="gone" + android:layout_marginBottom="@dimen/conversation_maps_margin" + android:layout_width="@dimen/conversation_maps_width" + android:layout_height="@dimen/conversation_maps_height"> + <ImageView + android:id="@+id/maps_image" + android:layout_width="@dimen/conversation_maps_width" + android:layout_height="@dimen/conversation_maps_height" + android:minWidth="@dimen/conversation_maps_width" + android:minHeight="@dimen/conversation_maps_height" + android:adjustViewBounds="true" + android:scaleType="centerInside" + android:layout_gravity="center_vertical"/> + <RelativeLayout + android:background="@drawable/maps_button_container_background" + android:elevation="@dimen/maps_button_elevation" + android:layout_width="@dimen/maps_button_width" + android:layout_height="@dimen/maps_button_height" + android:layout_alignParentBottom="true" + android:layout_marginLeft="@dimen/conversation_maps_margin" + android:layout_marginBottom="@dimen/conversation_maps_margin" + android:layout_marginRight="@dimen/conversation_maps_margin"> + <Button + style="?android:attr/borderlessButtonStyle" + android:id="@+id/request_ride_button" + android:background="@drawable/request_ride_button_background" + android:layout_alignParentLeft="true" + android:layout_width="@dimen/request_ride_button_width" + android:layout_height="match_parent" + android:paddingLeft="28dp" + android:paddingRight="50dp" + android:textColor="@color/black_54" + android:textSize="@dimen/request_ride_text_size" + android:fontFamily="sans-serif-medium" + android:text="@string/request_ride"/> + <ImageView + android:id="@+id/brand_image" + android:layout_width="@dimen/brand_image_width" + android:layout_height="@dimen/brand_image_height" + android:layout_alignParentLeft="true" + android:layout_marginLeft="@dimen/brand_image_margin" + android:layout_marginRight="@dimen/brand_image_margin" + android:layout_centerVertical="true" + android:focusable="false" + android:clickable="false" + android:src="@drawable/ic_generic_transport_icon"/> + <ImageView + android:id="@+id/directions_button" + android:layout_width="@dimen/directions_button_width" + android:layout_height="match_parent" + android:background="@drawable/directions_button_background" + android:layout_alignParentRight="true" + android:padding="@dimen/directions_button_padding" + android:layout_centerVertical="true" + android:src="@drawable/ic_get_directions"/> + <View + android:id="@+id/button_divider" + android:layout_toRightOf="@id/request_ride_button" + android:layout_toLeftOf="@id/directions_button" + android:layout_width="@dimen/maps_button_divider_width" + android:layout_height="match_parent" + android:background="@color/transparent_gray" /> + </RelativeLayout> +</RelativeLayout>
\ No newline at end of file diff --git a/res/layout/conversation_message_view.xml b/res/layout/conversation_message_view.xml index 8d10c84..004028d 100644 --- a/res/layout/conversation_message_view.xml +++ b/res/layout/conversation_message_view.xml @@ -66,6 +66,10 @@ app:cornerRadius="@dimen/attachment_rounded_corner_radius" android:contentDescription="@string/message_image_content_description" /> + <include + android:id="@+id/message_maps" + layout="@layout/attachment_maps" /> + </LinearLayout> <com.android.messaging.ui.conversation.MessageBubbleBackground diff --git a/res/values/cm_colors.xml b/res/values/cm_colors.xml index c154412..7bea399 100755 --- a/res/values/cm_colors.xml +++ b/res/values/cm_colors.xml @@ -38,4 +38,9 @@ <color name="outgoing_message_bg">#e4e7e8</color> <color name="qm_reply">#4d4d4d</color> + + <!-- Ridesharing --> + <color name="transparent_gray">#1F000000</color> + <color name="white_54">#8BFFFFFF</color> + <color name="black_54">#8B000000</color> </resources> diff --git a/res/values/cm_dimens.xml b/res/values/cm_dimens.xml index 2dc13c2..f367e0c 100644 --- a/res/values/cm_dimens.xml +++ b/res/values/cm_dimens.xml @@ -19,4 +19,23 @@ <dimen name="convolist_attribution_logo_marginRight">13dp</dimen> <dimen name="convo_attribution_logo_marginRight">5dp</dimen> <dimen name="convo_attribution_logo_marginBottom">5dp</dimen> + + <!-- Ride sharing --> + <dimen name="conversation_maps_width">221dp</dimen> + <dimen name="conversation_maps_height">144dp</dimen> + <dimen name="conversation_maps_margin">8dp</dimen> + <dimen name="maps_button_elevation">2dp</dimen> + <dimen name="maps_button_width">205dp</dimen> + <dimen name="maps_button_height">32dp</dimen> + <dimen name="request_ride_button_width">172dp</dimen> + <dimen name="request_ride_text_size">12sp</dimen> + <dimen name="brand_image_width">18dp</dimen> + <dimen name="brand_image_height">18dp</dimen> + <dimen name="brand_image_margin">7dp</dimen> + <dimen name="directions_button_width">32dp</dimen> + <dimen name="directions_button_padding">4dp</dimen> + <dimen name="maps_button_divider_width">1dp</dimen> + <dimen name="maps_error_icon_width">1dp</dimen> + <dimen name="maps_error_icon_height">1dp</dimen> + <dimen name="maps_corner_radius">3dp</dimen> </resources> diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index 4d6d424..e48c45c 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -155,4 +155,7 @@ <string name="mediapicker_audio_list_item_selected_content_description">The audio is selected.</string> <string name="mediapicker_audio_list_item_unselected_content_description">The audio is unselected.</string> <string name="mediapicker_audio_list_title_selection"><xliff:g id="count">%d</xliff:g> selected</string> + + <!-- Ride sharing --> + <string name="request_ride">Request Ride</string> </resources> diff --git a/res/values/google_maps_api.xml b/res/values/google_maps_api.xml new file mode 100644 index 0000000..f165a09 --- /dev/null +++ b/res/values/google_maps_api.xml @@ -0,0 +1,3 @@ +<resources> + <string name="google_maps_key" templateMergeStrategy="preserve" translatable="false"></string> +</resources> |