Search in sources :

Example 6 with MagazineThumb

use of com.baker.abaker.views.MagazineThumb in project baker-android by bakerframework.

the class GindActivity method unzipPendingPackages.

private void unzipPendingPackages() {
    for (int i = 0; i < flowLayout.getChildCount(); i++) {
        MagazineThumb thumb = (MagazineThumb) flowLayout.getChildAt(i);
        String zipName = thumb.getMagazine().getName().concat(this.getString(R.string.package_extension));
        if (this.magazineZipExists(zipName) && !thumb.isDownloading()) {
            Log.d(this.getClass().toString(), "Continue unzip of " + thumb.getMagazine().getName());
            String filepath = Configuration.getMagazinesDirectory(this.getApplicationContext()) + File.separator + zipName;
            thumb.startUnzip(filepath, thumb.getMagazine().getName());
        } else if (thumb.isDownloading()) {
            Log.d(this.getClass().getName(), "Continue download of: " + thumb.getMagazine().getName());
            // We continue the download.
            thumb.startPackageDownload();
        }
    }
}
Also used : MagazineThumb(com.baker.abaker.views.MagazineThumb)

Example 7 with MagazineThumb

use of com.baker.abaker.views.MagazineThumb in project baker-android by bakerframework.

the class GindActivity method downloadNextThumbnail.

private void downloadNextThumbnail() {
    if (!this.thumbnailIds.isEmpty() && this.thumbnailDownloaderHandler != null) {
        int id = this.thumbnailIds.get(0);
        MagazineThumb thumb = (MagazineThumb) findViewById(id);
        thumb.downloadCover();
        this.thumbnailIds.remove(0);
    }
}
Also used : MagazineThumb(com.baker.abaker.views.MagazineThumb)

Aggregations

MagazineThumb (com.baker.abaker.views.MagazineThumb)7 IOException (java.io.IOException)2 ParseException (java.text.ParseException)2 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 JSONException (org.json.JSONException)2 JSONObject (org.json.JSONObject)2 AlertDialog (android.app.AlertDialog)1 DialogInterface (android.content.DialogInterface)1 LinearLayout (android.widget.LinearLayout)1 Magazine (com.baker.abaker.model.Magazine)1