Commit 4e6d3500 authored by Henry Jian's avatar Henry Jian Committed by Commit Bot

[Android WebAPKs] Allow new splash webapk to mask splash icon

Previously, new splash webapks were not masking adaptive icon when
it was used in splash screen. This CL fixes that.

Bug: 977173
Change-Id: I6a38aec93369d6d7fda4fbba38f483c25b9b5960
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1891138Reviewed-by: default avatarPeter Kotwicz <pkotwicz@chromium.org>
Commit-Queue: Henry Jian <hzjian@google.com>
Cr-Commit-Position: refs/heads/master@{#710967}
parent 92e743c3
......@@ -12,4 +12,4 @@
# //chrome/android/webapk/shell_apk:webapk is changed. This includes
# Java files, Android resource files and AndroidManifest.xml. Does not affect
# Chrome.apk
current_shell_apk_version = 115
current_shell_apk_version = 116
......@@ -30,8 +30,14 @@ public class SplashUtils {
Bitmap icon = WebApkUtils.decodeBitmapFromDrawable(resources, R.drawable.splash_icon);
int backgroundColor = WebApkUtils.getColor(resources, R.color.background_color_non_empty);
boolean isIconAdaptive = false;
try {
isIconAdaptive = resources.getBoolean(R.bool.is_splash_icon_maskable);
} catch (Resources.NotFoundException e) {
}
FrameLayout layout = new FrameLayout(context);
SplashLayout.createLayout(context, layout, icon, false /* isIconAdaptive */,
SplashLayout.createLayout(context, layout, icon, isIconAdaptive,
false /* isIconGenerated */, resources.getString(R.string.name),
WebApkUtils.shouldUseLightForegroundOnBackground(backgroundColor));
layout.setBackgroundColor(backgroundColor);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment