public ViewHolder(Activity activity) { toolbar = Views.find(activity, R.id.toolbar); toolbarBack = Views.find(activity, R.id.flickr_toolbar_back); grid = Views.find(activity, R.id.flickr_list); pager = Views.find(activity, R.id.full_images_pager); pagerToolbar = Views.find(activity, R.id.full_image_toolbar); pagerTitle = Views.find(activity, R.id.full_image_title); pagerBackground = Views.find(activity, R.id.full_image_background); }
@Override protected void onSaveInstanceState(Bundle outState) { mPagerPhotoPosition = mAnimator.isLeaving() || mPagerAdapter.getCount() == 0 ? -1 : mViews.pager.getCurrentItem(); if (mViews.grid.getChildCount() > 0) { View child = mViews.grid.getChildAt(0); mGridPosition = mViews.grid.getChildAdapterPosition(child); mGridPositionFromTop = child.getTop() - Views.getMarginParams(child).topMargin - mViews.grid.getPaddingTop(); } else { mGridPosition = -1; mGridPositionFromTop = 0; } mSettingsMenu.onSaveInstanceState(outState); super.onSaveInstanceState(outState); }
public ViewHolder(ViewGroup parent) { super(Views.inflate(parent, R.layout.item_flickr_full_image)); image = Views.find(itemView, R.id.flickr_full_image); progress = Views.find(itemView, R.id.flickr_full_progress); }