Change Splash screen icon shape Android 12 - svg

I would like to use a decent size rectangle shape icon in android 12 splash screen, even though the icon I use is rectangle shape it is always displayed in a circle shape. I saw one question / answer here,
How to change icon shape in Android 12 Splash screen?
If I follow the answer from here, the icon is rectangle but it is small?
Like, this netflix is good size one (which is from android 12 phone), and I would like to make a similar one.

I read the documentation carefully, and it cannot use wider space! It stated
For example, if the full size of an image is 300×300 dp, the icon needs to fit within a circle with a diameter of 200 dp. Everything outside the circle will be invisible (masked).
https://developer.android.com/guide/topics/ui/splash-screen#splash_screen_dimensions
I was using an icon with background originally, so I was able to use only 160dp, however, once change the icon to be without background, I can use 192dp(or 200dp?) as the documentation, which is enough space for us.
I had to modify my image size by adding in our svg file to fit in the circle.
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="1920dp"
android:height="492dp"
android:viewportWidth="1920"
android:viewportHeight="492">
<group
android:pivotX="960"
android:pivotY="246"
android:scaleX="0.65"
android:scaleY="0.17">
<path .../>
<path .../>
</group>
</vector>

Related

What is the safe zone in Android Image Asset Studio

In Android Studio, while creating a Launcher Icon, there is a preview of a "Safe zone" circle that defines a certain padding around the edge of the displayed boundaries.
What does it specifically define?
Adaptive Icons, which are introduced in Android O, allows the system to apply a shape mask on top of your icons, which gives users a more consistent icon theme. Instead of a mixed bag of square & circle icons, users can now be shown all square or all circle icons.
The question is, how big a mask can systems make? Can they clip away 40px (10px from each side) of your icon? How about 80px? 120px? Even 400px? So Google created a rule:
A device OEM can specify a mask that may include a radius that is as short as 33 dp along certain points of the shape.
So the "safe zone" is the area that is guaranteed to not be clipped.
It looks like Android is planning on introducing parallax effects on icons when scrolling in the home screen, when they do, icons that are not completely in the "safe zone" may get see unnatural motion with the background when they are being animated. (See the "Clock" icon, and how it "escapes" the bounds of the background)

Defining viewport and viewbox in SVG to scale shapes with physical real world units

I am confused how to properly define viewport and viewbox in SVG file to convey shapes that have real world physical units.
I am mapping my AutoCAD design to a SVG file. The units in my AutoCAD file are defined in millimeters (mm). Image below shows my AutoCAD design. The orange box (16mm x 9mm) are my boundaries for visible part of the SVG file, thus anything outside the orange box will get cut off. My end application requires a PNG image that is a specific resolution, 1920x1080. (Notice how the aspect ratio is the same).
In my SVG file, all shapes (elements) are defined without units, however I know the values are in millimeters in the physical world. For example, below is an example of a circle. The radius of the circle is 0.474mm as set in the AutoCAD file.
<circle cx="1.22996130982" cy="2.27139057943" r="0.474" />
My question is, how do I properly define the viewport and viewbox in my SVG file? How do I properly define the viewport/viewbox such that the physical units in real world get scaled to fit in my desired image resolution?
I used the following method below to define my viewport/viewbox. However, this approach did not work. The resulting SVG image was a canvas of 1920x1080 however all my shapes were very tiny and it did NOT cut off the shapes desired outside the orange boundary box.
<svg width="1920px" height="1080px" viewbox="0 0 16mm 9mm">
<circle cx="1.22996130982" cy="2.27139057943" r="0.474" />
<!-- Other shapes in SVG here-->
</svg>

Gaussian blur cutoff at edges

I am working on an svg export utility for a drawing program on android. I am having a problem that the behind blur is cutoff past the shape boundaries - looks like i need to resize the viewBox or increase the margin or something. Does anyone know the best way?
The test file url is here - it downloads as the mime type isn't setup correctly on the server and I cant restart it at the moment :(. There are embedded images and fonts in the file, Which is why it's big. But if you save it to disk you can open in chrome, ff, etc...
An enlarged example of this problem is given. Notice the square edges on the orange glow.
The filter canvas has default values : x=y=-10% and width=height=120%. You can change them with the x, y, width and height attributes on the filter element.
Try to set a bigger canvas :
<filter x="-50%" y="-50%" width="200%" height="200%"/>
Yet, since the canvas is bigger, there will be performance loss.

Rollover overlays with SVG

i want to acheive the effect on this page using SVG. As you can see it uses a series of PNG transparent overlays when the user mouses over a polygonal hotspot drawn on a product.
What i want to achieve is the same thing with SVG, but without messing about with creating a load of PNGs, so that when the user mouses over an area the transparent shape (with link on it) appears over the top. The SVG shape would be built from a set of coordinates exactly as a polygonal hotspot would on an image map.
So i guess my first question is, can this be done with plain old SVG or do i need to use something like Raphael to achieve this? Never seen this effect before with SVG so if anyone has an example like that would be very useful.
Thanks in advance.
There are several ways to get this effect with plain old SVG. Probably the simplest is to use CSS within the SVG. For example:
<style>
.overlay:hover
{
opacity: 0.5;
}
</style>
<svg>
<a xlink:href="http://www.wherever/you/want/to/link/to.com">
<path class="overlay" d="Coordinates of your shape..." />
</a>
</svg>
I've written about various other methods at:
http://www.petercollingridge.co.uk/data-visualisation/mouseover-effects-svgs
Yes it can be done with SVG only, with or without javascript.
One way to get the effect would be to overlay a white semi-transparent path on top of the image that you want to whiten. Another way would be to use an SVG filter to process the image directly, similar to what I've done here or here to recolor a PNG (view page source and feel free to reuse that in any way you like).
You'll want to make use of the 'pointer-events' property most likely. Here's an example showing how to detect mouse-events on the fill and/or stroke of an svg shape, even if the shape is invisible.

Glyph Sizes in FontForge SVG Importing

I created a set of svg glyphs for a font I am building, in Inkscape.
They look fine in Inkscape, and fill the full canvas. But when I import them into FontForge, they appear tiny - around 1/10th of the size they should take up.
Can anyone explain why this is happening, and what I can do to fix it?
This happens because your artboard in inkscape has many more units than the font's cartesian grid space.
Open Inkscape
From the File menu, select Document Properties.
Set units to pixels (px) and document dimensions to 1000 x 1000, click OK
Set a horizontal guide at 200px
Draw a glyph – the hardest part! :-)
Save the drawing as an SVG
Open FontForge
From the File menu, select Import, chose SVG, find your drawing, click OK
Inkscape now has a template, 'FontForge Glyph' that should make this more convenient.
There are some bugs in the FontForge.This is a way to solve it.

Resources