xmlで、私は持っていLinearLayoutます。その中で私はを使用していExpandableListViewます。すべての展開アイテムには、であるビューが1つだけ含まれていGridViewます。、、およびの3GridView cellつのUIコンポーネントで構成します。これらの3つのUIコンポーネントを制御する方法は、次のとおりです。ImageViewTextViewButton
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
物事はかなりうまく機能しています。つまり、各セルは異なるセルとして識別されます。それらは異なる画像、適切なTextViewラベル、そしてButtonクリックイベントもうまく機能しています。ボタンのクリックには、を使用したダウンロードを使用しましたProgressDialog。それもうまくいきます。私が欲しいのはButton、ダウンロードが進行中のときに無効にすることです。AsyncTask別のクラスで行われているダウンロード。ユーザーがダウンロードのためにクリックしたボタンを無効にするにはどうすればよいですか。