Exemplo n.º 1
0
 public Flashcard getPreviousCard() {
   if (hasActiveCards()) {
     while (true) {
       cardIndex--;
       if (cardIndex < 0) {
         cardIndex = flashcards.size() - 1;
       }
       activeCard = flashcards.get(cardIndex);
       if (activeCard.getActive()) {
         return activeCard;
       }
     }
   }
   return activeCard;
 }
Exemplo n.º 2
0
 public Flashcard getNextCard() {
   if (hasActiveCards()) {
     while (true) {
       cardIndex++;
       if (cardIndex == flashcards.size()) {
         cardIndex = 0;
       }
       activeCard = flashcards.get(cardIndex);
       if (activeCard.getActive()) {
         return activeCard;
       }
     }
   }
   return activeCard;
 }
Exemplo n.º 3
0
 public String getActiveCardBack() {
   return getActiveCard().getNativeFirst() ? activeCard.getForeign() : activeCard.getText();
 }
Exemplo n.º 4
0
 public void flipActiveCard() {
   getActiveCard().setNativeFirst(!activeCard.getNativeFirst());
 }
Exemplo n.º 5
0
 public Flashcard getActiveCard() {
   if (activeCard.equals(nullCard) && activeCards > 0) {
     activeCard = flashcards.get(cardIndex);
   }
   return activeCard;
 }