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/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>