我在我的项目中使用全屏画廊,并且画廊我正在使用画廊的支持基础适配器现在我必须使画廊禁用/停止画廊的滚动,直到在按钮单击时显示弹出窗口任何人都可以帮助我解决这个问题?
--> 下面是使用库的基本适配器而不是扩展库的片段。
public class SubItemSelectedImageAdapter extends BaseAdapter {
int mGalleryItemBackground;
private Context mContext;
private String[] mImageIds;
ImageView[] mImages;
public SubItemSelectedImageAdapter(Context c, String[] mImageIds2) {
mImageIds = mImageIds2;
mImages = new ImageView[mImageIds.length];
mContext = c;
TypedArray attr = mContext
.obtainStyledAttributes(R.styleable.HelloGallery);
attr.recycle();
}
public int getCount() {
return mImageIds.length;
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
ImageView imageView = new ImageView(mContext);
imageView.setImageURI(Uri.fromFile(new File(mImageIds[position])));
imageView.setLayoutParams(new Gallery.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
return imageView;
}
}
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub
}
public void onTextChanged(CharSequence s, int start, int before, int count) {
// TODO Auto-generated method stub
}
}
并 delaring Gallery 对象并从 xml 引用它...
// full screen gallery implementation.
ImageAdapter = new SubItemSelectedImageAdapter(this, data);
Gallery gallery = (Gallery) findViewById(R.id.gallery);
gallery.setAdapter(ImageAdapter);