Move contact photo edit icon from ActionBar to lower right corner

Screenshots https://docs.google.com/drawings/d/1mekRSq4i3Y810Ow2tbNBDKBWl1NGmR4GLR7vlocZOxI/edit

Bug 19732687

Change-Id: I68f969eed59d925d9afd6d5c8e33ec80cbff5cfd
diff --git a/res/layout/compact_photo_editor_view.xml b/res/layout/compact_photo_editor_view.xml
index 670b24e..f3e7f7b 100644
--- a/res/layout/compact_photo_editor_view.xml
+++ b/res/layout/compact_photo_editor_view.xml
@@ -28,4 +28,21 @@
             android:layout_height="match_parent"
             android:scaleType="centerCrop"/>
 
+    <ImageView
+            android:id="@+id/photo_icon"
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_alignParentBottom="true"
+            android:layout_alignParentEnd="true"
+            android:layout_marginBottom="16dp"
+            android:layout_marginEnd="16dp"
+            android:background="?android:attr/selectableItemBackground"
+            android:src="@drawable/ic_photo_camera_white_24dp" />
+
+    <View
+            android:id="@+id/photo_touch_intercept_overlay"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="@drawable/item_background_material_dark" />
+
 </com.android.contacts.editor.CompactPhotoEditorView>
\ No newline at end of file
diff --git a/res/menu/edit_contact.xml b/res/menu/edit_contact.xml
index be15720..fe6d2b9 100644
--- a/res/menu/edit_contact.xml
+++ b/res/menu/edit_contact.xml
@@ -37,15 +37,6 @@
         android:id="@+id/menu_delete"
         android:title="@string/menu_deleteContact" />
 
-    <!-- The compact contact editor will set this to visible but we don't want it
-         in the fully expanded contact editor. -->
-    <item
-        android:id="@+id/menu_change_photo"
-        android:title="@string/menu_change_photo"
-        android:icon="@drawable/ic_photo_camera_white_24dp"
-        android:showAsAction="always"
-        android:visible="false" />
-
     <item
         android:id="@+id/menu_set_ringtone"
         android:title="@string/menu_set_ring_tone" />
diff --git a/src/com/android/contacts/editor/CompactContactEditorFragment.java b/src/com/android/contacts/editor/CompactContactEditorFragment.java
index e31e063..dee322d 100644
--- a/src/com/android/contacts/editor/CompactContactEditorFragment.java
+++ b/src/com/android/contacts/editor/CompactContactEditorFragment.java
@@ -189,26 +189,6 @@
     }
 
     @Override
-    public void onPrepareOptionsMenu(Menu menu) {
-        super.onPrepareOptionsMenu(menu);
-        menu.findItem(R.id.menu_change_photo).setVisible(true);
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        if (super.onOptionsItemSelected(item)) {
-            return true;
-        }
-        if (item.getItemId() == R.id.menu_change_photo) {
-            if (mPhotoHandler != null) {
-                mPhotoHandler.onClick(/* view =*/ null);
-            }
-            return true;
-        }
-        return false;
-    }
-
-    @Override
     protected void bindEditors() {
         if (!isReadyToBindEditors()) {
             return;
diff --git a/src/com/android/contacts/editor/CompactPhotoEditorView.java b/src/com/android/contacts/editor/CompactPhotoEditorView.java
index 6c8670d..ef96854 100644
--- a/src/com/android/contacts/editor/CompactPhotoEditorView.java
+++ b/src/com/android/contacts/editor/CompactPhotoEditorView.java
@@ -44,12 +44,12 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageView;
-import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
 
 /**
  * Displays the primary photo.
  */
-public class CompactPhotoEditorView extends LinearLayout implements View.OnClickListener {
+public class CompactPhotoEditorView extends RelativeLayout implements View.OnClickListener {
 
     private static final String TAG = CompactContactEditorFragment.TAG;
 
@@ -90,7 +90,7 @@
         mContactPhotoManager = ContactPhotoManager.getInstance(getContext());
 
         mPhotoImageView = (QuickContactImageView) findViewById(R.id.photo);
-        mPhotoImageView.setOnClickListener(this);
+        findViewById(R.id.photo_touch_intercept_overlay).setOnClickListener(this);
     }
 
     public void setValues(DataKind dataKind, ValuesDelta valuesDelta,