Use Toolbar for QC
* Moved star, add and edit buttons into Toolbar
* Fixed implementation of add/edit: copied the
ContractDetailFragment implementation
* Added unimplemented Share and Place on Home menu items
* Deleted some of the quickcontact_activity.xml files
* No longer handle click events on Contact photo view
Change-Id: Id333b11e89d8755ace600700be15077fd47b6172
diff --git a/res/drawable-hdpi/ic_star_24dp.png b/res/drawable-hdpi/ic_star_24dp.png
new file mode 100644
index 0000000..d053adb
--- /dev/null
+++ b/res/drawable-hdpi/ic_star_24dp.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_star_outline_24dp.png b/res/drawable-hdpi/ic_star_outline_24dp.png
new file mode 100644
index 0000000..809f1ee
--- /dev/null
+++ b/res/drawable-hdpi/ic_star_outline_24dp.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_star_24dp.png b/res/drawable-mdpi/ic_star_24dp.png
new file mode 100644
index 0000000..f68b428
--- /dev/null
+++ b/res/drawable-mdpi/ic_star_24dp.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_star_outline_24dp.png b/res/drawable-mdpi/ic_star_outline_24dp.png
new file mode 100644
index 0000000..743aaae
--- /dev/null
+++ b/res/drawable-mdpi/ic_star_outline_24dp.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_star_24dp.png b/res/drawable-xhdpi/ic_star_24dp.png
new file mode 100644
index 0000000..49faab8
--- /dev/null
+++ b/res/drawable-xhdpi/ic_star_24dp.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_star_outline_24dp.png b/res/drawable-xhdpi/ic_star_outline_24dp.png
new file mode 100644
index 0000000..0ce8d31
--- /dev/null
+++ b/res/drawable-xhdpi/ic_star_outline_24dp.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_star_24dp.png b/res/drawable-xxhdpi/ic_star_24dp.png
new file mode 100644
index 0000000..0aa8a26
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_star_24dp.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_star_outline_24dp.png b/res/drawable-xxhdpi/ic_star_outline_24dp.png
new file mode 100644
index 0000000..1f9a7a2
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_star_outline_24dp.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_star_24dp.png b/res/drawable-xxxhdpi/ic_star_24dp.png
new file mode 100644
index 0000000..7477c14
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_star_24dp.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_star_outline_24dp.png b/res/drawable-xxxhdpi/ic_star_outline_24dp.png
new file mode 100644
index 0000000..3ae24c7
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_star_outline_24dp.png
Binary files differ
diff --git a/res/layout-land/quickcontact_activity.xml b/res/layout-land/quickcontact_activity.xml
index 497e3dd..552f568 100644
--- a/res/layout-land/quickcontact_activity.xml
+++ b/res/layout-land/quickcontact_activity.xml
@@ -27,7 +27,23 @@
android:layout_height="match_parent"
ex:ratio="1.0"
ex:direction="heightToWidth">
- <include layout="@layout/quickcontact_photo_container" />
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <ImageView
+ android:id="@+id/photo"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="centerCrop"
+ android:contentDescription="@string/description_contact_photo" />
+ <!-- Need to set a non null background on Toolbar in order for MenuItem
+ ripples to be drawn on this view, instead of another-->
+ <Toolbar
+ android:layout_width="match_parent"
+ android:layout_height="?android:attr/actionBarSize"
+ android:background="#00000000"
+ android:id="@+id/toolbar"/>
+ </FrameLayout>
</view>
<com.android.contacts.quickcontact.ExpandingEntryCardView
style="@style/ExpandingEntryCardStyle"
diff --git a/res/layout-sw600dp-land/quickcontact_activity.xml b/res/layout-sw600dp-land/quickcontact_activity.xml
deleted file mode 100644
index 239c50c..0000000
--- a/res/layout-sw600dp-land/quickcontact_activity.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 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:id="@android:id/content"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:padding="32dip"
- android:orientation="horizontal">
- <FrameLayout
- android:layout_width="360dip"
- android:layout_height="360dip">
- <include layout="@layout/quickcontact_photo_container" />
- </FrameLayout>
- <com.android.contacts.quickcontact.ExpandingEntryCardView
- style="@style/ExpandingEntryCardStyle"
- android:id="@+id/communication_card"
- android:layout_marginTop="@dimen/communication_card_marginTop"
- android:visibility="gone" />
- <com.android.contacts.quickcontact.ExpandingEntryCardView
- style="@style/ExpandingEntryCardStyle"
- android:id="@+id/recent_card"
- android:visibility="gone" />
-</LinearLayout>
\ No newline at end of file
diff --git a/res/layout-sw600dp/quickcontact_activity.xml b/res/layout-sw600dp/quickcontact_activity.xml
deleted file mode 100644
index 6c275b1..0000000
--- a/res/layout-sw600dp/quickcontact_activity.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 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:id="@android:id/content"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:padding="32dip"
- android:orientation="vertical" >
- <FrameLayout
- android:layout_width="360dip"
- android:layout_height="@dimen/quick_contact_photo_container_height">
- <include layout="@layout/quickcontact_photo_container" />
- </FrameLayout>
- <com.android.contacts.quickcontact.ExpandingEntryCardView
- style="@style/ExpandingEntryCardStyle"
- android:id="@+id/communication_card"
- android:layout_marginTop="@dimen/communication_card_marginTop"
- android:visibility="gone" />
- <com.android.contacts.quickcontact.ExpandingEntryCardView
- style="@style/ExpandingEntryCardStyle"
- android:id="@+id/recent_card"
- android:visibility="gone" />
-</LinearLayout>
\ No newline at end of file
diff --git a/res/layout-sw720dp-land/quickcontact_activity.xml b/res/layout-sw720dp-land/quickcontact_activity.xml
deleted file mode 100644
index 239c50c..0000000
--- a/res/layout-sw720dp-land/quickcontact_activity.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 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:id="@android:id/content"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:padding="32dip"
- android:orientation="horizontal">
- <FrameLayout
- android:layout_width="360dip"
- android:layout_height="360dip">
- <include layout="@layout/quickcontact_photo_container" />
- </FrameLayout>
- <com.android.contacts.quickcontact.ExpandingEntryCardView
- style="@style/ExpandingEntryCardStyle"
- android:id="@+id/communication_card"
- android:layout_marginTop="@dimen/communication_card_marginTop"
- android:visibility="gone" />
- <com.android.contacts.quickcontact.ExpandingEntryCardView
- style="@style/ExpandingEntryCardStyle"
- android:id="@+id/recent_card"
- android:visibility="gone" />
-</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/quickcontact_activity.xml b/res/layout/quickcontact_activity.xml
index 9af1079..a7c12dd 100644
--- a/res/layout/quickcontact_activity.xml
+++ b/res/layout/quickcontact_activity.xml
@@ -24,14 +24,28 @@
android:focusableInTouchMode="true"
android:descendantFocusability="afterDescendants" >
- <!-- Will contain ToolBar and image behind ToolBar -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="@dimen/quickcontact_maximum_header_height"
android:layout_marginTop="@dimen/quickcontact_starting_empty_height"
android:background="@color/card_margin_color"
android:id="@+id/toolbar_parent">
- <include layout="@layout/quickcontact_photo_container" />
+
+ <ImageView
+ android:id="@+id/photo"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="centerCrop"
+ android:contentDescription="@string/description_contact_photo" />
+
+ <!-- Need to set a non null background on Toolbar in order for MenuItem
+ ripples to be drawn on this view, instead of another-->
+ <Toolbar
+ android:layout_width="match_parent"
+ android:layout_height="?android:attr/actionBarSize"
+ android:background="#00000000"
+ android:id="@+id/toolbar"/>
+
</FrameLayout>
<com.android.contacts.widget.TouchlessScrollView
diff --git a/res/layout/quickcontact_photo_container.xml b/res/layout/quickcontact_photo_container.xml
deleted file mode 100644
index 5685427..0000000
--- a/res/layout/quickcontact_photo_container.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 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.
--->
-<merge
- xmlns:android="http://schemas.android.com/apk/res/android">
- <RelativeLayout
- android:id="@+id/photo_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:gravity="center_vertical">
- <ImageView
- android:id="@+id/photo"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerCrop"
- android:clickable="true"
- android:contentDescription="@string/description_contact_photo" />
- <View
- android:layout_width="match_parent"
- android:layout_height="1dip"
- android:layout_alignParentTop="true"
- android:background="#4CFFFFFF" />
- <View
- android:id="@+id/photo_text_bar"
- android:layout_width="0dip"
- android:layout_height="42dip"
- android:layout_alignBottom="@id/photo"
- android:layout_alignLeft="@id/photo"
- android:layout_alignRight="@id/photo"
- android:layout_alignStart="@id/photo"
- android:layout_alignEnd="@id/photo"
- android:background="@color/quickcontact_name_detail_background" />
- <ImageView
- android:id="@+id/contact_edit_image"
- android:src="@drawable/ic_create_24dp"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_marginRight="16dip"
- android:layout_marginEnd="16dip"
- android:layout_marginBottom="5dip"
- android:layout_alignBottom="@id/photo_text_bar"
- android:layout_alignRight="@id/photo_text_bar"
- android:layout_alignEnd="@id/photo_text_bar"
- android:clickable="true"
- android:contentDescription="@string/editContactDescription" />
- <ImageView
- android:id="@+id/quickcontact_star_button"
- android:src="@drawable/ic_favorite_off_lt"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_marginBottom="5dip"
- android:layout_marginRight="16dip"
- android:layout_marginEnd="16dip"
- android:layout_alignBottom="@id/photo_text_bar"
- android:layout_toLeftOf="@id/contact_edit_image"
- android:layout_toStartOf="@id/contact_edit_image"
- android:clickable="true"
- android:contentDescription="@string/menu_addStar" />
- <TextView
- android:id="@+id/name"
- android:layout_width="match_parent"
- android:layout_height="42dip"
- android:layout_alignBottom="@id/photo"
- android:layout_alignLeft="@id/photo"
- android:layout_alignStart="@id/photo"
- android:layout_toLeftOf="@id/quickcontact_star_button"
- android:layout_toStartOf="@id/quickcontact_star_button"
- android:gravity="center_vertical"
- android:paddingLeft="8dip"
- android:paddingStart="8dip"
- android:singleLine="true"
- android:ellipsize="end"
- android:textColor="@android:color/white"
- android:textAppearance="?android:attr/textAppearanceMedium" />
- </RelativeLayout>
-</merge>
diff --git a/res/menu/quickcontact.xml b/res/menu/quickcontact.xml
new file mode 100644
index 0000000..34a6a10
--- /dev/null
+++ b/res/menu/quickcontact.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/menu_star"
+ android:showAsAction="always" />
+
+ <item
+ android:id="@+id/menu_edit"
+ android:icon="@drawable/ic_create_24dp"
+ android:showAsAction="always" />
+
+ <item
+ android:id="@+id/menu_share"
+ android:title="@string/menu_share"
+ android:alphabeticShortcut="s" />
+
+ <item
+ android:id="@+id/menu_create_contact_shortcut"
+ android:title="@string/menu_create_contact_shortcut" />
+</menu>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6be304b..c1bd3c0 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -658,6 +658,10 @@
<string name="timestamp_string_yesterday">Yesterday</string>
<!-- Timestamp string for interactions from tomorrow. [CHAR LIMIT=40] -->
<string name="timestamp_string_tomorrow">Tomorrow</string>
+
<!-- Title of sms action entry. [CHAR LIMIT=60] -->
<string name="send_message">Send message</string>
+
+ <!-- Toast that appears when you are copying a directory contact into your personal contacts -->
+ <string name="toast_making_personal_copy">Creating a personal copy...</string>
</resources>