Unexpected-Keyboard/srcs/res/SvgToVector.java
Jules Aguillon 997b7be4c0 launcher: Animated vector describing swipe gesture
Replace the short video with an animated vector image that shows the
swipe gesture.

This is much lighter and reliable than the mp4 video, which failed to
play on many devices.

Source for the image of the key is in inkscape SVG format in srcs/res
and is converted to an android drawable when needed. The swipe animation
is hand-written.
2024-11-18 00:13:08 +01:00

33 lines
775 B
Java

package srcs.res;
import com.android.ide.common.vectordrawable.Svg2Vector;
import java.io.File;
import java.io.FileOutputStream;
/** Inspired from Bernard Ladenthin's answer:
https://stackoverflow.com/a/78898372 */
public class SvgToVector
{
public static void main(String[] args)
{
if (args.length != 2)
{
System.out.println("Usage: svg_to_vector <input_file> <output_file>");
return;
}
try
{
File input_file = new File(args[0]);
FileOutputStream output_stream = new FileOutputStream(args[1]);
String warnings;
warnings = Svg2Vector.parseSvgToXml(input_file, output_stream);
System.err.println(warnings);
}
catch (Exception e)
{
e.printStackTrace();
System.exit(2);
}
}
}