Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9ff5645 authored by Walter Jang's avatar Walter Jang Committed by Android Git Automerger
Browse files

am faa22b97: am fbe232ef: Merge "Don\'t set super primary name on compact...

am faa22b97: am fbe232ef: Merge "Don\'t set super primary name on compact editor unless it changes" into mnc-dev

* commit 'faa22b97':
  Don't set super primary name on compact editor unless it changes
parents 0db4ae9b faa22b97
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -345,12 +345,9 @@ public class CompactContactEditorFragment extends ContactEditorBaseFragment impl
        if (isInsert) {
            // For inserts, prevent any changes from being saved when the base fragment is destroyed
            mStatus = Status.CLOSING;
        } else {
            // Prevent a Toast from being displayed as we transition to the full editor
            mShowToastAfterSave = false;

        } else if (hasPendingChanges()) {
            // Save whatever is in the form
            save(SaveMode.RELOAD, /* backPressed =*/ false);
            save(SaveMode.CLOSE, /* backPressed =*/ false);
        }

        // Prepare an Intent to start the expanded editor
+0 −7
Original line number Diff line number Diff line
@@ -174,13 +174,6 @@ public class CompactRawContactsEditorView extends LinearLayout implements View.O
    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.more_fields && mListener != null ) {
            // We mark the name that was displayed as super primary before expanding
            // so that a save on the expanded editor (without a name change) does not
            // cause the displayed name to change.
            if (mNameValuesDelta != null) {
                mNameValuesDelta.setSuperPrimary(true);
            }

            mListener.onExpandEditor();
        }
    }
+1 −5
Original line number Diff line number Diff line
@@ -373,10 +373,6 @@ abstract public class ContactEditorBaseFragment extends Fragment implements
    // Used to pre-populate the editor with a display name when a user edits a read-only contact.
    protected String mDefaultDisplayName;

    // Whether to show a Toast message after saves have completed.
    // Does not affect successful toasts shown after joins, which are never displayed.
    protected boolean mShowToastAfterSave = true;

    /**
     * The contact data loader listener.
     */
@@ -1343,7 +1339,7 @@ abstract public class ContactEditorBaseFragment extends Fragment implements
            Uri contactLookupUri, Bundle updatedPhotos, boolean backPressed, long photoId) {
        if (hadChanges) {
            if (saveSucceeded) {
                if (saveMode != SaveMode.JOIN && mShowToastAfterSave) {
                if (saveMode != SaveMode.JOIN) {
                    Toast.makeText(mContext, R.string.contactSavedToast, Toast.LENGTH_SHORT).show();
                }
            } else {