In a xml, I am having LinearLayout
.
Inside that I am using an ExpandableListView
.
Every expand item contain just one view which is a GridView
.
A GridView cell
compose with three UI components which are ImageView
, TextView
and a Button
.
How I have got control about those three UI components is as follow,
public View getView(final int position, View convertView, ViewGroup parent) {
LayoutInflater layoutInflater = (LayoutInflater) imageAdapterContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (convertView == null) {
convertView = layoutInflater.inflate(R.layout.single_grid_item, null);
viewHolder = new ViewHolder();
viewHolder.singleImageView = (ImageView) convertView.findViewById(R.id.singleGridItem_imageView);
viewHolder.singleTextView = (TextView) convertView.findViewById(R.id.singleGridItem_textView);
viewHolder.singleDownloadButton = (Button) convertView.findViewById(R.id.singleGridItem_download_button);
}
}
// ViewHolder is a static nested inner class
Things are working prety fine. That means each cell identify as different cells.
They have different images, and appropriate TextView
labels and also Button
click event also working fine.
For the button click I have used a downloading with a ProgressDialog
. That also working fine.
What I want is disable the Button
when the downloading in progress.
Downloading happening in a seperate AsyncTask
class.
Please tell me how can I disable the button which user has clicked for downloading.