summaryrefslogtreecommitdiffstats
path: root/src/com/android/contacts/editor/ContactEditorFragment.java
Commit message (Collapse)AuthorAgeFilesLines
* Add supports for SIM contactsblong2015-09-071-1/+1
| | | | | | | | - Support to update/insert/delete SIM contacts - Support to save anr and email for SIM contacts - Filter internal account when add new account Change-Id: Iec2da08d0fb9253e5edca1458b1e78f28d75fc1c
* Show account info for inserts and read-only contact editsWalter Jang2015-06-191-0/+1
| | | | | | Bug 21637149 Change-Id: I224ab188230f119f49f4ab7ddef4b51c451aa892
* Make saving a contact less confusingWalter Jang2015-06-191-2/+1
| | | | | | | | | | | | | | | | * Add always visible save menu item (a checkmark icon) on both the compact and full editors. Selecting it saves changes and closes the editor (what back does currently). * On the compact editor, make back perform a discard, including warning the user if there are unsaved changes. * On the full editor, back still saves and goes back to the full editor. This is not ideal but it's out of scope to not save changes between the two editors when editing an existing contact. Bug 19983789 Change-Id: Ie23b75978db70f2b438a824e39f0ae8fb8aa99ec
* Ignore new raw contact display names when saving contactsWalter Jang2015-06-181-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have logic to ignore the display name we add to newly created raw contacts (when the user wants to edit a read-only contact) when determining whether the user made any edits, we can enable changing the display on the compact editor again. Note, there is one glitch -- the name disappears on the compact editor after you click more fields (but only when editing read-only contacts). Tested scenarios: 1) Edit read-only contact, more fields, back, back No bogus contact is created and the read-only name is displayed on both editors. 2) Edit read-only contact, change name on compact editor, back, re-edit read-only contact, and split The read-only contact is unchanged and a new contact with the edited name is created. 3) Edit read-only contact, more fields, change name on full editor, back, back, re-edit read-only contact, and split Same result as (2) 4) Edit read-only contact, add phone on compact editor, back, re-edit read-only contact, and split The read-only contact is unchanged and a new contact with the read-only name and phone number is created. 5) Edit read-only contact, more fields, add phone on full editor, back, back, re-edit read-only contact, and split Same result as (4) Bug 21858251 Bug 21464081 Change-Id: I9028fee38b8ea7569968654a756eb98025318e69
* Don't initially focus any contact editor input fieldWalter Jang2015-06-091-6/+0
| | | | | | Bug 21644158 Change-Id: I84d1406b4db1646dcbf059ce84a2cc7534b0bd83
* Only use one hint color on contact editorsWalter Jang2015-06-011-47/+0
| | | | | | | | | | | Also, use the current 25% of black color which already follows the material guideline. Screenshots go/b21442589 Bug 21442589 Change-Id: I82c837fd9856c2165d3264a581165eb32702d807
* Distinguish between editor back button presses and framework stopageWalter Jang2015-05-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | We carry whether the editor fragment is being stopped because of a back button press or because the framework stopped the hosting Activity all the way through the various editor fragment callbacks and the ContactSaveService because it is not until ContactEditorBaseActivity.onSaveFinished where we start the next Intent -- starting it causes a "flash" if recents is clicked and follwed by an immediate starting of the next editor Activity, which is the bug that was filed. With this change, we only use the ContactSaveService resultIntent to go back to the compact editor on back presses. The expected behavior/tested scenarios are described at go/b21198041 Bug 21198041 Bug 19624360 Change-Id: Ic350e12aa447cff81747e003f504f25100bd5c60
* Fix contact name passing from compact to full editor on insertsWalter Jang2015-05-141-12/+25
| | | | | | Bug 19624360 Change-Id: I50c415b59c4bad1d08f18f8c2bc7d57ddb73c418
* Don't add compact editor fragment if it's already thereWalter Jang2015-04-031-1/+3
| | | | | | Bug 20040887 Change-Id: Ib968203e0340cd442e5652376a9e2aa7347994b1
* Fixed some contact editor compiler warningsWalter Jang2015-03-121-4/+0
| | | | Change-Id: I31deaeeedc4ae49da6b0326b128767785cd01852
* Pass full res contact photos between the compact and full editorsWalter Jang2015-03-111-3/+10
| | | | | | | Bug 19624360 Bug 19655206 Change-Id: I590ec7ecec75a9af95b824f5db9cda8f8aeda675
* Fixes for returning to the compact editor from the expanded oneWalter Jang2015-03-101-8/+2
| | | | | | | | | | | | | | | | | | | | | * Don't abort the save even if there are no unsaved changed when returning the compact from the full editor * No need to pass the material palette on insert intents. It does, however, need to be passed back to the compact editor when editing an existing contact w/o a picture. * Fix returning to the compact editor repeatedly by removing the Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET on compact editor intents. * Updated StructuredNameEditorView#getDisplayName to fall back to the display name directly from the ValuesDelta. This is required when the name is passed to the contact editor, and the user does not change it, in which case it will not be written to the underlying data structure, and thus not passed subsequent expantions. Bug 19624360 Change-Id: Ife285f3e411a869a76fbbff4d42939c866db617c
* Return to the compact contact editor on back from the fully expanded oneWalter Jang2015-03-091-0/+68
| | | | | | Bug 19624360 Change-Id: I249f1e456a2d85c5ecd831358692d56b09ee5a5b
* Batch join contactsBrian Attwell2015-03-031-2/+2
| | | | | | | | | * Add new action to ContactSaveService to support joining more than two contacts toghether. * Add new dialog fragment for the join Bug: 19549465 Change-Id: Ib0b1d5e7652e429f8e78d81dd3d98d03b3129e1e
* Try to show the "right" name on the compact contact editorWalter Jang2015-03-021-10/+60
| | | | | | | | | | | | | | | | * If a super primary is set use it on the compact editor * If a super primary is not set and the compact editor name value is changed, set it as super primary. But don't make an unchanged name super primary when expanding to the full editor. Also unset super primary if the name field becomes blank. * On the full editor, set the last changed name to super primary. Also unset super primary if the name field becomes blank. Bug 19124091 Change-Id: I1352f25f4decf31c5aeda20dbef133ce48d5d248
* Get join suggestions for the compact editor name fieldWalter Jang2015-02-241-5/+12
| | | | | | | | | Also fix photo height in portrait -- made a mistake in ag/641233. Bug 19124091 Change-Id: I988cbcf457002bc6f0996c87a8611fca82bdf78a
* First pass on photo support for compact contact editorWalter Jang2015-02-201-1/+1
| | | | | | | | Only updates the primary photo for now. Bug 19124091 Change-Id: I1886888b4cf249da4c483d570b9db6e05564518a
* Always show email and phone fieldsWalter Jang2015-02-181-3/+0
| | | | | | | | | | | | * This fixes showing an almost blank screen when writing the "me" profile also when adding a new contact. * Also fixed a bug when writing the "me" profile -- we weren't calling the RawContact.setAccountToLocal in createNewRawContactDelta in the base editor fragment. Bug 19124091 Change-Id: I93422047796189b4df060bfa39aa3c84ce47fa25
* Wire up saving edits using the compact contact editorWalter Jang2015-02-131-24/+8
| | | | | | | | Also fix refreshing the edit activity data after joining Bug 19124091 Change-Id: I161e38d9eaea89e3d090986d2b52cb6f8ee85422
* Do setIntentExtras, on[Save|Join]Completed in base contact edit fragmentWalter Jang2015-02-091-21/+13
| | | | | | | | | | | 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
* Move suggest joins popup & activiy to BaseEditContactFragmentWalter Jang2015-02-051-450/+2
| | | | | | Bug 19124091 Change-Id: Ic5a6b8b6359dc9691cfcac2348ba895c542d05d9
* Move join suggestion view to base contact edit fragmentWalter Jang2015-02-051-28/+0
| | | | | | | | | | | | | So that we can keep setEnabled logic entirely within the base fragment. The rest of the join suggestion functionality will be ported to the base so it can be shared with the compact editor in a seperate CL. Bug 19124091 Change-Id: I4d494c9b0c2db8a6dba6d9d752d049f48848f731
* Handle reading loaded Contact data in the base edit fragmentWalter Jang2015-02-031-155/+15
| | | | | | | | | | | | | | | | | | | | This reduces the number of abstract methods sub classes must implement and also keeps us from having to duplicate the logic to set up the new/local/me/existing RawContactData List (mState) in all sub edit fragments. The crux of this CL is moving the "bindEditor" methods into the base fragment. Also renamed the various bindEditors methods which are mostly reading fields the loaded Contact and settting up mState to be "setState" since we it seemed more appropriate to reserve the name bindEditors for setting up the actual Views. Bug 19124091 Change-Id: Ieb4a906ac372faa20694e546caa3bcba8c6b53b4
* Add edit contact menu options to compact editorWalter Jang2015-02-021-322/+2
| | | | | | | | | | * Also moved #setListener and #load from the sub contact editor fragments to the base fragment * Moved location of #setData in the base contact editor fragment Bug 19124091 Change-Id: Icbe3d46e1bf60f3e79437db7bc6c05a7a95f824b
* Move data loading and account creation to edit contact base classWalter Jang2015-01-301-387/+14
| | | | | | | | | | | | | | | While moving things from ContactEditorFragment to ContactEditorBaseFragment: * The data loader callbacks, #onActivityCreated, #setData, and account creation methods were not changed in any way * For the restoration of contact editor state, one small change was made. A new key, KEY_AUTO_ADD_TO_DEFAULT_GROUP, was added because the other options passed in via intentExtras argument to #load are saved so this looks like an oversight in the existing version. Bug 19124091 Change-Id: I7973f9c5703082f6d8db53c9db22d08a230c5876
* Re-order contact edit KEYS and state save/restore to match member orderWalter Jang2015-01-301-52/+102
| | | | | | | | | | | | | This will make subsequent CLs which will move these to base classes easier to read. No KEYS or save/restore's were removed or added, except KEY_SHOW_JOIN_SUGGESTIONS was renamed to more closely match the member that it is backing. Bug 19124091 Change-Id: I3557cffa37ee29fc5cd460a8e7358142c383967a
* Move some contact editor functionality into new base classesWalter Jang2015-01-281-148/+14
| | | | | | | | | | | | | | | | To make room for a new "compact" contact editor. The Status and SaveMode interfaces in ContactEditorFragment were moved to ContactEditorBaseActivity but the Listener interface was moved to the ContactEditorBaseFragment. The logic in ContactEditorFragment to construct the result Intent after successful saves was alos moved to the ContactEditorBaseFragment. This reverts commit 02375f1e45ade453c56810f32d63dfe8eebe4f44. Change-Id: Ib0129d9ba4e4351677b6979c5f720df2094bf48d
* Reorder edit contact fragment membersWalter Jang2015-01-281-46/+61
| | | | | | | | Before (re) moving editor functionality into base classes Bug 19124091 Change-Id: I8185b54f546f7e88893afbdeb4ff55cff3335711
* Split EntityDeltaComparator out of contact editor fragmentWalter Jang2015-01-281-102/+9
| | | | | | Bug 19124091 Change-Id: I01ccf06bd2527ea5054843b30c100b2c7cc4a7f4
* Add Insert.EXTRA_{ACCOUNT,DATA_SET} to API. P #2/2Brian Attwell2015-01-261-3/+4
| | | | | Bug: 18777272 Change-Id: I17a5b7cb4d4c5a0ba48936a6fc829acaab73f31d
* Revert "Move some contact editor functionality into new base classes"Walter Jang2015-01-261-13/+150
| | | | | | This reverts commit 5d1c571dbe5b4a60aec6cb81d69e9e595813268e. Change-Id: Ia9df02198b460529c157fbee6012349b0eca0bf3
* Move some contact editor functionality into new base classesWalter Jang2015-01-231-150/+13
| | | | | | | | | | | | | | | | To make room for a new "compact" contact editor. The Status and SaveMode interfaces in ContactEditorFragment were moved to ContactEditorBaseActivity but the Listener interface was moved to the ContactEditorBaseFragment. The logic in ContactEditorFragment to construct the result Intent after successful saves was alos moved to the ContactEditorBaseFragment. Bug 19124091 Change-Id: I5dd0b64580026a72757025915ee59be0b7d1dcbc
* Local account handling cleanupJay Shrauner2015-01-091-17/+5
| | | | | | | | Clean up null account handling and update local account detection to allow for a non-null account to represent a local account. Bug: 18959158 Change-Id: I0d5f7acb7d9a8d1ba7b6d3a4e0b6584e3646934a
* Unbundle from contacts contract part 3/3Brian Attwell2015-01-081-3/+3
| | | | | | | | | | | | * Remove some tests * Move ContactsContract.Intents.UI into Contacts * Remove references to ContactsContract.ProviderStatus.DATA1 and refactor to avoid usage of a new useless data object Discussion: go/contacts-contact-intent-ui Bug: 18777272 Change-Id: I9c6125cc30710e4637b38f3785608abb9928d1a2
* Merge "Change text colors to reflect their state" into lmp-mr1-devBrian Attwell2014-12-051-0/+25
|\
| * Change text colors to reflect their stateBrian Attwell2014-12-041-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The editor's text color suffered from two conflicting problems 1) It didn't all pass GAR 2) The difference between hint text and regular text is too subtle to differentiate at a glance Changes 1) Once a LabeledEditorView is non-empty, the text color of the spinner should no longer be the hint text color 2) Once an editor field is focused, all fields in the same EditKindSection get a slightly darker color. Since the various name editors, don't actually belong to a EditKindSection extra work needed to be done for them. 3) Drop down lists use non hint colors Read only editor continues to use the darker hint color. There is no need to strongly distinquish hint colors from non hint colors in the read only editor. Bug: 18004959 Change-Id: Ia6b16ab882b2fcb9113c2ac880e741f62115a1f9
* | Merge "Don't save contact after deleting it" into lmp-mr1-devBrian Attwell2014-12-031-3/+4
|\ \ | |/ |/|
| * Don't save contact after deleting itBrian Attwell2014-11-251-3/+4
| | | | | | | | Bug: 18514447 Change-Id: I695aa41eb6870b7c256efb9f5eccf9e0eadefe4f
* | Merge "In editor, use Up button instead of Save button" into lmp-mr1-devBrian Attwell2014-12-021-0/+1
|\ \
| * | In editor, use Up button instead of Save buttonBrian Attwell2014-11-251-0/+1
| |/ | | | | | | | | | | | | | | | | We can't yet delete the assets from editor_custom_action_bar since they are used inside the group editor. And we aren't 100% certain we want to delete all the groups. Bug: 18004959 Change-Id: Id60515d2e5bbaab98498162707581730baca2d8b
* | Merge "Collapse extra raw contact editors" into lmp-mr1-devBrian Attwell2014-12-011-20/+46
|\ \
| * | Collapse extra raw contact editorsBrian Attwell2014-11-261-20/+46
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are now two different header styles 1) When creating a new raw contact: if there are multiple accounts to create the raw contact under, then show a header with an acconut selector 2) Otherwise, show a visually distinct account header without a drop down account selector. If there are multiple raw contacts, this header also lets you collapse raw contacts Typical users, who only have a single writeable account, will never see header (1). This is fortunate, since switching between the two header styles is a bit visually inconsistent. Bug: 18004959 Change-Id: I133a7355a220f20b55657a6c1a51ff44665ea3b9
* / Use delete icon from go/iconsBrian Attwell2014-11-261-1/+1
|/ | | | | Bug: 18004959 Change-Id: Ia8a5fe6006f6caf313a0f2eb044a94535c43878c
* New design for photo editorBrian Attwell2014-11-101-15/+28
| | | | | | | | | | | | | | | | | | | | | | | | | The photo editor field now looks like the mocks. It includes a RadioButton that allows users to choose which photo is primary. This RadioButton only appears if more than one raw contact has a photo inside the contact. Additional changes: -fixed non-regression that made it impossible to set some photos as primary -fixed non-regression that made it possible for multiple photos to appear as primary -I fudged with a bunch of padding values in order to compensate for View insets and paddings. This can't always be done perfectly, since some insets/paddings vary based on screen-configuration. I needed to start taking fudging with these paddings in order to make the photo editor look consistent with the other editor fields. This CL doesn't bother ensuring the readonly photo edit field looks good. This will be done in a later CL. Bug: 18004959 Change-Id: I683f3ffa8e7f8683c2c083a2b4592b2b95c58c63
* Use larger photo in contact editorBrian Attwell2014-11-061-14/+11
| | | | | | | | | Increase the size of the photo in the contact editor. This means we can no longer rely on thumbnails. We now need to load contact photos from Uris. Bug: 18004959 Change-Id: Ice2099998194adad9336c5d90e9873a230ca4bd5
* Make it easier to delete a contactWalter Jang2014-11-031-0/+2
| | | | | | | | | | * Add delete menu item to quickcontact overflow menu * Promote delete menu item on edit contact activity from overflow menu to show as action Bug 18061876 Change-Id: I3f99e1cd00151b968a157ff818bf977c0be15eb2
* Fix analytics in Contacts appBrian Attwell2014-10-301-3/+1
| | | | | | | | | Remove dependencies on old analytics code. Initialize analytics inside ContactsApplication. Improving analytics CL #3/4 Bug: 18039620 Change-Id: I115315519ad245ff199bcf532270f56b9a2d6b61
* Use analytics activities and fragmentsBrian Attwell2014-10-231-1/+3
| | | | | | | | All Contacts's activities and fragments now inherit from analytics base classes. Bug: 18039620 Change-Id: Ia550263640f60bc3f7daa7e85cd9f612f0dfc8a8
* Disables the delete menu option on "insert or edit" actionsPaul Soulos2014-09-151-0/+10
| | | | | bug: 17468225 Change-Id: I9c26279cbedfe773d6fbd39ad49470d39ac88f2e
* Save menu state on rotation, in contact editorBrian Attwell2014-08-201-1/+9
| | | | | Bug: 17148558 Change-Id: I4f31ddd7a685b6bc6ea6d13e4c0d0f9be78df49a