use of com.hippo.ehviewer.FavouriteStatusRouter in project EhViewer by seven332.
the class GalleryInfoContentHelper method saveInstanceState.
@Override
protected Parcelable saveInstanceState(Parcelable superState) {
Bundle bundle = (Bundle) super.saveInstanceState(superState);
// TODO It's a bad design
FavouriteStatusRouter router = EhApplication.getFavouriteStatusRouter();
int id = router.saveDataMap(map);
bundle.putInt(KEY_DATA_MAP, id);
return bundle;
}
use of com.hippo.ehviewer.FavouriteStatusRouter in project EhViewer by seven332.
the class GalleryInfoContentHelper method restoreInstanceState.
@Override
protected Parcelable restoreInstanceState(Parcelable state) {
Bundle bundle = (Bundle) state;
int id = bundle.getInt(KEY_DATA_MAP, IntIdGenerator.INVALID_ID);
if (id != IntIdGenerator.INVALID_ID) {
FavouriteStatusRouter router = EhApplication.getFavouriteStatusRouter();
Map<Long, GalleryInfo> map = router.restoreDataMap(id);
if (map != null) {
this.map = map;
}
}
return super.restoreInstanceState(state);
}
Aggregations