示例#1
0
  protected String getBaseUrlForStylesheet() {
    TiUrl creationUrl = getCreationUrl();
    String baseUrl = creationUrl.baseUrl;
    if (baseUrl == null || (baseUrl.equals("app://") && creationUrl.url.equals(""))) {
      baseUrl = "app://app.js";
    } else {
      baseUrl = creationUrl.resolve();
    }

    int idx = baseUrl.lastIndexOf("/");
    if (idx != -1) {
      baseUrl = baseUrl.substring(idx + 1).replace(".js", "");
    }

    return baseUrl;
  }
 private Drawable getDrawableFromUrl(String url) {
   TiUrl imageUrl = new TiUrl((String) url);
   TiFileHelper tfh = new TiFileHelper(TiApplication.getInstance());
   return tfh.loadDrawable(imageUrl.resolve(), false);
 }