Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
7078f354
Commit
7078f354
authored
Dec 20, 2019
by
Evan W. Patton
Committed by
Jeffrey Schiller
Jan 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix adaptive icon scaling in latest release
Change-Id: I43c94d0c8c099174b10914b189e52afbf63f0ac3
parent
fec8a048
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
appinventor/aiplayapp/assets/AI2Companion-Icon.png
appinventor/aiplayapp/assets/AI2Companion-Icon.png
+0
-0
appinventor/buildserver/src/com/google/appinventor/buildserver/Compiler.java
...rver/src/com/google/appinventor/buildserver/Compiler.java
+4
-7
No files found.
appinventor/aiplayapp/assets/AI2Companion-Icon.png
View replaced file @
fec8a048
View file @
7078f354
2.58 KB
|
W:
|
H:
87.4 KB
|
W:
|
H:
2-up
Swipe
Onion skin
appinventor/buildserver/src/com/google/appinventor/buildserver/Compiler.java
View file @
7078f354
...
...
@@ -794,11 +794,7 @@ public final class Compiler {
out
.
write
(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
);
out
.
write
(
"<adaptive-icon "
+
"xmlns:android=\"http://schemas.android.com/apk/res/android\" "
+
">\n"
);
out
.
write
(
"<background android:drawable=\"@color/ic_launcher_background\" />\n"
);
if
(
isRound
)
{
out
.
write
(
"<foreground android:drawable=\"@mipmap/ic_launcher_round\" />\n"
);
}
else
{
out
.
write
(
"<foreground android:drawable=\"@mipmap/ic_launcher_foreground\" />\n"
);
}
out
.
write
(
"</adaptive-icon>\n"
);
out
.
close
();
}
catch
(
IOException
e
)
{
...
...
@@ -1766,8 +1762,9 @@ public final class Compiler {
*/
private
BufferedImage
produceForegroundImageIcon
(
BufferedImage
icon
)
{
int
imageWidth
=
icon
.
getWidth
();
// Ratio of icon size to png image size for foreground/round icon is 0.80
double
iconWidth
=
imageWidth
*
0.80
;
// According to the adaptive icon documentation, both layers are 108x108dp but only the inner
// 72x72dp appears in the masked viewport, so we shrink down the size of the image accordingly.
double
iconWidth
=
imageWidth
*
72.0
/
108.0
;
// Round iconWidth value to even int for a centered png
int
intIconWidth
=
((
int
)
Math
.
round
(
iconWidth
/
2
)
*
2
);
Image
tmp
=
icon
.
getScaledInstance
(
intIconWidth
,
intIconWidth
,
Image
.
SCALE_SMOOTH
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment