Skip to content

Commit

Permalink
Correctly size the Android 12 splash screen (#9797)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow authored Aug 31, 2022
1 parent ad3cf94 commit f097f92
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ void WriteDrawable(ResizeImageInfo splash)
writer.WriteAttributeString("xmlns", "android", ns: null, value: Namespace);

writer.WriteStartElement("item");
writer.WriteAttributeString("android", "drawable", Namespace, "@drawable/" + splash.OutputName);
writer.WriteAttributeString("android", "width", Namespace, "108dp");
writer.WriteAttributeString("android", "height", Namespace, "108dp");
writer.WriteAttributeString("android", "gravity", Namespace, "center");

writer.WriteStartElement("bitmap");
writer.WriteAttributeString("android", "gravity", Namespace, "fill");
writer.WriteAttributeString("android", "src", Namespace, "@drawable/" + splash.OutputName);
writer.WriteAttributeString("android", "mipMap", Namespace, "true");

writer.WriteEndDocument();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--This file was auto-generated by .NET MAUI.-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="{drawable}" />
<item
android:width="108dp"
android:height="108dp"
android:gravity="center">
<bitmap
android:gravity="fill"
android:src="{drawable}"
android:mipMap="true" />
</item>
</layer-list>

0 comments on commit f097f92

Please sign in to comment.