use of com.bourke.glimmr.common.GsonHelper in project glimmr by brk3.
the class PhotoViewerActivity method onRestoreInstanceState.
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
if (mPhotos.isEmpty()) {
String json = new GsonHelper(this).loadJson(PHOTO_LIST_FILE);
if (json.length() == 0) {
Log.e(TAG, String.format("Error reading '%s'", PHOTO_LIST_FILE));
} else {
Type collectionType = new TypeToken<Collection<Photo>>() {
}.getType();
mPhotos = new Gson().fromJson(json, collectionType);
}
}
boolean overlayOn = savedInstanceState.getBoolean(KEY_ACTIONBAR_SHOW, true);
if (overlayOn) {
mActionBar.show();
} else {
mActionBar.hide();
}
int pagerIndex = savedInstanceState.getInt(KEY_CURRENT_INDEX, 0);
initViewPager(pagerIndex, false);
if (savedInstanceState.getBoolean(KEY_SLIDESHOW_RUNNING, false)) {
startSlideshow();
}
}
use of com.bourke.glimmr.common.GsonHelper in project glimmr by brk3.
the class PhotosetGridFragment method onSaveInstanceState.
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
new GsonHelper(mActivity).marshallObject(mPhotoset, outState, KEY_PHOTOSET);
}
Aggregations