diff options
author | Gary Mai <garymai@google.com> | 2016-09-30 16:34:55 -0700 |
---|---|---|
committer | Gary Mai <garymai@google.com> | 2016-10-07 18:49:02 +0000 |
commit | a6c80b378e03ebdf6b654dbdb12f2c665fe98a80 (patch) | |
tree | f22b40874cdac3e3c2224abb1efaab379bf563e0 /res | |
parent | f448d9b9d15f680aa9fb9634dc70c4970b0a2b97 (diff) | |
download | packages_apps_Contacts-a6c80b378e03ebdf6b654dbdb12f2c665fe98a80.tar.gz packages_apps_Contacts-a6c80b378e03ebdf6b654dbdb12f2c665fe98a80.tar.bz2 packages_apps_Contacts-a6c80b378e03ebdf6b654dbdb12f2c665fe98a80.zip |
Implement editor springboard activity
Have the springboard handle edit intents.
Show a dialog if the contact is made of multiple raw contacts.
Go straight to editor if:
* Single raw contact
* Given a raw contact Uri
In the case of 1 read 1 writable, we still show the dialog
since there would otherwise be no way to view what data comes
from the read only raw contact.
The springboard does not handle legacy contact Uris and will throw
an exception if one is received.
Test:
Tested these scenarios:
1) Edit a single raw contact
2) Edit a single read only raw contact
3) Edit a contact made of >2 raws
4) Add new contact
5) Edit a contact made of one read only, one writable
6) Made edits and checked if quick contact continued to update
7) The relevant edit intents from the Test app
Bug: 31826229
Bug: 31088704
Change-Id: I4c1c44accc86521efce2081744189d25f00ec541
Diffstat (limited to 'res')
-rw-r--r-- | res/layout/raw_contact_list_item.xml | 74 | ||||
-rw-r--r-- | res/values/colors.xml | 3 | ||||
-rw-r--r-- | res/values/strings.xml | 6 | ||||
-rw-r--r-- | res/values/styles.xml | 10 |
4 files changed, 93 insertions, 0 deletions
diff --git a/res/layout/raw_contact_list_item.xml b/res/layout/raw_contact_list_item.xml new file mode 100644 index 000000000..ec5de0c26 --- /dev/null +++ b/res/layout/raw_contact_list_item.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2016 The Android Open Source 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. +--> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingLeft="24dp" + android:paddingRight="24dp" + android:paddingTop="12dp" + android:paddingBottom="12dp" + android:background="?android:attr/selectableItemBackground" + android:orientation="horizontal"> + + <ImageView + android:id="@+id/photo" + android:layout_width="40dp" + android:layout_height="40dp" + android:layout_marginEnd="16dp" + android:scaleType="fitCenter"/> + + <LinearLayout + android:id="@+id/text_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_weight="1" + android:orientation="vertical"> + + <TextView + android:id="@+id/display_name" + android:textSize="16sp" + android:textColor="@color/quantum_black_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="center_vertical"/> + + <LinearLayout + android:id="@+id/account_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="center_vertical"> + + <ImageView + android:id="@+id/account_icon" + android:layout_width="14dp" + android:layout_height="14dp" + android:layout_gravity="center_vertical" + android:layout_marginEnd="4dp" + android:scaleType="fitCenter"/> + + <TextView + android:id="@+id/account_name" + android:textSize="13sp" + android:textColor="@color/quantum_black_secondary_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical"/> + </LinearLayout> + + </LinearLayout> + +</LinearLayout> diff --git a/res/values/colors.xml b/res/values/colors.xml index 081d579ed..f55cc9592 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -14,6 +14,9 @@ limitations under the License. --> <resources> + <!-- 87% black --> + <color name="quantum_black_text">#dd000000</color> + <!-- 54% black --> <color name="quantum_black_secondary_text">#89000000</color> diff --git a/res/values/strings.xml b/res/values/strings.xml index 566bd7597..454777e02 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -693,6 +693,12 @@ at a pre-determined text size. [CHAR LIMIT=20] --> <string name="contact_editor_title_existing_contact">Edit contact</string> + <!-- Dialog title when the user is selecting a raw contact to edit. [CHAR LIMIT=128] --> + <string name="contact_editor_pick_raw_contact_dialog_title">Choose linked contact</string> + + <!-- Text next to a contact's name that lets the user know it is a read only contact. [CHAR LIMIT=128] --> + <string name="contact_editor_pick_raw_contact_read_only"><xliff:g id="display_name">%s</xliff:g> (read only)</string> + <!-- Button label to prompt the user to add an account (when there are 0 existing accounts on the device) [CHAR LIMIT=30] --> <string name="add_account">Add account</string> diff --git a/res/values/styles.xml b/res/values/styles.xml index e7b658292..d51392abf 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -498,4 +498,14 @@ background and text color. See also android:style/Widget.Holo.TextView.ListSepar <item name="android:windowContentOverlay">@null</item> <item name="android:windowElevation">0dp</item> </style> + + <!-- Transparent/blank activity --> + <style name="TransparentThemeAppCompat" parent="@style/PeopleActivityTheme"> + <item name="android:windowBackground">@android:color/transparent</item> + <item name="android:windowIsTranslucent">true</item> + <item name="android:windowContentOverlay">@null</item> + <item name="android:windowNoTitle">true</item> + <item name="android:windowIsFloating">true</item> + <item name="android:backgroundDimEnabled">false</item> + </style> </resources> |