History log of /frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e91aa0fa64db892194ba82ec7d41df6fb9185471 19-Sep-2012 Romain Guy <romainguy@google.com> Compute GradientDrawable's opacity correctly

The current implementation of GradientDrawable always assumes the shape needs
to be blended. This causes all windows to be considered translucent by default.
This change recomputes the opacity as needed to ensure windows are marked
opaque when they should.

Change-Id: Iaf291d889a6c5122ab00c9f5781df3e7f61547fa
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
5f49c3023a512efbef8bc9515d310c7a72be4af2 07-Sep-2012 Romain Guy <romainguy@google.com> The drawables cache strikes again
Bug #7117785

Draawables created from the ConstantState cache found in Resources must be
mutated before they can be safely modified by apps. Failure to do so results
in all drawables sharing the same constant state to be affected by the
modification.

In the case of the bugreport above, the status bar code plays tricks with
a background drawable and modifies its color to implement a fade in/out
effect. This drawable comes from a cached resource (color 0x0) and the
modifications made by the status bar apply to other clients of this drawable,
most notably the recents panel.

This change fixes several things:
- Simplifies colors caching by removing the assetCookie from the key. This
should result in better reuse of cached drawables
- Makes View.setBackgroundColor() honor the mutate() contract
- Ensure StateListDrawable properly mutates its children before modifying
them
- Optimize Bitmap/ColorDrawable to mark them mutated when they are not
created from an existing ConstantSate. The same optimization should be
applied to other drawables in the future

Change-Id: I54adb5d5b914c7d8930bf9b46f7e3f9dcbf4bcab
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
bbd51f1e360b22eece1d74bd65c7e6a0b59dee59 19-Apr-2012 Philip Milne <pmilne@google.com> Share Insets instances between views that have the same background (Drawable)

Change-Id: I47d93ccca6f553b678d25966d10d7a0a97cfa5ea
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
1557fd7809078e421f751efc7d2539b3efdc54b2 05-Apr-2012 Philip Milne <pmilne@google.com> Fix for bug 6110465.

Add layout bound metadata to 9-patch files and make layouts take them into account.

This CL contains a proposed API for dealing with layout bounds.

This solution exposes:

1. Class: Insets - for storing layout Insets (and later possibly padding).
2. Methods: View:(get/set)LayoutInsets() - for storing layoutBounds.
3. Methods: ViewGroup:(get/set)LayoutMode() - for controlling layoutMode.

It also iuncudes the changes to GridLayout to support layout bounds.

Change-Id: I60c836b6530b61c5abf37f93ee9c44aad73573f1
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
a0ac98bd5cb550319221c1d60277e07a9d2e3a91 25-Jun-2011 Jeff Sharkey <jsharkey@android.com> Finish any enter animation when jumping to state.

When jumpDrawablesToCurrentState(), finish any alpha animation in
progress. Fixes bug where drawable with enter fade would remain
transparent until next state change.

Change-Id: Ia087f935566a8d78e0efdcb0a1a2f791db05c70e
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
6efd2bad954e0e5bd74916a32f036a0f149dcd4d 13-Jan-2011 Christopher Lais <chris+android@zenthought.org> Don't drop the drawable cache completely on configuration change

There was a lot of fancy code just above the clear to ensure
that drawables that aren't affected by the change are kept,
then the entire array was cleared. This patch removes the
clear, so that the drawables that haven't changed are really
kept, matching the logs, comments and larger part of the code.

This patch also fixes the various constant states to return
correct ChangingConfigurations.

Change-Id: Ic11f6179537318d3de16dc58286989eb62a07f15
Old-Change-Id: I22495e6ed232dfe056207ce5155405af1fa82428
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
f2a47782f31b58d2d31bd00b50fe43604af8b9c2 15-Dec-2010 Romain Guy <romainguy@google.com> Make Drawable.mCallback a WeakReference.

Many memory leaks occur because of long lived drawables. This should
help.

Change-Id: I2e9e8dee26579ec56e8e73f08f6b1d62be7812d9
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
079e23575024e103358c982152afb7a720ae1a8a 19-Oct-2010 Dianne Hackborn <hackbod@google.com> Add new fade in/out feature for drawable containers.

This is used to allow list view's pressed and activated indicators
to fade in an out, though of course it can be used elsewhere as well.

There is a lot of complexity in supporting this in list view. The
two main things that are being dealt with:

- When recycling views, we need to make sure that the view's drawable
state doesn't get animated from an old row's state. The recycler
now keeps track of which position a view was last in, and if it is
reused at a new position there is a new View/Drawable API to tell
it to jump to its current state instead of animating.

- For the pressed indicator to fade out, we need to keep displaying it
after it is hidden. There are new variables and code to keep track
of this state, and tweaks in various places to be able to remember
the last selected position and continue updating the drawable bounds
as needed.

Change-Id: Ic96aa1a3c05e519665abf3098892ff2cc4f0ef2f
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
78aaa97b77d56e35e994611406deb398eb9005db 10-Apr-2010 Gilles Debunne <debunne@google.com> New MipmapDrawable class.

This Drawable holds different scaled version of a Drawable and use the appropriate one
depending on its actual bounds to minimize scaling artifacts.

Change-Id: I4ced045d73c1ddd8982d9aaf39c3599b3ac58a16
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
a41581ed4033004c73115113f45b9844e9b0210f 17-Sep-2009 Romain Guy <romainguy@android.com> Add StateListDrawable's dither flag to the constant state.

Change-Id: Ie377bfe3dfb83c33df3c0cc5a02810332a60a322
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
c2974809373697147cbe5754835cc871fb93aef1 14-Sep-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2116977: buttons are huge and bent

Now that we are using preloaded drawables in compatibilty mode, when
constructing them from their constant state we need to set the new
drawable's target density appropriately.

Change-Id: I3665cbea09d38b9ac5f45f8c380dc8641f86b266
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
211db4a2874f1a2d0e7a8cb8d33e81fa08801763 11-Sep-2009 Mike Reed <reed@google.com> change default for dither to true
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
1010ac9b7c52b1e2a64e8e1f4dcdb4d79f4d32cc 11-Aug-2009 Romain Guy <romainguy@android.com> Fix possible NPE when mutating a DrawableContainer
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
5140141c2637b89ad0d86c3b715459a1e7b92729 22-Jul-2009 Romain Guy <romainguy@android.com> DrawableContainer was not respecting the value returned by Drawable.getPadding(Rect).

Before this change, DrawableContainer would always return true from getPadding(Rect)
even if all of its children were returning false from getPadding(Rect). This change
modifies this behavior to respect getPadding(Rect): mConstantPadding is kept null
when getPadding(Rect) returns false for all of the children and a flag is set
to avoid recomputing that value every time getConstantPadding() is invoked.
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
6be507cc66863a08f08d6c0675e5bc11e5a45d32 30-Jun-2009 Phil Dubach <phillipd@google.com> Fix NullPointerException in DrawableContainer.mutate()

DrawableContainerState.mDrawables is an array which may be only partially
filled, as can be seen in the constructor and the addChild() method.

DrawableContainer.mutate() wrongly assumed that the array does not contain
null references.
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
83b2107c4d2f07f46b6ae663115421749486f8b1 12-May-2009 Romain Guy <romainguy@android.com> Fixes #1846038. DrawableContainer was wrongly returning its opacity by ignoring the visibility of the currently selected layer. This change simply reports a TRANSPARENT opacity if there is no currently selected layer of if the selected layer is not visible. Otherwise it reports the opacity computed by the state class.
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/graphics/java/android/graphics/drawable/DrawableContainer.java