Ejemplo n.º 1
0
  public boolean loadIntent(Intent intent) {
    String action = intent.getAction();

    if (Intent.ACTION_RUN.equals(action)) {
      mView.getEngine().runFromBundle(intent.getDataString());
      String route = intent.getStringExtra("route");
      if (route != null) mView.getEngine().pushRoute(route);
      return true;
    }

    return false;
  }
Ejemplo n.º 2
0
 @Override
 protected void onPause() {
   super.onPause();
   if (mView != null) {
     mView.getEngine().onActivityPaused();
   }
 }
Ejemplo n.º 3
0
  /** Override this function to customize startup behavior. */
  protected void onSkyReady() {
    TraceEvent.instant("SkyActivity.onSkyReady");

    Locale locale = getResources().getConfiguration().locale;
    mView.getEngine().onLocaleChanged(locale.getLanguage(), locale.getCountry());

    if (loadIntent(getIntent())) {
      return;
    }
    File dataDir = new File(PathUtils.getDataDirectory(this));
    File appBundle = new File(dataDir, SkyApplication.APP_BUNDLE);
    if (appBundle.exists()) {
      mView.getEngine().runFromBundle(appBundle.getPath());
      return;
    }
  }
Ejemplo n.º 4
0
 @Override
 protected void onPostResume() {
   super.onPostResume();
   if (mView != null) {
     mView.getEngine().onActivityResumed();
   }
 }
Ejemplo n.º 5
0
 /** Override this function to customize startup behavior. */
 protected void onSkyReady() {
   if (loadIntent(getIntent())) {
     return;
   }
   File dataDir = new File(PathUtils.getDataDirectory(this));
   File snapshot = new File(dataDir, SkyApplication.SNAPSHOT);
   if (snapshot.exists()) {
     mView.getEngine().runFromSnapshot(snapshot.getPath());
     return;
   }
   File appBundle = new File(dataDir, SkyApplication.APP_BUNDLE);
   if (appBundle.exists()) {
     mView.getEngine().runFromBundle(appBundle.getPath());
     return;
   }
 }
Ejemplo n.º 6
0
 @Override
 public void onBackPressed() {
   if (mView != null) {
     mView.getEngine().popRoute();
     return;
   }
   super.onBackPressed();
 }
Ejemplo n.º 7
0
 public boolean loadBundleByName(String name) {
   File dataDir = new File(PathUtils.getDataDirectory(this));
   File bundle = new File(dataDir, name);
   if (!bundle.exists()) {
     return false;
   }
   mView.getEngine().runFromBundle(bundle.getPath());
   return true;
 }
Ejemplo n.º 8
0
 @Override
 public void onBackPressed() {
   if (mView != null) {
     InputEvent event = new InputEvent();
     event.type = EventType.BACK;
     mView.getEngine().onInputEvent(event);
     return;
   }
   super.onBackPressed();
 }
Ejemplo n.º 9
0
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    Locale locale = getResources().getConfiguration().locale;
    mView.getEngine().onLocaleChanged(locale.getLanguage(), locale.getCountry());
  }
Ejemplo n.º 10
0
 public void loadUrl(String url) {
   mView.getEngine().runFromNetwork(url);
 }