MotionLabel

public class MotionLabel implements FloatLayout


This class is designed to create complex animated single line text in MotionLayout. Its API are designed with animation in mine. for example it uses setTextPanX(float x) where 0 is centered -1 is left +1 is right It supports the following features:

  • color outlines
  • Textured text
  • Blured Textured Text
  • Scrolling of Texture in text
  • PanX, PanY instead of Gravity

Summary

Public constructors

MotionLabel(
    @NonNull Context context,
    @Nullable AttributeSet attrs,
    @NonNull int defStyleAttr
)

Public methods

@NonNull float

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

@NonNull float

Get the fractional corner radius of curvature.

@NonNull float

if set the font is rendered to polygons at this size and then scaled to the size set by textSize.

@NonNull float

Gets 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

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

@NonNull int
@NonNull float

Pan the Texture in the text in the x axis.

@NonNull float

Pan the Texture in the text in the y axis.

@NonNull float

Pan the Texture in the text in the y axis.

@NonNull float

get the width of the texture.

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

To convert to regular layout l = (int)(0.5f + lf); You are expected to do your own measure if you need it.

@NonNull void
setGravity(@NonNull int gravity)

Sets the horizontal alignment of the text and the vertical gravity that will be used when there is extra space in the TextView beyond what is required for the text itself.

@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

if set the font is rendered to polygons at this size and then scaled to the size set by textSize.

@NonNull void
@NonNull void

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

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

@NonNull void

sets the rotation angle of the image in degrees

@NonNull void

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

@NonNull void

Set the color of the text.

@NonNull void

Sets the color of the text outline.

@NonNull void
@NonNull void
setTextPanX(@NonNull float textPanX)

Pan the Texture in the text in the x axis.

@NonNull void
setTextPanY(@NonNull float textPanY)

Pan the Texture in the text in the y axis.

@NonNull void
setTextSize(@NonNull float size)

set text size

@NonNull void
setTextureHeight(@NonNull float mTextureHeight)

set the height of the texture.

@NonNull void
setTextureWidth(@NonNull float mTextureWidth)

set the width of the texture.

@NonNull void

Inherited methods

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 void
draw(@NonNull Canvas canvas)
@NonNull void
drawableHotspotChanged(@NonNull float x, @NonNull float y)
@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 CharSequence
@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
@NonNull int
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
@NonNull boolean
static @NonNull View
inflate(
    @NonNull Context context,
    @NonNull int resource,
    @NonNull ViewGroup root
)
@NonNull void

This method is deprecated.

@NonNull void
@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
@NonNull boolean
final @NonNull boolean
@NonNull boolean
@NonNull boolean
final @NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull void
@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 PointerIcon
onResolvePointerIcon(@NonNull MotionEvent event, @NonNull int pointerIndex)
@NonNull void
onRtlPropertiesChanged(@NonNull int layoutDirection)
@NonNull void
onScreenStateChanged(@NonNull int screenState)
@NonNull void
@NonNull boolean
@NonNull boolean
@NonNull void
onVisibilityAggregated(@NonNull boolean isVisible)
@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
setAlpha(@NonNull float alpha)
@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
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
setSelected(@NonNull boolean selected)
@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
setVisibility(@NonNull int visibility)
@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

MotionLabel

public MotionLabel(@NonNull Context context)

MotionLabel

public MotionLabel(@NonNull Context context, @Nullable AttributeSet attrs)

MotionLabel

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

Public methods

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

getScaleFromTextSize

@NonNull
public float getScaleFromTextSize()

if set the font is rendered to polygons at this size and then scaled to the size set by textSize.

Returns
float

size to pre render font or NaN if not used.

getTextBackgroundPanX

@NonNull
public float getTextBackgroundPanX()

Gets 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

getTextBackgroundPanY

@NonNull
public float getTextBackgroundPanY()

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 NaN if not set

getTextBackgroundRotate

@NonNull
public float getTextBackgroundRotate()

gets the rotation

Returns
float

the rotation in degrees

getTextBackgroundZoom

@NonNull
public float getTextBackgroundZoom()

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

Returns
float

the zoom factor

getTextOutlineColor

@NonNull
public int getTextOutlineColor()

getTextPanX

@NonNull
public float getTextPanX()

Pan the Texture in the text in the x axis.

Returns
float

pan of the Text -1 = left 0 = center +1 = right

getTextPanY

@NonNull
public float getTextPanY()

Pan the Texture in the text in the y axis.

Returns
float

the pan value 0 being centered in the center of screen.

getTextureHeight

@NonNull
public float getTextureHeight()

Pan the Texture in the text in the y axis.

Returns
float

pan of the Text -1 = top 0 = center +1 = bottom

getTextureWidth

@NonNull
public float getTextureWidth()

get the width of the texture. Setting Float.NaN is the default Use the view size.

Returns
float

the width of the texture

getTypeface

@NonNull
public Typeface getTypeface()
Returns
Typeface

the current typeface and style in which the text is being displayed.

See also
setTypeface

#setTypeface(Typeface)

layout

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

layout

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

To convert to regular layout l = (int)(0.5f + lf); You are expected to do your own measure if you need it. This will be called only during animation.

setGravity

@NonNull
public void setGravity(@NonNull int gravity)

Sets the horizontal alignment of the text and the vertical gravity that will be used when there is extra space in the TextView beyond what is required for the text itself. gravity

See also
Gravity

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

setScaleFromTextSize

@NonNull
public void setScaleFromTextSize(@NonNull float size)

if set the font is rendered to polygons at this size and then scaled to the size set by textSize. This allows smooth efficient animation of fonts size.

Parameters
@NonNull float size

the size to pre render the font or NaN if not used.

setText

@NonNull
public void setText(@NonNull CharSequence text)

setTextBackgroundPanX

@NonNull
public void setTextBackgroundPanX(@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

setTextBackgroundPanY

@NonNull
public void setTextBackgroundPanY(@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 X. Where 0 is centered

setTextBackgroundRotate

@NonNull
public void setTextBackgroundRotate(@NonNull float rotation)

sets the rotation angle of the image in degrees

Parameters
@NonNull float rotation

angle in degrees

setTextBackgroundZoom

@NonNull
public void setTextBackgroundZoom(@NonNull float zoom)

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

Parameters
@NonNull float zoom

the zoom factor

setTextFillColor

@NonNull
public void setTextFillColor(@NonNull int color)

Set the color of the text.

Parameters
@NonNull int color

the color of the text

setTextOutlineColor

@NonNull
public void setTextOutlineColor(@NonNull int color)

Sets the color of the text outline.

Parameters
@NonNull int color

the color of the outline of the text

setTextOutlineThickness

@NonNull
public void setTextOutlineThickness(@NonNull float width)

setTextPanX

@NonNull
public void setTextPanX(@NonNull float textPanX)

Pan the Texture in the text in the x axis.

Parameters
@NonNull float textPanX

pan of the Text -1 = left 0 = center +1 = right

setTextPanY

@NonNull
public void setTextPanY(@NonNull float textPanY)

Pan the Texture in the text in the y axis.

Parameters
@NonNull float textPanY

pan of the Text -1 = top 0 = center +1 = bottom

setTextSize

@NonNull
public void setTextSize(@NonNull float size)

set text size

Parameters
@NonNull float size

the size of the text

See also
setTextSize

Paint#setTextSize(float)

setTextureHeight

@NonNull
public void setTextureHeight(@NonNull float mTextureHeight)

set the height of the texture. Setting Float.NaN is the default Use the view size.

Parameters
@NonNull float mTextureHeight

the height of the texture

setTextureWidth

@NonNull
public void setTextureWidth(@NonNull float mTextureWidth)

set the width of the texture. Setting Float.NaN is the default Use the view size

Parameters
@NonNull float mTextureWidth

set the width of the texture Float.NaN clears setting

setTypeface

@NonNull
public void setTypeface(@NonNull Typeface tf)