Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>finally i got answer of my own question i have created new adapter with use of android query library and implemented new grid view adapter to my screen and found great result with more smoothness in scroll view...</p> <p>here is my code</p> <pre><code>public class GalleryMainActivityGridViewAdapter extends BaseAdapter { AQuery listAQ; Context mContext; int layoutResourceId; ArrayList&lt;HashMap&lt;String, String&gt;&gt; dataArray; public GalleryMainActivityGridViewAdapter(Context context, ArrayList&lt;HashMap&lt;String, String&gt;&gt; resultArray) { this.mContext = context; // this.layoutResourceId = layoutId; this.dataArray = resultArray; listAQ = new AQuery(mContext); // aa = new ArrayAdapter&lt;Photo&gt;(mContext, layoutResourceId); } public int getCount() { return dataArray.size(); } public Object getItem(int position) { return position; } public long getItemId(int position) { return 0; } @SuppressWarnings("deprecation") public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = ((LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.gallery_main_page_grid_item, parent, false); } Holder holder = new Holder(); AQuery aq = listAQ.recycle(convertView); holder.imgView_Grid_Thumbnail_Gallery = (ImageView) convertView.findViewById(R.id.imgView_Grid_Thumbnail_Gallery); if (holder.imgView_Grid_Thumbnail_Gallery != null) { aq.id(holder.imgView_Grid_Thumbnail_Gallery.getId()).image(dataArray.get(position).get("thumbUrl") + "/11"); } holder.txtView_Grid_Name_Gallery = (TextView) convertView.findViewById(R.id.txtView_Grid_Name_Gallery); if (holder.txtView_Grid_Name_Gallery != null) { aq.id(holder.txtView_Grid_Name_Gallery.getId()).text(dataArray.get(position).get("user_name")); Typeface txtViewForName = Typeface.createFromAsset(convertView.getContext().getAssets(), "fonts/arial_bold.ttf"); holder.txtView_Grid_Name_Gallery.setTypeface(txtViewForName); } holder.imgView_GridItem_Gallery = (ImageView) convertView.findViewById(R.id.imgView_GridItem_Gallery); if (holder.imgView_GridItem_Gallery != null) { Bitmap cachedImage = aq.getCachedImage(R.drawable.loading); String publicUrl = dataArray.get(position).get("publicUrl") + "/13"; if (aq.shouldDelay(convertView, parent, publicUrl, 0)) { aq.id(holder.imgView_GridItem_Gallery.getId()).image(cachedImage, 0.75f); } else { aq.id(holder.imgView_GridItem_Gallery.getId()).image(publicUrl, true, true, 0, 0, cachedImage, 0, 0.75f); } } // if (holder.txtView_Grid_Views_Gallery != null) { // // } holder.imgView_Grid_PlayVideo = (ImageView) convertView.findViewById(R.id.imgView_Grid_PlayVideo); if (holder.imgView_Grid_PlayVideo != null) { if (dataArray.get(position).get("filetype").toString().equals("1")) { holder.imgView_Grid_PlayVideo.setVisibility(View.GONE); } else { holder.imgView_Grid_PlayVideo.setVisibility(View.VISIBLE); } } return convertView; } class Holder { ImageView imgView_Grid_PlayVideo; ImageView imgView_Grid_Thumbnail_Gallery; TextView txtView_Grid_Views_Gallery; TextView txtView_Grid_Name_Gallery; ImageView imgView_GridItem_Gallery; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload