summaryrefslogtreecommitdiff
path: root/src/com/android/mail/ui/AnimatedAdapter.java
Commit message (Collapse)AuthorAgeFilesLines
* Revert "UnifiedEmail: Supported Email search function"Danny Baumann2016-12-301-19/+0
| | | | | | This reverts commit ad4f76791d5306f6046150cefd7de07d9d15aa33. Change-Id: I396973b7f27a5df483a7845b16b1db804bb8916b
* UnifiedEmail: Supported Email search functionweitan2016-08-241-0/+19
| | | | | | | | | | | | | | | | | | | 1. Use the search function to search the local mail. 2. Search results interface: Filters All, Subject, Sender, Receiver click on the different filter, and search the corresponding results. All for the default selection filter. 3. Search results interface: slide switch filter, remove "sliding removing a single mail" effect. 4. Search results interface: alternative condition, slide switch filter, cancel the multiselect state. 5. Search results interface: UI-filters layout, sliding effect, search, according to the number of search results highlighted. Change-Id: I2af40a386de55e221878bd346cda3ea1cff8f2fa CRs-Fixed: 1023498
* Save the focused conversation via id instead of positionJin Cao2014-10-171-4/+4
| | | | | | | | | | | | | | | Don't rely on saving the position in the adapter because the position might change as the adapter's data set changes (e.g. new mails via sync), and we have no way of modifying the focused position accordingly. Instead, save the focused conversation with its id (tried using the uri, but the uri might change when the conversation gets cached). This way, no matter what happens to the items in the adapter, the focused item remains consistent. b/18027602 Change-Id: I51aa68bc15c5892c3b34bde5c199de281390ce7b
* Merge "Programmatically set selected state to correspond to peeking conv" ↵Andy Huang2014-10-171-4/+4
|\ | | | | | | into ub-gmail-ur14-dev
| * Programmatically set selected state to correspond to peeking convJin Cao2014-10-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I can't simply rely on ListView#setSelection to programmatically set the selected item because setSelection only caches the selection internally if the view is currently in touch mode. Thus, in touch modes, isSelected() will *always* return false for an item in listview. In order to know what's the current selected item, I keep track of the selected position that corresponds EXACTLY to the listview's selected position. Again, I can't use ListView#getSelectedItemPosition because it will always return INVALID_POSITION in touch mode. I change the selected position whenever a child calls setSelected() or we programmatically call setSelected. I tried using onItemSelectedListener. However, the listener's callback is called after the selected state is changed AND the re-draw happened, so the UI gets inconsistent since the selected state didn't properly update during the re-draw. When we programmatically select an item that's visible on the screen, we have to use ListView#setSelectionFromTop and pass in the current y value since the default behavior is to scroll such that the selected item is at the very top. Also, another caveat is that I am now saving the ConversationItemView's position in the adapter when the adapter binds data to it. I find that this approach is much more dependable than using ListView#getPositionForView because sometimes (for reasons beyond me) in ConversationItemView#setSelected the listview ONLY HAS ONE CHILD (even though on the device I can see a full list), thus getPositionForView will return index 0 since it thinks it's the only child.. I have no clue, so I'm saving the position myself instead. b/18015875 Change-Id: I11897056fc9fa630eb4019532b1fd4cf41c7486a
* | Don't include the default footer when there is no contentJin Cao2014-10-161-3/+9
|/ | | | | | b/18006338 Change-Id: Ie88ff9e161fef6ca1f28879119577517232679ce
* Always have a footer for AnimatedAdapterJin Cao2014-10-141-11/+16
| | | | | | | | | | If a custom footer is not set, use a default footer which is just a space with height of 88dp. This will cause the last item in the listview to not overlap with FAB/snackbar. b/17622053 Change-Id: Ie165cd7559681c32b6f36d962ec92e50c372614a
* Choose thread icon more carefullyJin Cao2014-09-151-2/+2
| | | | | | | | | | | | | | | | | | | b/17298161 Choosing the avatar to draw as the thread icon follows this algorithm: 1) Prefer the sender of the first unread message. 2) If all messages are read, prefer the last sender that is not the current account. 3) If all messages were sent from the current account (e.g. user is emailing themselves), use the last sender (aka current account). In the process of doing this work the last remaining dependency on DividedImageCanvas was broken, so it could be removed at this time. Tests confirming the new behavior have been added to SendersFormattingTests. Change-Id: If8e066de8cb98f2f95b019a88a2fdadc2f9f5090
* Keyboard support for focused stateJin Cao2014-09-021-2/+2
| | | | | | | | | | | | | | - remove focusable from FAB so keyboard won't navigate to it. - rename selectionSet to checkedSet - selected is a state for listview to focus one of its elements - what we really want is checked state for checked items in CAB mode. - show the blue focus bar when isSelected returns true - this is auto-set by the framework as we navigate using the keyboard. - remove blue background color for selected state b/17258708 Change-Id: Ic9739c9b349403942f64fafa26500c08d1f1cc4c
* AnimatedAdapter shouldn't show header if there is no contentJin Cao2014-08-281-12/+7
| | | | | | | | | | | | | Instead of having a separate getContentCount, simply have the count return 0 if the content count is 0. If the content count is nonempty, then add the header count to the result. This effectively prevents the headers from ever rendering unless there is some content underneath. b/17306351 Change-Id: I04a577d4fb3e54ea201214da2ec1aac74d3a27d2
* Don't include header size when checking for adapter sizeJin Cao2014-08-251-0/+10
| | | | | | | | | | | | We display the empty view when the adapter size is 0. However, this count shouldn't include header size since we are only interested in the adapter content. Note that teasers are not included in the header since they are separately considered by AnimatedAdapter. b/17258260 Change-Id: Iebcee7e2b9ded0c43aabac8b3bcd93a423263017
* Fix position offset for special viewsJin Cao2014-08-071-6/+18
| | | | | | | | | | | | | | | The position for special views should take header views into account since the special views start at index 0. The NPE was caused when we are supposed to return a special view. However, since the index is off, the special view is null and the offset position is -1. b/16728934 Change-Id: I83bc5059a52b2d824c929acbafc6895094999d28
* Ditch HeaderViewListAdapter and support headersJin Cao2014-08-011-7/+20
| | | | | | | | | | Support arbitrary number of headers in AnimatedAdapter instead of relying on ListView#addHeaderView and HeaderViewListAdapter. b/16728934 Change-Id: I1e4d02ac8b6557411ab47895002088d798ff2fc2
* Replace all references to UnifiedEmail's com.android.oldbitmap withJames Lemieux2014-07-111-1/+1
| | | | | | | | | equivalent usage of framework's com.android.bitmap. A small refactor of AccountAvatarDrawable.drawBitmap(...) is also included which produces no functional change. Change-Id: Ic67690cde56de6ca691ac8647ef02865b766ca62
* Remove attachment previews from Conversation ListJames Lemieux2014-07-111-53/+4
| | | | | | | | | | | | | | | This includes: - all references to the 3 attachment preview columns in the Gmail conversation table (except for migration code in MailStoreInitializer) - all layout and drawing code for attachment previews in conversation list - all assets related to attachment previews - all preference and analytics code that aided attachment previews NOTE: This does not alter, in any way, the display of attachments in conversation view. Change-Id: I0aa5a32c8cce0ba98758827b973b323896932c39
* Take adapter's teasers/footers into account when showing empty viewJin Cao2014-05-291-0/+5
| | | | | | | | | | Avoid showing anything until the cursor is partially/fully loaded. Once the cursor is loaded, use mAdapter.getCount instead of cursor.getCount to check for list count since mAdapter might have special views that it wants to show despite the empty list. b/14651214 Change-Id: Ife9de623110adbd191991fd9d8746f9ce93fbf5f
* Allow alternate sources for contact images.Andrew Sapperstein2014-05-281-10/+4
| | | | | | | | | | | | | | | | | | | | | | Makes some classes that overridable in order to provide alternative implementations: ContactResolver, ContactResolverTask, ContactLoaderCallbacks, and ContactPhotoFetcher all can be subclassed to provide new behavior. Also added hooks in ControllableActivity and MailIntentService to override building these classes. NotificationUtils was also updated to force all calls through MailIntentService which can be overridden. Finally, moved the BitmapCache used in conversation list to the activity level instead of at AnimatedAdapter-level (which is effectively fragment level). This speeds up subsequent queries for images dramatically. We reset the cache when changing accounts. b/11387812. Change-Id: Ie70d800862b073163ccbfa5295d6950e57d64009
* allow the user to recover from stuck-cursor issuesAndy Huang2014-05-061-0/+23
| | | | | | | | | | | Treat swipe-refresh as a trigger to clear stale adapter state that may prevent normal cursor refresh from happening. While it's important to delay cursor refresh until animations are complete (to prevent jank), there was previously no way to get out of buggy states where the adapter though an animation was happening but never did. Bug: 14297883 Change-Id: I0d279770246e93c939b589cd0ac5eba76358b47e
* Revert "Commit DestructiveActions immediately. b/9904716."Andy Huang2014-05-061-4/+0
| | | | | | | | | | This reverts commit 1165d291b938f406631768795c0dbee58898315e. This was causing the thread list to not update after an in-conversation delete/archive on tablets. Bug: 14297883 Change-Id: I55e2969e842e108507b7ee128ea53f462316220d
* Rename com.android.bitmap to com.android.oldbitmapScott Kennedy2014-03-271-3/+3
| | | | | | | This is causing some conflicts, and we want to replace this with the new library in the near future. Change-Id: Ie607e20a96861a6282e27410fea859f0ee1737cd
* Commit DestructiveActions immediately. b/9904716.Andrew Sapperstein2014-03-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | For whatever reason, we have this weird two stage commit of DestructiveActions. We call performAndSetNextAction twice every time we wanted to commit. This results in the next destructive action trying to perform the action again, but that doesn't matter because we debounce the actions so they're only performed once. Unfortunately, in two pane mode, when we transition back to the conversation list, we only called performAndSetNextAction once. As a result, the first call tried to re-apply the old version. But it was never called a second time so we never committed the action. Worse, the action would sit there waiting for another action and then get applied. Now, if we're in tablet, we set the next action so that the single call will commit when the animation completes. A proper fix probably involved rewriting all of this logic and is not something I want to touch this late in the release. Change-Id: Iaa7b4c7d21837b93916ada5b6c9b49b13361be08
* Show priority indicators (chevrons).Andrew Sapperstein2014-03-061-9/+16
| | | | | | | | | Fixes b/7961430. Creates a new account setting called showChevronsEnabled that, if true, results in the UI showing chevrons. Also properly distinguishes showing chevrons from the show importance marker setting. Change-Id: I767341457ed610309b5729887d121c6fb7c94eba
* Get rid of Account#nameTony Mantler2014-03-031-2/+2
| | | | | | b/13249115 Change-Id: I5478b139cba9e3e37924c3af1c7a4f818a803fa3
* Ensure we perform the action when we can't auto-advanceScott Kennedy2014-01-231-0/+2
| | | | | | | | | | | | If auto-advance was set to "newer" or "older", and you archived all your mail, the final operation would be set as the next operation to perform in the list, but it would never actually get performed. If we _always_ perform the action when a delete is performed, we fix this problem. Bug: 9904716 Change-Id: If1f0ef38a1468defabf81b385839c89334fedbc1
* Unicode wrap subject and snippet in convo list.Andrew Sapperstein2014-01-221-0/+7
| | | | | | Fixes b/5987892. Change-Id: Iaff34c3ca725dd3023a53ba30b916db6fa571232
* misc analyticsAndy Huang2013-11-211-0/+3
| | | | | | | | | | | | | | * lots of new menu items * log auto-advance setting * log message header taps * log photo-viewer menu items * log conversation views (including enclosing label, synced state, message count) * log folder views (including bucketed total counts) * log pager swipes (including folder type) Bug: 11253673 Change-Id: Iffdcbf19b202fbb3b6b33e0f7f0e9e4c24fa948d
* Allow dismissing teaser leave-behinds on user interactionScott Kennedy2013-09-301-0/+7
| | | | | Bug: 10649816 Change-Id: Ie6c0fa00de503ed7beaadf584149e3864c4373e4
* Clean up some comments that referenced old nested foldersScott Kennedy2013-09-301-9/+8
| | | | Change-Id: I193f63ad667e3824daf1e110b42f6b18e9513768
* resolved conflicts for merge of 4df54f8f to jb-ub-mail-ur11Scott Kennedy2013-09-201-56/+7
|\ | | | | | | Change-Id: I7d3e7edab211f7b713d75b2b020c746bcdf87d1a
| * Hierarchical folders in conversation listScott Kennedy2013-09-191-56/+7
| | | | | | | | | | | | | | | | | | Use something similar to the sectioned inbox teaser. Allow expanding/collapsing when there are too many folders. Bug: 9604590 Change-Id: I6cc79bd7c033bbf13c750e7720fe71227b38cc85
* | More svelte changesAlice Yang2013-09-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | - Re-enable sender images, but change the cache size of loaded images to 0 (instead of default of 300K) - Disable preloading of conversations in CV (for navigation to previous and next conversation) Bug 9325758, 9325806 Change-Id: Ifd70e47e1e0f5d378e4cb8c91208516a26da1db0
* | Use Drawables for senders image. Less animation jank, less GC jank, less memory.Mark Wei2013-09-131-33/+42
|/ | | | | | | | | | | | | | | | | | | | | | | | Protip: When testing sender images, go to your Sent folder. Tons of senders images appear because you are most likely to talk to people in your address book. Rewrite UI to use modular Drawables. It's much easier to understand, since Drawables with different functionality can be composed. Flipping animation is 10x smoother. Handles quick double-tap on senders image correctly. Letter tiles are not allocated bitmaps anymore. They simply draw a rect and a letter to the canvas. We are no longer allocating large bitmaps for every list item. We reuse Bitmaps whenever possible the same way that attachment previews do. Much smaller 339KB cache since we don't share with attachment previews anymore, just enough to fit 10 off-screen contact images. Bug: 10429228 Change-Id: I463b63520d881eefe3974dccf295366831adaf9e
* Remember our scroll position when we return to conv listScott Kennedy2013-08-301-2/+8
| | | | | | | Do this manually until we have a real backstack. Bug: 10533759 Change-Id: Ia97950837aa060d374e0a015eb1ff5db1cc3392d
* Fix a couple ad bugsScott Kennedy2013-08-281-0/+12
| | | | | | | | | | | 1. Show a new ad when we leave the conversation list and return 2. Do not show a new ad immediately after dismissing an ad 3. Eliminate some GCs and logspam 4. Don't send up a "shown" operation on rotation. Bug: 10499269 Bug: 10531721 Change-Id: I7e366bd2f1bde5f50764cc3240ac0870a4eda49f
* Log.wtf() if we call notifyDatasetChanged() off main threadScott Kennedy2013-08-281-0/+7
| | | | | Bug: 9527863 Change-Id: I4e65cc576173669f14c24b89d2dbcf265b74519f
* Remove an unused fieldScott Kennedy2013-08-271-4/+0
| | | | Change-Id: Iea0eab6ffb4633b7083325185e65c1b9b87d3216
* Fix long-pressScott Kennedy2013-08-271-3/+24
| | | | | | | | | | | | | | | The CAB mode teasers were having their dismiss animations run when CAB mode was entered, even if they weren't being displayed. As part of this dismissal, notifyDatasetChanged() was being called, which caused the conversation being selected to have its view recycled during the long press, which then triggered a short press. We were also unnecessarily calling notifyDatasetChanged() when the account's sync status changed. Bug: 10442289 Change-Id: Iefb784f60cf99ac10ae1b0785777a0e4711b2368
* Prevent an NPEScott Kennedy2013-08-231-0/+1
| | | | | | | By actually setting the adapter on NestedFolderView. Bug: 10461002 Change-Id: I19bbc7d7cdaec446aaa2ee58b8ab53b2026388e7
* Add a method to determine if we're in CAB modeScott Kennedy2013-08-231-0/+5
| | | | | Bug: 10412273 Change-Id: I60387f3de0086420480d10902a0e3ee87fa9e79a
* Merge "log notifications" into jb-ub-mail-ur10Andy Huang2013-08-231-0/+4
|\
| * log notificationsAndy Huang2013-08-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | Also fix a long-standing issue that caused notification intents to never get updated during development (we weren't setting FLAG_UPDATE_CURRENT). We can remove the version tag from the intent data URI later. Log reply/reply-all setting. Bug: 9861033 Change-Id: I49b2ab529de4167d1c8b42a8b053bcc2b9f65a23
* | Make the right edge more performantScott Kennedy2013-08-221-1/+5
|/ | | | | Bug: 9177552 Change-Id: I4250825bb658209166744ad1cb0455d4ac81da34
* Add the right edge line to all teasers on tabletsScott Kennedy2013-08-221-1/+1
| | | | | Bug: 9177552 Change-Id: I5270a0ae2196e9a6f732ed6d3327ffe3d30f34be
* Show the selected state on an ad on two paneScott Kennedy2013-08-191-0/+10
| | | | | | | Also show the selected caret Bug: 10212376 Change-Id: I075b2aebfbe869c658108f7d36109ad70402b4c7
* Fix some remaining ad teaser issuesScott Kennedy2013-08-191-0/+6
| | | | | | | 1. Disable interaction while in CAB mode Bug: 10212376 Change-Id: I2206ef4336bc9a2538c236479df837caa5724e8c
* more metricsAndy Huang2013-08-141-0/+6
| | | | | | | | | | | Reorg category/action/label to be more economical. This gives us an extra slot for data vs. spending on custom dimensions in the future. Log CAB actions, some settings state, drawer toggles, CAB mode start, swipe dismiss, and peek. Bug: 9861033 Change-Id: I16b30356db70f60ed87749f29ddd667790acbb07
* Change special views to update the view inside of getView()Scott Kennedy2013-08-091-2/+3
| | | | | | | | Rather than doing view updates in onUpdate(), add a new method, onGetView(), that is called before returning the special view from getView() in AnimatedAdapter(). Change-Id: Ie98fad2d2296842e1edd648db06aa472486de5e4
* Make some changes so the ad leave-behind can animateScott Kennedy2013-08-081-1/+0
| | | | | | | | | | | | | First, rename INVISIBLE to something so we aren't hiding View.INVISIBLE. Second, create a static method for the fade-in animation of the text so that the ad teaser can use the same code. Third, modify CIV so that we don't need to be contained in a SCIV for animations to work. Change-Id: Ib89015529871bc2b7eba191dd88a4185948927ea
* Bust some jank.Mark Wei2013-08-071-3/+3
| | | | | | | | | | Avoid view inflation in coordinates constructor. 22ms -> 14ms. Sleep background decode tasks sooner during fling. This avoids the 30ms GC alloc that may occur when we create file descriptors and use them to decode bounds. Bug: 10132860 Change-Id: I44bb731dde18efcc95e789f53247eca213d5804e
* Fix missing trace ends.Mark Wei2013-08-071-0/+2
| | | | Change-Id: Ib119d8b2353d2c08e5a5841675a15bcb4676ae71