public class PhotoEditor
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PhotoEditor.Builder
Builder pattern to define
PhotoEditor Instance |
static interface |
PhotoEditor.OnSaveListener
A callback to save the edited image asynchronously
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEmoji(java.lang.String emojiName)
Adds emoji to the
PhotoEditorView which you drag,rotate and scale using pinch
if PhotoEditor.Builder.setPinchTextScalable(boolean) enabled |
void |
addEmoji(android.graphics.Typeface emojiTypeface,
java.lang.String emojiName)
Adds emoji to the
PhotoEditorView which you drag,rotate and scale using pinch
if PhotoEditor.Builder.setPinchTextScalable(boolean) enabled |
void |
addImage(android.graphics.Bitmap desiredImage)
This will add image on
PhotoEditorView which you drag,rotate and scale using pinch
if PhotoEditor.Builder.setPinchTextScalable(boolean) enabled |
void |
addText(java.lang.String text,
int colorCodeTextView)
This add the text on the
PhotoEditorView with provided parameters
by default TextView.setText(int) will be 18sp |
void |
addText(java.lang.String text,
TextStyleBuilder styleBuilder)
This add the text on the
PhotoEditorView with provided parameters
by default TextView.setText(int) will be 18sp |
void |
addText(android.graphics.Typeface textTypeface,
java.lang.String text,
int colorCodeTextView)
This add the text on the
PhotoEditorView with provided parameters
by default TextView.setText(int) will be 18sp |
PhotoEditor |
brushEraser()
Its enables eraser mode after that whenever user drags on screen this will erase the existing
paint
Note : This eraser will work on paint views only |
void |
clearAllViews()
Removes all the edited operations performed
PhotoEditorView
This will also clear the undo and redo stack |
void |
clearHelperBox()
Remove all helper boxes from views
|
void |
editText(android.view.View view,
java.lang.String inputText,
int colorCode)
This will update text and color on provided view
|
void |
editText(android.view.View view,
java.lang.String inputText,
TextStyleBuilder styleBuilder)
This will update the text and color on provided view
|
void |
editText(android.view.View view,
android.graphics.Typeface textTypeface,
java.lang.String inputText,
int colorCode)
This will update the text and color on provided view
|
int |
getBrushColor() |
java.lang.Boolean |
getBrushDrawableMode() |
float |
getBrushSize() |
static java.util.ArrayList<java.lang.String> |
getEmojis(android.content.Context context)
Provide the list of emoji in form of unicode string
|
float |
getEraserSize() |
boolean |
isCacheEmpty()
Check if any changes made need to save
|
void |
onStartDrawing() |
void |
onStopDrawing() |
void |
onViewAdd(BrushDrawingView brushDrawingView) |
void |
onViewRemoved(BrushDrawingView brushDrawingView) |
boolean |
redo()
Redo the last operation perform on the
PhotoEditor |
void |
saveAsBitmap(OnBitmapSaveListener onBitmapSaveListener)
Save the edited image as bitmap
|
void |
saveAsBitmap(SaveSettings saveSettings,
OnBitmapSaveListener onBitmapSaveListener)
Save the edited image as bitmap
|
void |
saveAsFile(java.lang.String imagePath,
PhotoEditor.OnSaveListener onSaveListener)
Save the edited image on given path
|
void |
saveAsFile(java.lang.String imagePath,
SaveSettings saveSettings,
PhotoEditor.OnSaveListener onSaveListener)
Save the edited image on given path
|
PhotoEditor |
setBrushColor(int color)
set brush color which user want to paint
|
PhotoEditor |
setBrushDrawingMode(boolean brushDrawingMode)
Enable/Disable drawing mode to draw on
PhotoEditorView |
PhotoEditor |
setBrushEraserSize(float brushEraserSize)
set the eraser size
Note : Eraser size is different from the normal brush size |
PhotoEditor |
setBrushSize(float size)
set the size of bursh user want to paint on canvas i.e
BrushDrawingView |
PhotoEditor |
setFilterEffect(CustomEffect customEffect)
Setup of custom effect using effect type and set parameters values
|
PhotoEditor |
setFilterEffect(PhotoFilter filterType)
Set pre-define filter available
|
PhotoEditor |
setOnPhotoEditorListener(OnPhotoEditorListener onPhotoEditorListener)
Callback on editing operation perform on
PhotoEditorView |
PhotoEditor |
setOpacity(int opacity)
set opacity/transparency of brush while painting on
BrushDrawingView |
boolean |
undo()
Undo the last operation perform on the
PhotoEditor |
public void addImage(android.graphics.Bitmap desiredImage)
PhotoEditorView which you drag,rotate and scale using pinch
if PhotoEditor.Builder.setPinchTextScalable(boolean) enableddesiredImage - bitmap image you want to addpublic void addText(java.lang.String text,
int colorCodeTextView)
PhotoEditorView with provided parameters
by default TextView.setText(int) will be 18sptext - text to displaycolorCodeTextView - text color to be displayedpublic void addText(android.graphics.Typeface textTypeface,
java.lang.String text,
int colorCodeTextView)
PhotoEditorView with provided parameters
by default TextView.setText(int) will be 18sptextTypeface - typeface for custom font in the texttext - text to displaycolorCodeTextView - text color to be displayedpublic void addText(java.lang.String text,
TextStyleBuilder styleBuilder)
PhotoEditorView with provided parameters
by default TextView.setText(int) will be 18sptext - text to displaystyleBuilder - text style builder with your stylepublic void editText(android.view.View view,
java.lang.String inputText,
int colorCode)
view - view on which you want updateinputText - text to update TextViewcolorCode - color to update on TextViewpublic void editText(android.view.View view,
android.graphics.Typeface textTypeface,
java.lang.String inputText,
int colorCode)
view - root view where text view is a childtextTypeface - update typeface for custom font in the textinputText - text to update TextViewcolorCode - color to update on TextViewpublic void editText(android.view.View view,
java.lang.String inputText,
TextStyleBuilder styleBuilder)
view - root view where text view is a childinputText - text to update TextViewstyleBuilder - style to apply on TextViewpublic void addEmoji(java.lang.String emojiName)
PhotoEditorView which you drag,rotate and scale using pinch
if PhotoEditor.Builder.setPinchTextScalable(boolean) enabledemojiName - unicode in form of string to display emojipublic void addEmoji(android.graphics.Typeface emojiTypeface,
java.lang.String emojiName)
PhotoEditorView which you drag,rotate and scale using pinch
if PhotoEditor.Builder.setPinchTextScalable(boolean) enabledemojiTypeface - typeface for custom font to show emoji unicode in specific fontemojiName - unicode in form of string to display emojipublic PhotoEditor setBrushDrawingMode(boolean brushDrawingMode)
PhotoEditorViewbrushDrawingMode - true if mode is enabledpublic java.lang.Boolean getBrushDrawableMode()
public PhotoEditor setBrushSize(float size)
BrushDrawingViewsize - size of brushpublic PhotoEditor setOpacity(int opacity)
BrushDrawingViewopacity - opacity is in form of percentagepublic PhotoEditor setBrushColor(int color)
color - color value for paintpublic PhotoEditor setBrushEraserSize(float brushEraserSize)
brushEraserSize - size of eraserpublic float getEraserSize()
setBrushEraserSize(float)public float getBrushSize()
setBrushSize(float)public int getBrushColor()
setBrushColor(int)public PhotoEditor brushEraser()
Its enables eraser mode after that whenever user drags on screen this will erase the existing
paint
Note : This eraser will work on paint views only
public boolean undo()
PhotoEditorpublic boolean redo()
PhotoEditorpublic void clearAllViews()
PhotoEditorView
This will also clear the undo and redo stackpublic void clearHelperBox()
public PhotoEditor setFilterEffect(CustomEffect customEffect)
customEffect - CustomEffect.Builder.setParameter(String, Object)public PhotoEditor setFilterEffect(PhotoFilter filterType)
filterType - type of filter want to apply PhotoEditorpublic void saveAsFile(java.lang.String imagePath,
PhotoEditor.OnSaveListener onSaveListener)
imagePath - path on which image to be savedonSaveListener - callback for saving imagePhotoEditor.OnSaveListenerpublic void saveAsFile(java.lang.String imagePath,
SaveSettings saveSettings,
PhotoEditor.OnSaveListener onSaveListener)
imagePath - path on which image to be savedsaveSettings - builder for multiple save options SaveSettingsonSaveListener - callback for saving imagePhotoEditor.OnSaveListenerpublic void saveAsBitmap(OnBitmapSaveListener onBitmapSaveListener)
onBitmapSaveListener - callback for saving image as bitmapOnBitmapSaveListenerpublic void saveAsBitmap(SaveSettings saveSettings, OnBitmapSaveListener onBitmapSaveListener)
saveSettings - builder for multiple save options SaveSettingsonBitmapSaveListener - callback for saving image as bitmapOnBitmapSaveListenerpublic PhotoEditor setOnPhotoEditorListener(OnPhotoEditorListener onPhotoEditorListener)
PhotoEditorViewonPhotoEditorListener - OnPhotoEditorListenerpublic boolean isCacheEmpty()
public void onViewAdd(BrushDrawingView brushDrawingView)
public void onViewRemoved(BrushDrawingView brushDrawingView)
public void onStartDrawing()
public void onStopDrawing()
public static java.util.ArrayList<java.lang.String> getEmojis(android.content.Context context)
context - mContext