use of com.ichi2.libanki.stats.Stats in project Anki-Android by Ramblurr.
the class DeckTask method doInBackgroundLoadStatistics.
private TaskData doInBackgroundLoadStatistics(TaskData... params) {
// Log.i(AnkiDroidApp.TAG, "doInBackgroundLoadStatistics");
Collection col = params[0].getCollection();
int type = params[0].getInt();
boolean wholeCollection = params[0].getBoolean();
Stats stats = new Stats(col, wholeCollection);
switch(type) {
default:
case Stats.TYPE_FORECAST:
return new TaskData(stats.calculateDue(AnkiDroidApp.getSharedPrefs(AnkiDroidApp.getInstance().getBaseContext()).getInt("statsType", Stats.TYPE_MONTH)));
case Stats.TYPE_REVIEW_COUNT:
return new TaskData(stats.calculateDone(AnkiDroidApp.getSharedPrefs(AnkiDroidApp.getInstance().getBaseContext()).getInt("statsType", Stats.TYPE_MONTH), true));
case Stats.TYPE_REVIEW_TIME:
return new TaskData(stats.calculateDone(AnkiDroidApp.getSharedPrefs(AnkiDroidApp.getInstance().getBaseContext()).getInt("statsType", Stats.TYPE_MONTH), false));
}
}
Aggregations