Loading res/layout/item_photo_editor.xml +31 −18 Original line number Diff line number Diff line Loading @@ -17,6 +17,11 @@ <view class="com.android.contacts.editor.PhotoEditorView" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" > <FrameLayout android:layout_width="48dip" android:layout_height="48dip" > Loading @@ -38,4 +43,12 @@ android:contentDescription="@string/description_contact_photo" android:background="?android:attr/selectableItemBackground" /> </FrameLayout> <ImageView android:id="@+id/photo_triangle_affordance" android:src="@drawable/account_spinner_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" /> </view> res/layout/raw_contact_editor_view.xml +3 −17 Original line number Diff line number Diff line Loading @@ -52,25 +52,11 @@ </LinearLayout> <LinearLayout android:id="@+id/stub_photo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="8dip" android:orientation="horizontal"> <include android:id="@+id/edit_photo" android:layout_marginRight="8dip" layout="@layout/item_photo_editor" /> <ImageView android:src="@drawable/account_spinner_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" /> </LinearLayout> </LinearLayout> <LinearLayout Loading res/layout/raw_contact_readonly_editor_view.xml +3 −17 Original line number Diff line number Diff line Loading @@ -42,25 +42,11 @@ android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="?android:attr/textColorSecondary" /> <LinearLayout android:id="@+id/stub_photo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="8dip" android:orientation="horizontal"> <include android:id="@+id/edit_photo" android:layout_marginRight="8dip" layout="@layout/item_photo_editor" /> <ImageView android:src="@drawable/account_spinner_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" /> </LinearLayout> </LinearLayout> <Button Loading src/com/android/contacts/editor/ContactEditorFragment.java +2 −1 Original line number Diff line number Diff line Loading @@ -799,6 +799,7 @@ public class ContactEditorFragment extends Fragment implements mode = PhotoActionPopup.Modes.READ_ONLY_ALLOW_PRIMARY; } else { // Read-only and either no photo or the only photo ==> no options editor.getPhotoEditor().setEditorListener(null); return; } } Loading Loading @@ -882,7 +883,7 @@ public class ContactEditorFragment extends Fragment implements // Remove the pressed state from the account header because the user cannot switch accounts // on an existing contact final View accountView = editor.findViewById(R.id.account); accountView.setBackgroundDrawable(null); accountView.setBackground(null); accountView.setEnabled(false); } Loading src/com/android/contacts/editor/PhotoEditorView.java +9 −5 Original line number Diff line number Diff line Loading @@ -16,12 +16,12 @@ package com.android.contacts.editor; import com.android.contacts.ContactsUtils; import com.android.contacts.R; import com.android.contacts.model.DataKind; import com.android.contacts.model.EntityDelta; import com.android.contacts.model.EntityDelta.ValuesDelta; import com.android.contacts.util.ContactPhotoUtils; import com.android.contacts.ContactsUtils; import android.content.Context; import android.graphics.Bitmap; Loading @@ -29,19 +29,20 @@ import android.graphics.BitmapFactory; import android.provider.ContactsContract.CommonDataKinds.Photo; import android.util.AttributeSet; import android.view.View; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; /** * Simple editor for {@link Photo}. */ public class PhotoEditorView extends FrameLayout implements Editor { public class PhotoEditorView extends LinearLayout implements Editor { private ImageView mPhotoImageView; private View mFrameView; private ValuesDelta mEntry; private EditorListener mListener; private View mTriangleAffordance; private boolean mHasSetPhoto = false; private boolean mReadOnly; Loading Loading @@ -70,6 +71,7 @@ public class PhotoEditorView extends FrameLayout implements Editor { @Override protected void onFinishInflate() { super.onFinishInflate(); mTriangleAffordance = findViewById(R.id.photo_triangle_affordance); mPhotoImageView = (ImageView) findViewById(R.id.photo); mFrameView = findViewById(R.id.frame); mFrameView.setOnClickListener(new OnClickListener() { Loading Loading @@ -123,8 +125,6 @@ public class PhotoEditorView extends FrameLayout implements Editor { return mHasSetPhoto; } /** * Assign the given {@link Bitmap} as the new value, updating UI and * readying for persisting through {@link ValuesDelta}. Loading Loading @@ -176,6 +176,10 @@ public class PhotoEditorView extends FrameLayout implements Editor { @Override public void setEditorListener(EditorListener listener) { mListener = listener; final boolean isPushable = listener != null; mTriangleAffordance.setVisibility(isPushable ? View.VISIBLE : View.INVISIBLE); mFrameView.setVisibility(isPushable ? View.VISIBLE : View.INVISIBLE); } @Override Loading Loading
res/layout/item_photo_editor.xml +31 −18 Original line number Diff line number Diff line Loading @@ -17,6 +17,11 @@ <view class="com.android.contacts.editor.PhotoEditorView" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" > <FrameLayout android:layout_width="48dip" android:layout_height="48dip" > Loading @@ -38,4 +43,12 @@ android:contentDescription="@string/description_contact_photo" android:background="?android:attr/selectableItemBackground" /> </FrameLayout> <ImageView android:id="@+id/photo_triangle_affordance" android:src="@drawable/account_spinner_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" /> </view>
res/layout/raw_contact_editor_view.xml +3 −17 Original line number Diff line number Diff line Loading @@ -52,25 +52,11 @@ </LinearLayout> <LinearLayout android:id="@+id/stub_photo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="8dip" android:orientation="horizontal"> <include android:id="@+id/edit_photo" android:layout_marginRight="8dip" layout="@layout/item_photo_editor" /> <ImageView android:src="@drawable/account_spinner_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" /> </LinearLayout> </LinearLayout> <LinearLayout Loading
res/layout/raw_contact_readonly_editor_view.xml +3 −17 Original line number Diff line number Diff line Loading @@ -42,25 +42,11 @@ android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="?android:attr/textColorSecondary" /> <LinearLayout android:id="@+id/stub_photo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="8dip" android:orientation="horizontal"> <include android:id="@+id/edit_photo" android:layout_marginRight="8dip" layout="@layout/item_photo_editor" /> <ImageView android:src="@drawable/account_spinner_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" /> </LinearLayout> </LinearLayout> <Button Loading
src/com/android/contacts/editor/ContactEditorFragment.java +2 −1 Original line number Diff line number Diff line Loading @@ -799,6 +799,7 @@ public class ContactEditorFragment extends Fragment implements mode = PhotoActionPopup.Modes.READ_ONLY_ALLOW_PRIMARY; } else { // Read-only and either no photo or the only photo ==> no options editor.getPhotoEditor().setEditorListener(null); return; } } Loading Loading @@ -882,7 +883,7 @@ public class ContactEditorFragment extends Fragment implements // Remove the pressed state from the account header because the user cannot switch accounts // on an existing contact final View accountView = editor.findViewById(R.id.account); accountView.setBackgroundDrawable(null); accountView.setBackground(null); accountView.setEnabled(false); } Loading
src/com/android/contacts/editor/PhotoEditorView.java +9 −5 Original line number Diff line number Diff line Loading @@ -16,12 +16,12 @@ package com.android.contacts.editor; import com.android.contacts.ContactsUtils; import com.android.contacts.R; import com.android.contacts.model.DataKind; import com.android.contacts.model.EntityDelta; import com.android.contacts.model.EntityDelta.ValuesDelta; import com.android.contacts.util.ContactPhotoUtils; import com.android.contacts.ContactsUtils; import android.content.Context; import android.graphics.Bitmap; Loading @@ -29,19 +29,20 @@ import android.graphics.BitmapFactory; import android.provider.ContactsContract.CommonDataKinds.Photo; import android.util.AttributeSet; import android.view.View; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; /** * Simple editor for {@link Photo}. */ public class PhotoEditorView extends FrameLayout implements Editor { public class PhotoEditorView extends LinearLayout implements Editor { private ImageView mPhotoImageView; private View mFrameView; private ValuesDelta mEntry; private EditorListener mListener; private View mTriangleAffordance; private boolean mHasSetPhoto = false; private boolean mReadOnly; Loading Loading @@ -70,6 +71,7 @@ public class PhotoEditorView extends FrameLayout implements Editor { @Override protected void onFinishInflate() { super.onFinishInflate(); mTriangleAffordance = findViewById(R.id.photo_triangle_affordance); mPhotoImageView = (ImageView) findViewById(R.id.photo); mFrameView = findViewById(R.id.frame); mFrameView.setOnClickListener(new OnClickListener() { Loading Loading @@ -123,8 +125,6 @@ public class PhotoEditorView extends FrameLayout implements Editor { return mHasSetPhoto; } /** * Assign the given {@link Bitmap} as the new value, updating UI and * readying for persisting through {@link ValuesDelta}. Loading Loading @@ -176,6 +176,10 @@ public class PhotoEditorView extends FrameLayout implements Editor { @Override public void setEditorListener(EditorListener listener) { mListener = listener; final boolean isPushable = listener != null; mTriangleAffordance.setVisibility(isPushable ? View.VISIBLE : View.INVISIBLE); mFrameView.setVisibility(isPushable ? View.VISIBLE : View.INVISIBLE); } @Override Loading