Search in sources :

Example 6 with AssetModel

use of com.chute.sdk.v2.model.AssetModel in project photo-picker-plus-android by chute.

the class ServicesActivity method lastVideo.

@Override
public void lastVideo() {
    Uri videoUrl = MediaDAO.getLastVideoFromCurosr(getApplicationContext());
    if (videoUrl == null || videoUrl.toString().equals("")) {
        NotificationUtil.makeToast(getApplicationContext(), getResources().getString(R.string.no_camera_videos));
    } else {
        String videoThumbnail = MediaDAO.getLastVideoThumbnail(getApplicationContext());
        final AssetModel model = new AssetModel();
        model.setThumbnail(Uri.fromFile(new File(videoThumbnail)).toString());
        model.setUrl(Uri.fromFile(new File(videoThumbnail)).toString());
        model.setVideoUrl(videoUrl.toString());
        model.setType(MediaType.VIDEO.name().toLowerCase());
        IntentUtil.deliverDataToInitialActivity(ServicesActivity.this, model, null);
    }
}
Also used : AssetModel(com.chute.sdk.v2.model.AssetModel) Uri(android.net.Uri) File(java.io.File)

Example 7 with AssetModel

use of com.chute.sdk.v2.model.AssetModel in project photo-picker-plus-android by chute.

the class ServicesActivity method lastPhoto.

@Override
public void lastPhoto() {
    Uri uri = MediaDAO.getLastPhotoFromAllPhotos(getApplicationContext());
    if (uri.toString().equals("")) {
        NotificationUtil.makeToast(getApplicationContext(), getResources().getString(R.string.no_camera_photos));
    } else {
        final AssetModel model = new AssetModel();
        //model.setId(MediaDAO.getLastPhotoContentUri(getApplicationContext()).toString());
        model.setThumbnail(uri.toString());
        model.setUrl(uri.toString());
        model.setType(MediaType.IMAGE.name().toLowerCase());
        IntentUtil.deliverDataToInitialActivity(ServicesActivity.this, model, null);
    }
}
Also used : AssetModel(com.chute.sdk.v2.model.AssetModel) Uri(android.net.Uri)

Aggregations

AssetModel (com.chute.sdk.v2.model.AssetModel)7 Uri (android.net.Uri)3 File (java.io.File)3 Intent (android.content.Intent)1 Bitmap (android.graphics.Bitmap)1 AccountModel (com.chute.sdk.v2.model.AccountModel)1 DeliverMediaModel (com.getchute.android.photopickerplus.models.DeliverMediaModel)1 PhotoPickerPlusIntentWrapper (com.getchute.android.photopickerplus.util.intent.PhotoPickerPlusIntentWrapper)1 ArrayList (java.util.ArrayList)1