Search in sources :

Example 6 with Stats

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));
    }
}
Also used : Stats(com.ichi2.libanki.Stats) Collection(com.ichi2.libanki.Collection)

Aggregations

Stats (com.ichi2.libanki.stats.Stats)3 Stats (com.ichi2.libanki.Stats)2 Resources (android.content.res.Resources)1 GestureDetector (android.view.GestureDetector)1 MotionEvent (android.view.MotionEvent)1 View (android.view.View)1 LayoutParams (android.view.ViewGroup.LayoutParams)1 LinearLayout (android.widget.LinearLayout)1 TextView (android.widget.TextView)1 Collection (com.ichi2.libanki.Collection)1 Sched (com.ichi2.libanki.Sched)1 GraphicalView (org.achartengine.GraphicalView)1 XYSeries (org.achartengine.model.XYSeries)1 XYSeriesRenderer (org.achartengine.renderer.XYSeriesRenderer)1 JSONObject (org.json.JSONObject)1