History log of /packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
851222a96b5d68602fb361ea3527101e893f67e3 21-Jun-2012 Maurice Chu <mochu@google.com> Added thin object layer around contact data

This refactoring abstracts out the need to directly
refer to Contacts database columns throughout the code. Instead,
all of this information is retained in getter/setter methods
within the Contact, RawContact, and DataItem classes and
sub-classes.

ContactLoader.Result class has been pulled to the top level as
the Contact class.

The Entity class has been removed and replaced with a RawContact
class, with getters/setters to raw contact information.
Renamed EntityDelta to RawContactDelta for better understandability
as well as adding getters/setters for specific fields in the
ValuesDelta nested class within EntityDelta. EntityDeltaList
and EntityModifier have been renamed to RawContactDeltaList and
RawContactModifier with the methods using the RawContact class
directly rather than the Entity class.

Data items for a raw contact are represented by a DataItem object
with specialized getters/setters for subclasses of DataItem.
(e.g., EmailDataItem, PhoneDataItem. etc.). DataItem is a wrapper
around ContentValues. This abstracts away the ContactsContract
column fields into getters/setters.

The above refactoring is accompanied with changes throughout the
codebase to use the new Contact, RawContact, and DataItem classes.

Change-Id: I31c1dccd724e9652f9d0af78ca81feb6c5acd71d
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
e0b2f1e2d01d1ac52ba207dc7ce76971d853298e 12-Jun-2012 Chiao Cheng <chiaocheng@google.com> Global import order fix.

Changed import order to be in accordance with style guide:
http://source.android.com/source/code-style.html#order-import-statements

Static imports will be placed at the top since most existing files used that
convention. It is also a style that can be handled by both eclipse and intellij.

Change-Id: Ia7013c7a2d88e5fefb8f4975d121f7fcd3fcc462
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
0b398b3d178d1fe8fd3ebfb9396e36d1228b53c6 16-May-2012 Maurice Chu <mochu@google.com> Fragment carousel always starts on About page

Bug: 6485489
Change-Id: I6ad819578d79e332594fc3deb4ec0995220d0697
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
6e607d54ce08ebcc78d94963646a42605697f132 16-May-2012 Maurice Chu <mochu@google.com> Fixed contact detail animated transitions

When selecting different contacts on a tablet, the
animation is to set the contact details pane to white
and fade in the new contact details.

From quick contacts view (from Group or Favorites tab
and launcher screen shortcut), if quickcontact is opened
up and user touches the image, then when transitioning
back to the contact details, the contact details shows all
white and then transitions in the new contact details without
showing the previously selected contact details.

Bug: 6194409
Bug: 6324730
Change-Id: I5f56d46aef338b5d7a22e548548c42054656f381
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
13f6f26cb8b2f78f0b92dfc1d102222c13217300 09-May-2012 Maurice Chu <mochu@google.com> Change contact detail on 7" to fragment carousel

Contact details in 7" landscape uses the fragment
carousel to show details with updates. The layout
of the contact details fragment follows the 10"
landscape contact details fragment layout. Dimming
of the detail or updates panel in the fragment
carousel has been disabled, and to be consistent,
this dimming is also disabled on the phone landscape
layout.

Also, this changes fixes the bug with the overscroll
indicators in the contact details pane.

Bug: 6398940
Bug: 6378743
Change-Id: Ie93ab73a9ebad8b66f5bc7d75222f5550ed1b005
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
7edad9dd95a411cc5ed69815e5f0be8a5d1e8b19 20-Apr-2012 Josh Gargus <jjosh@google.com> Fix broken touch-interception in ContactDetailFragmentCarousel.

Tear out a confusion of code that wires XML specs up to alpha-
and touch-interceptor layers. Encapsulate in a new class,
FrameLayoutWithOverlay.

Bug: 6324499
Change-Id: Ic531327d67db8b5069abbd93e31fa10d99d4c4cd
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
84edfd9a76657a653491faac53b5976adf9fd2cb 16-Mar-2012 Josh Gargus <jjosh@google.com> Miscellaneous contact-detail fixes.

View-pager containing contact details and social updates are now
scrolled by the appropriate amount when ContactDetailTabCarousel is
swiped. Also, fix "bounce-back" where the carousel improperly
selected the wrong tab (i.e. the one you just swiped away from).
Finally, make it possible to start a swipe back to the "about" tab
from the "updates" tab (previously, you had to initiate the swipe
on the partially-revealed "about" tab).

In ContactDetailFragment, only make photos tappable when either:
- the photo is settable (i.e. the contact is not read-only), or
- the photo should expand when tapped.

Bug: 6009463

Change-Id: I291e0c42b1d77a11babc7a9cb282a19cdb305025
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
187c8167d77687fbc04237c9ac1e87564b2d5f33 14-Mar-2012 Josh Gargus <jjosh@google.com> Miscellaneous contact-detail fixes.

Fix bug in carousel "Updates" tab, which would turn black when swiping
it all the way to the left. This was caused by a small negative alpha
being computed, and some incautious integer arithmetic to transform it
for use in setBackgroundColor(). Fix clamps the alpha value between 0
and 1 (using newly-introduced MoreMath class).

Fix visual glitch where the "Updates" label displays the "pushed" glow
when tapped.

Bug: 6009463
Change-Id: Iee041ee7793f198f1d51ea5e7c5bbcb07b9a41df
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
cf3d9f04955a8ec3cb405b8a4ddcaddcece2a245 08-Mar-2012 Daniel Lehmann <lehmannd@google.com> Fixed various issues around cross-fades

* Fixes the layout in portrait tablet
* Introduces the same cross-fade when going from group to group
* Reduces memory consumption by creating the transition-bitmap on demand
(takes 40ms on Xoom)
* Simplifies the layout files by removing some configuration options
that we aren't using anyway
* Split the detail views for contact and groups, so that the animation
of one doesn't affect the other

Bug:6117161

Change-Id: I2509c9387de6b1ac60dbc9b694564291910bde72
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
2f41fe6bcc8d055bf53ad070425552fad57dff21 29-Feb-2012 Daniel Lehmann <lehmannd@google.com> Reintroduce cross-fade on tablet when going from one contact to the next

Bug:6009407
Change-Id: I6044963d1b4737ebdd2d3b5fded71281841f0d81
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
2a45e35ab3273c8901d9df3671e51614dc0250c6 14-Feb-2012 Daniel Lehmann <lehmannd@google.com> Animate show/hide updates

Also fixes the vertical text position which was wrong due to the shadow

Bug:5268733
Bug:5204655

Change-Id: I011a482500e13b1b189c7e27dbcd40e2e1f42318
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
ab5387bb8728c34bafcb554830961341f1f9daea 01-Nov-2011 Katherine Kuan <katherinekuan@google.com> Reset views when changing contacts on tablet

- On tablet, we re-use the same fragments for
different contacts because we have a 2-pane view.
We need to reset the state to prevent showing
the wrong tab or old scroll state information from
a previous contact.

- Resetting the list adapter is getting rid of the
scroll state information and resetting the tab
carousel / view pager gets us back to the "about"
tab.

- Store the contact URI in the saved instance
state bundle so that on rotation, we still
recognize that it could be the same contact
and restore scroll position.

Bug: 5529595
Change-Id: Ibd874799f926b70430e47518a4b995394fbfe547
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
253b3366bbb1b6c935ccaf7610511f97569ad956 20-Oct-2011 Katherine Kuan <katherinekuan@google.com> Fix swipe transition on tablet contact card

This happens on tablet portrait view when switching between
contacts with and without social updates.

Bug: 5283623
Change-Id: Idfb6be0d381fe4d72e79e210f2aebf9c6cbde1fe
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
ccf3b6bb9cba613eb31163c7ab97be71307234d1 09-Sep-2011 Katherine Kuan <katherinekuan@google.com> Fix fragment carousel going to wrong scroll position after rotation

- On devices with no physical buttons, there is a status
bar on screen, which triggers an onSizeChanged() method call
which causes the ContactDetailFragmentCarousel to scroll to
the focused view (which was wrongly set as the ListView in the
details page in phone landscape).

- Make sure the right view is focused on and remove the manual
scroll code in onLayout() in ContactDetailFragmentCarousel
because it doesn't do anything because the width of the child
view is not correct (when the page is first launched and doesn't
cause any scroll changes). Instead, when the data is loaded
and we enable/disable swipe, we select the right view to be focused
on, which takes care of scrolling to the right page.

Bug: 5265640
Change-Id: Id3b568b2d1c3af5d4d6cae285038131bb4cb1a45
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
226dcdf399e0a637711f9a76b575b7a23d2c7782 01-Sep-2011 Katherine Kuan <katherinekuan@google.com> Fix tab carousel flicker issues

Cases fixed:
- Animation of the tab carousel causes a brief jump
at the end of the animation because the vertical scroll
listener is trying to move the tab carousel to a different
Y coordinate at the same time

- Horizontally scrolling the tab carousel causes it to
get into an "in-between" state where it is out of sync
with the ViewPager (there is also flicker on each tab
because the alpha values are wrong)

- Rotating from phone landscape updates page to phone portrait
was never implemented (didn't scroll the tab carousel to the
right tab)

- Rotating from phone portrait updates page to phone landscape
would cause a noticeable flicker where the page would slide to
the left so the correct page was selected because it was scrolled
when executing a Runnable

Fix issues by scrolling the HorizontalScrollView if necessary
in onLayout(). Consume touch down/up events on the tab carousel.
Add flag to know when the tab carousel is already animating.

Bug: 5220668
Change-Id: Icecaa99b43682111fb7c7d201a059b3962b00cd6
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
a3364bc45b73c6a3bb0e0ec4586110f962ddf8c2 24-Aug-2011 Nick Pelly <npelly@google.com> Update for NDEF push API change.

Change-Id: I9101e2f756fbaeaa392d9d5f4ebc6523618a8a5c
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
4b25da79091157935042d2942a8961ceba92166f 25-Aug-2011 Minh Pham <phamm@google.com> Change commit() to commitAllowingStateLoss()

- Following the pattern in Email and Gmail, we change all commit() to commitAllowingStateLoss().
At least this will stop the monkey ISE.
Bug: 5167769
Bug: 5179918

Change-Id: Ibee8380a0f854aeb30bc3c4359fb706faf4efb4b
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
1edabe9a4d563f620cd74d5fb1f1ea197c18129b 24-Aug-2011 Daisuke Miyakawa <dmiyakawa@google.com> Merge "Show empty detail screen (on tablet) on nothing loaded"
050c3893fadaf6d02951a3fe29684f4cd94fa9c9 22-Aug-2011 Daisuke Miyakawa <dmiyakawa@google.com> Show empty detail screen (on tablet) on nothing loaded

TESTED:
- People on Phone should work as we expect.
(this change shouldn't affect Phone experience at all)
- People on Tablet, landscape and portrait
-- nothing should be shown when no contact is selected
on boot
-- detail should be shown when a contact is selected
-- nothing should be shown when filter has changed and
no contact is selected
-- detail should be shown when filter has changed and
a contact is selected after that
-- orientation change should not cause any problem

Bug: 5084998
Change-Id: Ieed0b551655b7ee3b3872117eca50af90df30021
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
6c0470e21d8506fb53915df7463634fd47288343 17-Aug-2011 Katherine Kuan <katherinekuan@google.com> Coordinate scrolling between two lists on contact card

FRAGMENT CHANGES:

- Add a method on each of these fragments to scroll the list by
a given offset (only when the first "fake" item in the list
is at the first visible position on the list). If any other
item (2nd, 3rd, etc..) is the first visible position on the list,
then it gets too complicated to figure out how much to offset the
list, so it's better to just animate the tab carousel to be at the
right spot.

- Add a method that returns the top position of the first item
in the list if the first item in list is visible (to verify
that the offset was done properly). If the offset is not
what we expect, then we know the list couldn't be scrolled.

TAB CAROUSEL:

- Keep track of the Y position of the carousel the last time
the user was on the details page, and the last time the user was
on the updates page. This is because syncing the scroll position
of the 2 lists or animating the tab carousel vertically is only
necessary if the tab carousel position has changed between the
two pages.

LAYOUT CONTROLLER:

- We need to be able to animate the tab carousel to the correct
Y position anyways because if the list in the fragment is not
scrollable (but the other list is scrollable), we need to rely on
animation to hide the big white space below the carousel.

- When a list (i.e. in the ContactDetailFragment) is idle, the user
has stopped interacting with the list, so use the time to sync
its position with the other list (since this may involve a
requestLayout() if a scroll is triggered).

- Because the list may not become completely idle (i.e. the user
flings the list and then starts to swipe), we still need a check
when the user starts swiping the view pager to sync the two lists.
If it's already at the right spot, then do nothing. If we can't
scroll the other list dynamically and we need to animate the tab
carousel, and we should only do this when the view pager has
settled down and is idle.

MISCELLANEOUSE EDGE CASES:

- Fix the tab carousel jumping to the starting position (if a sync
happens and the loader data is refreshed) because the layout is
likely being redrawn and the tab carousel is potentially redrawn
back inside the bounds of its parent. Hence store and reset the
tab carousel position to its previous Y value (which could be
outside the bounds of its parent).

- If the list is scrollable but only by a little bit, allow
the tab carousel to compensate by animating down the rest of the
offset amount

- Tapping on the tab should also work now

- Make photo in updates tab fill the whole tab, change
updates fragment background except for the tablet landscape mode

Bug: 5044680
Change-Id: Icc9445606ea52779dea97b194763c74a0b2a27ee
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
51f1071a1dc91dace0de73be1c5fbba4f091f054 16-Aug-2011 Katherine Kuan <katherinekuan@google.com> Allow phone contact card to switch b/t having/not having social updates

- Make phone portrait and landscape layouts have all views necessary
to switch between showing/hiding social updates. Disable swipe
if only the detail fragment is showing.

- Make ContactDetailActivity use ContactDetailLayoutController to
reduce code duplication, add another state for fragment carousel
in ContactDetailLayoutController

- Make fragment widths in fragment carousel configurable based
on screen width instead of fixed dip value

- Make setAlphaLayerValue() save the alpha value if the view
isn't ready yet (otherwise it's a no-op and the caller must
call it setAlphaLayerValue again when the view is attached) -->
this allows us to remove the code to set fragments in the
fragment carousel every time the data is reloaded

- Remove enableAlphaLayer() code and just make the alpha layer
view visible in the XML

Bug: 5164029

Change-Id: I8f28ac27d125502a12221f084ce253611e6f78a1
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
9def68a878226e0d9fc49701a7f0c63a24219283 05-Aug-2011 Flavio Lerda <flerda@google.com> Extract the functionality for scrolling the tab carousel.

This creates a TabCarouselScrollManager which handles scrolling of
carousel tabs up when the user scrolls one of the two list views.

This extracts a common copy in preparation for changing it to handle the
switching between scrolled tabs.

Bug: 5123933
Change-Id: I8741140b4770173ca33ea5a9baddb7862c5cf7f5
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
22cb663a251af60bc6beeb1954568c8e6a4c34e9 03-Aug-2011 Flavio Lerda <flerda@google.com> Support scrolling of Updates tab.

This commit changes the Updates tab to use a ListView for its items. The
ListView has an extra header item that overlaps with the carousel tab
(if present), and implements the scrolling which hides part of the
carousel (excluding the tab itself).

The fragment now basically contains only a list view, which will store
all the items, and an optional title (I need to check if that's actually
needed, but for now it is there).

The extra header is implemented with a layout: for those configurations
where there is a carousel, the header contains a placeholder which is
the same size as the carousel; for those configurations where there is
no carousel, the header will be an empty FrameLayout (but in those same
cases, there is a header at the top of the list in the fragment's
layout).

This commit does not take care of making the scrolling work across the
two tabs, e.g., when switching between tabs. I will address those issues
in a follow-up.

Bug: 5119353
Change-Id: I0eb6dcc06d624991ab1f5f8fe1197337ba03286b
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
3bbd9a0c3e85262365376ae212f9a8bc521e37d4 04-Aug-2011 Katherine Kuan <katherinekuan@google.com> Fix NPE on tablet contact card with social updates

- In tablet portrait, instead of having 3 fragments
on screen (2 fragments for the view pager and
1 detail fragment for contact with no updates), just
have 2 fragments where the view pager adapter has
count = 1 when there are no updates (which disables
the swipe).

- Store whether or not the contact has updates in
the save instance state bundle so it can be
restored in onCreate()

- Set retain instance = true for the ContactLoaderFragment

- There should always be a ContactDetailFragment and
ContactDetailUpdatesFragment after onCreate() of the
PeopleActivity on the tablet

- Basically apply similar logic from the phone CL:
https://android-git.corp.google.com/g/#change,125585

- TODO: Take out duplicated code from ContactDetailLayoutController
and ContactDetailActivity

Bug: 5106878
Bug: 5082871

Change-Id: I3af08bf84072d3d94e4f3a6bc1d01faf3432e3e7
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
bed71bedbaae4d6b26b2b64db476bffa710753e5 26-Jul-2011 Makoto Onuki <omakoto@google.com> Don't execute Runnables after host activity is destroyed

Use Activity.isFinishing() to detect if an activity is (or will soon
be) destroyed.

Also use FragmentTransaction.commitAllowingStateLoss() instead of commit()
in ContactDetailLayoutController.initialize(), which can be called from
Handler.post().
(And removed TODOs related to this.)

Bug 5032952

Change-Id: Ib5598a3e0a94adeaafd0497ac54518f2c6634603
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
9bd85b3ecd9129feb2f317784a3d8023aa211d42 24-Jul-2011 Katherine Kuan <katherinekuan@google.com> Fix photo + basic contact info header on tablet

- Fix these cases:
* On tablet landscape, for a contact with social updates, the name
has to be displayed to the right of the photo.
* On tablet landscape, for a contact without social updates, the
photo must be static and the name should scroll with the list of
details

- In order to support these cases, specify the header of the list
in XML in the case with and without social updates, otherwise there will
be a lot of boolean flags and unnecessary views inflated

- There still needs to be a flag in the tablet landscape view
because the ContactDetailFragment is reused for both cases where the
contact does and does not have social updates. The static photo
must be explicitly hidden in the case of the contact with social
updates because it will appear in the scrolling header. This flag
must be set outside the ContactDetailFragment b/t the phone
landscape view has a static photo that is shown regardless
of whether the contact has social updates or not.

Bug: 4689488

Change-Id: Ifea16c48496b8552b313a05cbb8ade80ae117069
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
3915600d2b0ff499e0129e951dfd39bff46b2f42 19-Jul-2011 Dave Santoro <dsantoro@google.com> Stream items UI.

This is still pretty rough at this point, and does not fully implement
the UI. It handles loading in the stream items and photo metadata in
the contact loader, and displaying those items in a scrollable view
in the updates pane.

Change-Id: I3e796a6141ffa385aa2acc769cf6dd11f37aa39c
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
93f625d8f2825575b4f63f4cf78ecbb7b56354eb 21-Jul-2011 Katherine Kuan <katherinekuan@google.com> Don't commit transactions after onSaveInstanceState()

- On the tablet portrait view, once the contact details are loaded,
a runnable is posted to a handler to properly setup the fragments
(by showing/hiding the ContactDetailFragment or ViewPager/Tab carousel)
- Since it's posted to a handler, we need to make sure that
onSaveInstanceState has not already been called or at least allow
the fragment transaction to be lost if it has been
- Prevent the runnable from doing anything if the activity is already
destroyed

Bug: 5011890

Change-Id: Ib43278f21eee390202ffe4b7ed4057482c34e61c
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java
58fc577bd7966e6566cdcac09589a0d3e05128e7 04-Jul-2011 Katherine Kuan <katherinekuan@google.com> Contact card on tablet

- Two-column layout in landscape
- ViewPager and tab carousel in portrait
- Views with and without social updates
- Use ContactDetailLayoutController which controls hiding/showing
fragments based on orietnation and contact data
- Move options menu into the loader fragment because there can
be multiple ContactDetailFragments on the screen now at one time
or it can be dynamically created by the ViewPagerAdapter and
we won't have a reference to that in the PeopleActivity

TODO: Use ContactDetailLayoutController in ContactDetailActivity
so there isn't duplicated code. But just make it work now and do
cleanup later.

Change-Id: Ibf8eb317c6e19bc3d98eb9ce46a45cccb237c631
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailLayoutController.java