use of com.github.pockethub.android.Intents.EXTRA_GIST_FILE in project PocketHub by pockethub.
the class GistFileFragment method loadSource.
private void loadSource() {
store.refreshGist(gistId).map(gist -> {
Map<String, GistFile> files = gist.files();
if (files == null) {
throw new IOException();
}
GistFile loadedFile = files.get(file.filename());
if (loadedFile == null) {
throw new IOException();
}
return loadedFile;
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(loadedFile -> {
file = loadedFile;
getArguments().putParcelable(EXTRA_GIST_FILE, file);
if (file.content() != null) {
showSource();
}
}, e -> ToastUtils.show(getActivity(), R.string.error_gist_file_load));
}
Aggregations