public class ImgLyConfig extends Settings<ly.img.android.sdk.models.state.ImgLyConfig.Event> implements android.os.Parcelable
Settings.RevertibleFieldStateObservable.StateUnbindedExeption| Modifier and Type | Field and Description |
|---|---|
static android.os.Parcelable.Creator<ImgLyConfig> |
CREATOR |
isRevertible, revertibleFields, STATE_REVERTED, STATE_REVERTED_EVENTSTATE_INVALID, STATE_INVALID_EVENT| Modifier | Constructor and Description |
|---|---|
|
ImgLyConfig() |
protected |
ImgLyConfig(android.os.Parcel in) |
getFrozenSettings, getSettingsModel, hasRevertableState, isRevertible, revertState, saveStateaddCallback, getStateModel, invalidate, isFrozen, isInvalidateble, notifyChange, notifyPropertyChanged, notifyPropertyChanged, onBind, onBind, removeCallbackpublic static final android.os.Parcelable.Creator<ImgLyConfig> CREATOR
public ImgLyConfig()
protected ImgLyConfig(android.os.Parcel in)
@NonNull public java.util.ArrayList<AbstractConfig.FontConfigInterface> getFontConfig()
@NonNull public java.util.ArrayList<AbstractConfig.ImageFilterInterface> getFilterConfig()
public java.util.ArrayList<AbstractConfig.FrameConfigInterface> getFrameConfig()
@NonNull public java.util.ArrayList<AbstractConfig.ToolConfigInterface> getTools()
public ImgLyConfig setTools(@NonNull java.util.ArrayList<AbstractConfig.ToolConfigInterface> tools)
ArrayList<AbstractConfig.ToolConfigInterface> tools = new ArrayList<>() tools.add(new CropTool(R.string.imgly_tool_name_crop, R.drawable.imgly_icon_option_crop)); tools.add(new TextTool(R.string.imgly_tool_name_text, R.drawable.imgly_icon_option_text)); tools.add(new FilterTool(R.string.imgly_tool_name_filter, R.drawable.imgly_icon_option_filters)); tools.add(new OrientationTool(R.string.imgly_tool_name_orientation, R.drawable.imgly_icon_option_orientation)); tools.add(new StickerTool(R.string.imgly_tool_name_sticker, R.drawable.imgly_icon_option_sticker)); tools.add(new ColorAdjustmentTool.Contrast(R.string.imgly_tool_name_contrast, R.drawable.imgly_icon_option_contrast)); tools.add(new ColorAdjustmentTool.Brightness(R.string.imgly_tool_name_brightness, R.drawable.imgly_icon_option_brightness)); tools.add(new ColorAdjustmentTool.Saturation(R.string.imgly_tool_name_saturation, R.drawable.imgly_icon_option_saturation)); config.setTools(tools)
public ImgLyConfig setTools(@NonNull AbstractConfig.ToolConfigInterface... tools)
config.setTools( new CropTool(R.string.imgly_tool_name_crop, R.drawable.imgly_icon_option_crop), new TextTool(R.string.imgly_tool_name_text, R.drawable.imgly_icon_option_text), new FilterTool(R.string.imgly_tool_name_filter, R.drawable.imgly_icon_option_filters), new OrientationTool(R.string.imgly_tool_name_orientation, R.drawable.imgly_icon_option_orientation), new StickerTool(R.string.imgly_tool_name_sticker, R.drawable.imgly_icon_option_sticker), new ColorAdjustmentTool.Contrast(R.string.imgly_tool_name_contrast, R.drawable.imgly_icon_option_contrast), new ColorAdjustmentTool.Brightness(R.string.imgly_tool_name_brightness, R.drawable.imgly_icon_option_brightness), new ColorAdjustmentTool.Saturation(R.string.imgly_tool_name_saturation, R.drawable.imgly_icon_option_saturation) )
@NonNull public java.util.ArrayList<AbstractConfig.AspectConfigInterface> getCropConfig()
@NonNull public java.util.ArrayList<AbstractConfig.StickerConfigInterface> getStickerConfig()
public ImgLyConfig setForcedCropMode(boolean forceCropCapture, CropAspectConfig portraitCrop, CropAspectConfig landscapeCrop)
@Nullable public CropAspectConfig getForceLandscapeCrop()
@Nullable public CropAspectConfig getForcePortraitCrop()
public boolean isForceCropCaptureEnabled()
@NonNull public java.util.ArrayList<AbstractConfig.ColorConfigInterface> getTextColorConfig()
public java.util.ArrayList<AbstractConfig.ColorConfigInterface> getBrushColors()
public ImgLyConfig setBrushColors(@NonNull java.util.ArrayList<AbstractConfig.ColorConfigInterface> brushColors)
ArrayList<AbstractConfig.ColorConfigInterface> colors = new ArrayListArrayList<>(); colors.add(new ColorConfig(R.string.imgly_color_accessibility_name_green, 0xFF00FF00)); colors.add(new ColorConfig(R.string.imgly_color_accessibility_name_red, 0xFFFF0000)); config.setBrushColors(colors);
public ImgLyConfig setBrushColors(@NonNull AbstractConfig.ColorConfigInterface... brushColors)
config.setBrushColors( new ColorConfig(R.string.imgly_color_accessibility_name_green, 0xFF00FF00), new ColorConfig(R.string.imgly_color_accessibility_name_red, 0xFFFF0000) );
public ImgLyConfig setFonts(@NonNull java.util.ArrayList<AbstractConfig.FontConfigInterface> fonts)
ArrayList<AbstractConfig.FontConfigInterface> fonts = new ArrayListArrayList<>();
fonts.add(new FontConfig("Geared Slab", fontAssetsFolder + "GearedSlab.ttf"));
config.setFonts(fonts);
public ImgLyConfig setFonts(@NonNull AbstractConfig.FontConfigInterface... fonts)
public ImgLyConfig setFilter(@NonNull java.util.ArrayList<AbstractConfig.ImageFilterInterface> filter)
ArrayList<AbstractConfig.ImageFilterInterface> filter = new ArrayListArrayList<>() filter.add(new NoneImageFilter()); filter.add(new ColorFilterAD1920()); filter.add(new ColorFilterAncient()); filter.add(new ColorFilterBleached()); filter.add(new ColorFilterBleachedBlue()); filter.add(new ColorFilterBlues()); filter.add(new ColorFilterBlueShadows()); filter.add(new ColorFilterBreeze()); filter.add(new ColorFilterBW()); filter.add(new ColorFilterCelsius()); filter.add(new ColorFilterClassic()); filter.add(new ColorFilterColorful()); filter.add(new ColorFilterCool()); filter.add(new ColorFilterCottonCandy()); filter.add(new ColorFilterCreamy()); filter.add(new ColorFilterEighties()); filter.add(new ColorFilterElder()); filter.add(new ColorFilterEvening()); filter.add(new ColorFilterFall()); filter.add(new ColorFilterFixie()); filter.add(new ColorFilterFood()); filter.add(new ColorFilterFridge()); filter.add(new ColorFilterFront()); filter.add(new ColorFilterGlam()); filter.add(new ColorFilterHighCarb()); filter.add(new ColorFilterHighContrast()); filter.add(new ColorFilterK1()); filter.add(new ColorFilterK2()); filter.add(new ColorFilterK6()); filter.add(new ColorFilterKDynamic()); filter.add(new ColorFilterKeen()); filter.add(new ColorFilterLenin()); filter.add(new ColorFilterLitho()); filter.add(new ColorFilterLomo()); filter.add(new ColorFilterLomo100()); filter.add(new ColorFilterLucid()); filter.add(new ColorFilterMellow()); filter.add(new ColorFilterNeat()); filter.add(new ColorFilterNoGreen()); filter.add(new ColorFilterOrchid()); filter.add(new ColorFilterPale()); filter.add(new ColorFilterPola669()); filter.add(new ColorFilterPolaSx()); filter.add(new ColorFilterPro400()); filter.add(new ColorFilterQuozi()); filter.add(new ColorFilterSepiahigh()); filter.add(new ColorFilterSettled()); filter.add(new ColorFilterSeventies()); filter.add(new ColorFilterSin()); filter.add(new ColorFilterSoft()); filter.add(new ColorFilterSteel()); filter.add(new ColorFilterSummer()); filter.add(new ColorFilterSunset()); filter.add(new ColorFilterTender()); filter.add(new ColorFilterTexas()); filter.add(new ColorFilterTwilight()); filter.add(new ColorFilterWinter()); filter.add(new ColorFilterX400()); config.setFilter(filter)
public ImgLyConfig setFilter(@NonNull AbstractConfig.ImageFilterInterface... filter)
config.setFilter( new NoneImageFilter(), new ColorFilterAD1920(), new ColorFilterX400() )
public ImgLyConfig setAspects(@NonNull java.util.ArrayList<AbstractConfig.AspectConfigInterface> aspects)
ArrayList<AbstractConfig.AspectConfigInterface> cropConfig = new ArrayListArrayList<>(); cropConfig.add(new CropAspectConfig(R.string.imgly_crop_name_custom, R.drawable.imgly_icon_crop_custom, -1)); cropConfig.add(new CropAspectConfig(R.string.imgly_crop_name_4_3, R.drawable.imgly_icon_crop_4_3, 4/3f)); config.setAspects(cropConfig);
public ImgLyConfig setAspects(@NonNull AbstractConfig.AspectConfigInterface... aspects)
config.setAspects( new CropAspectConfig(R.string.imgly_crop_name_custom, R.drawable.imgly_icon_crop_custom, -1), new CropAspectConfig(R.string.imgly_crop_name_4_3, R.drawable.imgly_icon_crop_4_3, 4/3f) );
public ImgLyConfig setStickers(@NonNull java.util.ArrayList<AbstractConfig.StickerConfigInterface> stickers)
ArrayList<AbstractConfig.StickerConfigInterface> stickers = new ArrayListArrayList<>(); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_glasses_normal, R.drawable.imgly_sticker_preview_glasses_normal, R.drawable.imgly_sticker_glasses_normal)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_glasses_nerd, R.drawable.imgly_sticker_preview_glasses_nerd, R.drawable.imgly_sticker_glasses_nerd)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_glasses_shutter_green, R.drawable.imgly_sticker_preview_glasses_shutter_green, R.drawable.imgly_sticker_glasses_shutter_green)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_glasses_shutter_yellow, R.drawable.imgly_sticker_preview_glasses_shutter_yellow, R.drawable.imgly_sticker_glasses_shutter_yellow)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_glasses_sun, R.drawable.imgly_sticker_preview_glasses_sun, R.drawable.imgly_sticker_glasses_sun)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_hat_cap, R.drawable.imgly_sticker_preview_hat_cap, R.drawable.imgly_sticker_hat_cap)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_hat_sherrif, R.drawable.imgly_sticker_preview_hat_sherrif, R.drawable.imgly_sticker_hat_sherrif)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_hat_party, R.drawable.imgly_sticker_preview_hat_party, R.drawable.imgly_sticker_hat_party)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_hat_zylinder, R.drawable.imgly_sticker_preview_hat_zylinder, R.drawable.imgly_sticker_hat_zylinder)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_mustache1, R.drawable.imgly_sticker_preview_mustache1, R.drawable.imgly_sticker_mustache1)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_mustache2, R.drawable.imgly_sticker_preview_mustache2, R.drawable.imgly_sticker_mustache2)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_mustache3, R.drawable.imgly_sticker_preview_mustache3, R.drawable.imgly_sticker_mustache3)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_mustache_long, R.drawable.imgly_sticker_preview_mustache_long, R.drawable.imgly_sticker_mustache_long)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_snowflake, R.drawable.imgly_sticker_preview_snowflake, R.drawable.imgly_sticker_snowflake)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_heart, R.drawable.imgly_sticker_preview_heart, R.drawable.imgly_sticker_heart)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_pipe, R.drawable.imgly_sticker_preview_pipe, R.drawable.imgly_sticker_pipe)); stickers.add(new ImageStickerConfig(R.string.imgly_sticker_name_star, R.drawable.imgly_sticker_preview_star, R.drawable.imgly_sticker_star)); config.setStickers(stickers);
public ImgLyConfig setStickers(@NonNull AbstractConfig.StickerConfigInterface... stickers)
config.setStickers( new ImageStickerConfig(R.string.imgly_sticker_name_glasses_normal, R.drawable.imgly_sticker_preview_glasses_normal, R.drawable.imgly_sticker_glasses_normal), new ImageStickerConfig(R.string.imgly_sticker_name_glasses_nerd, R.drawable.imgly_sticker_preview_glasses_nerd, R.drawable.imgly_sticker_glasses_nerd), new ImageStickerConfig(R.string.imgly_sticker_name_glasses_shutter_green, R.drawable.imgly_sticker_preview_glasses_shutter_green, R.drawable.imgly_sticker_glasses_shutter_green), new ImageStickerConfig(R.string.imgly_sticker_name_glasses_shutter_yellow, R.drawable.imgly_sticker_preview_glasses_shutter_yellow, R.drawable.imgly_sticker_glasses_shutter_yellow), new ImageStickerConfig(R.string.imgly_sticker_name_glasses_sun, R.drawable.imgly_sticker_preview_glasses_sun, R.drawable.imgly_sticker_glasses_sun), new ImageStickerConfig(R.string.imgly_sticker_name_hat_cap, R.drawable.imgly_sticker_preview_hat_cap, R.drawable.imgly_sticker_hat_cap), new ImageStickerConfig(R.string.imgly_sticker_name_hat_sherrif, R.drawable.imgly_sticker_preview_hat_sherrif, R.drawable.imgly_sticker_hat_sherrif), new ImageStickerConfig(R.string.imgly_sticker_name_hat_party, R.drawable.imgly_sticker_preview_hat_party, R.drawable.imgly_sticker_hat_party), new ImageStickerConfig(R.string.imgly_sticker_name_hat_zylinder, R.drawable.imgly_sticker_preview_hat_zylinder, R.drawable.imgly_sticker_hat_zylinder), new ImageStickerConfig(R.string.imgly_sticker_name_mustache1, R.drawable.imgly_sticker_preview_mustache1, R.drawable.imgly_sticker_mustache1), new ImageStickerConfig(R.string.imgly_sticker_name_mustache2, R.drawable.imgly_sticker_preview_mustache2, R.drawable.imgly_sticker_mustache2), new ImageStickerConfig(R.string.imgly_sticker_name_mustache3, R.drawable.imgly_sticker_preview_mustache3, R.drawable.imgly_sticker_mustache3), new ImageStickerConfig(R.string.imgly_sticker_name_mustache_long, R.drawable.imgly_sticker_preview_mustache_long, R.drawable.imgly_sticker_mustache_long), new ImageStickerConfig(R.string.imgly_sticker_name_snowflake, R.drawable.imgly_sticker_preview_snowflake, R.drawable.imgly_sticker_snowflake). new ImageStickerConfig(R.string.imgly_sticker_name_heart, R.drawable.imgly_sticker_preview_heart, R.drawable.imgly_sticker_heart), new ImageStickerConfig(R.string.imgly_sticker_name_pipe, R.drawable.imgly_sticker_preview_pipe, R.drawable.imgly_sticker_pipe), new ImageStickerConfig(R.string.imgly_sticker_name_star, R.drawable.imgly_sticker_preview_star, R.drawable.imgly_sticker_star) );
public ImgLyConfig setTextColors(@NonNull java.util.ArrayList<AbstractConfig.ColorConfigInterface> textColors)
ArrayList<AbstractConfig.ColorConfigInterface> colors = new ArrayListArrayList<>() colors.add(new ColorConfig(R.string.imgly_color_accessibility_name_green, 0xFF00FF00)); colors.add(new ColorConfig(R.string.imgly_color_accessibility_name_red, 0xFFFF0000)); config.setTextColors(colors)
public ImgLyConfig setTextColors(@NonNull AbstractConfig.ColorConfigInterface... textColors)
config.setTextColors( new ColorConfig(R.string.imgly_color_accessibility_name_green, 0xFF00FF00), new ColorConfig(R.string.imgly_color_accessibility_name_red, 0xFFFF0000) );
public ImgLyConfig setFrame(@NonNull java.util.ArrayList<AbstractConfig.FrameConfigInterface> frame)
ArrayList<AbstractConfig.AspectConfigInterface> cropConfig = new ArrayListArrayList<>();
CropAspectConfig crop4_3 = new CropAspectConfig(R.string.imgly_crop_name_4_3, R.drawable.imgly_icon_crop_4_3, 4/3f);
CropAspectConfig crop16_9 = new CropAspectConfig(R.string.imgly_crop_name_16_9, R.drawable.imgly_icon_crop_16_9, 16/9f);
config.seAspects(
new CropAspectConfig(R.string.imgly_crop_name_custom, R.drawable.imgly_icon_crop_custom, -1),
crop4_3,
crop16_9
);
config.setFrames(
new FrameConfig(
R.string.imgly_frame_name_wood,
R.drawable.imgly_frame_preview_wood,
R.drawable.imgly_frame_wood_4_3,
crop4_3
),
new FrameConfig(
R.string.imgly_frame_name_wood,
R.drawable.imgly_frame_preview_wood,
R.drawable.imgly_frame_wood_16_9,
crop16_9
),
);
config.setFrames(frame)
public ImgLyConfig setFrames(@NonNull AbstractConfig.FrameConfigInterface... frame)
ArrayList<AbstractConfig.AspectConfigInterface> cropConfig = new ArrayListArrayList<>(); cropConfig.add(new CropAspectConfig(R.string.imgly_crop_name_custom, R.drawable.imgly_icon_crop_custom, -1)); cropConfig.add(new CropAspectConfig(R.string.imgly_crop_name_4_3, R.drawable.imgly_icon_crop_4_3, 4/3)); config.setAspects(cropConfig); ArrayList<AbstractConfig.FrameConfigInterface> frames = new ArrayListArrayList<>(); frames.add(new FrameConfig( R.string.imgly_frame_name_wood, R.drawable.imgly_frame_preview_wood, R.drawable.imgly_frame_wood, cropConfig.get(1) )); config.setFrames(frame)
public OrientationSensor.SCREEN_ROTATION_MODE getCameraScreenRotationMode()
public ImgLyConfig setCameraScreenRotationMode(OrientationSensor.SCREEN_ROTATION_MODE mode)
mode - desired screen modepublic OrientationSensor.SCREEN_ROTATION_MODE getEditorScreenRotationMode()
public ImgLyConfig setEditorScreenRotationMode(OrientationSensor.SCREEN_ROTATION_MODE mode)
mode - desired screen modepublic int describeContents()
describeContents in interface android.os.ParcelabledescribeContents in class Settings<ly.img.android.sdk.models.state.ImgLyConfig.Event>public void writeToParcel(android.os.Parcel dest,
int flags)
writeToParcel in interface android.os.ParcelablewriteToParcel in class Settings<ly.img.android.sdk.models.state.ImgLyConfig.Event>