use of com.bourke.glimmr.tasks.AddItemToPhotosetTask in project glimmr by brk3.
the class AddToPhotosetTaskQueueService method initTaskQueue.
@Override
protected void initTaskQueue() {
TaskQueueDelegateFactory<AddItemToPhotosetTask> factory = new TaskQueueDelegateFactory<AddItemToPhotosetTask>(this);
mQueue = new TaskQueue(factory.get(Constants.PHOTOSET_QUEUE, AddItemToPhotosetTask.class));
}
use of com.bourke.glimmr.tasks.AddItemToPhotosetTask in project glimmr by brk3.
the class AddToPhotosetDialogFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mLayout = (LinearLayout) inflater.inflate(R.layout.add_to_photoset_fragment, container, false);
TextView titleTextView = (TextView) mLayout.findViewById(R.id.titleText);
titleTextView.setText(R.string.add_photos);
mTextUtils.setFont(titleTextView, TextUtils.FONT_ROBOTOBOLD);
//ProgressBar progressBar = (ProgressBar)
// mLayout.findViewById(R.id.progressIndicator);
/* Nested fragments have to be added this way, not from xml */
FragmentTransaction ft = getChildFragmentManager().beginTransaction();
final boolean retainInstance = false;
final PhotoStreamGridFragment frag = PhotoStreamGridFragment.newInstance(mOAuth.getUser(), retainInstance, ListView.CHOICE_MODE_MULTIPLE);
ft.replace(R.id.photoStreamFragment, frag);
ft.commit();
/* When add button is clicked, get selected ids and add to queue */
mLayout.findViewById(R.id.buttonAddToPhotoset).setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
List<Photo> selectedPhotos = frag.getSelectedPhotos();
for (Photo photo : selectedPhotos) {
mQueue.add(new AddItemToPhotosetTask(mPhotoset.getId(), photo.getId(), mOAuth));
}
mActivity.startService(new Intent(mActivity, AddToPhotosetTaskQueueService.class));
dismiss();
Crouton.makeText(mActivity, R.string.photos_will_be_added, Style.CONFIRM).show();
}
});
return mLayout;
}
use of com.bourke.glimmr.tasks.AddItemToPhotosetTask in project glimmr by brk3.
the class AddToPhotosetDialogFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TaskQueueDelegateFactory<AddItemToPhotosetTask> factory = new TaskQueueDelegateFactory<AddItemToPhotosetTask>(mActivity);
mQueue = new TaskQueue(factory.get(Constants.PHOTOSET_QUEUE, AddItemToPhotosetTask.class));
setStyle(STYLE_NO_TITLE, 0);
}
Aggregations