Beispiel #1
0
 public void setAlbumResult(AlbumResult result) {
   this.albumResult = result;
   mTitleView.setText(albumResult.getTitle());
   mViewPager.setAdapter(new AlbumPagerAdapter(getContext(), albumResult));
   mViewPager.setOnPageChangeListener(this);
   onPageSelected(mViewPager.getCurrentItem());
 }
Beispiel #2
0
 public void onPageSelected(int position) {
   Data data = albumResult.getAlbum().getData();
   Image image = data.getImages().get(position);
   int total = data.getTotal();
   String order = String.format(getResources().getString(R.string.order), image.getIndex(), total);
   mOrderView.setText(order);
   mDescrView.setText(image.getDescr());
 }
Beispiel #3
0
 public AlbumPagerAdapter(Context context, AlbumResult albumResult) {
   this.images = albumResult.getAlbum().getData().getImages();
   this.mContext = context;
   imageLoader = Utils.getImageLoader(context);
 }