Example #1
0
  public static boolean showOn(FragmentActivity activity) {
    if (Config.getFirstInstallVersion() >= BuildConfig.VERSION_CODE) return false;

    FragmentManager fm = activity.getSupportFragmentManager();
    if (fm.isDestroyed()) return false;

    if (Config.getLastWhatsNewVersion() / 10 >= BuildConfig.VERSION_CODE / 10
        && !recreate(activity)) return false;

    create(activity);

    Config.setWhatsNewShown();
    return true;
  }
Example #2
0
  private void setLanguage(@NonNull LanguageData lang) {
    Config.setTtsEnabled(true);
    TtsPlayer.INSTANCE.setLanguage(lang);
    mPrefLanguages.setSummary(lang.name);

    update();
  }
Example #3
0
  public void prepare(@Nullable MapObject startPoint, @Nullable MapObject endPoint) {
    mLogger.d("prepare (" + (endPoint == null ? "route)" : "p2p)"));

    if (!Config.isRoutingDisclaimerAccepted()) {
      showDisclaimer(startPoint, endPoint);
      return;
    }

    cancel();
    mStartPoint = startPoint;
    mEndPoint = endPoint;
    setState(State.PREPARE);

    if (mStartPoint != null && mEndPoint != null)
      mLastRouterType =
          Framework.nativeGetBestRouter(
              mStartPoint.getLat(), mStartPoint.getLon(),
              mEndPoint.getLat(), mEndPoint.getLon());
    Framework.nativeSetRouter(mLastRouterType);

    if (mContainer != null)
      mContainer.showRoutePlan(
          true,
          new Runnable() {
            @Override
            public void run() {
              if (mStartPoint == null || mEndPoint == null) updatePlan();
              else build();
            }
          });
  }