简体   繁体   English

Android Pixate FreeStyle更改default.css路径

[英]Android Pixate FreeStyle change default.css path

I am using Pixate for skinning android app via CSS, and in their docs it states that default.css file should be placed in assets folder inside app (included in build) and this way everything works fine, but I have to download at the startup this css from some portal and copy it in the application storage directory, can't include it in the assets folder so Pixate doesn't know the new path for this css file. 我正在使用Pixate通过CSS来为Android应用程序蒙皮,并且在他们的文档中指出default.css文件应放置在应用程序内的Assets文件夹中(包括在build中),这样一切正常,但是我必须在启动时下载从某些门户网站将此CSS并复制到应用程序存储目录中,无法将其包含在资产文件夹中,因此Pixate不知道此CSS文件的新路径。

Is there any way that I can set path to default.css file so that Pixate can know where to look for the css? 有什么办法可以将路径设置为default.css文件,以便Pixate知道在哪里寻找CSS? This path in my case has to be somewhere in external app storage? 就我而言,此路径必须位于外部应用程序存储中的某个位置?

The stylesheet is loaded at https://github.com/Pixate/pixate-freestyle-android/blob/master/pixate-freestyle/src/com/pixate/freestyle/styling/PXStylesheet.java#L88 You can fork and change this to anything you like. 样式表位于https://github.com/Pixate/pixate-freestyle-android/blob/master/pixate-freestyle/src/com/pixate/freestyle/styling/PXStylesheet.java#L88,您可以进行分叉和更改随便你 This method is eventually called once via the the PixateFreestyle.init() method. 该方法最终通过PixateFreestyle.init()方法被调用一次。

Now, there is a second init() method. 现在,有了第二个init()方法。 You can specify your own CSS file, see: 您可以指定自己的CSS文件,请参见:

PixateFreestyle.init(Context context, String cssFileName) PixateFreestyle.init(上下文上下文,字符串cssFileName)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM