use of android.widget.Gallery in project android_packages_apps_Launcher2 by CyanogenMod.
the class WallpaperChooserDialogFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
findWallpapers();
/* If this fragment is embedded in the layout of this activity, then we should
* generate a view to display. Otherwise, a dialog will be created in
* onCreateDialog()
*/
if (mEmbedded) {
View view = inflater.inflate(R.layout.wallpaper_chooser, container, false);
view.setBackground(mWallpaperDrawable);
final Gallery gallery = (Gallery) view.findViewById(R.id.gallery);
gallery.setCallbackDuringFling(false);
gallery.setOnItemSelectedListener(this);
gallery.setAdapter(new ImageAdapter(getActivity()));
View setButton = view.findViewById(R.id.set);
setButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
selectWallpaper(gallery.getSelectedItemPosition());
}
});
return view;
}
return null;
}
use of android.widget.Gallery in project android_frameworks_base by DirtyUnicorns.
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 android_frameworks_base by crdroidandroid.
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 SmartAndroidSource by jaychou2012.
the class Common method shouldDelayGallery.
private static boolean shouldDelayGallery(int position, View convertView, ViewGroup parent, String url) {
if (url == null || BitmapAjaxCallback.isMemoryCached(url)) {
return false;
}
Gallery gallery = (Gallery) parent;
Integer selected = (Integer) gallery.getTag(AQuery.TAG_NUM);
if (selected == null) {
selected = 0;
gallery.setTag(AQuery.TAG_NUM, 0);
gallery.setCallbackDuringFling(false);
Common common = new Common();
common.listen(gallery);
}
int first = gallery.getFirstVisiblePosition();
int last = gallery.getLastVisiblePosition();
int diff = last - first;
int delta = (diff / 2) + 1;
int from = selected - delta;
int to = selected + delta;
if (from < 0) {
//shift window back to positive region
to = to - from;
from = 0;
}
if ((position >= from && position <= to)) {
//AQUtility.debug("yes", position + ":" + from + "." + to);
convertView.setTag(AQuery.TAG_NUM, position);
return false;
}
//AQUtility.debug("no", position + ":" + from + "." + to);
convertView.setTag(AQuery.TAG_NUM, null);
return true;
}
use of android.widget.Gallery in project Android-Universal-Image-Loader by nostra13.
the class ImageGalleryFragment method onCreateView.
@SuppressWarnings("deprecation")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fr_image_gallery, container, false);
Gallery gallery = (Gallery) rootView.findViewById(R.id.gallery);
gallery.setAdapter(new ImageAdapter(getActivity()));
gallery.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
startImagePagerActivity(position);
}
});
return rootView;
}
Aggregations