Exemplo n.º 1
0
 @Override
 public void onLoadFinished(Loader<Collection> loader, Collection col) {
   if (col != null && AnkiDroidApp.colIsOpen()) {
     onCollectionLoaded(col);
   } else {
     onCollectionLoadError();
   }
 }
Exemplo n.º 2
0
 // Method for loading the collection which is inherited by all AnkiActivitys
 public void startLoadingCollection() {
   // Initialize the open collection loader
   Timber.d("AnkiActivity.startLoadingCollection()");
   if (!AnkiDroidApp.colIsOpen()) {
     showOpeningCollectionDialog();
   }
   getSupportLoaderManager().restartLoader(0, null, this);
 }
Exemplo n.º 3
0
  @Override
  protected void onStop() {
    super.onStop();

    if (!isFinishing()) {
      if (AnkiDroidApp.colIsOpen()) {
        WidgetStatus.update(this, mSched.progressToday(null, mCurrentCard, true));
      }
    }
    UIUtils.saveCollectionInBackground();
  }
Exemplo n.º 4
0
 @Override
 protected void setTitle() {
   try {
     String[] title = {""};
     if (AnkiDroidApp.colIsOpen()) {
       title = getCol().getDecks().current().getString("name").split("::");
     } else {
       Timber.e("Could not set title in reviewer because collection closed");
     }
     AnkiDroidApp.getCompat().setTitle(this, title[title.length - 1], mNightMode);
     super.setTitle(title[title.length - 1]);
   } catch (JSONException e) {
     throw new RuntimeException(e);
   }
   AnkiDroidApp.getCompat().setSubtitle(this, "", mNightMode);
 }
Exemplo n.º 5
0
 public boolean colOpen() {
   return AnkiDroidApp.colIsOpen();
 }