use of com.abewy.android.apps.klyph.widget.CheckableGalleryLayout in project Klyph by jonathangerbaud.
the class GalleryFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
loadingView = (ProgressBar) view.findViewById(android.R.id.progress);
setListVisible(false);
super.onViewCreated(view, savedInstanceState);
imageUris = new ArrayList<String>();
getGridView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
getGridView().setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> gridView, View view, int position, long id) {
GraphObject o = getAdapter().getItem(position);
if (o instanceof CameraObject) {
Intent intent = new Intent(getActivity(), GalleryActivity.class);
intent.putExtra(KlyphBundleExtras.CAMERA_PICTURES, true);
intent.putStringArrayListExtra(KlyphBundleExtras.PHOTO_LIST_URI, (ArrayList<String>) initUris);
startActivityForResult(intent, CAMERA_GALLERY_CODE);
} else {
if (!Android.isMinAPI(11)) {
CheckableGalleryLayout cgl = (CheckableGalleryLayout) view;
cgl.toggle();
Picture image = (Picture) o;
image.setSelected(cgl.isChecked());
}
if (actionMode == null)
actionMode = getActivity().startActionMode(mActionModeCallback);
refreshActionModeTitle();
}
}
});
showCamera = !getActivity().getIntent().getBooleanExtra(KlyphBundleExtras.CAMERA_PICTURES, false);
hasCamera = getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA) || getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT);
defineEmptyText(R.string.empty_list_no_photo);
}
Aggregations