ImageFilterButton

public class ImageFilterButton


An AppCompatImageButton that can display, combine and filter images. Added in 2.0

Subclass of AppCompatImageButton to handle various common filtering operations.

ImageFilterButton attributes
altSrc Provide and alternative image to the src image to allow cross fading
saturation Sets the saturation of the image. 0 = grayscale, 1 = original, 2 = hyper saturated
brightness Sets the brightness of the image. 0 = black, 1 = original, 2 = twice as bright
warmth This adjust the apparent color temperature of the image. 1=neutral, 2=warm, .5=cold
contrast This sets the contrast. 1 = unchanged, 0 = gray, 2 = high contrast
crossfade Set the current mix between the two images. 0=src 1= altSrc image
round (id) call the TransitionListener with this trigger id
roundPercent Set the corner radius of curvature as a fraction of the smaller side. For squares 1 will result in a circle
overlay Defines whether the alt image will be faded in on top of the original image or if it will be crossfaded with it. Default is true. Set to false for semitransparent objects

Summary

Public constructors

ImageFilterButton(
    @NonNull Context context,
    @NonNull AttributeSet attrs,
    @NonNull int defStyleAttr
)

Public methods

@Override @NonNull void
draw(@NonNull Canvas canvas)
@NonNull float

Returns the currently applied contrast

@NonNull float

Returns the currently applied crossfade.

@NonNull float

gts the pan from the center pan of 1 the image is "all the way to the right" if the images width is greater than the screen width, pan = 1 results in the left edge lining up if the images width is less than the screen width, pan = 1 results in the right edges lining up if image width == screen width it does nothing

@NonNull float

gets the pan from the center pan of 1 the image is "all the way to the bottom" if the images width is greater than the screen height, pan = 1 results in the bottom edge lining up if the images width is less than the screen height, pan = 1 results in the top edges lining up if image height == screen height it does nothing

@NonNull float

gets the rotation

@NonNull float

sets the zoom where 1 scales the image just enough to fill the view

@NonNull float

Get the corner radius of curvature NaN = RoundPercent in effect.

@NonNull float

Get the fractional corner radius of curvature.

@NonNull float

Returns the currently applied saturation

@NonNull float

Returns the currently applied warmth

@Override @NonNull void
layout(@NonNull int l, @NonNull int t, @NonNull int r, @NonNull int b)
@NonNull void

Set the alternative image used to cross fade to.

@NonNull void
setBrightness(@NonNull float brightness)

sets the brightness of the image; 0 = black, 1 = original, 2 = twice as bright

@NonNull void
setContrast(@NonNull float contrast)

This sets the contrast.

@NonNull void
setCrossfade(@NonNull float crossfade)

Set the current mix between the two images that can be set on this view.

@Override @NonNull void
@NonNull void
setImagePanX(@NonNull float pan)

sets the pan from the center pan of 1 the image is "all the way to the right" if the images width is greater than the screen width, pan = 1 results in the left edge lining up if the images width is less than the screen width, pan = 1 results in the right edges lining up if image width == screen width it does nothing

@NonNull void
setImagePanY(@NonNull float pan)

sets the pan from the center pan of 1 the image is "all the way to the bottom" if the images width is greater than the screen height, pan = 1 results in the bottom edge lining up if the images width is less than the screen height, pan = 1 results in the top edges lining up if image height == screen height it does nothing

@Override @NonNull void
@NonNull void
setImageRotate(@NonNull float rotation)

sets the rotation angle of the image in degrees

@NonNull void
setImageZoom(@NonNull float zoom)

sets the zoom where 1 scales the image just enough to fill the view

@RequiresApi(value = Build.VERSION_CODES.LOLLIPOP) @NonNull void
setRound(@NonNull float round)

Set the corner radius of curvature

@RequiresApi(value = Build.VERSION_CODES.LOLLIPOP) @NonNull void
setRoundPercent(@NonNull float round)

Set the corner radius of curvature as a fraction of the smaller side.

@NonNull void
setSaturation(@NonNull float saturation)

sets the saturation of the image; 0 = grayscale, 1 = original, 2 = hyper saturated

@NonNull void
setWarmth(@NonNull float warmth)

This makes the apparent color temperature of the image warmer or colder.

Inherited methods

From class AppCompatImageButton
From class ImageButton
From class ImageView
@NonNull void
final @NonNull void
@NonNull void
drawableHotspotChanged(@NonNull float x, @NonNull float y)
@NonNull boolean
@NonNull int
@NonNull boolean
@NonNull ColorFilter
@NonNull boolean
@NonNull Drawable
@NonNull int
@NonNull Matrix
@NonNull BlendMode
@NonNull ColorStateList
@NonNull PorterDuff.Mode
@NonNull int
@NonNull int
@NonNull ImageView.ScaleType
@NonNull void
@NonNull boolean
@NonNull void
@NonNull Array<@NonNull int>
onCreateDrawableState(@NonNull int extraSpace)
@NonNull void
onRtlPropertiesChanged(@NonNull int layoutDirection)
@NonNull void
onVisibilityAggregated(@NonNull boolean isVisible)
@NonNull void
setAdjustViewBounds(@NonNull boolean adjustViewBounds)
@NonNull void
setAlpha(@NonNull int alpha)

This method is deprecated.

@NonNull void
setBaseline(@NonNull int baseline)
@NonNull void
setBaselineAlignBottom(@NonNull boolean aligned)
final @NonNull void
@NonNull void
setCropToPadding(@NonNull boolean cropToPadding)
@NonNull void
setImageAlpha(@NonNull int alpha)
@NonNull void
@NonNull void
setImageLevel(@NonNull int level)
@NonNull void
@NonNull void
setImageState(@NonNull Array<@NonNull int> state, @NonNull boolean merge)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setMaxHeight(@NonNull int maxHeight)
@NonNull void
setMaxWidth(@NonNull int maxWidth)
@NonNull void
@NonNull void
setSelected(@NonNull boolean selected)
@NonNull void
setVisibility(@NonNull int visibility)
From class View
@NonNull void
@NonNull void
addExtraDataToAccessibilityNodeInfo(
    @NonNull AccessibilityNodeInfo info,
    @NonNull String extraDataKey,
    @NonNull Bundle arguments
)
@NonNull void
addFocusables(
    @NonNull ArrayList<@NonNull View> views,
    @NonNull int direction
)
@NonNull void
addKeyboardNavigationClusters(
    @NonNull Collection<@NonNull View> views,
    @NonNull int direction
)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull ViewPropertyAnimator
@NonNull void
@NonNull void
@NonNull void
@NonNull void

This method is deprecated.

@NonNull void
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
canScrollVertically(@NonNull int direction)
final @NonNull void
@NonNull void
final @NonNull void
@NonNull boolean
@NonNull void
@NonNull void
static @NonNull int
combineMeasuredStates(@NonNull int curState, @NonNull int newState)
@NonNull void
@NonNull WindowInsets
computeSystemWindowInsets(
    @NonNull WindowInsets in,
    @NonNull Rect outLocalInsets
)
@NonNull AccessibilityNodeInfo
@NonNull void
@NonNull void

This method is deprecated.

@NonNull WindowInsets
@NonNull boolean
@NonNull void
@NonNull void
@NonNull boolean
@NonNull void
@NonNull void
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
dispatchNestedFling(
    @NonNull float velocityX,
    @NonNull float velocityY,
    @NonNull boolean consumed
)
@NonNull boolean
dispatchNestedPreFling(@NonNull float velocityX, @NonNull float velocityY)
@NonNull boolean
dispatchNestedPrePerformAccessibilityAction(
    @NonNull int action,
    @NonNull Bundle arguments
)
@NonNull boolean
dispatchNestedPreScroll(
    @NonNull int dx,
    @NonNull int dy,
    @NonNull Array<@NonNull int> consumed,
    @NonNull Array<@NonNull int> offsetInWindow
)
@NonNull boolean
dispatchNestedScroll(
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed,
    @NonNull Array<@NonNull int> offsetInWindow
)
@NonNull void
@NonNull boolean
@NonNull void
dispatchProvideAutofillStructure(
    @NonNull ViewStructure structure,
    @NonNull int flags
)
@NonNull void
@NonNull void
@NonNull void

This method is deprecated.

@NonNull boolean
@NonNull boolean
@NonNull boolean
dispatchUnhandledMove(@NonNull View focused, @NonNull int direction)
@NonNull void
@NonNull void
@NonNull void
@NonNull WindowInsets
@NonNull WindowInsetsAnimation.Bounds
@NonNull void

This method is deprecated.

@NonNull void
@NonNull View
final @NonNull T
<T extends View> findViewById(@NonNull int id)
final @NonNull T
<T extends View> findViewWithTag(@NonNull Object tag)
@NonNull void
findViewsWithText(
    @NonNull ArrayList<@NonNull View> outViews,
    @NonNull CharSequence searched,
    @NonNull int flags
)
@NonNull View
focusSearch(@NonNull int direction)
@NonNull void
forceHasOverlappingRendering(@NonNull boolean hasOverlappingRendering)
@NonNull void
static @NonNull int
@NonNull View.AccessibilityDelegate
@NonNull int
@NonNull AccessibilityNodeProvider
@NonNull CharSequence
@NonNull int
@NonNull int
@NonNull float
@NonNull Animation
@NonNull Matrix
@NonNull IBinder
@NonNull Array<@NonNull int>
@NonNull Map<@NonNull Integer, @NonNull Integer>
@NonNull Array<@NonNull String>
final @NonNull AutofillId
@NonNull int
@NonNull AutofillValue
@NonNull Drawable
@NonNull BlendMode
@NonNull ColorStateList
@NonNull PorterDuff.Mode
final @NonNull int
@NonNull float
@NonNull Rect
@NonNull boolean
final @NonNull boolean
final @NonNull ContentCaptureSession
@NonNull CharSequence
final @NonNull Context
final @NonNull boolean
static @NonNull int
getDefaultSize(@NonNull int size, @NonNull int measureSpec)
@NonNull Display
final @NonNull Array<@NonNull int>
@NonNull Bitmap

This method is deprecated.

@NonNull int

This method is deprecated.

@NonNull int

This method is deprecated.

@NonNull void
@NonNull long
@NonNull float
@NonNull int
@NonNull boolean
@NonNull boolean
@NonNull int
@NonNull ArrayList<@NonNull View>
getFocusables(@NonNull int direction)
@NonNull void
@NonNull Drawable
@NonNull int
@NonNull BlendMode
@NonNull ColorStateList
@NonNull PorterDuff.Mode
@NonNull boolean
@NonNull Handler
final @NonNull boolean
final @NonNull int
@NonNull void
@NonNull int
@NonNull Drawable
@NonNull Drawable
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull boolean
@NonNull KeyEvent.DispatcherState
@NonNull int
@NonNull int
@NonNull int
@NonNull ViewGroup.LayoutParams
final @NonNull int
final @NonNull boolean
@NonNull void
@NonNull void
@NonNull void
@NonNull Matrix
final @NonNull int
final @NonNull int
final @NonNull int
final @NonNull int
final @NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull View.OnFocusChangeListener
@NonNull int
@NonNull ViewOutlineProvider
@NonNull int
@NonNull int
@NonNull ViewOverlay
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
final @NonNull ViewParent
@NonNull ViewParent
@NonNull float
@NonNull float
@NonNull PointerIcon
@NonNull Resources
final @NonNull boolean
final @NonNull int
@NonNull View
@NonNull WindowInsets
@NonNull float
@NonNull float
@NonNull float
@NonNull float
@NonNull float
@NonNull int
@NonNull int
@NonNull int
@NonNull int
@NonNull int
final @NonNull int
final @NonNull int
@NonNull int
@NonNull int
final @NonNull CharSequence
@NonNull StateListAnimator
@NonNull List<@NonNull Rect>
@NonNull int

This method is deprecated.

@NonNull Object
@NonNull int
@NonNull int
@NonNull CharSequence
final @NonNull int
@NonNull TouchDelegate
@NonNull ArrayList<@NonNull View>
@NonNull float
@NonNull String
@NonNull float
@NonNull float
@NonNull float
@NonNull long
@NonNull int
@NonNull int
@NonNull Drawable
@NonNull Drawable
@NonNull int
@NonNull ViewTreeObserver
@NonNull int
final @NonNull int
@NonNull WindowId
@NonNull WindowInsetsController
@NonNull int

This method is deprecated.

@NonNull IBinder
@NonNull int
@NonNull void
@NonNull float
@NonNull float
@NonNull float
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
static @NonNull View
inflate(
    @NonNull Context context,
    @NonNull int resource,
    @NonNull ViewGroup root
)
@NonNull void

This method is deprecated.

@NonNull void
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean

This method is deprecated.

@NonNull boolean
@NonNull boolean
final @NonNull boolean
final @NonNull boolean
@NonNull boolean
final @NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
final @NonNull boolean
final @NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
final @NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
final @NonNull boolean
@NonNull boolean
@NonNull boolean
final @NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull View
keyboardNavigationClusterSearch(
    @NonNull View currentCluster,
    @NonNull int direction
)
final @NonNull void
measure(@NonNull int widthMeasureSpec, @NonNull int heightMeasureSpec)
@NonNull void
@NonNull void
@NonNull WindowInsets
@NonNull void
@NonNull boolean
@NonNull boolean
@NonNull InputConnection
@NonNull boolean
@NonNull void
@NonNull boolean
@NonNull void
@NonNull boolean
@NonNull void
onHoverChanged(@NonNull boolean hovered)
@NonNull boolean
@NonNull void
@NonNull void
@NonNull boolean
onKeyDown(@NonNull int keyCode, @NonNull KeyEvent event)
@NonNull boolean
onKeyLongPress(@NonNull int keyCode, @NonNull KeyEvent event)
@NonNull boolean
onKeyMultiple(
    @NonNull int keyCode,
    @NonNull int repeatCount,
    @NonNull KeyEvent event
)
@NonNull boolean
onKeyPreIme(@NonNull int keyCode, @NonNull KeyEvent event)
@NonNull boolean
onKeyShortcut(@NonNull int keyCode, @NonNull KeyEvent event)
@NonNull boolean
onKeyUp(@NonNull int keyCode, @NonNull KeyEvent event)
@NonNull void
onPointerCaptureChange(@NonNull boolean hasCapture)
@NonNull void
@NonNull void
onProvideAutofillStructure(
    @NonNull ViewStructure structure,
    @NonNull int flags
)
@NonNull void
onProvideAutofillVirtualStructure(
    @NonNull ViewStructure structure,
    @NonNull int flags
)
@NonNull void
onProvideContentCaptureStructure(
    @NonNull ViewStructure structure,
    @NonNull int flags
)
@NonNull void
@NonNull void
@NonNull void
onScreenStateChanged(@NonNull int screenState)
@NonNull void
@NonNull boolean
@NonNull boolean
@NonNull void
onWindowFocusChanged(@NonNull boolean hasWindowFocus)
@NonNull void

This method is deprecated.

@NonNull boolean
performAccessibilityAction(@NonNull int action, @NonNull Bundle arguments)
@NonNull boolean
@NonNull boolean
performContextClick(@NonNull float x, @NonNull float y)
@NonNull boolean
performHapticFeedback(@NonNull int feedbackConstant)
@NonNull boolean
@NonNull void
playSoundEffect(@NonNull int soundConstant)
@NonNull boolean
@NonNull boolean
postDelayed(@NonNull Runnable action, @NonNull long delayMillis)
@NonNull void
@NonNull void
postInvalidateDelayed(@NonNull long delayMilliseconds)
@NonNull void
@NonNull void
@NonNull void
postOnAnimationDelayed(@NonNull Runnable action, @NonNull long delayMillis)
@NonNull void
@NonNull void
@NonNull boolean
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void

This method is deprecated.

final @NonNull boolean
final @NonNull boolean
@NonNull void
@NonNull void
@NonNull boolean
final @NonNull void
final @NonNull T
<T extends View> requireViewById(@NonNull int id)
@NonNull void
static @NonNull int
resolveSize(@NonNull int size, @NonNull int measureSpec)
static @NonNull int
resolveSizeAndState(
    @NonNull int size,
    @NonNull int measureSpec,
    @NonNull int childMeasuredState
)
@NonNull boolean
@NonNull void
final @NonNull void
saveAttributeDataForStyleable(
    @NonNull Context context,
    @NonNull Array<@NonNull int> styleable,
    @NonNull AttributeSet attrs,
    @NonNull TypedArray t,
    @NonNull int defStyleAttr,
    @NonNull int defStyleRes
)
@NonNull void
@NonNull void
scheduleDrawable(
    @NonNull Drawable who,
    @NonNull Runnable what,
    @NonNull long when
)
@NonNull void
scrollBy(@NonNull int x, @NonNull int y)
@NonNull void
scrollTo(@NonNull int x, @NonNull int y)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setAccessibilityHeading(@NonNull boolean isHeading)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setActivated(@NonNull boolean activated)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
final @NonNull void
setBottom(@NonNull int bottom)
@NonNull void
setCameraDistance(@NonNull float distance)
@NonNull void
setClickable(@NonNull boolean clickable)
@NonNull void
setClipBounds(@NonNull Rect clipBounds)
@NonNull void
setClipToOutline(@NonNull boolean clipToOutline)
@NonNull void
setContentCaptureSession(
    @NonNull ContentCaptureSession contentCaptureSession
)
@NonNull void
@NonNull void
setContextClickable(@NonNull boolean contextClickable)
@NonNull void
setDefaultFocusHighlightEnabled(
    @NonNull boolean defaultFocusHighlightEnabled
)
@NonNull void

This method is deprecated.

@NonNull void
setDrawingCacheEnabled(@NonNull boolean enabled)

This method is deprecated.

@NonNull void

This method is deprecated.

@NonNull void
@NonNull void
setElevation(@NonNull float elevation)
@NonNull void
setEnabled(@NonNull boolean enabled)
@NonNull void
@NonNull void
@NonNull void
setFitsSystemWindows(@NonNull boolean fitSystemWindows)
@NonNull void
setFocusable(@NonNull boolean focusable)
@NonNull void
setFocusableInTouchMode(@NonNull boolean focusableInTouchMode)
@NonNull void
setFocusedByDefault(@NonNull boolean isFocusedByDefault)
@NonNull void
setForceDarkAllowed(@NonNull boolean allow)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setHapticFeedbackEnabled(@NonNull boolean hapticFeedbackEnabled)
@NonNull void
setHasTransientState(@NonNull boolean hasTransientState)
@NonNull void
setHorizontalFadingEdgeEnabled(
    @NonNull boolean horizontalFadingEdgeEnabled
)
@NonNull void
setHorizontalScrollBarEnabled(
    @NonNull boolean horizontalScrollBarEnabled
)
@NonNull void
@NonNull void
@NonNull void
setHovered(@NonNull boolean hovered)
@NonNull void
setId(@NonNull int id)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setKeepScreenOn(@NonNull boolean keepScreenOn)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setLayerType(@NonNull int layerType, @NonNull Paint paint)
@NonNull void
setLayoutDirection(@NonNull int layoutDirection)
@NonNull void
final @NonNull void
setLeft(@NonNull int left)
final @NonNull void
setLeftTopRightBottom(
    @NonNull int left,
    @NonNull int top,
    @NonNull int right,
    @NonNull int bottom
)
@NonNull void
setLongClickable(@NonNull boolean longClickable)
@NonNull void
setMinimumHeight(@NonNull int minHeight)
@NonNull void
setMinimumWidth(@NonNull int minWidth)
@NonNull void
@NonNull void
setNextClusterForwardId(@NonNull int nextClusterForwardId)
@NonNull void
setNextFocusDownId(@NonNull int nextFocusDownId)
@NonNull void
setNextFocusForwardId(@NonNull int nextFocusForwardId)
@NonNull void
setNextFocusLeftId(@NonNull int nextFocusLeftId)
@NonNull void
setNextFocusRightId(@NonNull int nextFocusRightId)
@NonNull void
setNextFocusUpId(@NonNull int nextFocusUpId)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void

This method is deprecated.

@NonNull void
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setOverScrollMode(@NonNull int overScrollMode)
@NonNull void
setPadding(
    @NonNull int left,
    @NonNull int top,
    @NonNull int right,
    @NonNull int bottom
)
@NonNull void
setPaddingRelative(
    @NonNull int start,
    @NonNull int top,
    @NonNull int end,
    @NonNull int bottom
)
@NonNull void
setPivotX(@NonNull float pivotX)
@NonNull void
setPivotY(@NonNull float pivotY)
@NonNull void
@NonNull void
setPressed(@NonNull boolean pressed)
final @NonNull void
setRevealOnFocusHint(@NonNull boolean revealOnFocus)
final @NonNull void
setRight(@NonNull int right)
@NonNull void
setRotation(@NonNull float rotation)
@NonNull void
setRotationX(@NonNull float rotationX)
@NonNull void
setRotationY(@NonNull float rotationY)
@NonNull void
setSaveEnabled(@NonNull boolean enabled)
@NonNull void
@NonNull void
setScaleX(@NonNull float scaleX)
@NonNull void
setScaleY(@NonNull float scaleY)
@NonNull void
setScreenReaderFocusable(@NonNull boolean screenReaderFocusable)
@NonNull void
setScrollBarDefaultDelayBeforeFade(
    @NonNull int scrollBarDefaultDelayBeforeFade
)
@NonNull void
setScrollBarFadeDuration(@NonNull int scrollBarFadeDuration)
@NonNull void
setScrollBarSize(@NonNull int scrollBarSize)
@NonNull void
@NonNull void
setScrollContainer(@NonNull boolean isScrollContainer)
@NonNull void
setScrollIndicators(@NonNull int indicators)
@NonNull void
setScrollX(@NonNull int value)
@NonNull void
setScrollY(@NonNull int value)
@NonNull void
setScrollbarFadingEnabled(@NonNull boolean fadeScrollbars)
@NonNull void
setSoundEffectsEnabled(@NonNull boolean soundEffectsEnabled)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setSystemUiVisibility(@NonNull int visibility)

This method is deprecated.

@NonNull void
@NonNull void
setTextAlignment(@NonNull int textAlignment)
@NonNull void
setTextDirection(@NonNull int textDirection)
@NonNull void
final @NonNull void
setTop(@NonNull int top)
@NonNull void
@NonNull void
final @NonNull void
setTransitionName(@NonNull String transitionName)
@NonNull void
@NonNull void
setTranslationX(@NonNull float translationX)
@NonNull void
setTranslationY(@NonNull float translationY)
@NonNull void
setTranslationZ(@NonNull float translationZ)
@NonNull void
setVerticalFadingEdgeEnabled(@NonNull boolean verticalFadingEdgeEnabled)
@NonNull void
setVerticalScrollBarEnabled(@NonNull boolean verticalScrollBarEnabled)
@NonNull void
@NonNull void
@NonNull void
@NonNull void
setWillNotCacheDrawing(@NonNull boolean willNotCacheDrawing)

This method is deprecated.

@NonNull void
setWillNotDraw(@NonNull boolean willNotDraw)
@NonNull void
@NonNull void
setX(@NonNull float x)
@NonNull void
setY(@NonNull float y)
@NonNull void
setZ(@NonNull float z)
@NonNull boolean
@NonNull ActionMode
@NonNull void
final @NonNull boolean
startDrag(
    @NonNull ClipData data,
    @NonNull View.DragShadowBuilder shadowBuilder,
    @NonNull Object myLocalState,
    @NonNull int flags
)

This method is deprecated.

final @NonNull boolean
startDragAndDrop(
    @NonNull ClipData data,
    @NonNull View.DragShadowBuilder shadowBuilder,
    @NonNull Object myLocalState,
    @NonNull int flags
)
@NonNull boolean
@NonNull void
@NonNull String
@NonNull void
@NonNull void
@NonNull void
final @NonNull void
@NonNull boolean

This method is deprecated.

@NonNull boolean

Public constructors

ImageFilterButton

public ImageFilterButton(@NonNull Context context)

ImageFilterButton

public ImageFilterButton(@NonNull Context context, @NonNull AttributeSet attrs)

ImageFilterButton

public ImageFilterButton(
    @NonNull Context context,
    @NonNull AttributeSet attrs,
    @NonNull int defStyleAttr
)

Public methods

draw

@Override
@NonNull
public @Override void draw(@NonNull Canvas canvas)

getContrast

@NonNull
public float getContrast()

Returns the currently applied contrast

Returns
float

1 = unchanged, 0 = gray, 2 = high contrast

getCrossfade

@NonNull
public float getCrossfade()

Returns the currently applied crossfade.

Returns
float

a number from 0 to 1

getImagePanX

@NonNull
public float getImagePanX()

gts the pan from the center pan of 1 the image is "all the way to the right" if the images width is greater than the screen width, pan = 1 results in the left edge lining up if the images width is less than the screen width, pan = 1 results in the right edges lining up if image width == screen width it does nothing

Returns
float

the pan in X. Where 0 is centered = Float. NaN if not set

getImagePanY

@NonNull
public float getImagePanY()

gets the pan from the center pan of 1 the image is "all the way to the bottom" if the images width is greater than the screen height, pan = 1 results in the bottom edge lining up if the images width is less than the screen height, pan = 1 results in the top edges lining up if image height == screen height it does nothing

Returns
float

pan in Y. Where 0 is centered

getImageRotate

@NonNull
public float getImageRotate()

gets the rotation

Returns
float

the rotation in degrees

getImageZoom

@NonNull
public float getImageZoom()

sets the zoom where 1 scales the image just enough to fill the view

Returns
float

the zoom

getRound

@NonNull
public float getRound()

Get the corner radius of curvature NaN = RoundPercent in effect.

Returns
float

Radius of curvature

getRoundPercent

@NonNull
public float getRoundPercent()

Get the fractional corner radius of curvature.

Returns
float

Fractional radius of curvature with respect to smallest size

getSaturation

@NonNull
public float getSaturation()

Returns the currently applied saturation

Returns
float

0 = grayscale, 1 = original, 2 = hyper saturated

getWarmth

@NonNull
public float getWarmth()

Returns the currently applied warmth

Returns
float

warmth 1 is neutral, 2 is warm, .5 is cold

layout

@Override
@NonNull
public @Override void layout(@NonNull int l, @NonNull int t, @NonNull int r, @NonNull int b)

setAltImageResource

@NonNull
public void setAltImageResource(@NonNull int resId)

Set the alternative image used to cross fade to.

Parameters
@NonNull int resId

setBrightness

@NonNull
public void setBrightness(@NonNull float brightness)

sets the brightness of the image; 0 = black, 1 = original, 2 = twice as bright

Parameters
@NonNull float brightness

setContrast

@NonNull
public void setContrast(@NonNull float contrast)

This sets the contrast. 1 = unchanged, 0 = gray, 2 = high contrast

Parameters
@NonNull float contrast

setCrossfade

@NonNull
public void setCrossfade(@NonNull float crossfade)

Set the current mix between the two images that can be set on this view.

Parameters
@NonNull float crossfade

a number from 0 to 1

setImageDrawable

@Override
@NonNull
public @Override void setImageDrawable(@NonNull Drawable drawable)

setImagePanX

@NonNull
public void setImagePanX(@NonNull float pan)

sets the pan from the center pan of 1 the image is "all the way to the right" if the images width is greater than the screen width, pan = 1 results in the left edge lining up if the images width is less than the screen width, pan = 1 results in the right edges lining up if image width == screen width it does nothing

Parameters
@NonNull float pan

sets the pan in X. Where 0 is centered

setImagePanY

@NonNull
public void setImagePanY(@NonNull float pan)

sets the pan from the center pan of 1 the image is "all the way to the bottom" if the images width is greater than the screen height, pan = 1 results in the bottom edge lining up if the images width is less than the screen height, pan = 1 results in the top edges lining up if image height == screen height it does nothing

Parameters
@NonNull float pan

sets the pan in Y. Where 0 is centered

setImageResource

@Override
@NonNull
public @Override void setImageResource(@NonNull int resId)

setImageRotate

@NonNull
public void setImageRotate(@NonNull float rotation)

sets the rotation angle of the image in degrees

Parameters
@NonNull float rotation

the rotation in degrees

setImageZoom

@NonNull
public void setImageZoom(@NonNull float zoom)

sets the zoom where 1 scales the image just enough to fill the view

Parameters
@NonNull float zoom

the zoom factor

setRound

@RequiresApi(value = Build.VERSION_CODES.LOLLIPOP)
@NonNull
public @RequiresApi(value = Build.VERSION_CODES.LOLLIPOP) void setRound(@NonNull float round)

Set the corner radius of curvature

Parameters
@NonNull float round

the radius of curvature NaN = default meaning roundPercent in effect

setRoundPercent

@RequiresApi(value = Build.VERSION_CODES.LOLLIPOP)
@NonNull
public @RequiresApi(value = Build.VERSION_CODES.LOLLIPOP) void setRoundPercent(@NonNull float round)

Set the corner radius of curvature as a fraction of the smaller side. For squares 1 will result in a circle

Parameters
@NonNull float round

the radius of curvature as a fraction of the smaller width

setSaturation

@NonNull
public void setSaturation(@NonNull float saturation)

sets the saturation of the image; 0 = grayscale, 1 = original, 2 = hyper saturated

Parameters
@NonNull float saturation

setWarmth

@NonNull
public void setWarmth(@NonNull float warmth)

This makes the apparent color temperature of the image warmer or colder.

Parameters
@NonNull float warmth

1 is neutral, 2 is warm, .5 is cold