Пример #1
0
 private void showTaskCreateHelpPopover() {
   if (!AstridPreferences.canShowPopover()) return;
   if (!Preferences.getBoolean(R.string.p_showed_add_task_help, false)) {
     Preferences.setBoolean(R.string.p_showed_add_task_help, true);
     HelpInfoPopover.showPopover(
         getActivity(), quickAddBar.getQuickAddBox(), R.string.help_popover_add_task, null);
   }
 }
Пример #2
0
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (quickAddBar.onActivityResult(requestCode, resultCode, data)) return;

    if (requestCode == ACTIVITY_SETTINGS) {
      if (resultCode == EditPreferences.RESULT_CODE_THEME_CHANGED
          || resultCode == EditPreferences.RESULT_CODE_PERFORMANCE_PREF_CHANGED) {
        getActivity().finish();
        getActivity().startActivity(getActivity().getIntent());
        TasksWidget.updateWidgets(getActivity());
        return;
      } else if (resultCode == SyncProviderPreferences.RESULT_CODE_SYNCHRONIZE) {
        Preferences.setLong(
            SyncActionHelper.PREF_LAST_AUTO_SYNC, 0); // Forces autosync to occur after login
      }
    }

    super.onActivityResult(requestCode, resultCode, data);

    if (!Preferences.getBoolean(R.string.p_showed_add_task_help, false)) {
      if (!AstridPreferences.canShowPopover()) return;
      quickAddBar
          .getQuickAddBox()
          .postDelayed(
              new Runnable() {
                @Override
                public void run() {
                  Activity activity = getActivity();
                  if (activity != null) {
                    HelpInfoPopover.showPopover(
                        getActivity(),
                        quickAddBar.getQuickAddBox(),
                        R.string.help_popover_add_task,
                        null);
                    Preferences.setBoolean(R.string.p_showed_add_task_help, true);
                  }
                }
              },
              1000);
    }
  }