Skip to content

Commit

Permalink
[M3][Colors] Add supporting brand list of dynamic colors
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 413825567
  • Loading branch information
Material Design Team authored and josefigueroa168 committed Dec 6, 2021
1 parent acb7958 commit b2f05d5
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -49,6 +49,9 @@ public class DynamicColors {
"infinix mobility limited", "hmd global", "sharp", "sony", "tcl", "lenovo", "google",
"robolectric"));

private static final Set<String> DYNAMIC_COLOR_SUPPORTED_BRANDS =
new HashSet<>(Arrays.asList("jio"));

private static final int USE_DEFAULT_THEME_OVERLAY = 0;

private static final Precondition ALWAYS_ALLOW = new Precondition() {
Expand Down Expand Up @@ -221,7 +224,8 @@ public static Context wrapContextIfAvailable(
@ChecksSdkIntAtLeast(api = VERSION_CODES.S)
public static boolean isDynamicColorAvailable() {
return VERSION.SDK_INT >= VERSION_CODES.S
&& DYNAMIC_COLOR_SUPPORTED_MANUFACTURERS.contains(Build.MANUFACTURER.toLowerCase());
&& (DYNAMIC_COLOR_SUPPORTED_MANUFACTURERS.contains(Build.MANUFACTURER.toLowerCase())
|| DYNAMIC_COLOR_SUPPORTED_BRANDS.contains(Build.BRAND.toLowerCase()));
}

private static int getDefaultThemeOverlay(@NonNull Context context) {
Expand Down

0 comments on commit b2f05d5

Please sign in to comment.