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

Commit b6d0b07c authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

Merge branch '1776-r-default_to_device_if_no_account' into 'v1-r'

Issue 1776: Default to phone-only if no account

See merge request !100
parents 1f6d8589 f3639866
Loading
Loading
Loading
Loading
+4 −28
Original line number Diff line number Diff line
@@ -170,35 +170,11 @@ public class ContactEditorAccountsChangedActivity extends Activity
                }
            });
        } else {
            // If the user has 0 writable accounts, we will just show the user a message with 2
            // possible action buttons.
            view = View.inflate(this,
                    R.layout.contact_editor_accounts_changed_activity_with_text, null);

            final TextView textView = (TextView) view.findViewById(R.id.text);
            final Button leftButton = (Button) view.findViewById(R.id.left_button);
            final Button rightButton = (Button) view.findViewById(R.id.right_button);

            textView.setText(getString(R.string.contact_editor_prompt_zero_accounts));

            // This button allows the user to continue editing the contact as a phone-only
            // local contact.
            leftButton.setText(getString(android.R.string.cancel));
            leftButton.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {
                    // Remember that the user wants to create local contacts, so the user is not
                    // prompted again with this activity.
            // If the user has 0 writable accounts, default to device contact
            view = new View(this);
            saveAccountAndReturnResult(AccountWithDataSet.getNullAccount());
            finish();
        }
            });

            // This button allows the user to add a new account to the device and return to
            // this app afterwards.
            rightButton.setText(getString(R.string.add_account));
            rightButton.setOnClickListener(mAddAccountClickListener);
        }

        if (mDialog != null && mDialog.isShowing()) {
            mDialog.dismiss();