summaryrefslogtreecommitdiffstats
path: root/src/com/android/mail/photomanager/LetterTileProvider.java
Commit message (Collapse)AuthorAgeFilesLines
* Don't assume that a string isn't emptyMarcos Marado2015-10-181-1/+1
| | | | | | Fixes DOGEDUMP-1106 Change-Id: I8eb67deac2e4190d4df40998d992490fcea47db6
* Updated anonymous avatar.Andrew Sapperstein2014-09-191-1/+1
| | | | | | Fixes b/17476433 Change-Id: Icff94bc766cedcc8172a5dd6a6d31b25aef0add6
* New generic avatar. b/17476433Andrew Sapperstein2014-09-181-2/+1
| | | | Change-Id: I75f143584e1cea15f1507b500c54c478e5475ec1
* Allow LetterTileProvider to use a defined fontsizeRégis Décamps2014-09-091-13/+12
| | | | | | | | | | Also refactors the bitmap cropping into a circle from MessageHeaderView into BitmapUtil and makes NotificationUtils use that method as well. Bug: 16875798 SetupAddressesActivity: Show letter avatar if none Bug: 16378212 Draw letter tile for non-Gmail avatars in Account switcher Change-Id: I375990e3df331ff9952652d5f06a4f4f8d133e48
* Refactoring in ContactDrawable to pick a color.Régis Décamps2014-09-021-15/+6
| | | | | | | | | | | Strategy pattern to pick a color in the letter tile. Thanks to this, subimplementations can draw the letter tiles for avatars differently, and still use the all the features of the ContactDrawable. Bug: 16378212 Draw letter tile for non-Gmail avatars Change-Id: I999aa43724ba0e4dd23f2106133aaa34ee3ba008
* New letter tile palette. b/16219169Andrew Sapperstein2014-07-181-4/+3
| | | | Change-Id: If0ec83382974aa5e1b34fcba2187b03c7b31371d
* LetterTileDrawable colors from Contacts & BabelBrian Attwell2014-06-251-1/+1
| | | | | | | | | | | Right now gmail is 1) using different LetterTileDrawable colors than Contacts or Babel. 2) picking colors by based on a different hash function This CL only addresses (1). Bug: 15889179 Change-Id: I4cab1669e448fc47350777a3ed69127e1fcb2a40
* Use Drawables for senders image. Less animation jank, less GC jank, less memory.Mark Wei2013-09-131-30/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Attachments in Conversation List: Backend changes so that the appropriateMark Wei2013-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attachments are passed to the UI. Implement PhotoManager so we can start showing images. Upon sync, we extract two image attachments from the first unread message, and add them to the conversations table. UI changes as well. Load BEST if that is available, else load SIMPLE. No vertical dividers in attachment previews. Attachment previews are above labels. Round badge appears for unread conversations when there are more images than shown. Only appears after the previews have loaded. Clicking on the attachment previews launches photoviewer. Attempt to load bigger images than necessary to prevent reloading during mark read/unread and rotate. Show animated loading icon while previews are loading. Previews load from top to bottom, from left to right. Big performance improvements: No longer decoding bitmap on UI thread. This kills most of the jank. Only load when we are not scrolling. This kills a lot of jank. Remaining jank will be delt with later: DividedImageCanvas.setDimensions() creates a huge empty bitmap on the UI thread, which causes a GC. ath will fix. Multiple images in one line now load whatever's ready first. Added tracing. Bitmap cache given more memory. Following ath's advice, decode Bitmap from InputStream rather than byte[]. Don't compress into BitmapHolder. Only use the bigger Bitmap cache. Bug: 7481049 Change-Id: Icf823f56abc9345e6d0b800a1e6d45444d8fa028
* Use letter tiles in notificationsScott Kennedy2013-06-271-13/+22
| | | | | | | | For notifications where we would display a contact photo if it existed, we will now show a letter tile if we can make one. Bug: 9597536 Change-Id: Idb060d2c055074ff930154c12ddfff7d960dbf75
* Clean up a bunch of warningsScott Kennedy2013-06-251-1/+0
| | | | | Bug: 9565838 Change-Id: Ie3a380581e81c63aaa0764875c55bfdccd5f2b13
* Use icon with colored background for sender image.Andrew Sapperstein2013-05-061-15/+22
| | | | | | | | | | | | Fixes b/8794452. Instead of defaulting to boring grey man, we now use the same colored background when we don't have a sender image and draw a generic white icon on top of the color. Also, deleted LetterTileUtils since we no longer use it. Change-Id: I3b905afdffbc70eeeca4f030dc57f5ab3748ee64
* Revert "Add analytics support"Paul Westbrook2013-05-011-1/+1
| | | | | | | This reverts commit cebb805a486d38bca50009905777e170b375b066. Bug: 8764535 Change-Id: I70092a456bcfeda2e60f93e747e5e9097df0b77e
* Add analytics supportPaul Westbrook2013-04-261-1/+1
| | | | | | | This adds support for analytics, and tracks how popluated the letter tiles are. Change-Id: I59e699cf455f1b80d585bf809786912a67d9aed6
* am 65e5a530: Merge "Everybody loves colors" into jb-mr2-devAlice Yang2013-04-251-1/+1
|\ | | | | | | | | * commit '65e5a530c22295d3572b64c0703060979fd93f39': Everybody loves colors
| * Everybody loves colorsAlice Yang2013-04-251-1/+1
| | | | | | | | | | | | Bug 8701175 Change-Id: I1509856f61763f05971b28a20e5fbfd771d8254e
* | don't generate a default tile again when contact lookup failsAndy Huang2013-04-231-2/+7
| | | | | | | | | | | | | | a small win. Bug: 8051779 Change-Id: Icd0af6be6b9f5646af9d202253cae12d0ab10eb3
* | optimize contact photos in listAndy Huang2013-04-191-69/+80
|/ | | | | | | | | | | | | | | | | | | | | | Overhaul the photo manager: * lower the thread priority of the worker thread * in addition to having the worker thread load JPEG images from disk, have it decode those images into exactly-sized, properly cropped bitmaps that the UI thread can use without further processing * ignore stale requests that are now more likely to occur when list view recycling reuses a canvas before a default image for an old request is applied Minor optimizations throughout photo and tile loading codepath. Recreate bitmaps when the canvas size changes, as it does on 2-pane when switching between wide and normal layouts. Fix default bitmap drawing (for non-English senders) when applied to HALF or QUARTER scale. Bug: 8051779 Change-Id: Ic3a5451538ddc2c955b645eb06816266542363d8
* CleanupScott Kennedy2013-04-051-6/+4
| | | | Change-Id: Iee8abf75639450d469632e43fe0e102b687558db
* Give color to letter tilesAlice Yang2013-04-041-9/+21
| | | | Change-Id: Ic94cd0d5e138ebec13fd43a5e409d43a50a3c2e2
* Attachments in Conversation List: UI changes to display attachment previewsMark Wei2013-04-031-0/+15
| | | | | | | | | | | in the conversation list. Depends on: PhotoManager: https://googleplex-android-review.googlesource.com/#/c/285814/ Backend: https://googleplex-android-review.googlesource.com/#/c/289305/ Bug: 7481049 Change-Id: I284ec722bb0ed0ddb8b27804c0ee5591ef672032
* Refactor ContactPhotoManager so we can reuse its preloading and cachingMark Wei2013-04-021-9/+17
| | | | | | | | | | | | | | mechanisms for other tasks. I've elevated all the generic preloading and caching code to an abstract PhotoManager class. ContactPhotoManager now extends this class, and contains all the contacts specific code. I will be creating a new AttachmentPhotoManager subclass later, so that I can take advantage of PhotoManager. Other refactored classes are DividedImageCanvas and PhotoLoaderThread. Bug: 7481049 Change-Id: I2535ab33af9c1cd074ca1ee29153499383ed5389
* Speedup creating letter tilesmindyp2013-01-281-35/+40
| | | | | | | | | | Fixes b/8051779 Framerate is slow for the list view with tiles When this becomes a library, will want this to be fast Minor cleanup Since creating the sized background bitmaps is the most expensive op, creating them once and caching the backgrounds for re-use makes this more efficient. Change-Id: Ie178ab662bf5f8f9234d20abd6c30f37ee90239a
* Make it possible to show numbers or letters in scrabble tiles.mindyp2013-01-251-2/+2
| | | | | | | | Fixes b/8051960 Gmail scrabble tile doesn't show content for senders who names starts with a number When this becomes a library, will want this functionality Change-Id: Iecf9fc6ec793822c8a4699d34a978a1d580214d1
* Small tweaks to polish the tilesmindyp2013-01-171-6/+4
| | | | Change-Id: I776ebf36a2b6d36b308a13cfc021ff96084eb1ad
* Add white line dividers between multiple contact images; better centering of ↵mindyp2013-01-171-42/+10
| | | | | | tiles; use roboto for tile letters Change-Id: Id3d8531019783518e4df75cf5c2f1d35dac8d48c
* New redlines for scrabble tiles; use people default contact icon as fallbackmindyp2013-01-171-31/+79
| | | | | This is ic_contact_picture provided from the chips library Change-Id: Id3f51949f11a3017362d89bdc40daf54e0e158db
* Improved scaling for letter tiles; match only us lettersmindyp2013-01-111-28/+42
| | | | | | | | Change-Id: Ic9b89d5fdd262a5a8bcb0ca797ae005db8d65783 Note: tiles are still disabled Conflicts: src/com/android/mail/photomanager/LetterTileProvider.java
* Fix issue with "me" contact photo never showing up; show gray guy for ↵mindyp2013-01-101-3/+6
| | | | | | default image Change-Id: I9b02c17fc389737cb63831b5075610f39f510aa7
* Make sure the character rendered in the default tile is always upper casemindyp2013-01-081-1/+1
| | | | Change-Id: I77966f64ff45992ce7fb7ecc84c2df5ddb71d947
* fixup algorithm for which sender photos we need to show pictures formindyp2013-01-071-7/+7
| | | | | | | | | | | | Algorithm: 1) show pic for first sender 2) show pic for last 3 senders, ellided or not Also, messages from "me" should show my contact icon Make sure we just use characters for the tiles: fixes b/7959815 Problems with sender "letter" Change-Id: I1b713df0cd12b3ca324fa4f6492ed337f867a434
* Sender emails are now available. Use the senders email to lookup their ↵mindyp2013-01-041-0/+101
contact photo. Creates the DividedImageCanvas, a light weight way of collecting and rendering sender images to a canvas than a standard android view. Also, allows us to get bitmap processing off the main thread in a future perf related cl TODO: perf pass; implement correct visual design for letter tiles once available Change-Id: I67b8f74f40703543609d1011098062c98e3e42cc