GeraudBourdin / Ti.SvgView

Create a view from an svg file (expose the androidsvg-1.2.1 lib and the SVGKit 2.X for IOS lib).
MIT License
50 stars 24 forks source link

Support for Mobile Web #10

Open DaKaZ opened 8 years ago

DaKaZ commented 8 years ago

In mobile web, you can simply create a standard image view. So my code is littered with blocks like these:

if (!OS_MOBILEWEB) {
    var svgView = require('com.geraudbourdin.svgview');
    var svg = svgView.createView({
        image: "/images/logo.svg",
        width: Ti.UI.FILL,
        left: "15%",
        right: "15%",
        top: "33%"
    });
    $.viewLogo.add(svg);
} else {
    $.viewLogo.add(Ti.UI.createImageView({
        image: "/images/logo.svg",
        width: Ti.UI.FILL,
        left: "15%",
        right: "15%",
        top: "33%"
    }));
}

It would be ideal if this module would do that automatically. I started to look at how to do this, but I have never built a module so frankly I am at a loss. Happy help if someone could point me to a primer or howto on this subject.

GeraudBourdin commented 8 years ago

you are right, that would be great to get this done. I do not have enough time at the moment (too much work, sadly), but i ll surely digg it in the future. That would have been great if somone could do this quicly. I'll look at the way to do it in a kind of module.. Thanks for the issue :)

DaKaZ commented 8 years ago

Hi @GeraudBourdin - I happy to do the work, I just really don't know where to start with a module. If you have any suggestions at all I can look into.