public static class UCrop.Options
extends java.lang.Object
UCrop.withOptions(Options)| Constructor and Description |
|---|
Options() |
| Modifier and Type | Method and Description |
|---|---|
android.os.Bundle |
getOptionBundle() |
void |
setActiveWidgetColor(int color) |
void |
setAllowedGestures(int tabScale,
int tabRotate,
int tabAspectRatio)
Choose what set of gestures will be enabled on each tab - if any.
|
void |
setAspectRatioOptions(int selectedByDefault,
AspectRatio... aspectRatio)
Pass an ordered list of desired aspect ratios that should be available for a user.
|
void |
setCircleDimmedLayer(boolean isCircle) |
void |
setCompressionFormat(android.graphics.Bitmap.CompressFormat format)
Set one of
Bitmap.CompressFormat that will be used to save resulting Bitmap. |
void |
setCompressionQuality(int compressQuality)
Set compression quality [0-100] that will be used to save resulting Bitmap.
|
void |
setCropFrameColor(int color) |
void |
setCropFrameStrokeWidth(int width) |
void |
setCropGridColor(int color) |
void |
setCropGridColumnCount(int count) |
void |
setCropGridRowCount(int count) |
void |
setCropGridStrokeWidth(int width) |
void |
setDimmedLayerColor(int color) |
void |
setFreeStyleCropEnabled(boolean enabled) |
void |
setHideBottomControls(boolean hide) |
void |
setImageToCropBoundsAnimDuration(int durationMillis)
This method sets animation duration for image to wrap the crop bounds
|
void |
setLogoColor(int color) |
void |
setMaxBitmapSize(int maxBitmapSize)
Setter for max size for both width and height of bitmap that will be decoded from an input Uri and used in the view.
|
void |
setMaxScaleMultiplier(float maxScaleMultiplier)
This method sets multiplier that is used to calculate max image scale from min image scale.
|
void |
setRootViewBackgroundColor(int color) |
void |
setShowCropFrame(boolean show) |
void |
setShowCropGrid(boolean show) |
void |
setStatusBarColor(int color) |
void |
setToolbarCancelDrawable(int drawable) |
void |
setToolbarColor(int color) |
void |
setToolbarCropDrawable(int drawable) |
void |
setToolbarTitle(java.lang.String text) |
void |
setToolbarWidgetColor(int color) |
void |
useSourceImageAspectRatio()
Set an aspect ratio for crop bounds that is evaluated from source image width and height.
|
void |
withAspectRatio(float x,
float y)
Set an aspect ratio for crop bounds.
|
void |
withMaxResultSize(int width,
int height)
Set maximum size for result cropped image.
|
public static final java.lang.String EXTRA_COMPRESSION_FORMAT_NAME
public static final java.lang.String EXTRA_COMPRESSION_QUALITY
public static final java.lang.String EXTRA_ALLOWED_GESTURES
public static final java.lang.String EXTRA_MAX_BITMAP_SIZE
public static final java.lang.String EXTRA_MAX_SCALE_MULTIPLIER
public static final java.lang.String EXTRA_IMAGE_TO_CROP_BOUNDS_ANIM_DURATION
public static final java.lang.String EXTRA_DIMMED_LAYER_COLOR
public static final java.lang.String EXTRA_CIRCLE_DIMMED_LAYER
public static final java.lang.String EXTRA_SHOW_CROP_FRAME
public static final java.lang.String EXTRA_CROP_FRAME_COLOR
public static final java.lang.String EXTRA_CROP_FRAME_STROKE_WIDTH
public static final java.lang.String EXTRA_SHOW_CROP_GRID
public static final java.lang.String EXTRA_CROP_GRID_ROW_COUNT
public static final java.lang.String EXTRA_CROP_GRID_COLUMN_COUNT
public static final java.lang.String EXTRA_CROP_GRID_COLOR
public static final java.lang.String EXTRA_CROP_GRID_STROKE_WIDTH
public static final java.lang.String EXTRA_TOOL_BAR_COLOR
public static final java.lang.String EXTRA_STATUS_BAR_COLOR
public static final java.lang.String EXTRA_UCROP_COLOR_WIDGET_ACTIVE
public static final java.lang.String EXTRA_UCROP_WIDGET_COLOR_TOOLBAR
public static final java.lang.String EXTRA_UCROP_TITLE_TEXT_TOOLBAR
public static final java.lang.String EXTRA_UCROP_WIDGET_CANCEL_DRAWABLE
public static final java.lang.String EXTRA_UCROP_WIDGET_CROP_DRAWABLE
public static final java.lang.String EXTRA_UCROP_LOGO_COLOR
public static final java.lang.String EXTRA_HIDE_BOTTOM_CONTROLS
public static final java.lang.String EXTRA_FREE_STYLE_CROP
public static final java.lang.String EXTRA_ASPECT_RATIO_SELECTED_BY_DEFAULT
public static final java.lang.String EXTRA_ASPECT_RATIO_OPTIONS
public static final java.lang.String EXTRA_UCROP_ROOT_VIEW_BACKGROUND_COLOR
public android.os.Bundle getOptionBundle()
public void setCompressionFormat(android.graphics.Bitmap.CompressFormat format)
Bitmap.CompressFormat that will be used to save resulting Bitmap.public void setCompressionQuality(int compressQuality)
public void setAllowedGestures(int tabScale,
int tabRotate,
int tabAspectRatio)
public void setMaxScaleMultiplier(float maxScaleMultiplier)
maxScaleMultiplier - - (minScale * maxScaleMultiplier) = maxScalepublic void setImageToCropBoundsAnimDuration(int durationMillis)
durationMillis - - duration in millisecondspublic void setMaxBitmapSize(int maxBitmapSize)
maxBitmapSize - - size in pixelspublic void setDimmedLayerColor(int color)
color - - desired color of dimmed area around the crop boundspublic void setCircleDimmedLayer(boolean isCircle)
isCircle - - set it to true if you want dimmed layer to have an circle insidepublic void setShowCropFrame(boolean show)
show - - set to true if you want to see a crop frame rectangle on top of an imagepublic void setCropFrameColor(int color)
color - - desired color of crop framepublic void setCropFrameStrokeWidth(int width)
width - - desired width of crop frame line in pixelspublic void setShowCropGrid(boolean show)
show - - set to true if you want to see a crop grid/guidelines on top of an imagepublic void setCropGridRowCount(int count)
count - - crop grid rows count.public void setCropGridColumnCount(int count)
count - - crop grid columns count.public void setCropGridColor(int color)
color - - desired color of crop grid/guidelinespublic void setCropGridStrokeWidth(int width)
width - - desired width of crop grid lines in pixelspublic void setToolbarColor(int color)
color - - desired resolved color of the toolbarpublic void setStatusBarColor(int color)
color - - desired resolved color of the statusbarpublic void setActiveWidgetColor(int color)
color - - desired resolved color of the active and selected widget (default is orange) and progress wheel middle linepublic void setToolbarWidgetColor(int color)
color - - desired resolved color of Toolbar text and buttons (default is darker orange)public void setToolbarTitle(java.lang.String text)
text - - desired text for Toolbar titlepublic void setToolbarCancelDrawable(int drawable)
drawable - - desired drawable for the Toolbar left cancel iconpublic void setToolbarCropDrawable(int drawable)
drawable - - desired drawable for the Toolbar right crop iconpublic void setLogoColor(int color)
color - - desired resolved color of logo fill (default is darker grey)public void setHideBottomControls(boolean hide)
hide - - set to true to hide the bottom controls (shown by default)public void setFreeStyleCropEnabled(boolean enabled)
enabled - - set to true to let user resize crop bounds (disabled by default)public void setAspectRatioOptions(int selectedByDefault,
AspectRatio... aspectRatio)
selectedByDefault - - index of aspect ratio option that is selected by default (starts with 0).aspectRatio - - list of aspect ratio options that are available to userpublic void setRootViewBackgroundColor(int color)
color - - desired background color that should be applied to the root viewpublic void withAspectRatio(float x,
float y)
x - aspect ratio Xy - aspect ratio Ypublic void useSourceImageAspectRatio()
public void withMaxResultSize(int width,
int height)
width - max cropped image widthheight - max cropped image height