use of com.trovebox.android.common.ui.adapter.PhotosEndlessAdapter.ParametersHolder in project mobile-android by photo.
the class PhotoDetailsFragment method initFromIntent.
public int initFromIntent(Intent intent) {
int position = -1;
if (intent.hasExtra(EXTRA_PHOTO)) {
Photo photo = intent.getParcelableExtra(EXTRA_PHOTO);
ArrayList<Photo> photos = new ArrayList<Photo>();
photos.add(photo);
thumbnailsAdapter = new ThumbnailsAdapter(photos);
position = 0;
} else if (intent.hasExtra(EXTRA_PHOTOS)) {
ArrayList<Photo> photos = intent.getParcelableArrayListExtra(EXTRA_PHOTOS);
thumbnailsAdapter = new ThumbnailsAdapter(photos);
position = 0;
} else if (intent.hasExtra(EXTRA_ADAPTER_PHOTOS)) {
PhotosEndlessAdapter.ParametersHolder parameters = (ParametersHolder) intent.getParcelableExtra(EXTRA_ADAPTER_PHOTOS);
position = parameters.getPosition();
thumbnailsAdapter = new ThumbnailsAdapter(parameters);
}
return position;
}
use of com.trovebox.android.common.ui.adapter.PhotosEndlessAdapter.ParametersHolder in project mobile-android by photo.
the class PhotoDetailsFragment method onSaveInstanceState.
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putParcelable(EXTRA_ADAPTER_PHOTOS, new ParametersHolder(thumbnailsAdapter, mAdapter.currentPhoto));
}
use of com.trovebox.android.common.ui.adapter.PhotosEndlessAdapter.ParametersHolder in project mobile-android by photo.
the class PhotoDetailsFragment method init.
void init(View v, Bundle savedInstanceState) {
titleText = (TextView) v.findViewById(R.id.image_title);
dateText = (TextView) v.findViewById(R.id.image_date);
privateBtn = (ImageView) v.findViewById(R.id.button_private);
detailsView = v.findViewById(R.id.image_details);
int position = 0;
if (savedInstanceState != null) {
PhotosEndlessAdapter.ParametersHolder parameters = (ParametersHolder) savedInstanceState.getParcelable(EXTRA_ADAPTER_PHOTOS);
position = parameters.getPosition();
thumbnailsAdapter = new ThumbnailsAdapter(parameters);
} else {
position = initFromIntent(getActivity().getIntent());
}
initImageViewers(v, position);
}
Aggregations