Skip to content

Commit

Permalink
Update library/src/ru/truba/touchgallery/GalleryWidget/UrlPagerAdapte…
Browse files Browse the repository at this point in the history
…r.java

Deprecated calls fixed
  • Loading branch information
Sash0k committed Jan 26, 2013
1 parent a3eb79c commit a86523a
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
*/
public class UrlPagerAdapter extends PagerAdapter {

private List<String> mResources;
private Context mContext;
private final List<String> mResources;
private final Context mContext;
public UrlPagerAdapter(Context context, List<String> resources){
this.mResources = resources;
this.mContext = context;
Expand All @@ -47,18 +47,17 @@ public void setPrimaryItem(ViewGroup container, int position, Object object) {
}

@Override
public Object instantiateItem(View collection, int position){
UrlTouchImageView iv = new UrlTouchImageView(mContext);
public Object instantiateItem(ViewGroup collection, int position){
final UrlTouchImageView iv = new UrlTouchImageView(mContext);
iv.setUrl(mResources.get(position));
iv.setLayoutParams(new Gallery.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));

((ViewPager) collection).addView(iv, 0);
iv.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
collection.addView(iv, 0);
return iv;
}

@Override
public void destroyItem(View collection, int position, Object view){
((ViewPager) collection).removeView((View) view);
public void destroyItem(ViewGroup collection, int position, Object view){
collection.removeView((View) view);
}

@Override
Expand All @@ -72,7 +71,7 @@ public boolean isViewFromObject(View view, Object object){
}

@Override
public void finishUpdate(View arg0){
public void finishUpdate(ViewGroup arg0){
}

@Override
Expand All @@ -85,7 +84,7 @@ public Parcelable saveState(){
}

@Override
public void startUpdate(View arg0){
public void startUpdate(ViewGroup arg0){
}

}
}

0 comments on commit a86523a

Please sign in to comment.