Example #1
0
 private void sendSelectedPhotos() {
   if (selectedPhotos.isEmpty() && selectedWebPhotos.isEmpty()
       || delegate == null
       || sendPressed) {
     return;
   }
   sendPressed = true;
   delegate.actionButtonPressed(false);
   finishFragment();
 }
Example #2
0
 @Override
 public void setPhotoChecked(int index) {
   boolean add = true;
   if (selectedAlbum != null) {
     if (index < 0 || index >= selectedAlbum.photos.size()) {
       return;
     }
     MediaController.PhotoEntry photoEntry = selectedAlbum.photos.get(index);
     if (selectedPhotos.containsKey(photoEntry.imageId)) {
       selectedPhotos.remove(photoEntry.imageId);
       add = false;
     } else {
       selectedPhotos.put(photoEntry.imageId, photoEntry);
     }
   } else {
     MediaController.SearchImage photoEntry;
     ArrayList<MediaController.SearchImage> array;
     if (searchResult.isEmpty() && lastSearchString == null) {
       array = recentImages;
     } else {
       array = searchResult;
     }
     if (index < 0 || index >= array.size()) {
       return;
     }
     photoEntry = array.get(index);
     if (selectedWebPhotos.containsKey(photoEntry.id)) {
       selectedWebPhotos.remove(photoEntry.id);
       add = false;
     } else {
       selectedWebPhotos.put(photoEntry.id, photoEntry);
     }
   }
   int count = listView.getChildCount();
   for (int a = 0; a < count; a++) {
     View view = listView.getChildAt(a);
     int num = (Integer) view.getTag();
     if (num == index) {
       ((PhotoPickerPhotoCell) view).checkBox.setChecked(add, false);
       break;
     }
   }
   pickerBottomLayout.updateSelectedCount(selectedPhotos.size() + selectedWebPhotos.size(), true);
   delegate.selectedPhotosChanged();
 }
Example #3
0
 @Override
 public void cancelButtonPressed() {
   delegate.actionButtonPressed(true);
   finishFragment();
 }