summaryrefslogtreecommitdiffstats
path: root/src/com/android/contacts/editor/ContactEditorFragment.java
diff options
context:
space:
mode:
authorWalter Jang <wjang@google.com>2015-02-06 10:23:37 -0800
committerWalter Jang <wjang@google.com>2015-02-09 17:56:02 -0800
commit92f8ccc1f15df787b7434224857c056721281046 (patch)
tree127c5c4d409c576840c2a09d9f932e6d97d0dffa /src/com/android/contacts/editor/ContactEditorFragment.java
parent3e9a62449b8ca3a38b1d51019c6ea13972263bc2 (diff)
downloadpackages_apps_Contacts-92f8ccc1f15df787b7434224857c056721281046.tar.gz
packages_apps_Contacts-92f8ccc1f15df787b7434224857c056721281046.tar.bz2
packages_apps_Contacts-92f8ccc1f15df787b7434224857c056721281046.zip
Do setIntentExtras, on[Save|Join]Completed in base contact edit fragment
Do setGroupMetaData in the child classes since the layout will be drastically different between the two. Also moved a public Intent extra constant to the base. Bug 19124091 Change-Id: Idd20ff39b91eb3584c69e406f1e3472bcb278f42
Diffstat (limited to 'src/com/android/contacts/editor/ContactEditorFragment.java')
-rw-r--r--src/com/android/contacts/editor/ContactEditorFragment.java34
1 files changed, 13 insertions, 21 deletions
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index c71c891de..f30360c3d 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -71,8 +71,6 @@ public class ContactEditorFragment extends ContactEditorBaseFragment implements
private static final String KEY_CURRENT_PHOTO_URI = "currentphotouri";
private static final String KEY_UPDATED_PHOTOS = "updatedPhotos";
- public static final String SAVE_MODE_EXTRA_KEY = "saveMode";
-
// Used to store which raw contact editors have been expanded. Keyed on raw contact ids.
private HashMap<Long, Boolean> mExpandedEditors = new HashMap<Long, Boolean>();
@@ -132,23 +130,6 @@ public class ContactEditorFragment extends ContactEditorBaseFragment implements
updatedExpandedEditorsMap();
}
- @Override
- public void setIntentExtras(Bundle extras) {
- if (extras == null || extras.size() == 0) {
- return;
- }
-
- final AccountTypeManager accountTypes = AccountTypeManager.getInstance(mContext);
- for (RawContactDelta state : mState) {
- final AccountType type = state.getAccountType(accountTypes);
- if (type.areContactsWritable()) {
- // Apply extras to the first writable raw contact only
- RawContactModifier.parseExtras(mContext, type, state, extras);
- break;
- }
- }
- }
-
/**
* Removes a current editor ({@link #mState}) and rebinds new editor for a new account.
* Some of old data are reused with new restriction enforced by the new account.
@@ -181,6 +162,18 @@ public class ContactEditorFragment extends ContactEditorBaseFragment implements
}
@Override
+ protected void setGroupMetaData() {
+ if (mGroupMetaData == null) {
+ return;
+ }
+ int editorCount = mContent.getChildCount();
+ for (int i = 0; i < editorCount; i++) {
+ BaseRawContactEditorView editor = (BaseRawContactEditorView) mContent.getChildAt(i);
+ editor.setGroupMetaData(mGroupMetaData);
+ }
+ }
+
+ @Override
protected void bindEditors() {
// bindEditors() can only bind views if there is data in mState, so immediately return
// if mState is null
@@ -309,8 +302,7 @@ public class ContactEditorFragment extends ContactEditorBaseFragment implements
// Refresh Action Bar as the visibility of the join command
// Activity can be null if we have been detached from the Activity
- final Activity activity = getActivity();
- if (activity != null) activity.invalidateOptionsMenu();
+ invalidateOptionsMenu();
updatedExpandedEditorsMap();
}