use of com.bourke.glimmr.tasks.UploadPhotoTask in project glimmr by brk3.
the class UploadPhotoTaskQueueService method initTaskQueue.
@Override
protected void initTaskQueue() {
TaskQueueDelegateFactory<UploadPhotoTask> factory = new TaskQueueDelegateFactory<UploadPhotoTask>(this);
mQueue = new TaskQueue(factory.get(Constants.UPLOAD_QUEUE, UploadPhotoTask.class));
}
use of com.bourke.glimmr.tasks.UploadPhotoTask in project glimmr by brk3.
the class PhotoUploadActivity method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) {
case R.id.menu_upload_photos:
/* make sure to grab UI state for current photo before finishing */
mPhotoUploadFragment.updateMetadataFromUI();
/* now add each photo to upload queue, and start the tape service */
for (LocalPhotosGridFragment.LocalPhoto photo : mUploadImages) {
mUploadQueue.add(new UploadPhotoTask(mOAuth, photo));
}
startService(new Intent(this, UploadPhotoTaskQueueService.class));
final Intent mainActivity = new Intent(this, MainActivity.class);
mainActivity.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(mainActivity);
}
return super.onOptionsItemSelected(item);
}
use of com.bourke.glimmr.tasks.UploadPhotoTask in project glimmr by brk3.
the class PhotoUploadActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (BuildConfig.DEBUG)
Log.d(getLogTag(), "onCreate");
setContentView(R.layout.photo_upload_activity);
mPhotoUploadFragment = (PhotoUploadFragment) getSupportFragmentManager().findFragmentById(R.id.photoUploadFragment);
mActionBar.setDisplayHomeAsUpEnabled(true);
TaskQueueDelegateFactory<UploadPhotoTask> factory = new TaskQueueDelegateFactory<UploadPhotoTask>(this);
mUploadQueue = new TaskQueue(factory.get(Constants.UPLOAD_QUEUE, UploadPhotoTask.class));
/* hide the keyboard */
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
handleIntent(getIntent());
}
Aggregations