Loading src/com/android/contacts/activities/ContactEditorActivity.java +4 −20 Original line number Diff line number Diff line Loading @@ -95,31 +95,15 @@ public class ContactEditorActivity extends ContactsActivity ActionBar actionBar = getActionBar(); if (actionBar != null) { // Inflate a custom action bar that contains the "done" button for saving changes // to the contact LayoutInflater inflater = (LayoutInflater) getSystemService (Context.LAYOUT_INFLATER_SERVICE); View customActionBarView = inflater.inflate(R.layout.editor_custom_action_bar, null); View saveMenuItem = customActionBarView.findViewById(R.id.save_menu_item); saveMenuItem.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mFragment.doSaveAction(); } }); TextView title = (TextView) customActionBarView.findViewById(R.id.title); if (Intent.ACTION_EDIT.equals(action)) { title.setText(getResources().getString( actionBar.setTitle(getResources().getString( R.string.contact_editor_title_existing_contact)); } else { title.setText(getResources().getString( actionBar.setTitle(getResources().getString( R.string.contact_editor_title_new_contact)); } // Show the custom action bar but hide the home icon and title actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE); actionBar.setCustomView(customActionBarView); actionBar.setDisplayShowHomeEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } mFragment = (ContactEditorFragment) getFragmentManager().findFragmentById( Loading src/com/android/contacts/editor/ContactEditorFragment.java +1 −0 Original line number Diff line number Diff line Loading @@ -1125,6 +1125,7 @@ public class ContactEditorFragment extends Fragment implements @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: case R.id.menu_done: return save(SaveMode.CLOSE); case R.id.menu_discard: Loading Loading
src/com/android/contacts/activities/ContactEditorActivity.java +4 −20 Original line number Diff line number Diff line Loading @@ -95,31 +95,15 @@ public class ContactEditorActivity extends ContactsActivity ActionBar actionBar = getActionBar(); if (actionBar != null) { // Inflate a custom action bar that contains the "done" button for saving changes // to the contact LayoutInflater inflater = (LayoutInflater) getSystemService (Context.LAYOUT_INFLATER_SERVICE); View customActionBarView = inflater.inflate(R.layout.editor_custom_action_bar, null); View saveMenuItem = customActionBarView.findViewById(R.id.save_menu_item); saveMenuItem.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mFragment.doSaveAction(); } }); TextView title = (TextView) customActionBarView.findViewById(R.id.title); if (Intent.ACTION_EDIT.equals(action)) { title.setText(getResources().getString( actionBar.setTitle(getResources().getString( R.string.contact_editor_title_existing_contact)); } else { title.setText(getResources().getString( actionBar.setTitle(getResources().getString( R.string.contact_editor_title_new_contact)); } // Show the custom action bar but hide the home icon and title actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE); actionBar.setCustomView(customActionBarView); actionBar.setDisplayShowHomeEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } mFragment = (ContactEditorFragment) getFragmentManager().findFragmentById( Loading
src/com/android/contacts/editor/ContactEditorFragment.java +1 −0 Original line number Diff line number Diff line Loading @@ -1125,6 +1125,7 @@ public class ContactEditorFragment extends Fragment implements @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: case R.id.menu_done: return save(SaveMode.CLOSE); case R.id.menu_discard: Loading