History log of /packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailFragmentCarousel.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
988c2266116b705b43bbf643ca16773a989ade35 18-Jun-2013 Chiao Cheng <chiaocheng@google.com> Fixing default page for RTL.

Horizontal offset is calculated to determine the page to be displayed.
Fix calculation to take RTL into consideration. Also added RTL to
logic for determining number of pages to display.

Bug: 9302365
Change-Id: I5a6585b2df65ba2801692367219f940e34591cb9
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailFragmentCarousel.java
a5b52c36b9817a48bcb155862255462ef1bae4ca 09-Apr-2013 Chiao Cheng <chiaocheng@google.com> Stop social update view from stealing focus.

ContactDetailFragmentCarousel was requesting focus to set the initial offset of
the HorizontalScrollView. This was probably a hacky work around to get the
smoothScrollTo() method to work.

Instead of requesting focus, call scrollTo(). Before scrollTo() did not work
in the enableSwipe() method because HorizontalScrollView "clamp"s the offset
to the size of the width. And the size of the width was calculated based on
mEnableSwipe flag in the onMeasure() method. To fix it so scrollTo() works
within enableSwipe(), change the width calculation to also take into account
mCurrentPage which may be initialized to 1 instead of 0.

Old order
+ onMeasure() [mEnabledSwipe = false, width set for a single child]
+ enableSwipe() [mEnabledSwipe = true, width still set for a single child]
+ scrollTo() [page 1, fails because width set for a single child]

New logic
+ onMeasure() [mCurrentPage = 1, width set for 2 childs]
+ enableSwipe()
+ scrollTo() [page 1, suceeds]

Bug: 8157306
Change-Id: I3a693a0b3d43a68d251faea4b5805791f2316aaa
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailFragmentCarousel.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/ContactDetailFragmentCarousel.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/ContactDetailFragmentCarousel.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/ContactDetailFragmentCarousel.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/ContactDetailFragmentCarousel.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/ContactDetailFragmentCarousel.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/ContactDetailFragmentCarousel.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/ContactDetailFragmentCarousel.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/ContactDetailFragmentCarousel.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/ContactDetailFragmentCarousel.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/ContactDetailFragmentCarousel.java
25594d6db384d27641b402cddf23d44818e1cd10 13-Aug-2011 Katherine Kuan <katherinekuan@google.com> Performance improvements for contact card with social updates

- Use background color with alpha hex color instead of
alpha attribute of View
- Instead of posting a runnable in onMeasure, move it
to setCurrentPage / setFragments methods

Bug: 5161205

Change-Id: Ib1ad3b11c359d8fdc1e9143ab9d64c39aa914b91
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailFragmentCarousel.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/ContactDetailFragmentCarousel.java
db0d8669cd1ffaa45827edb65b2b0eecb27561f5 03-Aug-2011 Katherine Kuan <katherinekuan@google.com> Reuse fragments when rotating contact card on phone

- Part 1 of refactoring contact card fragment code,
Part 2 will be refactoring the tablet code to fix
bug 5082871

- ContactDetailActivity should always have non-null
fragments after onCreate() (either retrieved from
Fragment Manager or created dynamically)

- New view pager adapter that returns views that contain
existing fragments (instead of generating new fragments)

- The main reason for these changes is that when we
create fragments dynamically (necessary for the ViewPager
otherwise the fragment from XML will already have a parent),
the view ID will be the pager view ID. When we rotate,
the fragments are already defined in XML for the fragment
carousel and already have different view IDs, so it won't
restore properly. We can't put the pager view ID in the
fragment carousel layout, otherwise the ContactDetailActivity
will try to cast it to a ViewPager. Alternatively, if we make
both layouts rely on dynamically created fragments, the problem
becomes the fact that once fragments are added to the fragment manager,
they cannot be retrieved and added again to a different parent if there's a
different layout (exception is thrown). Thus, the solution is to have
the same parent container in both phone portrait and landscape layouts.

- Also it is unclear what was happening to the fragments on
rotation (they weren't being restored but weren't being removed
from the FragmentManager). We can remove the hack now that
would store the ViewPager fragment tags in the saved instance bundle
and manually remove those fragments from the FragmentManager after
an orientation change.

- In onCreate() of the ContactDetailActivity, if this is a
restored instance, then inflate the correct layout right away
so the fragments can find the parent containers.

- Save/restore ListView state on rotation

- Save/restore selected tab for contact with social updates

- Clean up computation code for FragmentCarousel by moving it to
onMeasure() method

Bug: 4976082
Bug: 4686406
Bug: 5082871

Change-Id: I7840b1dd1110da4dcc28ebabe3fc2739ff11c2f2
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailFragmentCarousel.java
2ad0dea36362beb70f5a92ac9b4c6a1db7bbb8b9 27-Jul-2011 Katherine Kuan <katherinekuan@google.com> Add alpha layer to tab carousel on contact card

- Introduce CarouselTab class to handle the
alpha layer and touch interceptor
- Clicking anywhere on the tab will select that
tab
- Remove split style action bar on contact card
so favorites star will be in upper right corner

Bug: 5081735
Bug: 5042660

Change-Id: I54088b49c928297dbfc523752258ceaa97cce445
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailFragmentCarousel.java
8f0f3343e4363a5e1f11b35392c8393f263aaa41 21-Jun-2011 Katherine Kuan <katherinekuan@google.com> Phone landscape view of contact card

- No tab carousel, show half of the other (about or updates) page,
tap or swipe to see the other page
- Add alpha layer and touch interceptor layer
- Add new resources folder for w470dp to cover landscape on
phone sized devices

Change-Id: Ia3b1cd76ebe35420b1facd415998b14ba161b0ba
/packages/apps/Contacts/src/com/android/contacts/detail/ContactDetailFragmentCarousel.java