rename a couple variables

This commit is contained in:
tibbi 2016-07-04 16:18:03 +02:00
parent bb71618d54
commit 1e3b2ff8d6
3 changed files with 22 additions and 22 deletions

View file

@ -23,20 +23,20 @@ public class DirectoryAdapter extends BaseAdapter {
private final LayoutInflater mInflater;
public DirectoryAdapter(Context context, List<Directory> dirs) {
this.mContext = context;
this.mDirs = dirs;
this.mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mContext = context;
mDirs = dirs;
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public View getView(int position, View view, ViewGroup parent) {
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (view == null) {
view = mInflater.inflate(R.layout.directory_item, parent, false);
holder = new ViewHolder(view);
view.setTag(holder);
if (convertView == null) {
convertView = mInflater.inflate(R.layout.directory_item, parent, false);
holder = new ViewHolder(convertView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) view.getTag();
holder = (ViewHolder) convertView.getTag();
}
final Directory dir = mDirs.get(position);
@ -45,7 +45,7 @@ public class DirectoryAdapter extends BaseAdapter {
Glide.with(mContext).load(dir.getThumbnail()).placeholder(R.color.tmb_background).centerCrop().crossFade()
.into(holder.dirThumbnail);
return view;
return convertView;
}
@Override

View file

@ -22,21 +22,21 @@ public class MediaAdapter extends BaseAdapter {
private final LayoutInflater mInflater;
public MediaAdapter(Context context, List<Medium> media) {
this.mContext = context;
this.mMedia = media;
this.mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mContext = context;
mMedia = media;
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public View getView(int position, View view, ViewGroup parent) {
public View getView(int position, View convertView, ViewGroup parent) {
final Medium medium = mMedia.get(position);
ViewHolder holder;
if (view == null) {
view = mInflater.inflate(R.layout.video_item, parent, false);
holder = new ViewHolder(view);
view.setTag(holder);
if (convertView == null) {
convertView = mInflater.inflate(R.layout.video_item, parent, false);
holder = new ViewHolder(convertView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) view.getTag();
holder = (ViewHolder) convertView.getTag();
}
if (medium.getIsVideo()) {
@ -48,7 +48,7 @@ public class MediaAdapter extends BaseAdapter {
final String path = medium.getPath();
Glide.with(mContext).load(path).placeholder(R.color.tmb_background).centerCrop().crossFade().into(holder.photoThumbnail);
return view;
return convertView;
}
@Override

View file

@ -23,8 +23,8 @@ public class MyPagerAdapter extends FragmentStatePagerAdapter {
public MyPagerAdapter(ViewPagerActivity act, FragmentManager fm, List<Medium> media) {
super(fm);
this.mActivity = act;
this.mMedia = media;
mActivity = act;
mMedia = media;
mFragments = new HashMap<>();
}