Rename editor files
Drop the Compact prefix since we only have one editor now.
Remove KindSectionDataList since it's now unused.
Test:
Tested build
Bug: 31088704
Change-Id: Ia5ac295804a14f79d0c837b151e33aabc60aa3d0
diff --git a/src/com/android/contacts/ContactSaveService.java b/src/com/android/contacts/ContactSaveService.java
index b278144..d4da588 100755
--- a/src/com/android/contacts/ContactSaveService.java
+++ b/src/com/android/contacts/ContactSaveService.java
@@ -51,7 +51,7 @@
import android.util.Log;
import android.widget.Toast;
-import com.android.contacts.activities.CompactContactEditorActivity;
+import com.android.contacts.activities.ContactEditorActivity;
import com.android.contacts.common.compat.CompatUtils;
import com.android.contacts.common.database.ContactUpdateUtils;
import com.android.contacts.common.model.AccountTypeManager;
@@ -215,13 +215,13 @@
} catch (Exception exception) {
final int resId;
switch (saveMode) {
- case CompactContactEditorActivity.ContactEditor.SaveMode.SPLIT:
+ case ContactEditorActivity.ContactEditor.SaveMode.SPLIT:
resId = R.string.contactUnlinkErrorToast;
break;
- case CompactContactEditorActivity.ContactEditor.SaveMode.RELOAD:
+ case ContactEditorActivity.ContactEditor.SaveMode.RELOAD:
resId = R.string.contactJoinErrorToast;
break;
- case CompactContactEditorActivity.ContactEditor.SaveMode.CLOSE:
+ case ContactEditorActivity.ContactEditor.SaveMode.CLOSE:
resId = R.string.contactSavedErrorToast;
break;
default:
@@ -744,7 +744,7 @@
ContentValues values = new ContentValues();
// TODO: Move this into the contact editor where it belongs. This needs to be integrated
// with the way other intent extras that are passed to the
- // {@link CompactContactEditorActivity}.
+ // {@link ContactEditorActivity}.
values.clear();
values.put(Data.MIMETYPE, GroupMembership.CONTENT_ITEM_TYPE);
values.put(GroupMembership.GROUP_ROW_ID, ContentUris.parseId(groupUri));
diff --git a/src/com/android/contacts/ContactsDrawerActivity.java b/src/com/android/contacts/ContactsDrawerActivity.java
index 9990e9f..19d1466 100644
--- a/src/com/android/contacts/ContactsDrawerActivity.java
+++ b/src/com/android/contacts/ContactsDrawerActivity.java
@@ -55,7 +55,7 @@
import com.android.contacts.common.util.AccountsListAdapter.AccountListFilter;
import com.android.contacts.common.util.ImplicitIntentsUtil;
import com.android.contacts.common.util.ViewUtil;
-import com.android.contacts.editor.CompactContactEditorFragment;
+import com.android.contacts.editor.ContactEditorFragment;
import com.android.contacts.editor.SelectAccountDialogFragment;
import com.android.contacts.group.GroupListItem;
import com.android.contacts.group.GroupMembersFragment;
@@ -68,7 +68,6 @@
import com.android.contacts.interactions.AccountFiltersFragment.AccountFiltersListener;
import com.android.contacts.list.DefaultContactBrowseListFragment;
import com.android.contacts.list.MultiSelectContactsListFragment;
-import com.android.contacts.quickcontact.QuickContactActivity;
import com.android.contacts.common.model.account.AccountDisplayInfo;
import com.android.contacts.common.model.account.AccountDisplayInfoFactory;
import com.android.contacts.util.SharedPreferenceUtil;
@@ -570,7 +569,7 @@
private Intent createPreferenceIntent() {
final Intent intent = new Intent(this, ContactsPreferenceActivity.class);
intent.putExtra(ContactsPreferenceActivity.EXTRA_NEW_LOCAL_PROFILE,
- CompactContactEditorFragment.INTENT_EXTRA_NEW_LOCAL_PROFILE);
+ ContactEditorFragment.INTENT_EXTRA_NEW_LOCAL_PROFILE);
return intent;
}
diff --git a/src/com/android/contacts/activities/CompactContactEditorActivity.java b/src/com/android/contacts/activities/ContactEditorActivity.java
similarity index 87%
rename from src/com/android/contacts/activities/CompactContactEditorActivity.java
rename to src/com/android/contacts/activities/ContactEditorActivity.java
index 1d1ac84..8c26e2e 100644
--- a/src/com/android/contacts/activities/CompactContactEditorActivity.java
+++ b/src/com/android/contacts/activities/ContactEditorActivity.java
@@ -35,7 +35,7 @@
import com.android.contacts.common.model.RawContactDeltaList;
import com.android.contacts.common.util.ImplicitIntentsUtil;
import com.android.contacts.detail.PhotoSelectionHandler;
-import com.android.contacts.editor.CompactContactEditorFragment;
+import com.android.contacts.editor.ContactEditorFragment;
import com.android.contacts.editor.EditorIntents;
import com.android.contacts.editor.PhotoSourceDialogFragment;
import com.android.contacts.interactions.ContactDeletionInteraction;
@@ -47,7 +47,7 @@
/**
* Contact editor with only the most important fields displayed initially.
*/
-public class CompactContactEditorActivity extends ContactsActivity implements
+public class ContactEditorActivity extends ContactsActivity implements
PhotoSourceDialogFragment.Listener,
DialogManager.DialogShowingViewActivity {
private static final String TAG = "ContactEditorActivity";
@@ -68,7 +68,7 @@
public static final String EXTRA_SAVE_TO_DEVICE_FLAG =
"com.android.contacts.SAVE_TO_DEVICE_FLAG";
- private static final String TAG_COMPACT_EDITOR = "compact_editor";
+ private static final String TAG_EDITOR_FRAGMENT = "editor_fragment";
private static final String STATE_PHOTO_MODE = "photo_mode";
private static final String STATE_ACTION_BAR_TITLE = "action_bar_title";
@@ -112,9 +112,9 @@
int JOIN = 3;
/**
- * Navigate to the compact editor view after saving.
+ * Navigate to the editor view after saving.
*/
- int COMPACT = 4;
+ int EDITOR = 4;
}
/**
@@ -142,7 +142,7 @@
* - After Save/Close
* - After Revert
* - After the user has accepted an edit suggestion
- * - After the user chooses to expand the compact editor
+ * - After the user chooses to expand the editor
*/
int CLOSING = 3;
@@ -155,7 +155,7 @@
/**
* Sets the hosting Activity that will receive callbacks from the contact editor.
*/
- void setListener(CompactContactEditorFragment.Listener listener);
+ void setListener(ContactEditorFragment.Listener listener);
/**
* Initialize the contact editor.
@@ -194,12 +194,12 @@
/**
* Displays a PopupWindow with photo edit options.
*/
- private final class CompactPhotoSelectionHandler extends PhotoSelectionHandler {
+ private final class EditorPhotoSelectionHandler extends PhotoSelectionHandler {
/**
* Receiver of photo edit option callbacks.
*/
- private final class CompactPhotoActionListener extends PhotoActionListener {
+ private final class EditorPhotoActionListener extends PhotoActionListener {
@Override
public void onRemovePictureChosen() {
@@ -227,17 +227,17 @@
}
}
- private final CompactPhotoActionListener mPhotoActionListener;
+ private final EditorPhotoActionListener mPhotoActionListener;
- public CompactPhotoSelectionHandler(int photoMode) {
+ public EditorPhotoSelectionHandler(int photoMode) {
// We pass a null changeAnchorView since we are overriding onClick so that we
// can show the photo options in a dialog instead of a ListPopupWindow (which would
// be anchored at changeAnchorView).
// TODO: empty raw contact delta list
- super(CompactContactEditorActivity.this, /* changeAnchorView =*/ null, photoMode,
+ super(ContactEditorActivity.this, /* changeAnchorView =*/ null, photoMode,
/* isDirectoryContact =*/ false, new RawContactDeltaList());
- mPhotoActionListener = new CompactPhotoActionListener();
+ mPhotoActionListener = new EditorPhotoActionListener();
}
@Override
@@ -257,17 +257,17 @@
private boolean mFinishActivityOnSaveCompleted;
private DialogManager mDialogManager = new DialogManager(this);
- private CompactPhotoSelectionHandler mPhotoSelectionHandler;
+ private EditorPhotoSelectionHandler mPhotoSelectionHandler;
private Uri mPhotoUri;
private int mPhotoMode;
- private final CompactContactEditorFragment.Listener mFragmentListener =
- new CompactContactEditorFragment.Listener() {
+ private final ContactEditorFragment.Listener mFragmentListener =
+ new ContactEditorFragment.Listener() {
@Override
public void onDeleteRequested(Uri contactUri) {
ContactDeletionInteraction.start(
- CompactContactEditorActivity.this, contactUri, true);
+ ContactEditorActivity.this, contactUri, true);
}
@Override
@@ -283,13 +283,13 @@
// If it's a smart profile Intent it must be started "for result"
if (QuickContact.ACTION_QUICK_CONTACT.equals(resultIntent.getAction())) {
ImplicitIntentsUtil.startActivityInApp(
- CompactContactEditorActivity.this, resultIntent);
+ ContactEditorActivity.this, resultIntent);
} else {
startActivityForResult(resultIntent, /* requestCode */ 0);
}
ImplicitIntentsUtil.startActivityInApp(
- CompactContactEditorActivity.this, resultIntent);
+ ContactEditorActivity.this, resultIntent);
}
finish();
}
@@ -309,9 +309,9 @@
public void onEditOtherContactRequested(
Uri contactLookupUri, ArrayList<ContentValues> values) {
final Intent intent = EditorIntents.createEditOtherContactIntent(
- CompactContactEditorActivity.this, contactLookupUri, values);
+ ContactEditorActivity.this, contactLookupUri, values);
ImplicitIntentsUtil.startActivityInApp(
- CompactContactEditorActivity.this, intent);
+ ContactEditorActivity.this, intent);
finish();
}
};
@@ -359,13 +359,13 @@
actionBar.setHomeAsUpIndicator(R.drawable.ic_close_dk);
}
- setContentView(R.layout.compact_contact_editor_activity);
+ setContentView(R.layout.contact_editor_activity);
if (savedState == null) {
// Create the editor and photo selection fragments
- mFragment = new CompactContactEditorFragment();
+ mFragment = new ContactEditorFragment();
getFragmentManager().beginTransaction()
- .add(R.id.fragment_container, getEditorFragment(), TAG_COMPACT_EDITOR)
+ .add(R.id.fragment_container, getEditorFragment(), TAG_EDITOR_FRAGMENT)
.commit();
} else {
// Restore state
@@ -374,8 +374,8 @@
mPhotoUri = Uri.parse(savedState.getString(STATE_PHOTO_URI));
// Show/hide the editor and photo selection fragments (w/o animations)
- mFragment = (CompactContactEditorFragment) getFragmentManager()
- .findFragmentByTag(TAG_COMPACT_EDITOR);
+ mFragment = (ContactEditorFragment) getFragmentManager()
+ .findFragmentByTag(TAG_EDITOR_FRAGMENT);
final FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.show(getEditorFragment()).commit();
getActionBar().setTitle(getResources().getString(mActionBarTitleResId));
@@ -412,11 +412,11 @@
mFragment.setIntentExtras(intent.getExtras());
} else if (ACTION_SAVE_COMPLETED.equals(action)) {
mFragment.onSaveCompleted(true,
- intent.getIntExtra(CompactContactEditorFragment.SAVE_MODE_EXTRA_KEY,
+ intent.getIntExtra(ContactEditorFragment.SAVE_MODE_EXTRA_KEY,
ContactEditor.SaveMode.CLOSE),
intent.getBooleanExtra(ContactSaveService.EXTRA_SAVE_SUCCEEDED, false),
intent.getData(),
- intent.getLongExtra(CompactContactEditorFragment.JOIN_CONTACT_ID_EXTRA_KEY, -1));
+ intent.getLongExtra(ContactEditorFragment.JOIN_CONTACT_ID_EXTRA_KEY, -1));
} else if (ACTION_JOIN_COMPLETED.equals(action)) {
mFragment.onJoinCompleted(intent.getData());
}
@@ -448,7 +448,7 @@
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (mPhotoSelectionHandler == null) {
- mPhotoSelectionHandler = (CompactPhotoSelectionHandler) getPhotoSelectionHandler();
+ mPhotoSelectionHandler = (EditorPhotoSelectionHandler) getPhotoSelectionHandler();
}
if (mPhotoSelectionHandler.handlePhotoActivityResult(requestCode, resultCode, data)) {
return;
@@ -489,12 +489,12 @@
private PhotoSelectionHandler getPhotoSelectionHandler() {
if (mPhotoSelectionHandler == null) {
- mPhotoSelectionHandler = new CompactPhotoSelectionHandler(mPhotoMode);
+ mPhotoSelectionHandler = new EditorPhotoSelectionHandler(mPhotoMode);
}
return mPhotoSelectionHandler;
}
- private CompactContactEditorFragment getEditorFragment() {
- return (CompactContactEditorFragment) mFragment;
+ private ContactEditorFragment getEditorFragment() {
+ return (ContactEditorFragment) mFragment;
}
}
diff --git a/src/com/android/contacts/activities/ContactSelectionActivity.java b/src/com/android/contacts/activities/ContactSelectionActivity.java
index d34ebc6..fe95465 100644
--- a/src/com/android/contacts/activities/ContactSelectionActivity.java
+++ b/src/com/android/contacts/activities/ContactSelectionActivity.java
@@ -488,7 +488,7 @@
@Override
public void onEditContactAction(Uri contactLookupUri) {
- startActivityAndForwardResult(EditorIntents.createCompactEditContactIntent(
+ startActivityAndForwardResult(EditorIntents.createEditContactIntent(
ContactSelectionActivity.this, contactLookupUri, /* materialPalette =*/ null,
/* photoId =*/ -1));
}
@@ -653,7 +653,7 @@
private void startCreateNewContactActivity() {
Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
- intent.putExtra(CompactContactEditorActivity.
+ intent.putExtra(ContactEditorActivity.
INTENT_KEY_FINISH_ACTIVITY_ON_SAVE_COMPLETED, true);
startActivityAndForwardResult(intent);
}
diff --git a/src/com/android/contacts/common/model/RawContactModifier.java b/src/com/android/contacts/common/model/RawContactModifier.java
index ee9695a..5e8941d 100644
--- a/src/com/android/contacts/common/model/RawContactModifier.java
+++ b/src/com/android/contacts/common/model/RawContactModifier.java
@@ -694,7 +694,7 @@
final Integer type = values.getAsInteger(Phone.TYPE);
// If the provided phone number provides a custom phone type but not a label,
// replace it with mobile (by default) to avoid the "Enter custom label" from
- // popping up immediately upon entering the CompactContactEditorFragment
+ // popping up immediately upon entering the ContactEditorFragment
if (type != null && type == Phone.TYPE_CUSTOM &&
TextUtils.isEmpty(values.getAsString(Phone.LABEL))) {
values.put(Phone.TYPE, Phone.TYPE_MOBILE);
diff --git a/src/com/android/contacts/common/util/AccountFilterUtil.java b/src/com/android/contacts/common/util/AccountFilterUtil.java
index 2e57c65..89aebc0 100644
--- a/src/com/android/contacts/common/util/AccountFilterUtil.java
+++ b/src/com/android/contacts/common/util/AccountFilterUtil.java
@@ -23,22 +23,18 @@
import android.content.AsyncTaskLoader;
import android.content.Context;
import android.content.Intent;
-import android.content.SharedPreferences;
-import android.database.Cursor;
import android.graphics.drawable.Drawable;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Intents;
-import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import com.android.contacts.R;
-import com.android.contacts.activities.CompactContactEditorActivity;
+import com.android.contacts.activities.ContactEditorActivity;
import com.android.contacts.common.list.AccountFilterActivity;
import com.android.contacts.common.list.ContactListFilter;
import com.android.contacts.common.list.ContactListFilterController;
import com.android.contacts.common.model.AccountTypeManager;
-import com.android.contacts.common.model.RawContact;
import com.android.contacts.common.model.account.AccountType;
import com.android.contacts.common.model.account.AccountWithDataSet;
import com.android.contacts.common.preference.ContactsPreferences;
@@ -196,7 +192,7 @@
} else if (isDeviceContactsFilter(filter)) {
// It's OK to add this even though it's an implicit intent. If a different app
// receives the intent it should just ignore the flag.
- intent.putExtra(CompactContactEditorActivity.EXTRA_SAVE_TO_DEVICE_FLAG, true);
+ intent.putExtra(ContactEditorActivity.EXTRA_SAVE_TO_DEVICE_FLAG, true);
}
try {
diff --git a/src/com/android/contacts/editor/CancelEditDialogFragment.java b/src/com/android/contacts/editor/CancelEditDialogFragment.java
index ec937a6..d467f3c 100644
--- a/src/com/android/contacts/editor/CancelEditDialogFragment.java
+++ b/src/com/android/contacts/editor/CancelEditDialogFragment.java
@@ -35,7 +35,7 @@
* Shows a {@link CancelEditDialogFragment} after setting the given Fragment as the
* target of the dialog.
*/
- public static void show(CompactContactEditorFragment fragment) {
+ public static void show(ContactEditorFragment fragment) {
final CancelEditDialogFragment dialog = new CancelEditDialogFragment();
dialog.setTargetFragment(fragment, 0);
dialog.show(fragment.getFragmentManager(), TAG);
diff --git a/src/com/android/contacts/editor/CompactContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
similarity index 96%
rename from src/com/android/contacts/editor/CompactContactEditorFragment.java
rename to src/com/android/contacts/editor/ContactEditorFragment.java
index 6a5edae..05a69ec 100644
--- a/src/com/android/contacts/editor/CompactContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -59,8 +59,8 @@
import com.android.contacts.ContactSaveService;
import com.android.contacts.GroupMetaDataLoader;
import com.android.contacts.R;
-import com.android.contacts.activities.CompactContactEditorActivity;
-import com.android.contacts.activities.CompactContactEditorActivity.ContactEditor;
+import com.android.contacts.activities.ContactEditorActivity;
+import com.android.contacts.activities.ContactEditorActivity.ContactEditor;
import com.android.contacts.activities.ContactEditorAccountsChangedActivity;
import com.android.contacts.activities.ContactSelectionActivity;
import com.android.contacts.common.Experiments;
@@ -101,12 +101,12 @@
/**
* Contact editor with only the most important fields displayed initially.
*/
-public class CompactContactEditorFragment extends Fragment implements
+public class ContactEditorFragment extends Fragment implements
ContactEditor, SplitContactConfirmationDialogFragment.Listener,
JoinContactConfirmationDialogFragment.Listener,
AggregationSuggestionEngine.Listener, AggregationSuggestionView.Listener,
CancelEditDialogFragment.Listener,
- CompactRawContactsEditorView.Listener, CompactPhotoEditorView.Listener {
+ RawContactEditorView.Listener, PhotoEditorView.Listener {
static final String TAG = "ContactEditor";
@@ -119,7 +119,7 @@
private static final List<String> VALID_INTENT_ACTIONS = new ArrayList<String>() {{
add(Intent.ACTION_EDIT);
add(Intent.ACTION_INSERT);
- add(CompactContactEditorActivity.ACTION_SAVE_COMPLETED);
+ add(ContactEditorActivity.ACTION_SAVE_COMPLETED);
}};
private static final String KEY_ACTION = "action";
@@ -182,16 +182,14 @@
/**
* Intent key to pass the photo palette primary color calculated by
- * {@link com.android.contacts.quickcontact.QuickContactActivity} to the editor and between
- * the compact and fully expanded editors.
+ * {@link com.android.contacts.quickcontact.QuickContactActivity} to the editor.
*/
public static final String INTENT_EXTRA_MATERIAL_PALETTE_PRIMARY_COLOR =
"material_palette_primary_color";
/**
* Intent key to pass the photo palette secondary color calculated by
- * {@link com.android.contacts.quickcontact.QuickContactActivity} to the editor and between
- * the compact and fully expanded editors.
+ * {@link com.android.contacts.quickcontact.QuickContactActivity} to the editor.
*/
public static final String INTENT_EXTRA_MATERIAL_PALETTE_SECONDARY_COLOR =
"material_palette_secondary_color";
@@ -204,20 +202,6 @@
public static final String INTENT_EXTRA_PHOTO_ID = "photo_id";
/**
- * Intent key to pass the ID of the raw contact id that should be displayed in the full editor
- * by itself.
- */
- public static final String INTENT_EXTRA_RAW_CONTACT_ID_TO_DISPLAY_ALONE =
- "raw_contact_id_to_display_alone";
-
- /**
- * Intent key to pass the boolean value of if the raw contact id that should be displayed
- * in the full editor by itself is read-only.
- */
- public static final String INTENT_EXTRA_RAW_CONTACT_DISPLAY_ALONE_IS_READ_ONLY =
- "raw_contact_display_alone_is_read_only";
-
- /**
* Intent extra to specify a {@link ContactEditor.SaveMode}.
*/
public static final String SAVE_MODE_EXTRA_KEY = "saveMode";
@@ -542,7 +526,7 @@
setHasOptionsMenu(true);
final View view = inflater.inflate(
- R.layout.compact_contact_editor_fragment, container, false);
+ R.layout.contact_editor_fragment, container, false);
mContent = (LinearLayout) view.findViewById(R.id.raw_contacts_editor_view);
return view;
}
@@ -586,7 +570,7 @@
if (mAccountWithDataSet != null) {
createContact(mAccountWithDataSet);
} else if (mIntentExtras != null && mIntentExtras.getBoolean(
- CompactContactEditorActivity.EXTRA_SAVE_TO_DEVICE_FLAG, false)) {
+ ContactEditorActivity.EXTRA_SAVE_TO_DEVICE_FLAG, false)) {
createContact(null);
} else {
// No Account specified. Let the user choose
@@ -959,7 +943,7 @@
}
// If we are about to close the editor - there is no need to refresh the data
- if (saveMode == SaveMode.CLOSE || saveMode == SaveMode.COMPACT
+ if (saveMode == SaveMode.CLOSE || saveMode == SaveMode.EDITOR
|| saveMode == SaveMode.SPLIT) {
getLoaderManager().destroyLoader(LOADER_CONTACT);
}
@@ -1379,7 +1363,7 @@
}
// Add input fields for the loaded Contact
- final CompactRawContactsEditorView editorView = getContent();
+ final RawContactEditorView editorView = getContent();
editorView.setListener(this);
if (mCopyReadOnlyName) {
copyReadOnlyName();
@@ -1492,10 +1476,6 @@
mIntentExtras.getInt(INTENT_EXTRA_MATERIAL_PALETTE_PRIMARY_COLOR),
mIntentExtras.getInt(INTENT_EXTRA_MATERIAL_PALETTE_SECONDARY_COLOR));
}
- mRawContactIdToDisplayAlone = mIntentExtras.getLong(
- INTENT_EXTRA_RAW_CONTACT_ID_TO_DISPLAY_ALONE, -1);
- mRawContactDisplayAloneIsReadOnly = mIntentExtras.getBoolean(
- INTENT_EXTRA_RAW_CONTACT_DISPLAY_ALONE_IS_READ_ONLY);
}
}
@@ -1572,7 +1552,7 @@
if (mListener != null) mListener.onSaveFinished(resultIntent);
break;
}
- case SaveMode.COMPACT: {
+ case SaveMode.EDITOR: {
// It is already saved, so prevent it from being saved again
mStatus = Status.CLOSING;
if (mListener != null) mListener.onSaveFinished(/* resultIntent= */ null);
@@ -1776,7 +1756,7 @@
final Intent intent = ContactSaveService.createSaveContactIntent(mContext, mState,
SAVE_MODE_EXTRA_KEY, saveMode, isEditingUserProfile(),
((Activity) mContext).getClass(),
- CompactContactEditorActivity.ACTION_SAVE_COMPLETED, mUpdatedPhotos,
+ ContactEditorActivity.ACTION_SAVE_COMPLETED, mUpdatedPhotos,
JOIN_CONTACT_ID_EXTRA_KEY, joinContactId);
return startSaveService(mContext, intent, saveMode);
}
@@ -1799,8 +1779,8 @@
*/
protected void joinAggregate(final long contactId) {
final Intent intent = ContactSaveService.createJoinContactsIntent(
- mContext, mContactIdForJoin, contactId, CompactContactEditorActivity.class,
- CompactContactEditorActivity.ACTION_JOIN_COMPLETED);
+ mContext, mContactIdForJoin, contactId, ContactEditorActivity.class,
+ ContactEditorActivity.ACTION_JOIN_COMPLETED);
mContext.startService(intent);
}
@@ -1845,7 +1825,7 @@
public void onBindEditorsFailed() {
final Activity activity = getActivity();
if (activity != null && !activity.isFinishing()) {
- Toast.makeText(activity, R.string.compact_editor_failed_to_load,
+ Toast.makeText(activity, R.string.editor_failed_to_load,
Toast.LENGTH_SHORT).show();
activity.setResult(Activity.RESULT_CANCELED);
activity.finish();
@@ -1880,11 +1860,11 @@
: PhotoActionPopup.Modes.NO_PHOTO;
}
- private CompactContactEditorActivity getEditorActivity() {
- return (CompactContactEditorActivity) getActivity();
+ private ContactEditorActivity getEditorActivity() {
+ return (ContactEditorActivity) getActivity();
}
- private CompactRawContactsEditorView getContent() {
- return (CompactRawContactsEditorView) mContent;
+ private RawContactEditorView getContent() {
+ return (RawContactEditorView) mContent;
}
}
diff --git a/src/com/android/contacts/editor/EditorIntents.java b/src/com/android/contacts/editor/EditorIntents.java
index af6ef77..c4f48e6 100644
--- a/src/com/android/contacts/editor/EditorIntents.java
+++ b/src/com/android/contacts/editor/EditorIntents.java
@@ -23,7 +23,7 @@
import android.provider.ContactsContract.Contacts;
import android.text.TextUtils;
-import com.android.contacts.activities.CompactContactEditorActivity;
+import com.android.contacts.activities.ContactEditorActivity;
import com.android.contacts.common.model.RawContactDeltaList;
import com.android.contacts.common.util.MaterialColorMapUtils.MaterialPalette;
@@ -38,38 +38,29 @@
}
/**
- * Returns an Intent to start the {@link CompactContactEditorActivity} for an
+ * Returns an Intent to start the {@link ContactEditorActivity} for an
* existing contact.
*/
- public static Intent createCompactEditContactIntent(Context context, Uri contactLookupUri,
+ public static Intent createEditContactIntent(Context context, Uri contactLookupUri,
MaterialPalette materialPalette, long photoId) {
final Intent intent = new Intent(Intent.ACTION_EDIT, contactLookupUri, context,
- CompactContactEditorActivity.class);
+ ContactEditorActivity.class);
putMaterialPalette(intent, materialPalette);
putPhotoId(intent, photoId);
return intent;
}
/**
- * Returns an Intent to start the {@link CompactContactEditorActivity} for a new contact.
- */
- public static Intent createCompactInsertContactIntent(Context context) {
- return createCompactInsertContactIntent(context, /* rawContactDeltaList =*/ null,
- /* displayName =*/ null, /* phoneticName =*/ null,
- /* isNewLocalProfile =*/ false);
- }
-
- /**
- * Returns an Intent to start the {@link CompactContactEditorActivity} for a new contact with
+ * Returns an Intent to start the {@link ContactEditorActivity} for a new contact with
* the field values specified by rawContactDeltaList pre-populate in the form.
*/
- public static Intent createCompactInsertContactIntent(Context context,
+ public static Intent createInsertContactIntent(Context context,
RawContactDeltaList rawContactDeltaList, String displayName, String phoneticName,
/* Bundle updatedPhotos, */ boolean isNewLocalProfile) {
final Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI,
- context, CompactContactEditorActivity.class);
+ context, ContactEditorActivity.class);
intent.putExtra(
- CompactContactEditorFragment.INTENT_EXTRA_NEW_LOCAL_PROFILE, isNewLocalProfile);
+ ContactEditorFragment.INTENT_EXTRA_NEW_LOCAL_PROFILE, isNewLocalProfile);
if (rawContactDeltaList != null || displayName != null || phoneticName != null) {
putRawContactDeltaValues(intent, rawContactDeltaList, displayName, phoneticName);
}
@@ -77,16 +68,16 @@
}
/**
- * Returns an Intent to edit a different contact in the compact editor with whatever
- * values were already entered on the currently displayed contact editor.
+ * Returns an Intent to edit a different contact in the editor with whatever
+ * values were already entered on the current editor.
*/
public static Intent createEditOtherContactIntent(Context context, Uri contactLookupUri,
ArrayList<ContentValues> contentValues) {
final Intent intent = new Intent(Intent.ACTION_EDIT, contactLookupUri, context,
- CompactContactEditorActivity.class);
+ ContactEditorActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
| Intent.FLAG_ACTIVITY_FORWARD_RESULT);
- intent.putExtra(CompactContactEditorFragment.INTENT_EXTRA_ADD_TO_DEFAULT_DIRECTORY, "");
+ intent.putExtra(ContactEditorFragment.INTENT_EXTRA_ADD_TO_DEFAULT_DIRECTORY, "");
// Pass on all the data that has been entered so far
if (contentValues != null && contentValues.size() != 0) {
@@ -95,35 +86,20 @@
return intent;
}
- /**
- * Returns an Intent to start the compact editor for the given raw contact.
- */
- public static Intent createEditContactIntentForRawContact(Context context,
- Uri contactLookupUri, long rawContactId, boolean isReadOnly) {
- final Intent intent = new Intent(Intent.ACTION_EDIT, contactLookupUri, context,
- CompactContactEditorActivity.class);
- intent.putExtra(CompactContactEditorFragment.INTENT_EXTRA_RAW_CONTACT_ID_TO_DISPLAY_ALONE,
- rawContactId);
- intent.putExtra(
- CompactContactEditorFragment.INTENT_EXTRA_RAW_CONTACT_DISPLAY_ALONE_IS_READ_ONLY,
- isReadOnly);
- return intent;
- }
-
private static void putMaterialPalette(Intent intent, MaterialPalette materialPalette) {
if (materialPalette != null) {
intent.putExtra(
- CompactContactEditorFragment.INTENT_EXTRA_MATERIAL_PALETTE_PRIMARY_COLOR,
+ ContactEditorFragment.INTENT_EXTRA_MATERIAL_PALETTE_PRIMARY_COLOR,
materialPalette.mPrimaryColor);
intent.putExtra(
- CompactContactEditorFragment.INTENT_EXTRA_MATERIAL_PALETTE_SECONDARY_COLOR,
+ ContactEditorFragment.INTENT_EXTRA_MATERIAL_PALETTE_SECONDARY_COLOR,
materialPalette.mSecondaryColor);
}
}
private static void putPhotoId(Intent intent, long photoId) {
if (photoId >= 0) {
- intent.putExtra(CompactContactEditorFragment.INTENT_EXTRA_PHOTO_ID, photoId);
+ intent.putExtra(ContactEditorFragment.INTENT_EXTRA_PHOTO_ID, photoId);
}
}
diff --git a/src/com/android/contacts/editor/JoinContactConfirmationDialogFragment.java b/src/com/android/contacts/editor/JoinContactConfirmationDialogFragment.java
index dab7085..d238c38 100644
--- a/src/com/android/contacts/editor/JoinContactConfirmationDialogFragment.java
+++ b/src/com/android/contacts/editor/JoinContactConfirmationDialogFragment.java
@@ -48,7 +48,7 @@
/**
* @param joinContactId The raw contact ID of the contact to join to after confirmation.
*/
- public static void show(CompactContactEditorFragment fragment, long joinContactId) {
+ public static void show(ContactEditorFragment fragment, long joinContactId) {
final Bundle args = new Bundle();
args.putLong(ARG_JOIN_CONTACT_ID, joinContactId);
diff --git a/src/com/android/contacts/editor/JoinSuggestedContactDialogFragment.java b/src/com/android/contacts/editor/JoinSuggestedContactDialogFragment.java
index a057a5b..8f8b56a 100644
--- a/src/com/android/contacts/editor/JoinSuggestedContactDialogFragment.java
+++ b/src/com/android/contacts/editor/JoinSuggestedContactDialogFragment.java
@@ -28,7 +28,7 @@
private static final String ARG_RAW_CONTACT_IDS = "rawContactIds";
- public static void show(CompactContactEditorFragment fragment, long[] rawContactIds) {
+ public static void show(ContactEditorFragment fragment, long[] rawContactIds) {
final Bundle args = new Bundle();
args.putLongArray(ARG_RAW_CONTACT_IDS, rawContactIds);
@@ -47,8 +47,8 @@
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
- CompactContactEditorFragment targetFragment =
- (CompactContactEditorFragment) getTargetFragment();
+ ContactEditorFragment targetFragment =
+ (ContactEditorFragment) getTargetFragment();
long rawContactIds[] =
getArguments().getLongArray(ARG_RAW_CONTACT_IDS);
targetFragment.doJoinSuggestedContact(rawContactIds);
diff --git a/src/com/android/contacts/editor/KindSectionDataList.java b/src/com/android/contacts/editor/KindSectionDataList.java
deleted file mode 100644
index cb82806..0000000
--- a/src/com/android/contacts/editor/KindSectionDataList.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.contacts.editor;
-
-import com.android.contacts.common.model.RawContactDelta;
-import com.android.contacts.common.model.ValuesDelta;
-import com.android.contacts.common.model.account.AccountWithDataSet;
-import com.android.contacts.common.model.dataitem.DataKind;
-import com.android.contacts.common.model.RawContactModifier;
-
-import android.util.Log;
-import android.util.Pair;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * Container for multiple {@link KindSectionData} objects. Provides convenience methods for
- * interrogating the collection for a certain KindSectionData item (e.g. the first writable, or
- * "primary", one. Also enforces that only items with the same DataKind/mime-type are added.
- */
-public class KindSectionDataList extends ArrayList<KindSectionData> {
-
- private static final String TAG = CompactRawContactsEditorView.TAG;
-
- /**
- * Returns the mime type for all DataKinds in this List.
- */
- public String getMimeType() {
- if (isEmpty()) return null;
- return get(0).getDataKind().mimeType;
- }
-
- /**
- * Returns the DataKind for all entries in this List.
- */
- public DataKind getDataKind() {
- return isEmpty() ? null : get(0).getDataKind();
- }
-
- /**
- * Returns the primary KindSectionData and ValuesDelta that should be written for this List.
- */
- public Pair<KindSectionData,ValuesDelta> getEntryToWrite(long id,
- AccountWithDataSet primaryAccount, boolean isUserProfile) {
- final String mimeType = getMimeType();
- if (mimeType == null) return null;
-
- if (!isUserProfile) {
- if (id > 0) {
- // Look for a match for the ID that was passed in
- for (KindSectionData kindSectionData : this) {
- if (kindSectionData.getAccountType().areContactsWritable()) {
- final ValuesDelta valuesDelta = kindSectionData.getValuesDeltaById(id);
- if (valuesDelta != null) {
- vlog(mimeType + ": matched kind section data to write by ID");
- return new Pair<>(kindSectionData, valuesDelta);
- }
- }
- }
- }
-
- // Look for a super primary entry
- for (KindSectionData kindSectionData : this) {
- if (kindSectionData.getAccountType().areContactsWritable()) {
- final ValuesDelta valuesDelta = kindSectionData.getSuperPrimaryValuesDelta();
- if (valuesDelta != null) {
- vlog(mimeType + ": matched kind section data to write by super primary");
- return new Pair<>(kindSectionData, valuesDelta);
- }
- }
- }
-
- // Use the first writable contact that matches the primary account
- if (primaryAccount != null) {
- for (KindSectionData kindSectionData : this) {
- if (kindSectionData.getAccountType().areContactsWritable()) {
- if (matchesAccount(primaryAccount, kindSectionData.getRawContactDelta())
- && !kindSectionData.getValuesDeltas().isEmpty()) {
- vlog(mimeType + ": matched kind section data to write by primary " +
- "account");
- return new Pair<>(kindSectionData,
- kindSectionData.getValuesDeltas().get(0));
- }
- }
- }
- }
- }
-
- // Just return the first writable entry.
- for (KindSectionData kindSectionData : this) {
- if (kindSectionData.getAccountType().areContactsWritable()) {
- // Create an entry if necessary
- RawContactModifier.ensureKindExists(kindSectionData.getRawContactDelta(),
- kindSectionData.getAccountType(), mimeType);
-
- if (!kindSectionData.getValuesDeltas().isEmpty()) {
- vlog(mimeType + ": falling back to first kind section data to write");
- return new Pair<>(kindSectionData, kindSectionData.getValuesDeltas().get(0));
- }
- }
- }
-
- wlog(mimeType+ ": no writable kind section data found");
- return null;
- }
-
- /** Whether the given RawContactDelta belong to the given account. */
- private static boolean matchesAccount(AccountWithDataSet accountWithDataSet,
- RawContactDelta rawContactDelta) {
- return Objects.equals(accountWithDataSet.name, rawContactDelta.getAccountName())
- && Objects.equals(accountWithDataSet.type, rawContactDelta.getAccountType())
- && Objects.equals(accountWithDataSet.dataSet, rawContactDelta.getDataSet());
- }
-
- /**
- * Returns the KindSectionData and ValuesDelta that should be displayed to the user.
- */
- public Pair<KindSectionData,ValuesDelta> getEntryToDisplay(long id) {
- final String mimeType = getMimeType();
- if (mimeType == null) return null;
-
- if (id > 0) {
- // Look for a match for the ID that was passed in
- for (KindSectionData kindSectionData : this) {
- final ValuesDelta valuesDelta = kindSectionData.getValuesDeltaById(id);
- if (valuesDelta != null) {
- vlog(mimeType + ": matched kind section data to display by ID");
- return new Pair<>(kindSectionData, valuesDelta);
- }
- }
- }
- // Look for a super primary entry
- for (KindSectionData kindSectionData : this) {
- final ValuesDelta valuesDelta = kindSectionData.getSuperPrimaryValuesDelta();
- if (valuesDelta != null) {
- vlog(mimeType + ": matched kind section data to display by super primary");
- return new Pair<>(kindSectionData, valuesDelta);
- }
- }
-
- // Fall back to the first non-empty value
- for (KindSectionData kindSectionData : this) {
- final ValuesDelta valuesDelta = kindSectionData.getFirstNonEmptyValuesDelta();
- if (valuesDelta != null) {
- vlog(mimeType + ": using first non empty value to display");
- return new Pair<>(kindSectionData, valuesDelta);
- }
- }
-
- for (KindSectionData kindSectionData : this) {
- final List<ValuesDelta> valuesDeltaList = kindSectionData.getValuesDeltas();
- if (!valuesDeltaList.isEmpty()) {
- vlog(mimeType + ": falling back to first empty entry to display");
- final ValuesDelta valuesDelta = valuesDeltaList.get(0);
- return new Pair<>(kindSectionData, valuesDelta);
- }
- }
-
- wlog(mimeType + ": no kind section data found to display");
- return null;
- }
-
- @Override
- public boolean add(KindSectionData kindSectionData) {
- if (kindSectionData == null) throw new NullPointerException();
-
- // Enforce that only entries of the same type are added to this list
- final String listMimeType = getMimeType();
- if (listMimeType != null) {
- final String newEntryMimeType = kindSectionData.getDataKind().mimeType;
- if (!listMimeType.equals(newEntryMimeType)) {
- throw new IllegalArgumentException(
- "Can't add " + newEntryMimeType + " to list with type " + listMimeType);
- }
- }
- return super.add(kindSectionData);
- }
-
- private static void wlog(String message) {
- if (Log.isLoggable(TAG, Log.WARN)) {
- Log.w(TAG, message);
- }
- }
-
- private static void vlog(String message) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
- Log.v(TAG, message);
- }
- }
-}
diff --git a/src/com/android/contacts/editor/CompactKindSectionView.java b/src/com/android/contacts/editor/KindSectionView.java
similarity index 97%
rename from src/com/android/contacts/editor/CompactKindSectionView.java
rename to src/com/android/contacts/editor/KindSectionView.java
index 66ef691..4380af9 100644
--- a/src/com/android/contacts/editor/CompactKindSectionView.java
+++ b/src/com/android/contacts/editor/KindSectionView.java
@@ -45,7 +45,7 @@
* {@link DataKind} around a {@link Data#MIMETYPE}. This view shows a
* section header and a trigger for adding new {@link Data} rows.
*/
-public class CompactKindSectionView extends LinearLayout {
+public class KindSectionView extends LinearLayout {
/**
* Marks a name as super primary when it is changed.
@@ -57,10 +57,10 @@
private final ValuesDelta mValuesDelta;
private final long mRawContactId;
- private final CompactRawContactsEditorView.Listener mListener;
+ private final RawContactEditorView.Listener mListener;
public StructuredNameEditorListener(ValuesDelta valuesDelta, long rawContactId,
- CompactRawContactsEditorView.Listener listener) {
+ RawContactEditorView.Listener listener) {
mValuesDelta = valuesDelta;
mRawContactId = rawContactId;
mListener = listener;
@@ -151,7 +151,7 @@
private KindSectionData mKindSectionData;
private ViewIdGenerator mViewIdGenerator;
- private CompactRawContactsEditorView.Listener mListener;
+ private RawContactEditorView.Listener mListener;
private boolean mIsUserProfile;
private boolean mShowOneEmptyEditor = false;
@@ -161,11 +161,11 @@
private ViewGroup mEditors;
private ImageView mIcon;
- public CompactKindSectionView(Context context) {
+ public KindSectionView(Context context) {
this(context, /* attrs =*/ null);
}
- public CompactKindSectionView(Context context, AttributeSet attrs) {
+ public KindSectionView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@@ -264,7 +264,7 @@
* displayed, even if it is empty.
*/
public void setState(KindSectionData kindSectionData,
- ViewIdGenerator viewIdGenerator, CompactRawContactsEditorView.Listener listener) {
+ ViewIdGenerator viewIdGenerator, RawContactEditorView.Listener listener) {
mKindSectionData = kindSectionData;
mViewIdGenerator = viewIdGenerator;
mListener = listener;
diff --git a/src/com/android/contacts/editor/CompactPhotoEditorView.java b/src/com/android/contacts/editor/PhotoEditorView.java
similarity index 97%
rename from src/com/android/contacts/editor/CompactPhotoEditorView.java
rename to src/com/android/contacts/editor/PhotoEditorView.java
index 66fe68a..5283009 100644
--- a/src/com/android/contacts/editor/CompactPhotoEditorView.java
+++ b/src/com/android/contacts/editor/PhotoEditorView.java
@@ -39,7 +39,7 @@
/**
* Displays a photo and calls the host back when the user clicks it.
*/
-public class CompactPhotoEditorView extends RelativeLayout implements View.OnClickListener {
+public class PhotoEditorView extends RelativeLayout implements View.OnClickListener {
/**
* Callbacks for the host of this view.
@@ -70,11 +70,11 @@
private boolean mReadOnly;
private boolean mIsNonDefaultPhotoBound;
- public CompactPhotoEditorView(Context context) {
+ public PhotoEditorView(Context context) {
this(context, null);
}
- public CompactPhotoEditorView(Context context, AttributeSet attrs) {
+ public PhotoEditorView(Context context, AttributeSet attrs) {
super(context, attrs);
mLandscapePhotoRatio = getTypedFloat(R.dimen.quickcontact_landscape_photo_ratio);
diff --git a/src/com/android/contacts/editor/CompactRawContactsEditorView.java b/src/com/android/contacts/editor/RawContactEditorView.java
similarity index 94%
rename from src/com/android/contacts/editor/CompactRawContactsEditorView.java
rename to src/com/android/contacts/editor/RawContactEditorView.java
index f41b33e..bbd23d4 100644
--- a/src/com/android/contacts/editor/CompactRawContactsEditorView.java
+++ b/src/com/android/contacts/editor/RawContactEditorView.java
@@ -84,12 +84,12 @@
/**
* View to display information from multiple {@link RawContactDelta}s grouped together.
*/
-public class CompactRawContactsEditorView extends LinearLayout implements View.OnClickListener {
+public class RawContactEditorView extends LinearLayout implements View.OnClickListener {
- static final String TAG = "CompactEditorView";
+ static final String TAG = "RawContactEditorView";
/**
- * Callbacks for hosts of {@link CompactRawContactsEditorView}s.
+ * Callbacks for hosts of {@link RawContactEditorView}s.
*/
public interface Listener {
@@ -102,7 +102,7 @@
public void onNameFieldChanged(long rawContactId, ValuesDelta valuesDelta);
/**
- * Invoked when the compact editor should rebind editors for a new account.
+ * Invoked when the editor should rebind editors for a new account.
*
* @param oldState Old data being edited.
* @param oldAccount Old account associated with oldState.
@@ -265,7 +265,7 @@
}
}
- private CompactRawContactsEditorView.Listener mListener;
+ private RawContactEditorView.Listener mListener;
private AccountTypeManager mAccountTypeManager;
private AccountDisplayInfoFactory mAccountDisplayInfoFactory;
@@ -290,25 +290,25 @@
private ImageView mAccountHeaderIcon;
private ImageView mAccountHeaderExpanderIcon;
- private CompactPhotoEditorView mPhotoView;
+ private PhotoEditorView mPhotoView;
private ViewGroup mKindSectionViews;
- private Map<String, CompactKindSectionView> mKindSectionViewMap = new HashMap<>();
+ private Map<String, KindSectionView> mKindSectionViewMap = new HashMap<>();
private View mMoreFields;
private boolean mIsExpanded;
private ValuesDelta mPhotoValuesDelta;
- public CompactRawContactsEditorView(Context context) {
+ public RawContactEditorView(Context context) {
super(context);
}
- public CompactRawContactsEditorView(Context context, AttributeSet attrs) {
+ public RawContactEditorView(Context context, AttributeSet attrs) {
super(context, attrs);
}
/**
- * Sets the receiver for {@link CompactRawContactsEditorView} callbacks.
+ * Sets the receiver for {@link RawContactEditorView} callbacks.
*/
public void setListener(Listener listener) {
mListener = listener;
@@ -330,7 +330,7 @@
mAccountHeaderIcon = (ImageView) findViewById(R.id.account_type_icon);
mAccountHeaderExpanderIcon = (ImageView) findViewById(R.id.account_expander_icon);
- mPhotoView = (CompactPhotoEditorView) findViewById(R.id.photo_editor);
+ mPhotoView = (PhotoEditorView) findViewById(R.id.photo_editor);
mKindSectionViews = (LinearLayout) findViewById(R.id.kind_section_views);
mMoreFields = findViewById(R.id.more_fields);
mMoreFields.setOnClickListener(this);
@@ -375,9 +375,9 @@
}
/**
- * Pass through to {@link CompactPhotoEditorView#setListener}.
+ * Pass through to {@link PhotoEditorView#setListener}.
*/
- public void setPhotoListener(CompactPhotoEditorView.Listener listener) {
+ public void setPhotoListener(PhotoEditorView.Listener listener) {
mPhotoView.setListener(listener);
}
@@ -390,7 +390,7 @@
}
/**
- * Pass through to {@link CompactPhotoEditorView#setFullSizedPhoto(Uri)}.
+ * Pass through to {@link PhotoEditorView#setFullSizedPhoto(Uri)}.
*/
public void setFullSizePhoto(Uri photoUri) {
mPhotoView.setFullSizedPhoto(photoUri);
@@ -440,21 +440,21 @@
}
/**
- * Pass through to {@link CompactPhotoEditorView#isWritablePhotoSet}.
+ * Pass through to {@link PhotoEditorView#isWritablePhotoSet}.
*/
public boolean isWritablePhotoSet() {
return mPhotoView.isWritablePhotoSet();
}
/**
- * Get the raw contact ID for the CompactHeaderView photo.
+ * Get the raw contact ID for the current photo.
*/
public long getPhotoRawContactId() {
return mCurrentRawContactDelta.getRawContactId();
}
public StructuredNameEditorView getNameEditorView() {
- final CompactKindSectionView nameKindSectionView = mKindSectionViewMap
+ final KindSectionView nameKindSectionView = mKindSectionViewMap
.get(StructuredName.CONTENT_ITEM_TYPE);
return nameKindSectionView == null
? null : nameKindSectionView.getNameEditorView();
@@ -487,7 +487,7 @@
}
public void setGroupMetaData(Cursor groupMetaData) {
- final CompactKindSectionView groupKindSectionView =
+ final KindSectionView groupKindSectionView =
mKindSectionViewMap.get(GroupMembership.CONTENT_ITEM_TYPE);
if (groupKindSectionView == null) {
return;
@@ -559,12 +559,12 @@
// We're want to display the inputs fields for a single read only raw contact
addReadOnlyRawContactEditorViews();
} else {
- setupCompactEditorNormally();
+ setupEditorNormally();
}
if (mListener != null) mListener.onEditorsBound();
}
- private void setupCompactEditorNormally() {
+ private void setupEditorNormally() {
addAccountInfo();
addKindSectionViews();
@@ -813,8 +813,7 @@
result.add(rawContactDelta);
}
}
- // Don't return a list of size 1 that would just open the raw contact being edited
- // in the compact editor in the full editor
+ // Don't return a list of size 1 that would just open the current raw contact being edited.
if (result.size() == 1 && result.get(0).getRawContactAccountType(
getContext()).areContactsWritable()) {
result.clear();
@@ -832,8 +831,8 @@
// Set the account type
final String selectorTitle = getResources().getString(isReadOnlyRawContact() ?
- R.string.compact_editor_account_selector_read_only_title :
- R.string.compact_editor_account_selector_title);
+ R.string.editor_account_selector_read_only_title :
+ R.string.editor_account_selector_title);
mAccountHeaderType.setText(selectorTitle);
// Set the icon
@@ -966,7 +965,7 @@
vlog("kind: " + i + " " + mimeType + " dropped");
continue;
}
- final CompactKindSectionView kindSectionView;
+ final KindSectionView kindSectionView;
final KindSectionData kindSectionData = mKindSectionDataMap.get(mimeType);
kindSectionView = inflateKindSectionView(mKindSectionViews, kindSectionData, mimeType);
mKindSectionViews.addView(kindSectionView);
@@ -976,10 +975,10 @@
}
}
- private CompactKindSectionView inflateKindSectionView(ViewGroup viewGroup,
+ private KindSectionView inflateKindSectionView(ViewGroup viewGroup,
KindSectionData kindSectionData, String mimeType) {
- final CompactKindSectionView kindSectionView = (CompactKindSectionView)
- mLayoutInflater.inflate(R.layout.compact_item_kind_section, viewGroup,
+ final KindSectionView kindSectionView = (KindSectionView)
+ mLayoutInflater.inflate(R.layout.item_kind_section, viewGroup,
/* attachToRoot =*/ false);
kindSectionView.setIsUserProfile(mIsUserProfile);
@@ -1002,8 +1001,8 @@
private void showAllFields() {
// Stop hiding empty editors and allow the user to enter values for all kinds now
for (int i = 0; i < mKindSectionViews.getChildCount(); i++) {
- final CompactKindSectionView kindSectionView =
- (CompactKindSectionView) mKindSectionViews.getChildAt(i);
+ final KindSectionView kindSectionView =
+ (KindSectionView) mKindSectionViews.getChildAt(i);
kindSectionView.setHideWhenEmpty(false);
kindSectionView.updateEmptyEditors(/* shouldAnimate =*/ true);
}
@@ -1014,7 +1013,7 @@
}
private boolean hasMoreFields() {
- for (CompactKindSectionView section : mKindSectionViewMap.values()) {
+ for (KindSectionView section : mKindSectionViewMap.values()) {
if (section.getVisibility() != View.VISIBLE) {
return true;
}
diff --git a/src/com/android/contacts/editor/SplitContactConfirmationDialogFragment.java b/src/com/android/contacts/editor/SplitContactConfirmationDialogFragment.java
index 41d45a1..a8f88cf 100644
--- a/src/com/android/contacts/editor/SplitContactConfirmationDialogFragment.java
+++ b/src/com/android/contacts/editor/SplitContactConfirmationDialogFragment.java
@@ -49,7 +49,7 @@
void onSplitContactConfirmed(boolean hasPendingChanges);
}
- public static void show(CompactContactEditorFragment fragment, boolean hasPendingChanges) {
+ public static void show(ContactEditorFragment fragment, boolean hasPendingChanges) {
final Bundle args = new Bundle();
args.putBoolean(ARG_HAS_PENDING_CHANGES, hasPendingChanges);
diff --git a/src/com/android/contacts/editor/SuggestionEditConfirmationDialogFragment.java b/src/com/android/contacts/editor/SuggestionEditConfirmationDialogFragment.java
index 31437b4..9408c7e 100644
--- a/src/com/android/contacts/editor/SuggestionEditConfirmationDialogFragment.java
+++ b/src/com/android/contacts/editor/SuggestionEditConfirmationDialogFragment.java
@@ -29,7 +29,7 @@
private static final String ARG_CONTACT_URI = "contactUri";
- public static void show(CompactContactEditorFragment fragment, Uri contactUri) {
+ public static void show(ContactEditorFragment fragment, Uri contactUri) {
final Bundle args = new Bundle();
args.putParcelable(ARG_CONTACT_URI, contactUri);
@@ -49,8 +49,8 @@
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
- final CompactContactEditorFragment targetFragment =
- (CompactContactEditorFragment) getTargetFragment();
+ final ContactEditorFragment targetFragment =
+ (ContactEditorFragment) getTargetFragment();
final Uri contactUri =
getArguments().getParcelable(ARG_CONTACT_URI);
targetFragment.doEditSuggestedContact(contactUri);
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index b8e5312..550f214 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -106,7 +106,7 @@
import com.android.contacts.ContactsActivity;
import com.android.contacts.NfcHandler;
import com.android.contacts.R;
-import com.android.contacts.activities.CompactContactEditorActivity;
+import com.android.contacts.activities.ContactEditorActivity;
import com.android.contacts.common.CallUtil;
import com.android.contacts.common.ClipboardUtils;
import com.android.contacts.common.Collapser;
@@ -158,7 +158,7 @@
import com.android.contacts.detail.ContactDisplayUtils;
import com.android.contacts.editor.AggregationSuggestionEngine;
import com.android.contacts.editor.AggregationSuggestionEngine.Suggestion;
-import com.android.contacts.editor.CompactContactEditorFragment;
+import com.android.contacts.editor.ContactEditorFragment;
import com.android.contacts.editor.EditorIntents;
import com.android.contacts.interactions.CalendarInteractionsLoader;
import com.android.contacts.interactions.CallLogInteractionsLoader;
@@ -1165,7 +1165,7 @@
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
final boolean deletedOrSplit = requestCode == REQUEST_CODE_CONTACT_EDITOR_ACTIVITY &&
(resultCode == ContactDeletionInteraction.RESULT_CODE_DELETED ||
- resultCode == CompactContactEditorActivity.RESULT_CODE_SPLIT);
+ resultCode == ContactEditorActivity.RESULT_CODE_SPLIT);
setResult(resultCode, data);
if (deletedOrSplit) {
finish();
@@ -1205,7 +1205,7 @@
}
Uri lookupUri = intent.getData();
if (intent.getBooleanExtra(EXTRA_CONTACT_EDITED, false)) {
- setResult(CompactContactEditorActivity.RESULT_CODE_EDITED);
+ setResult(ContactEditorActivity.RESULT_CODE_EDITED);
}
// Check to see whether it comes from the old version.
@@ -2844,7 +2844,7 @@
}
private Intent getEditContactIntent() {
- return EditorIntents.createCompactEditContactIntent(QuickContactActivity.this,
+ return EditorIntents.createEditContactIntent(QuickContactActivity.this,
mContactData.getLookupUri(),
mHasComputedThemeColor
? new MaterialPalette(mColorFilterColor, mStatusBarColor) : null,
@@ -3043,7 +3043,7 @@
intent.putExtra(Intents.Insert.DATA, values);
// If the contact can only export to the same account, add it to the intent.
- // Otherwise the CompactContactEditorFragment will show a dialog for selecting
+ // Otherwise the ContactEditorFragment will show a dialog for selecting
// an account.
if (mContactData.getDirectoryExportSupport() ==
Directory.EXPORT_SUPPORT_SAME_ACCOUNT_ONLY) {
@@ -3057,7 +3057,7 @@
// Add this flag to disable the delete menu option on directory contact joins
// with local contacts. The delete option is ambiguous when joining contacts.
intent.putExtra(
- CompactContactEditorFragment.INTENT_EXTRA_DISABLE_DELETE_MENU_OPTION,
+ ContactEditorFragment.INTENT_EXTRA_DISABLE_DELETE_MENU_OPTION,
true);
intent.setPackage(getPackageName());