Make SkyDemo.apk start offline

Offline support isn't complete, but after this CL, SkyDemo.apk is able to start
and show some UI offline.

R=eseidel@chromium.org, eseidel@google.com

Review URL: https://codereview.chromium.org/1225883002.
This commit is contained in:
Adam Barth 2015-07-06 16:17:04 -07:00
parent 07d3108e86
commit b69a2e761b
15 changed files with 12 additions and 44 deletions

View File

@ -30,10 +30,7 @@ group("sky_apk") {
]
if (is_android) {
deps += [
"//sky/apk/demo",
"//sky/services/intents",
]
deps += [ "//sky/services/intents" ]
}
if (is_linux) {

View File

@ -2,27 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//sky/build/skyx.gni")
template("sky_apk") {
android_apk(target_name) {
apk_name = invoker.apk_name
android_manifest = invoker.android_manifest
native_libs = [ "libsky_shell.so" ]
asset_location = "$root_build_dir/sky_shell/assets"
deps = [
"//base:base_java",
"//sky/shell:assets",
"//sky/shell:java",
"//sky/shell:sky_shell",
] + invoker.deps
}
}
template("sky_app") {
skyx("app") {
main_dart = invoker.main_dart

View File

@ -2,9 +2,15 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//sky/build/skyx.gni")
import("//sky/build/sky_app.gni")
skyx("demo_launcher") {
sky_app("demo_launcher") {
apk_name = "SkyDemo"
main_dart = "lib/main.dart"
manifest = "sky.yaml"
deps = [
"//sky/sdk/example/demo_launcher/apk:java",
"//sky/sdk/example/demo_launcher/apk:resources",
]
}

View File

@ -6,7 +6,6 @@ assert(is_android)
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//sky/apk/rules.gni")
android_library("java") {
java_files = [
@ -30,16 +29,7 @@ android_library("java") {
]
}
sky_apk("demo") {
apk_name = "SkyDemo"
android_manifest = "AndroidManifest.xml"
deps = [
":java",
":demo_resources",
]
}
android_resources("demo_resources") {
android_resources("resources") {
resource_dirs = [ "res" ]
android_manifest = "AndroidManifest.xml"
}

View File

@ -12,18 +12,11 @@ import org.domokit.sky.shell.SkyActivity;
* Main activity for SkyDemo.
*/
public class SkyDemoActivity extends SkyActivity {
private static final String DEFAULT_URL = "https://domokit.github.io/example/demo_launcher/lib/main.dart";
@Override
protected void onSkyReady() {
Intent intent = getIntent();
String action = intent.getAction();
if (Intent.ACTION_MAIN.equals(action)) {
loadUrl(DEFAULT_URL);
return;
}
if (Intent.ACTION_VIEW.equals(action)) {
String bundleName = intent.getStringExtra("bundleName");
if (bundleName != null && loadBundleByName(bundleName)) {

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -4,7 +4,7 @@
assert(is_android)
import("//sky/apk/rules.gni")
import("//sky/build/sky_app.gni")
sky_app("mine_digger") {
apk_name = "MineDigger"

View File

@ -4,7 +4,7 @@
assert(is_android)
import("//sky/apk/rules.gni")
import("//sky/build/sky_app.gni")
sky_app("stocks") {
apk_name = "Stocks"