ImageIntent extends ContentIntent<ImageIntent> { @Override public ImageIntent input(@Nullable final Uri uri) { super.input(uri); if (uri != null) { this.dataType = MimeType.IMAGE; } return this; }  @NonNull static Intent createGalleryIntent(); @NonNull static Intent createCameraIntent(); @NonNull static Intent createCameraIntent(@Nullable final File outputFile); @NonNull static Intent createCameraIntent(@Nullable final Uri outputUri); @Nullable static File createImageFile(); @Nullable static File createImageFile(@NonNull final String fileName); @SuppressWarnings("ConstantConditions") @Override ImageIntent withDefaultHandlers(@NonNull final Context context); @Override ImageIntent input(@Nullable final Uri uri); @Override ImageIntent output(@Nullable final Uri uri); static final int REQUEST_CODE_GALLERY; static final int REQUEST_CODE_CAMERA; static final String IMAGE_FILE_NAME_FORMAT; }
@Test public void testInput() { final ImageIntent intent = new ImageIntent(); intent.input(new File("input.tmp")); assertThat(intent.dataType(), is(MimeType.IMAGE)); }
@Test public void testInputWithNullValue() { final ImageIntent intent = new ImageIntent(); intent.input(new File("input.tmp")); assertThat(intent.dataType(), is(notNullValue())); intent.input((Uri) null); assertThat(intent.uri(), is(nullValue())); assertThat(intent.dataType(), is(nullValue())); }