Search in sources :

Example 66 with CardDao

use of org.liberty.android.fantastischmemo.dao.CardDao in project AnyMemo by helloworld1.

the class CardWrapperListLoader method dbLoadInBackground.

@Override
protected List<CardWrapper> dbLoadInBackground() {
    CardDao cardDao = dbOpenHelper.getCardDao();
    List<CardWrapper> cardWrappers = new ArrayList<CardWrapper>((int) cardDao.countOf());
    for (Card card : cardDao.getAllCards(null)) {
        cardWrappers.add(new CardWrapper(card, initialAnswerVisible));
    }
    return cardWrappers;
}
Also used : ArrayList(java.util.ArrayList) CardWrapper(org.liberty.android.fantastischmemo.ui.CardListActivity.CardWrapper) CardDao(org.liberty.android.fantastischmemo.dao.CardDao) Card(org.liberty.android.fantastischmemo.entity.Card)

Aggregations

CardDao (org.liberty.android.fantastischmemo.dao.CardDao)66 Card (org.liberty.android.fantastischmemo.entity.Card)61 SmallTest (android.support.test.filters.SmallTest)37 Test (org.junit.Test)37 AbstractExistingDBTest (org.liberty.android.fantastischmemo.test.AbstractExistingDBTest)37 AnyMemoDBOpenHelper (org.liberty.android.fantastischmemo.common.AnyMemoDBOpenHelper)28 Category (org.liberty.android.fantastischmemo.entity.Category)27 CategoryDao (org.liberty.android.fantastischmemo.dao.CategoryDao)22 LearningData (org.liberty.android.fantastischmemo.entity.LearningData)15 LearningDataDao (org.liberty.android.fantastischmemo.dao.LearningDataDao)13 File (java.io.File)10 ArrayList (java.util.ArrayList)8 IOException (java.io.IOException)6 URL (java.net.URL)5 FileWriter (java.io.FileWriter)4 Date (java.util.Date)4 BufferedWriter (java.io.BufferedWriter)3 PrintWriter (java.io.PrintWriter)3 SAXParser (javax.xml.parsers.SAXParser)3 SAXParserFactory (javax.xml.parsers.SAXParserFactory)3