Search in sources :

Example 1 with BookJsonParserTask

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");
}
Also used : BookJsonParserTask(com.baker.abaker.workers.BookJsonParserTask) TextView(android.widget.TextView)

Example 2 with BookJsonParserTask

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());
    }
}
Also used : BookJsonParserTask(com.baker.abaker.workers.BookJsonParserTask)

Example 3 with BookJsonParserTask

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();
    }
}
Also used : BookJsonParserTask(com.baker.abaker.workers.BookJsonParserTask) JSONArray(org.json.JSONArray) Magazine(com.baker.abaker.model.Magazine)

Aggregations

BookJsonParserTask (com.baker.abaker.workers.BookJsonParserTask)3 TextView (android.widget.TextView)1 Magazine (com.baker.abaker.model.Magazine)1 JSONArray (org.json.JSONArray)1