From bdffdd52fa37bb94470a6ef079fb4163b5609f70 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Wed, 28 Jun 2017 09:49:47 -0700 Subject: Hide all color hints references Change-Id: I9714bf8a982e0f58cab7e707129e81ee3d8cf5db Fixes: 63096109 Test: make --- api/current.txt | 4 +--- api/system-current.txt | 4 +--- api/test-current.txt | 4 +--- core/java/android/app/WallpaperColors.java | 32 +++++++++++++++++++----------- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/api/current.txt b/api/current.txt index d7f8ecd0f606..6b1805806cd9 100644 --- a/api/current.txt +++ b/api/current.txt @@ -6089,17 +6089,15 @@ package android.app { public final class WallpaperColors implements android.os.Parcelable { ctor public WallpaperColors(android.os.Parcel); - ctor public WallpaperColors(android.graphics.Color, android.graphics.Color, android.graphics.Color, int); + ctor public WallpaperColors(android.graphics.Color, android.graphics.Color, android.graphics.Color); method public int describeContents(); method public static android.app.WallpaperColors fromBitmap(android.graphics.Bitmap); method public static android.app.WallpaperColors fromDrawable(android.graphics.drawable.Drawable); - method public int getColorHints(); method public android.graphics.Color getPrimaryColor(); method public android.graphics.Color getSecondaryColor(); method public android.graphics.Color getTertiaryColor(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; - field public static final int HINT_SUPPORTS_DARK_TEXT = 1; // 0x1 } public final class WallpaperInfo implements android.os.Parcelable { diff --git a/api/system-current.txt b/api/system-current.txt index 85e917563602..62be1d3f9377 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -6299,17 +6299,15 @@ package android.app { public final class WallpaperColors implements android.os.Parcelable { ctor public WallpaperColors(android.os.Parcel); - ctor public WallpaperColors(android.graphics.Color, android.graphics.Color, android.graphics.Color, int); + ctor public WallpaperColors(android.graphics.Color, android.graphics.Color, android.graphics.Color); method public int describeContents(); method public static android.app.WallpaperColors fromBitmap(android.graphics.Bitmap); method public static android.app.WallpaperColors fromDrawable(android.graphics.drawable.Drawable); - method public int getColorHints(); method public android.graphics.Color getPrimaryColor(); method public android.graphics.Color getSecondaryColor(); method public android.graphics.Color getTertiaryColor(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; - field public static final int HINT_SUPPORTS_DARK_TEXT = 1; // 0x1 } public final class WallpaperInfo implements android.os.Parcelable { diff --git a/api/test-current.txt b/api/test-current.txt index ed9071a2eec9..1aaf2883f4d3 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -6110,17 +6110,15 @@ package android.app { public final class WallpaperColors implements android.os.Parcelable { ctor public WallpaperColors(android.os.Parcel); - ctor public WallpaperColors(android.graphics.Color, android.graphics.Color, android.graphics.Color, int); + ctor public WallpaperColors(android.graphics.Color, android.graphics.Color, android.graphics.Color); method public int describeContents(); method public static android.app.WallpaperColors fromBitmap(android.graphics.Bitmap); method public static android.app.WallpaperColors fromDrawable(android.graphics.drawable.Drawable); - method public int getColorHints(); method public android.graphics.Color getPrimaryColor(); method public android.graphics.Color getSecondaryColor(); method public android.graphics.Color getTertiaryColor(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; - field public static final int HINT_SUPPORTS_DARK_TEXT = 1; // 0x1 } public final class WallpaperInfo implements android.os.Parcelable { diff --git a/core/java/android/app/WallpaperColors.java b/core/java/android/app/WallpaperColors.java index 8f172ba806f6..57c7efca5715 100644 --- a/core/java/android/app/WallpaperColors.java +++ b/core/java/android/app/WallpaperColors.java @@ -36,16 +36,9 @@ import java.util.List; /** * Provides information about the colors of a wallpaper. *

- * This class contains two main components: - *

    - *
  • Named colors: Most visually representative colors of a wallpaper. Can be either + * Exposes the 3 most visually representative colors of a wallpaper. Can be either * {@link WallpaperColors#getPrimaryColor()}, {@link WallpaperColors#getSecondaryColor()} * or {@link WallpaperColors#getTertiaryColor()}. - *
  • - *
  • Hints: How colors may affect other system components. Currently the only supported hint is - * {@link WallpaperColors#HINT_SUPPORTS_DARK_TEXT}, which specifies if dark text is preferred - * over the wallpaper.
  • - *
*/ public final class WallpaperColors implements Parcelable { @@ -53,6 +46,7 @@ public final class WallpaperColors implements Parcelable { * Specifies that dark text is preferred over the current wallpaper for best presentation. *

* eg. A launcher may set its text color to black if this flag is specified. + * @hide */ public static final int HINT_SUPPORTS_DARK_TEXT = 0x1; @@ -91,9 +85,8 @@ public final class WallpaperColors implements Parcelable { /** * Constructs {@link WallpaperColors} from a drawable. *

- * Main colors will be extracted from the drawable and hints will be calculated. + * Main colors will be extracted from the drawable. * - * @see WallpaperColors#HINT_SUPPORTS_DARK_TEXT * @param drawable Source where to extract from. */ public static WallpaperColors fromDrawable(Drawable drawable) { @@ -122,9 +115,8 @@ public final class WallpaperColors implements Parcelable { /** * Constructs {@link WallpaperColors} from a bitmap. *

- * Main colors will be extracted from the bitmap and hints will be calculated. + * Main colors will be extracted from the bitmap. * - * @see WallpaperColors#HINT_SUPPORTS_DARK_TEXT * @param bitmap Source where to extract from. */ public static WallpaperColors fromBitmap(@NonNull Bitmap bitmap) { @@ -184,6 +176,20 @@ public final class WallpaperColors implements Parcelable { return new WallpaperColors(primary, secondary, tertiary, hints); } + /** + * Constructs a new object from three colors. + * + * @param primaryColor Primary color. + * @param secondaryColor Secondary color. + * @param tertiaryColor Tertiary color. + * @see WallpaperColors#fromBitmap(Bitmap) + * @see WallpaperColors#fromDrawable(Drawable) + */ + public WallpaperColors(@NonNull Color primaryColor, @Nullable Color secondaryColor, + @Nullable Color tertiaryColor) { + this(primaryColor, secondaryColor, tertiaryColor, 0); + } + /** * Constructs a new object from three colors, where hints can be specified. * @@ -194,6 +200,7 @@ public final class WallpaperColors implements Parcelable { * @see WallpaperColors#HINT_SUPPORTS_DARK_TEXT * @see WallpaperColors#fromBitmap(Bitmap) * @see WallpaperColors#fromDrawable(Drawable) + * @hide */ public WallpaperColors(@NonNull Color primaryColor, @Nullable Color secondaryColor, @Nullable Color tertiaryColor, int colorHints) { @@ -307,6 +314,7 @@ public final class WallpaperColors implements Parcelable { * * @see WallpaperColors#HINT_SUPPORTS_DARK_TEXT * @return True if dark text is supported. + * @hide */ public int getColorHints() { return mColorHints; -- cgit v1.2.3-59-g8ed1b