We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1. Place the standard GridView-adapter is used in the footer (or header); 2. Add Glide to this adapter with the settings as in the code below.
After this, a problem arises: no images are displayed
@Override protected void onCreate(Bundle savedInstanceState) { GridViewWithHeaderAndFooter numberGridView = (GridViewWithHeaderAndFooter) findViewById(R.id.number_view); LayoutInflater layoutIn = LayoutInflater.from(this); View footerView = layoutIn.inflate(R.layout.footer_view, null); GridView photoGridView = (GridView) footerView.findViewById(R.id.photo_view); photoGridView.setAdapter(new PhotoAdapter(this, photoList)); // photoList - ArrayList<String> list of photo names numberGridView.addFooterView(footerView); numberGridView.setAdapter(null); } private class PhotoAdapter extends BaseAdapter { Context myContext; List<String> myPhoto; LayoutInflater myLayout; ImageView myPhotoView; private PhotoAdapter(Context contextView, List<String> photoList) { myPhoto = photoList; myContext = contextView; myLayout = LayoutInflater.from(contextView); } @Override public int getCount() { return myPhoto.size(); } @Override public Object getItem(int position) { return myPhoto.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; if (view == null) { view = myLayout.inflate(R.layout.photo_view_item, parent, false); } myPhotoView = (ImageView) view.findViewById(R.id.photo_item); Glide .with(myContext) .load("http://site.ru/photos/" + getItem(position) + ".jpg") .diskCacheStrategy(DiskCacheStrategy.NONE) // IMPORTANT (IT IS NECESSARY) .skipMemoryCache(true) // IMPORTANT (IT IS NECESSARY) .into(myPhotoView); return view; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1. Place the standard GridView-adapter is used in the footer (or header);
2. Add Glide to this adapter with the settings as in the code below.
After this, a problem arises: no images are displayed
The text was updated successfully, but these errors were encountered: