Search in sources :

Example 1 with CompressFormat

use of android.graphics.Bitmap.CompressFormat in project mobile-android by photo.

the class FeatherActivity method handleIntent.

/**
	 * Handle the original received intent.
	 * 
	 * @param intent
	 *           the intent
	 * @return the uri
	 */
protected Uri handleIntent(Intent intent) {
    LocalDataService service = mFilterManager.getService(LocalDataService.class);
    if (intent != null && intent.getData() != null) {
        Uri data = intent.getData();
        if (SystemUtils.isIceCreamSandwich()) {
            if (data.toString().startsWith("content://com.android.gallery3d.provider")) {
                // use the com.google provider, not the com.android provider ( for ICS only )
                data = Uri.parse(data.toString().replace("com.android.gallery3d", "com.google.android.gallery3d"));
            }
        }
        Bundle extras = intent.getExtras();
        if (extras != null) {
            Uri destUri = (Uri) extras.getParcelable(Constants.EXTRA_OUTPUT);
            if (destUri != null) {
                service.setDestImageUri(destUri);
                String outputFormatString = extras.getString(Constants.EXTRA_OUTPUT_FORMAT);
                if (outputFormatString != null) {
                    CompressFormat format = Bitmap.CompressFormat.valueOf(outputFormatString);
                    service.setOutputFormat(format);
                }
            }
            if (extras.containsKey(Constants.EXTRA_TOOLS_LIST)) {
                mToolList = Arrays.asList(extras.getStringArray(Constants.EXTRA_TOOLS_LIST));
            }
            if (extras.containsKey(Constants.EXTRA_HIDE_EXIT_UNSAVE_CONFIRMATION)) {
                mHideExitAlertConfirmation = extras.getBoolean(Constants.EXTRA_HIDE_EXIT_UNSAVE_CONFIRMATION);
            }
        }
        return data;
    }
    return null;
}
Also used : LocalDataService(com.aviary.android.feather.library.services.LocalDataService) CompressFormat(android.graphics.Bitmap.CompressFormat) Bundle(android.os.Bundle) Uri(android.net.Uri)

Aggregations

CompressFormat (android.graphics.Bitmap.CompressFormat)1 Uri (android.net.Uri)1 Bundle (android.os.Bundle)1 LocalDataService (com.aviary.android.feather.library.services.LocalDataService)1