Java Code Examples for com.squareup.tape.TaskQueue

The following examples show how to use com.squareup.tape.TaskQueue. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: glimmr   Source File: PhotoUploadActivity.java    License: Apache License 2.0 6 votes vote down vote up
@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());
}
 
Example 2
Source Project: goro   Source File: AppModule.java    License: Apache License 2.0 5 votes vote down vote up
@Provides @Singleton
public TaskQueue<TransactionTask> tokenTaskTaskQueue() {
  try {
    TaskSerializer serializer = new TaskSerializer();
    return new TaskQueue<>(
        new FileObjectQueue<>(appContext.getFileStreamPath("token-tasks"), serializer)
    );
  } catch (IOException e) {
    throw new AssertionError(e);
  }
}
 
Example 3
Source Project: glimmr   Source File: AddToGroupDialogFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    TaskQueueDelegateFactory<AddItemToGroupTask> factory =
        new TaskQueueDelegateFactory<AddItemToGroupTask>(mActivity);
    mQueue = new TaskQueue(factory.get(Constants.GROUP_QUEUE, AddItemToGroupTask.class));
    BusProvider.getInstance().register(this);
    setStyle(STYLE_NO_TITLE, 0);
}
 
Example 4
Source Project: glimmr   Source File: AddToPhotosetDialogFragment.java    License: Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example 5
Source Project: goro   Source File: SampleActivity.java    License: Apache License 2.0 4 votes vote down vote up
Enqueue(final TokenGenerator generator, final TaskQueue<TransactionTask> tape) {
  this.generator = generator;
  this.tape = tape;
}
 
Example 6
Source Project: glimmr   Source File: UploadPhotoTaskQueueService.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected void initTaskQueue() {
    TaskQueueDelegateFactory<UploadPhotoTask> factory =
            new TaskQueueDelegateFactory<UploadPhotoTask>(this);
    mQueue = new TaskQueue(factory.get(Constants.UPLOAD_QUEUE, UploadPhotoTask.class));
}
 
Example 7
Source Project: glimmr   Source File: AddToPhotosetTaskQueueService.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected void initTaskQueue() {
    TaskQueueDelegateFactory<AddItemToPhotosetTask> factory =
        new TaskQueueDelegateFactory<AddItemToPhotosetTask>(this);
    mQueue = new TaskQueue(factory.get(Constants.PHOTOSET_QUEUE, AddItemToPhotosetTask.class));
}
 
Example 8
Source Project: glimmr   Source File: AddToGroupTaskQueueService.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected void initTaskQueue() {
    TaskQueueDelegateFactory<AddItemToGroupTask> factory =
        new TaskQueueDelegateFactory<AddItemToGroupTask>(this);
    mQueue = new TaskQueue(factory.get(Constants.GROUP_QUEUE, AddItemToGroupTask.class));
}
 
Example 9
Source Project: denominator   Source File: ZoneListModule.java    License: Apache License 2.0 4 votes vote down vote up
@Provides
@Singleton
TaskQueue<ZoneList> taskQueue(ZoneListQueue zlq) {
  return zlq;
}