use of android.widget.Gallery in project platform_frameworks_base by android.
the class BiDiTestGalleryRtl method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.gallery_rtl, container, false);
Gallery g = (Gallery) v.findViewById(R.id.galleryview);
g.setAdapter(new BiDiTestGalleryImages(this.getActivity().getBaseContext()));
return v;
}
use of android.widget.Gallery in project coursera-android by aporter.
the class GalleryActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Gallery g = (Gallery) findViewById(R.id.gallery);
// Create a new ImageAdapter and set in as the Adapter for the Gallery
g.setAdapter(new ImageAdapter(this));
// Set an setOnItemClickListener on the Gallery
g.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
// Display a Toast message indicate the selected item
Toast.makeText(GalleryActivity.this, "" + position, Toast.LENGTH_SHORT).show();
}
});
}
use of android.widget.Gallery in project android_frameworks_base by ParanoidAndroid.
the class BiDiTestGalleryLtr method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.gallery_ltr, container, false);
Gallery g = (Gallery) v.findViewById(R.id.galleryview);
g.setAdapter(new BiDiTestGalleryImages(this.getActivity().getBaseContext()));
return v;
}
use of android.widget.Gallery in project ignition by mttkay.
the class RemoteImageGalleryActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.remote_image_gallery_sample);
RemoteImageView.setSharedImageLoader(new RemoteImageLoader(this));
Gallery gallery = (Gallery) findViewById(R.id.gallery);
gallery.setAdapter(new RemoteImageGalleryAdapter(this, Arrays.asList(imageUrls)) {
@Override
protected void onGetView(int position, RemoteImageView remoteImageView, ViewGroup remoteImageViewContainer, ViewGroup parent) {
// just to illustrate how you can adjust aspects of the rendered images here
remoteImageView.setScaleType(ScaleType.CENTER_CROP);
remoteImageViewContainer.setBackgroundResource(android.R.drawable.gallery_thumb);
int padding = IgnitedScreens.dipToPx(parent.getContext(), 15);
remoteImageViewContainer.setPadding(padding, padding, padding, padding);
}
});
}
use of android.widget.Gallery in project UltimateAndroid by cymcsg.
the class ImageFilterActivity method LoadImageFilter.
/**
* ����ͼƬfilter
*/
private void LoadImageFilter() {
Gallery gallery = (Gallery) findViewById(R.id.galleryFilter);
final ImageFilterAdapter filterAdapter = new ImageFilterAdapter(ImageFilterActivity.this);
gallery.setAdapter(new ImageFilterAdapter(ImageFilterActivity.this));
gallery.setSelection(2);
gallery.setAnimationDuration(3000);
gallery.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long id) {
IImageFilter filter = (IImageFilter) filterAdapter.getItem(position);
new processImageTask(ImageFilterActivity.this, filter).execute();
}
});
}
Aggregations