Search in sources :

Example 1 with DownsizeImageTask

use of com.keylesspalace.tusky.util.DownsizeImageTask in project Tusky by Vavassor.

the class ComposeActivity method downsizeMedia.

private void downsizeMedia(final QueuedMedia item) {
    item.readyStage = QueuedMedia.ReadyStage.DOWNSIZING;
    new DownsizeImageTask(STATUS_MEDIA_SIZE_LIMIT, getContentResolver(), new DownsizeImageTask.Listener() {

        @Override
        public void onSuccess(List<byte[]> contentList) {
            item.content = contentList.get(0);
            uploadMedia(item);
        }

        @Override
        public void onFailure() {
            onMediaDownsizeFailure(item);
        }
    }).execute(item.uri);
}
Also used : List(java.util.List) ArrayList(java.util.ArrayList) DownsizeImageTask(com.keylesspalace.tusky.util.DownsizeImageTask)

Example 2 with DownsizeImageTask

use of com.keylesspalace.tusky.util.DownsizeImageTask in project Tusky by tuskyapp.

the class ComposeActivity method downsizeMedia.

private void downsizeMedia(final QueuedMedia item) {
    item.readyStage = QueuedMedia.ReadyStage.DOWNSIZING;
    new DownsizeImageTask(STATUS_MEDIA_SIZE_LIMIT, getContentResolver(), new DownsizeImageTask.Listener() {

        @Override
        public void onSuccess(List<byte[]> contentList) {
            item.content = contentList.get(0);
            uploadMedia(item);
        }

        @Override
        public void onFailure() {
            onMediaDownsizeFailure(item);
        }
    }).execute(item.uri);
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) DownsizeImageTask(com.keylesspalace.tusky.util.DownsizeImageTask)

Aggregations

DownsizeImageTask (com.keylesspalace.tusky.util.DownsizeImageTask)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2