summaryrefslogtreecommitdiff
path: root/src/com/android/mail/bitmap/ContactDrawable.java
Commit message (Collapse)AuthorAgeFilesLines
* Fix wrong color in ContactDrawableRégis Décamps2014-09-291-7/+8
| | | | | | | | The ColorPicker is static, which prevents setting different color pickers for different types of accounts. Bug: 16875798 SetupAddressesActivity: Show letter avatar if none Change-Id: Ic26501e7b1e60a65558e2d19d06e00ba404cb4bc
* Prevent contact icons from croppingJin Cao2014-09-261-220/+7
| | | | | | | | | | | | | | | | | | | | | | The main issue is caused by DecodeTask when the decoded bitmap is bigger than the desired size. In some situations, the algorithm will crop the decoded bitmap down to the desired size. Since the size returned from the API is always capped at 96px by 96px, we can just use that when building our bitmap buffer size so that DecodeTask will rarely (I say rarely because it's possible for the user to upload a 10px by 10px contact photo, but that is extremely rare considering how big 96x96 is) have to crop the resulting image when decoding. The destination (either ImageView or an image drawable) will then scale the image accordingly. I also noticed a LOT of overlap between AccountAvatarDrawable and ContactDrawable, so I refactored them into a common base class and allow child classes to override default drawable. b/17319292 Change-Id: I96b9fe39769e434fb45cebe11f9699d3259960df
* Updated anonymous avatar.Andrew Sapperstein2014-09-191-1/+1
| | | | | | Fixes b/17476433 Change-Id: Icff94bc766cedcc8172a5dd6a6d31b25aef0add6
* New generic avatar. b/17476433Andrew Sapperstein2014-09-181-1/+1
| | | | Change-Id: I75f143584e1cea15f1507b500c54c478e5475ec1
* Allow LetterTileProvider to use a defined fontsizeRégis Décamps2014-09-091-1/+1
| | | | | | | | | | 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-17/+27
| | | | | | | | | | | 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
* Fix NPE when ContactProvider or Bitmapcache are not setRégis Décamps2014-09-021-4/+12
| | | | | | | | | Let ContactDrawable draw the letter tile when ContactProvider unset. Don't use the cache if it's null. Bug: 16875798 SetupAddressesActivity: Show letter avatar if none Change-Id: I59a69fb533b30c9b8cfc8a39be7ca226459910fe
* New letter tile palette. b/16219169Andrew Sapperstein2014-07-181-4/+3
| | | | Change-Id: If0ec83382974aa5e1b34fcba2187b03c7b31371d
* Implement circular icons in Conversation ListJames Lemieux2014-07-151-26/+71
| | | | | | | | | | This crosscuts three UI elements: - the border around contact images - the border around letter tiles - the border around checkmarks Change-Id: I86dee47282cded696d7658a87e69223244358d68
* Replace all references to UnifiedEmail's com.android.oldbitmap withJames Lemieux2014-07-111-5/+20
| | | | | | | | | 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
* conversation footer b/15595931Andrew Sapperstein2014-07-031-1/+1
| | | | Change-Id: I9eda1060f4e49a0448a321f603aec0a254daf86a
* 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
* Change the layout of the account selectorMartin Hibdon2014-03-261-2/+3
| | | | | | b/12099292 Change-Id: Ie14ab2a534bacd915421a7083c9c3e3cc6b01a4b
* Use Drawables for senders image. Less animation jank, less GC jank, less memory.Mark Wei2013-09-131-0/+252
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