use of com.baker.abaker.workers.BookJsonParserTask in project baker-android by bakerframework.
the class MagazineThumb method readOnline.
private void readOnline() {
previewLoaded = true;
findViewById(R.id.actions_ui).setVisibility(View.GONE);
findViewById(R.id.download_container).setVisibility(View.GONE);
findViewById(R.id.progress_ui).setVisibility(View.GONE);
findViewById(R.id.txtProgress).setVisibility(View.VISIBLE);
((TextView) findViewById(R.id.txtProgress)).setText(R.string.loadingPreview);
BookJsonParserTask parser = new BookJsonParserTask(this.getContext(), this.magazine, this, BOOK_JSON_PARSE_TASK);
parser.execute("ONLINE");
}
use of com.baker.abaker.workers.BookJsonParserTask in project baker-android by bakerframework.
the class MagazineThumb method readIssue.
/**
* Change the views to start reading the issue.
*/
private void readIssue() {
enableReadArchiveActions();
BookJsonParserTask parser = new BookJsonParserTask(this.getContext(), this.magazine, this, BOOK_JSON_PARSE_TASK);
if (magazine.isStandalone()) {
parser.execute("STANDALONE");
} else {
parser.execute(magazine.getName());
}
}
use of com.baker.abaker.workers.BookJsonParserTask in project baker-android by bakerframework.
the class GindActivity method readStandaloneIssues.
private void readStandaloneIssues(final ArrayList<String> issues) {
Log.d(this.getClass().getName(), "Found " + issues.size() + " issues.");
if (issues.size() == 1) {
RETURN_TO_SHELF = false;
Magazine magazine = new Magazine();
magazine.setName(issues.get(0));
magazine.setStandalone(STANDALONE_MODE);
boolean fromAssets = !this.getResources().getBoolean(R.bool.sa_read_from_custom_directory);
bookJsonParserTask = new BookJsonParserTask(this, magazine, this, BOOK_JSON_PARSE_TASK);
bookJsonParserTask.setFromAssets(fromAssets);
bookJsonParserTask.execute("STANDALONE");
} else if (issues.size() > 1) {
JSONArray jsonArray = new JSONArray();
for (String issue : issues) {
Log.d(this.getClass().getName(), "The file is: " + issue);
jsonArray.put(this.getIssueData(issue));
}
this.createThumbnails(jsonArray);
} else {
Log.e(this.getClass().getName(), "Running standalone but no issues were found.");
Toast.makeText(this, getString(R.string.sa_no_issues), Toast.LENGTH_LONG).show();
this.finish();
}
}
Aggregations