summaryrefslogtreecommitdiffstats
path: root/src/com/android/contacts/editor/ContactEditorFragment.java
diff options
context:
space:
mode:
authorWalter Jang <wjang@google.com>2015-01-28 08:40:51 -0800
committerWalter Jang <wjang@google.com>2015-01-28 12:01:34 -0800
commitfb5dc6f857104c38ff49993d7498e8aa5fbc462e (patch)
tree54d0a812ff3e8bc4408ba87c60ec530510b4ab06 /src/com/android/contacts/editor/ContactEditorFragment.java
parent92101e77238e450dedb56814cec80edc0adf79c0 (diff)
downloadpackages_apps_Contacts-fb5dc6f857104c38ff49993d7498e8aa5fbc462e.tar.gz
packages_apps_Contacts-fb5dc6f857104c38ff49993d7498e8aa5fbc462e.tar.bz2
packages_apps_Contacts-fb5dc6f857104c38ff49993d7498e8aa5fbc462e.zip
Reorder edit contact fragment members
Before (re) moving editor functionality into base classes Bug 19124091 Change-Id: I8185b54f546f7e88893afbdeb4ff55cff3335711
Diffstat (limited to 'src/com/android/contacts/editor/ContactEditorFragment.java')
-rw-r--r--src/com/android/contacts/editor/ContactEditorFragment.java107
1 files changed, 61 insertions, 46 deletions
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index f73e166b1..2ad1e703c 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -138,7 +138,6 @@ public class ContactEditorFragment extends Fragment implements
public static final String SAVE_MODE_EXTRA_KEY = "saveMode";
-
/**
* An intent extra that forces the editor to add the edited contact
* to the default group (e.g. "My Contacts").
@@ -215,46 +214,40 @@ public class ContactEditorFragment extends Fragment implements
private static final int REQUEST_CODE_ACCOUNTS_CHANGED = 1;
private static final int REQUEST_CODE_PICK_RINGTONE = 2;
- /**
- * The raw contact for which we started "take photo" or "choose photo from gallery" most
- * recently. Used to restore {@link #mCurrentPhotoHandler} after orientation change.
- */
- private long mRawContactIdRequestingPhoto;
- /**
- * The {@link PhotoHandler} for the photo editor for the {@link #mRawContactIdRequestingPhoto}
- * raw contact.
- *
- * A {@link PhotoHandler} is created for each photo editor in {@link #bindPhotoHandler}, but
- * the only "active" one should get the activity result. This member represents the active
- * one.
- */
- private PhotoHandler mCurrentPhotoHandler;
-
- private RawContactDeltaComparator mComparator;
-
- private Cursor mGroupMetaData;
+ private Context mContext;
+ private Listener mListener;
- private Uri mCurrentPhotoUri;
- private Bundle mUpdatedPhotos = new Bundle();
+ private LinearLayout mContent;
- private Context mContext;
+ //
+ // Parameters passed in on {@link #load}
+ //
private String mAction;
private Uri mLookupUri;
private Bundle mIntentExtras;
- private Listener mListener;
-
- private long mContactIdForJoin;
- private boolean mContactWritableForJoin;
+ private boolean mAutoAddToDefaultGroup;
+ private boolean mDisableDeleteMenuOption = false;
+ private boolean mNewLocalProfile = false;
+ //
+ // Helpers
+ //
private ContactEditorUtils mEditorUtils;
-
- private LinearLayout mContent;
- private RawContactDeltaList mState;
-
+ private RawContactDeltaComparator mComparator;
private ViewIdGenerator mViewIdGenerator;
+ private AggregationSuggestionEngine mAggregationSuggestionEngine;
- private long mLoaderStartTime;
+ //
+ // Loaded data
+ //
+ // Used to temporarily store existing contact data during a rebind call (i.e. account switch)
+ private ImmutableList<RawContact> mRawContacts;
+ private Cursor mGroupMetaData;
+ //
+ // Contact editor state
+ //
+ private RawContactDeltaList mState;
private int mStatus;
// Whether to show the new contact blank form and if it's corresponding delta is ready.
@@ -270,20 +263,47 @@ public class ContactEditorFragment extends Fragment implements
private boolean mArePhoneOptionsChangable;
private String mCustomRingtone;
+ // Joins
+ private long mContactIdForJoin;
+ private boolean mContactWritableForJoin;
+
+ // Used to store which raw contact editors have been expanded. Keyed on raw contact ids.
+ private HashMap<Long, Boolean> mExpandedEditors = new HashMap<Long, Boolean>();
+
+ private boolean mIsUserProfile = false;
+
+ // Whether editors and options menu items are enabled
+ private boolean mEnabled = true;
+
+ // Whether the name editor should receive focus after being bound
+ private boolean mRequestFocus;
+
// This is used to pre-populate the editor with a display name when a user edits a read-only
// contact.
private String mDefaultDisplayName;
- // Used to temporarily store existing contact data during a rebind call (i.e. account switch)
- private ImmutableList<RawContact> mRawContacts;
+ // Photos
+ /**
+ * The raw contact for which we started "take photo" or "choose photo from gallery" most
+ * recently. Used to restore {@link #mCurrentPhotoHandler} after orientation change.
+ */
+ private long mRawContactIdRequestingPhoto;
- // Used to store which raw contact editors have been expanded. Keyed on raw contact ids.
- private HashMap<Long, Boolean> mExpandedEditors = new HashMap<Long, Boolean>();
+ /**
+ * The {@link PhotoHandler} for the photo editor for the {@link #mRawContactIdRequestingPhoto}
+ * raw contact.
+ *
+ * A {@link PhotoHandler} is created for each photo editor in {@link #bindPhotoHandler}, but
+ * the only "active" one should get the activity result. This member represents the active
+ * one.
+ */
+ private PhotoHandler mCurrentPhotoHandler;
+ private Uri mCurrentPhotoUri;
+ private Bundle mUpdatedPhotos = new Bundle();
- private AggregationSuggestionEngine mAggregationSuggestionEngine;
+ // Aggregations
private long mAggregationSuggestionsRawContactId;
private View mAggregationSuggestionView;
-
private ListPopupWindow mAggregationSuggestionPopup;
private static final class AggregationSuggestionAdapter extends BaseAdapter {
@@ -340,14 +360,6 @@ public class ContactEditorFragment extends Fragment implements
}
};
- private boolean mAutoAddToDefaultGroup;
-
- private boolean mEnabled = true;
- private boolean mRequestFocus;
- private boolean mNewLocalProfile = false;
- private boolean mIsUserProfile = false;
- private boolean mDisableDeleteMenuOption = false;
-
public ContactEditorFragment() {
}
@@ -477,7 +489,7 @@ public class ContactEditorFragment extends Fragment implements
mLookupUri = lookupUri;
mIntentExtras = intentExtras;
mAutoAddToDefaultGroup = mIntentExtras != null
- && mIntentExtras.containsKey(INTENT_EXTRA_ADD_TO_DEFAULT_DIRECTORY);
+ && mIntentExtras.containsKey(INTENT_EXTRA_ADD_TO_DEFAULT_DIRECTORY);
mNewLocalProfile = mIntentExtras != null
&& mIntentExtras.getBoolean(INTENT_EXTRA_NEW_LOCAL_PROFILE);
mDisableDeleteMenuOption = mIntentExtras != null
@@ -1878,6 +1890,9 @@ public class ContactEditorFragment extends Fragment implements
*/
private final LoaderManager.LoaderCallbacks<Contact> mDataLoaderListener =
new LoaderCallbacks<Contact>() {
+
+ private long mLoaderStartTime;
+
@Override
public Loader<Contact> onCreateLoader(int id, Bundle args) {
mLoaderStartTime = SystemClock.elapsedRealtime();