Search in sources :

Example 6 with AudioAttachment

use of ve.com.abicelis.remindy.model.attachment.AudioAttachment in project Remindy by abicelis.

the class TaskDetailActivity method onClick.

@Override
public void onClick(View v) {
    int id = v.getId();
    mAttachmentsFabMenu.close(true);
    switch(id) {
        case R.id.activity_task_detail_add_list_attachment:
            addAttachment(new ListAttachment());
            break;
        case R.id.activity_task_detail_add_text_attachment:
            addAttachment(new TextAttachment(""));
            break;
        case R.id.activity_task_detail_add_link_attachment:
            addAttachment(new LinkAttachment(""));
            break;
        case R.id.activity_task_detail_add_image_attachment:
            addAttachment(new ImageAttachment());
            break;
        case R.id.activity_task_detail_add_audio_attachment:
            addAttachment(new AudioAttachment());
            break;
        case R.id.activity_task_detail_done_button:
            if (mTask.getDoneDate() == null) {
                mTask.setDoneDate(CalendarUtil.getNewInstanceZeroedCalendar());
                mTask.setStatus(TaskStatus.DONE);
            } else {
                mTask.setDoneDate(null);
                mTask.setStatus((mTask.getReminderType() == ReminderType.NONE ? TaskStatus.UNPROGRAMMED : TaskStatus.PROGRAMMED));
            }
            mTaskDataUpdated = true;
            //Force a TASK_DETAIL_RETURN_ACTION_EDITED_REMINDER state.
            mOldReminderJson = "!";
            setUpDoneOrOverdue();
            break;
    }
    //Scroll to added item
    if (mAdapter != null && mAdapter.getItemCount() > 0)
        mRecyclerView.smoothScrollToPosition(mAdapter.getItemCount() - 1);
}
Also used : TextAttachment(ve.com.abicelis.remindy.model.attachment.TextAttachment) LinkAttachment(ve.com.abicelis.remindy.model.attachment.LinkAttachment) AudioAttachment(ve.com.abicelis.remindy.model.attachment.AudioAttachment) ListAttachment(ve.com.abicelis.remindy.model.attachment.ListAttachment) ImageAttachment(ve.com.abicelis.remindy.model.attachment.ImageAttachment)

Aggregations

AudioAttachment (ve.com.abicelis.remindy.model.attachment.AudioAttachment)6 ImageAttachment (ve.com.abicelis.remindy.model.attachment.ImageAttachment)6 LinkAttachment (ve.com.abicelis.remindy.model.attachment.LinkAttachment)5 ListAttachment (ve.com.abicelis.remindy.model.attachment.ListAttachment)5 TextAttachment (ve.com.abicelis.remindy.model.attachment.TextAttachment)5 Attachment (ve.com.abicelis.remindy.model.attachment.Attachment)3 InvalidParameterException (java.security.InvalidParameterException)2 AudioAttachmentViewHolder (ve.com.abicelis.remindy.app.holders.AudioAttachmentViewHolder)1 ImageAttachmentViewHolder (ve.com.abicelis.remindy.app.holders.ImageAttachmentViewHolder)1 LinkAttachmentViewHolder (ve.com.abicelis.remindy.app.holders.LinkAttachmentViewHolder)1 ListAttachmentViewHolder (ve.com.abicelis.remindy.app.holders.ListAttachmentViewHolder)1 TextAttachmentViewHolder (ve.com.abicelis.remindy.app.holders.TextAttachmentViewHolder)1 AttachmentType (ve.com.abicelis.remindy.enums.AttachmentType)1