summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Jang <wjang@google.com>2015-03-16 13:35:08 -0700
committerWalter Jang <wjang@google.com>2015-03-16 23:49:30 +0000
commitff16eea0e4d18cf2964667ce8e597780797e2b69 (patch)
tree3760d4f343914b1af3dfb5af78a322d725116531
parent9d8f37e77052543c4ae07cbf8329e4ff0ddef66b (diff)
downloadpackages_apps_Contacts-ff16eea0e4d18cf2964667ce8e597780797e2b69.tar.gz
packages_apps_Contacts-ff16eea0e4d18cf2964667ce8e597780797e2b69.tar.bz2
packages_apps_Contacts-ff16eea0e4d18cf2964667ce8e597780797e2b69.zip
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
-rw-r--r--res/layout/compact_photo_editor_view.xml17
-rw-r--r--res/menu/edit_contact.xml9
-rw-r--r--src/com/android/contacts/editor/CompactContactEditorFragment.java20
-rw-r--r--src/com/android/contacts/editor/CompactPhotoEditorView.java6
4 files changed, 20 insertions, 32 deletions
diff --git a/res/layout/compact_photo_editor_view.xml b/res/layout/compact_photo_editor_view.xml
index 670b24ee3..f3e7f7b1d 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 be1572068..fe6d2b9c4 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 e31e0639b..dee322d12 100644
--- a/src/com/android/contacts/editor/CompactContactEditorFragment.java
+++ b/src/com/android/contacts/editor/CompactContactEditorFragment.java
@@ -189,26 +189,6 @@ public class CompactContactEditorFragment extends ContactEditorBaseFragment impl
}
@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 6c8670dca..ef96854bc 100644
--- a/src/com/android/contacts/editor/CompactPhotoEditorView.java
+++ b/src/com/android/contacts/editor/CompactPhotoEditorView.java
@@ -44,12 +44,12 @@ import android.util.TypedValue;
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 @@ public class CompactPhotoEditorView extends LinearLayout implements View.OnClick
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,