Example #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;
  }
Example #2
0
 @Override
 protected void onPause() {
   super.onPause();
   if (mView != null) {
     mView.getEngine().onActivityPaused();
   }
 }
Example #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;
    }
  }
Example #4
0
 @Override
 protected void onPostResume() {
   super.onPostResume();
   if (mView != null) {
     mView.getEngine().onActivityResumed();
   }
 }
Example #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;
   }
 }
Example #6
0
 @Override
 public void onBackPressed() {
   if (mView != null) {
     mView.getEngine().popRoute();
     return;
   }
   super.onBackPressed();
 }
Example #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;
 }
Example #8
0
 @Override
 public void onBackPressed() {
   if (mView != null) {
     InputEvent event = new InputEvent();
     event.type = EventType.BACK;
     mView.getEngine().onInputEvent(event);
     return;
   }
   super.onBackPressed();
 }
Example #9
0
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

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