Loading src/com/android/contacts/editor/Editor.java +7 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,13 @@ public interface Editor { public void onFieldChanged(String column, String value); /** * Performs the delete operation for this {@link Editor}. * Marks the underlying ValuesDelta as deleted, but does not update the view. */ public void markDeleted(); /** * Performs the delete operation for this {@link Editor}, which involves both * marking the underlying ValuesDelta as deleted and updating the view. */ public void deleteEditor(); Loading src/com/android/contacts/editor/KindSectionView.java +12 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,7 @@ public class KindSectionView extends LinearLayout implements EditorListener { // If there is a listener, let it decide whether to delete the Editor or the entire // KindSectionView so that there is no jank from both animations happening in succession. if (mListener != null) { editor.markDeleted(); mListener.onDeleteRequested(editor); } else { editor.deleteEditor(); Loading @@ -140,10 +141,21 @@ public class KindSectionView extends LinearLayout implements EditorListener { } } /** * Calling this signifies that this entire section view is intended to be removed from the * layout. Note, calling this does not change the deleted state of any underlying * {@link Editor}, i.e. {@link com.android.contacts.common.model.ValuesDelta#markDeleted()} * is not invoked on any editor in this section. It is purely marked for higher level UI * layers to manipulate the layout w/o introducing jank. * See b/22228718 for context. */ public void markForRemoval() { mMarkedForRemoval = true; } /** * Whether the entire section view is intended to be removed from the layout. */ public boolean isMarkedForRemoval() { return mMarkedForRemoval; } Loading src/com/android/contacts/editor/LabeledEditorView.java +6 −1 Original line number Diff line number Diff line Loading @@ -185,9 +185,14 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor, } @Override public void deleteEditor() { public void markDeleted() { // Keep around in model, but mark as deleted mEntry.markDeleted(); } @Override public void deleteEditor() { markDeleted(); // Remove the view EditorAnimator.getInstance().removeEditorView(this); Loading src/com/android/contacts/editor/PhotoEditorView.java +5 −0 Original line number Diff line number Diff line Loading @@ -251,6 +251,11 @@ public class PhotoEditorView extends LinearLayout implements Editor { return !mHasSetPhoto; } @Override public void markDeleted() { // Photo is not deletable } @Override public void deleteEditor() { // Photo is not deletable Loading Loading
src/com/android/contacts/editor/Editor.java +7 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,13 @@ public interface Editor { public void onFieldChanged(String column, String value); /** * Performs the delete operation for this {@link Editor}. * Marks the underlying ValuesDelta as deleted, but does not update the view. */ public void markDeleted(); /** * Performs the delete operation for this {@link Editor}, which involves both * marking the underlying ValuesDelta as deleted and updating the view. */ public void deleteEditor(); Loading
src/com/android/contacts/editor/KindSectionView.java +12 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,7 @@ public class KindSectionView extends LinearLayout implements EditorListener { // If there is a listener, let it decide whether to delete the Editor or the entire // KindSectionView so that there is no jank from both animations happening in succession. if (mListener != null) { editor.markDeleted(); mListener.onDeleteRequested(editor); } else { editor.deleteEditor(); Loading @@ -140,10 +141,21 @@ public class KindSectionView extends LinearLayout implements EditorListener { } } /** * Calling this signifies that this entire section view is intended to be removed from the * layout. Note, calling this does not change the deleted state of any underlying * {@link Editor}, i.e. {@link com.android.contacts.common.model.ValuesDelta#markDeleted()} * is not invoked on any editor in this section. It is purely marked for higher level UI * layers to manipulate the layout w/o introducing jank. * See b/22228718 for context. */ public void markForRemoval() { mMarkedForRemoval = true; } /** * Whether the entire section view is intended to be removed from the layout. */ public boolean isMarkedForRemoval() { return mMarkedForRemoval; } Loading
src/com/android/contacts/editor/LabeledEditorView.java +6 −1 Original line number Diff line number Diff line Loading @@ -185,9 +185,14 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor, } @Override public void deleteEditor() { public void markDeleted() { // Keep around in model, but mark as deleted mEntry.markDeleted(); } @Override public void deleteEditor() { markDeleted(); // Remove the view EditorAnimator.getInstance().removeEditorView(this); Loading
src/com/android/contacts/editor/PhotoEditorView.java +5 −0 Original line number Diff line number Diff line Loading @@ -251,6 +251,11 @@ public class PhotoEditorView extends LinearLayout implements Editor { return !mHasSetPhoto; } @Override public void markDeleted() { // Photo is not deletable } @Override public void deleteEditor() { // Photo is not deletable Loading