Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1421)

Unified Diff: sky/shell/android/org/domokit/sky/shell/SkyActivity.java

Issue 1213203008: Make it possible to load Sky demos from local bundles (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: re-upload Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/shell/android/org/domokit/sky/shell/SkyActivity.java
diff --git a/sky/shell/android/org/domokit/sky/shell/SkyActivity.java b/sky/shell/android/org/domokit/sky/shell/SkyActivity.java
index 0724ebf9a1d4efcfafaafdb4538ff2ce4af1f106..de84817719f6a725f88ff88354e175cd5355a5c6 100644
--- a/sky/shell/android/org/domokit/sky/shell/SkyActivity.java
+++ b/sky/shell/android/org/domokit/sky/shell/SkyActivity.java
@@ -85,4 +85,14 @@ public class SkyActivity extends Activity {
public void loadUrl(String url) {
mView.loadUrl(url);
}
+
+ public boolean loadBundleByName(String name) {
+ File dataDir = new File(PathUtils.getDataDirectory(this));
+ File bundle = new File(dataDir, name);
+ if (!bundle.exists()) {
+ return false;
+ }
+ mView.loadBundle(bundle.getPath());
+ return true;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698