OSDN Git Service

Set default outline alpha to 1.0f
authorChris Craik <ccraik@google.com>
Mon, 4 Aug 2014 20:42:18 +0000 (13:42 -0700)
committerChris Craik <ccraik@google.com>
Mon, 4 Aug 2014 20:53:41 +0000 (20:53 +0000)
bug:16795461
Change-Id: I7ccecee84b47a2bbf91fc11ad3005160f913ba77

core/java/android/view/View.java
core/java/android/view/ViewOutlineProvider.java

index 7e16c7d..a8d2bef 100644 (file)
@@ -10830,13 +10830,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
         // Unattached views ignore this signal, and outline is recomputed in onAttachedToWindow()
         if (mAttachInfo == null) return;
 
-        final Outline outline = mAttachInfo.mTmpOutline;
-        outline.setEmpty();
-
         if (mOutlineProvider == null) {
             // no provider, remove outline
             mRenderNode.setOutline(null);
         } else {
+            final Outline outline = mAttachInfo.mTmpOutline;
+            outline.setEmpty();
+            outline.setAlpha(1.0f);
+
             mOutlineProvider.getOutline(this, outline);
             mRenderNode.setOutline(outline);
         }
index 4054031..170c5d8 100644 (file)
@@ -37,7 +37,6 @@ public abstract class ViewOutlineProvider {
             if (background != null) {
                 background.getOutline(outline);
             } else {
-
                 outline.setRect(0, 0, view.getWidth(), view.getHeight());
                 outline.setAlpha(0.0f);
             }
@@ -51,6 +50,8 @@ public abstract class ViewOutlineProvider {
      * View's size changes, or if {@link View#invalidateOutline()} is called
      * explicitly.
      *
+     * The input outline is empty and has an alpha of <code>1.0f</code>.
+     *
      * @param view The view building the outline.
      * @param outline The empty outline to be populated.
      */