Checkpoint of new edit contact UI, work in progress.
This change introduces several new concepts which are
summarized below. One major change is a MMVC approach that
has two models: the structured Contacts data, and the
data-source constraints model. Another is augmenting an
Entity using a specific set of actions.
First, each data source is defined through a ContactsSource
that describe how it handles data, both for rendering and
editing cases, such as the Data.MIMETYPE it handles, what
types are allowed, and the fields required for editing. In
this change, ContactsSource objects for Google and Exchange
are hard-coded, but an initial XML version will need to be
finalized for supporting third-party apps that show custom
icons and strings.
Second, AugmentedEntity allows us to keep the edit changes
separate from the initial data and build a "diff" between
the current Entity state and the desired changes, which is
represented as a set of ContentProviderOperations. If the
data changed while the user was editing, we can easily swap
in the new Entity and apply the edits on top. In the worst
case, this may end up creating duplicated data, but won't
lose the users changes.
Finally, this change starts splitting the UI and modeling
code into different sub-packages. The UI is split into
multiple ViewHolders to mirror the structure on screen.
There are dozens of TODOs littered throughout the code,
which I'm following up on shortly. This is a checkpoint to
start a code review on the core structure.
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index c4a43df..b37ba3a 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -285,7 +285,7 @@
</activity>
<!-- Edits the details of a single contact -->
- <activity android:name="EditContactActivity"
+ <activity android:name=".ui.EditContactActivity"
android:windowSoftInputMode="stateVisible|adjustResize">
<intent-filter android:label="@string/editContactDescription">
<action android:name="android.intent.action.EDIT" />