class MotionLabel : View, 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(context: Context!)
MotionLabel(context: Context!, attrs: AttributeSet?)
MotionLabel(context: Context!, attrs: AttributeSet?, defStyleAttr: Int)

Public functions

Float

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

Float

Get the fractional corner radius of curvature.

Float

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

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

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

Float

gets the rotation

Float

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

Int
Float

Pan the Texture in the text in the x axis.

Float

Pan the Texture in the text in the y axis.

Float

Pan the Texture in the text in the y axis.

Float

get the width of the texture.

Typeface!
Unit
layout(l: Float, t: Float, r: Float, b: Float)

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

Unit
layout(l: Int, t: Int, r: Int, b: Int)
Unit
setGravity(gravity: Int)

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.

Unit
@RequiresApi(value = Build.VERSION_CODES.LOLLIPOP)
setRound(round: Float)

Set the corner radius of curvature

Unit
@RequiresApi(value = Build.VERSION_CODES.LOLLIPOP)
setRoundPercent(round: Float)

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

Unit

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

Unit

set text

Unit

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

Unit

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

Unit

sets the rotation angle of the image in degrees

Unit

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

Unit

Set the color of the text.

Unit

Sets the color of the text outline.

Unit

Set outline thickness

Unit
setTextPanX(textPanX: Float)

Pan the Texture in the text in the x axis.

Unit
setTextPanY(textPanY: Float)

Pan the Texture in the text in the y axis.

Unit

set text size

Unit
setTextureHeight(mTextureHeight: Float)

set the height of the texture.

Unit
setTextureWidth(mTextureWidth: Float)

set the width of the texture.

Unit

set the typeface

Protected functions

Unit
onDraw(canvas: Canvas)
Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

Inherited Constants

From android.view.View
const Int
const Int
const Int
const Int
const Int
const Int
const Property<View!, Float!>!
const Int
const String!
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = "creditCardExpirationDate"
const String!
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay"
const String!
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = "creditCardExpirationMonth"
const String!
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR = "creditCardExpirationYear"
const String!
const String!
AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = "creditCardSecurityCode"
const String!
const String!
const String!
const String!
const String!
const String!
const String!
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const Int
const Int
const Int
const Int
const Int
const Int
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const Int
const Int
const Int
const Int
const Int
const Int
const Int
GONE = 8
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
KEEP_SCREEN_ON = 67108864
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
NO_ID = -1
const Int
const Int
const Int
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const IntArray<Int>!
const IntArray<Int>!
const Int
const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const String!
VIEW_LOG_TAG = "View"
const Int
const IntArray<Int>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!

Inherited functions

From android.view.View
Unit
Unit
addExtraDataToAccessibilityNodeInfo(
    info: AccessibilityNodeInfo!,
    extraDataKey: String!,
    arguments: Bundle!
)
Unit
addFocusables(views: ArrayList<View!>!, direction: Int)
Unit
addKeyboardNavigationClusters(
    views: (Mutable)Collection<View!>!,
    direction: Int
)
Unit
Unit
Unit
Unit
ViewPropertyAnimator!
Unit
Unit
Boolean
Unit
Unit

This function is deprecated.

Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Unit
Unit
Unit
Boolean
Unit
Unit
Unit
java-static Int
combineMeasuredStates(curState: Int, newState: Int)
Int
Int
Int
Unit
WindowInsets!
computeSystemWindowInsets(in: WindowInsets!, outLocalInsets: Rect!)
Int
Int
Int
AccessibilityNodeInfo!
Unit
Unit

This function is deprecated.

WindowInsets!
Boolean
Unit
Unit
dispatchCreateViewTranslationRequest(
    viewIds: (Mutable)Map<AutofillId!, LongArray!>!,
    supportedFormats: IntArray!,
    capability: TranslationCapability!,
    requests: (Mutable)List<ViewTranslationRequest!>!
)
Unit
Boolean
Unit
dispatchDraw(canvas: Canvas!)
Unit
Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
dispatchNestedFling(velocityX: Float, velocityY: Float, consumed: Boolean)
Boolean
dispatchNestedPreFling(velocityX: Float, velocityY: Float)
Boolean
dispatchNestedPrePerformAccessibilityAction(
    action: Int,
    arguments: Bundle!
)
Boolean
dispatchNestedPreScroll(
    dx: Int,
    dy: Int,
    consumed: IntArray!,
    offsetInWindow: IntArray!
)
Boolean
dispatchNestedScroll(
    dxConsumed: Int,
    dyConsumed: Int,
    dxUnconsumed: Int,
    dyUnconsumed: Int,
    offsetInWindow: IntArray!
)
Unit
Boolean
Unit
Unit
Unit
Unit
Unit
dispatchScrollCaptureSearch(
    localVisibleRect: Rect!,
    windowOffset: Point!,
    targets: Consumer<ScrollCaptureTarget!>!
)
Unit
Unit
Unit
Unit
Unit

This function is deprecated.

Boolean
Boolean
Boolean
dispatchUnhandledMove(focused: View!, direction: Int)
Unit
dispatchVisibilityChanged(changedView: View!, visibility: Int)
Unit
Unit
Unit
WindowInsets!
dispatchWindowInsetsAnimationProgress(
    insets: WindowInsets!,
    runningAnimations: (Mutable)List<WindowInsetsAnimation!>!
)
WindowInsetsAnimation.Bounds!
Unit

This function is deprecated.

Unit
Unit
draw(canvas: Canvas!)
Unit
Unit
View!
OnBackInvokedDispatcher!
T!
<T : View?> findViewById(id: Int)
T!
<T : View?> findViewWithTag(tag: Any!)
Unit
findViewsWithText(
    outViews: ArrayList<View!>!,
    searched: CharSequence!,
    flags: Int
)
Boolean

This function is deprecated.

View!
focusSearch(direction: Int)
Unit
forceHasOverlappingRendering(hasOverlappingRendering: Boolean)
Unit
Boolean
Unit
generateDisplayHash(
    hashAlgorithm: String!,
    bounds: Rect!,
    executor: Executor!,
    callback: DisplayHashResultCallback!
)
java-static Int
CharSequence!
View.AccessibilityDelegate!
Int
AccessibilityNodeProvider!
CharSequence!
Int
Int
String!
String!
Float
Animation!
Matrix!
IBinder!
IntArray<Int>!
(Mutable)Map<Int!, Int!>!
Array<String!>!
AutofillId!
Int
AutofillValue!
Drawable!
BlendMode!
ColorStateList!
PorterDuff.Mode!
Int
Int
Float
Int
Float
Rect!
Boolean
getClipBounds(outRect: Rect!)
Boolean
ContentCaptureSession!
CharSequence!
Context!
ContextMenu.ContextMenuInfo!
Boolean
java-static Int
getDefaultSize(size: Int, measureSpec: Int)
Display!
IntArray<Int>!
Bitmap!

This function is deprecated.

Int

This function is deprecated.

Int

This function is deprecated.

Unit
getDrawingRect(outRect: Rect!)
Long
Float
Int
Boolean
Boolean
Int
ArrayList<View!>!
getFocusables(direction: Int)
Unit
Drawable!
Int
BlendMode!
ColorStateList!
PorterDuff.Mode!
Boolean
getGlobalVisibleRect(r: Rect!, globalOffset: Point!)
Handler!
Float
Float
Float
Float
Runnable!
Boolean
Int
Unit
getHitRect(outRect: Rect!)
Int
Int
Drawable!
Drawable!
Int
Int
Int
Int
Boolean
KeyEvent.DispatcherState!
Int
Int
Int
ViewGroup.LayoutParams!
Int
Float
Int
Boolean
Unit
Unit
Unit
Matrix!
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
View.OnFocusChangeListener!
Int
ViewOutlineProvider!
Int
Int
ViewOverlay!
Int
Int
Int
Int
Int
Int
ViewParent!
ViewParent!
Float
Float
PointerIcon!
(Mutable)List<Rect!>!
Array<String!>!
Resources!
Boolean
Int
Float
Int
AttachedSurfaceControl!
View!
WindowInsets!
Float
Float
Float
Float
Float
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
CharSequence!
StateListAnimator!
Int
Int
(Mutable)List<Rect!>!
Int

This function is deprecated.

Any!
Int
Int
CharSequence!
Int
Float
Int
TouchDelegate!
ArrayList<View!>!
Float
String!
Float
Float
Float
Long
Int
Int
Drawable!
Drawable!
Int
ViewTranslationResponse!
ViewTreeObserver!
Int
Int
Int
WindowId!
WindowInsetsController!
Int

This function is deprecated.

IBinder!
Int
Unit
Float
Float
Float
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
java-static View!
inflate(context: Context!, resource: Int, root: ViewGroup!)
Unit
invalidate(dirty: Rect!)

This function is deprecated.

Unit
Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

This function is deprecated.

Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Unit
View!
keyboardNavigationClusterSearch(currentCluster: View!, direction: Int)
Unit
measure(widthMeasureSpec: Int, heightMeasureSpec: Int)
java-static IntArray<Int>!
mergeDrawableStates(baseState: IntArray!, additionalState: IntArray!)
Unit
Unit
Unit
Unit
WindowInsets!
Unit
Unit
Boolean
Boolean
Unit
Unit
IntArray<Int>!
InputConnection!
Unit
onCreateViewTranslationRequest(
    supportedFormats: IntArray!,
    requestsCollector: Consumer<ViewTranslationRequest!>!
)
Unit
onCreateVirtualViewTranslationRequests(
    virtualIds: LongArray!,
    supportedFormats: IntArray!,
    requestsCollector: Consumer<ViewTranslationRequest!>!
)
Unit
Unit
Boolean
Unit
Unit
Boolean
Unit
Unit
Unit
onFocusChanged(
    gainFocus: Boolean,
    direction: Int,
    previouslyFocusedRect: Rect!
)
Boolean
Unit
Boolean
Unit
Unit
Boolean
onKeyDown(keyCode: Int, event: KeyEvent!)
Boolean
onKeyLongPress(keyCode: Int, event: KeyEvent!)
Boolean
onKeyMultiple(keyCode: Int, repeatCount: Int, event: KeyEvent!)
Boolean
onKeyPreIme(keyCode: Int, event: KeyEvent!)
Boolean
onKeyShortcut(keyCode: Int, event: KeyEvent!)
Boolean
onKeyUp(keyCode: Int, event: KeyEvent!)
Unit
onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int)
Unit
onOverScrolled(
    scrollX: Int,
    scrollY: Int,
    clampedX: Boolean,
    clampedY: Boolean
)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
ContentInfo!
PointerIcon!
onResolvePointerIcon(event: MotionEvent!, pointerIndex: Int)
Unit
Unit
onRtlPropertiesChanged(layoutDirection: Int)
Parcelable!
Unit
onScreenStateChanged(screenState: Int)
Unit
onScrollCaptureSearch(
    localVisibleRect: Rect!,
    windowOffset: Point!,
    targets: Consumer<ScrollCaptureTarget!>!
)
Unit
onScrollChanged(l: Int, t: Int, oldl: Int, oldt: Int)
Boolean
onSetAlpha(alpha: Int)
Unit
onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int)
Unit
Boolean
Boolean
Unit
Unit
Unit
Unit
onVisibilityChanged(changedView: View!, visibility: Int)
Unit
onWindowFocusChanged(hasWindowFocus: Boolean)
Unit

This function is deprecated.

Unit
Boolean
overScrollBy(
    deltaX: Int,
    deltaY: Int,
    scrollX: Int,
    scrollY: Int,
    scrollRangeX: Int,
    scrollRangeY: Int,
    maxOverScrollX: Int,
    maxOverScrollY: Int,
    isTouchEvent: Boolean
)
Boolean
performAccessibilityAction(action: Int, arguments: Bundle!)
Boolean
Boolean
Boolean
performHapticFeedback(feedbackConstant: Int)
Boolean
ContentInfo!
Unit
playSoundEffect(soundConstant: Int)
Boolean
post(action: Runnable!)
Boolean
postDelayed(action: Runnable!, delayMillis: Long)
Unit
Unit
postInvalidateDelayed(delayMilliseconds: Long)
Unit
Unit
Unit
postOnAnimationDelayed(action: Runnable!, delayMillis: Long)
Unit
Unit
Boolean
Unit
Unit
Unit
Unit
Unit

This function is deprecated.

Boolean
Boolean
Unit
Unit
Boolean
Unit
T!
<T : View?> requireViewById(id: Int)
Unit
java-static Int
resolveSize(size: Int, measureSpec: Int)
java-static Int
resolveSizeAndState(size: Int, measureSpec: Int, childMeasuredState: Int)
Boolean
Unit
Unit
saveAttributeDataForStyleable(
    context: Context!,
    styleable: IntArray!,
    attrs: AttributeSet!,
    t: TypedArray!,
    defStyleAttr: Int,
    defStyleRes: Int
)
Unit
Unit
scheduleDrawable(who: Drawable!, what: Runnable!, when: Long)
Unit
scrollBy(x: Int, y: Int)
Unit
scrollTo(x: Int, y: Int)
Unit
Unit
Unit
setAccessibilityDataSensitive(accessibilityDataSensitive: Int)
Unit
Unit
Unit
Unit
setAccessibilityPaneTitle(accessibilityPaneTitle: CharSequence!)
Unit
Unit
Unit
setActivated(activated: Boolean)
Unit
setAllowClickWhenDisabled(clickableWhenDisabled: Boolean)
Unit
Unit
Unit
setAlpha(alpha: Float)
Unit
setAnimation(animation: Animation!)
Unit
Unit
Unit
setAutofillHints(autofillHints: Array<String!>!)
Unit
Unit
setBackground(background: Drawable!)
Unit
Unit

This function is deprecated.

Unit
Unit
Unit
Unit
Unit
setBottom(bottom: Int)
Unit
Unit
setClickable(clickable: Boolean)
Unit
setClipBounds(clipBounds: Rect!)
Unit
setClipToOutline(clipToOutline: Boolean)
Unit
Unit
setContentDescription(contentDescription: CharSequence!)
Unit
setContextClickable(contextClickable: Boolean)
Unit
setDefaultFocusHighlightEnabled(defaultFocusHighlightEnabled: Boolean)
Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
Unit
setElevation(elevation: Float)
Unit
setEnabled(enabled: Boolean)
Unit
Unit
Unit
setFitsSystemWindows(fitSystemWindows: Boolean)
Unit
setFocusable(focusable: Boolean)
Unit
setFocusableInTouchMode(focusableInTouchMode: Boolean)
Unit
setFocusedByDefault(isFocusedByDefault: Boolean)
Unit
Unit
setForeground(foreground: Drawable!)
Unit
Unit
Unit
Unit
Unit
setHandwritingBoundsOffsets(
    offsetLeft: Float,
    offsetTop: Float,
    offsetRight: Float,
    offsetBottom: Float
)
Unit
Unit
setHapticFeedbackEnabled(hapticFeedbackEnabled: Boolean)
Unit
setHasTransientState(hasTransientState: Boolean)
Unit
setHorizontalFadingEdgeEnabled(horizontalFadingEdgeEnabled: Boolean)
Unit
setHorizontalScrollBarEnabled(horizontalScrollBarEnabled: Boolean)
Unit
Unit
Unit
setHovered(hovered: Boolean)
Unit
setId(id: Int)
Unit
Unit
Unit
Unit
setIsCredential(isCredential: Boolean)
Unit
setIsHandwritingDelegate(isHandwritingDelegate: Boolean)
Unit
setKeepScreenOn(keepScreenOn: Boolean)
Unit
Unit
Unit
Unit
setLayerType(layerType: Int, paint: Paint!)
Unit
setLayoutDirection(layoutDirection: Int)
Unit
Unit
setLeft(left: Int)
Unit
setLeftTopRightBottom(left: Int, top: Int, right: Int, bottom: Int)
Unit
setLongClickable(longClickable: Boolean)
Unit
setMeasuredDimension(measuredWidth: Int, measuredHeight: Int)
Unit
setMinimumHeight(minHeight: Int)
Unit
setMinimumWidth(minWidth: Int)
Unit
Unit
setNextClusterForwardId(nextClusterForwardId: Int)
Unit
setNextFocusDownId(nextFocusDownId: Int)
Unit
setNextFocusForwardId(nextFocusForwardId: Int)
Unit
setNextFocusLeftId(nextFocusLeftId: Int)
Unit
setNextFocusRightId(nextFocusRightId: Int)
Unit
setNextFocusUpId(nextFocusUpId: Int)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
setOnReceiveContentListener(
    mimeTypes: Array<String!>!,
    listener: OnReceiveContentListener!
)
Unit
Unit

This function is deprecated.

Unit
Unit
Unit
Unit
Unit
setOverScrollMode(overScrollMode: Int)
Unit
setPadding(left: Int, top: Int, right: Int, bottom: Int)
Unit
setPaddingRelative(start: Int, top: Int, end: Int, bottom: Int)
Unit
setPivotX(pivotX: Float)
Unit
setPivotY(pivotY: Float)
Unit
setPointerIcon(pointerIcon: PointerIcon!)
Unit
setPreferKeepClear(preferKeepClear: Boolean)
Unit
Unit
setPressed(pressed: Boolean)
Unit
setRenderEffect(renderEffect: RenderEffect!)
Unit
setRevealOnFocusHint(revealOnFocus: Boolean)
Unit
setRight(right: Int)
Unit
setRotation(rotation: Float)
Unit
setRotationX(rotationX: Float)
Unit
setRotationY(rotationY: Float)
Unit
Unit
Unit
setScaleX(scaleX: Float)
Unit
setScaleY(scaleY: Float)
Unit
setScreenReaderFocusable(screenReaderFocusable: Boolean)
Unit
setScrollBarDefaultDelayBeforeFade(
    scrollBarDefaultDelayBeforeFade: Int
)
Unit
setScrollBarFadeDuration(scrollBarFadeDuration: Int)
Unit
setScrollBarSize(scrollBarSize: Int)
Unit
Unit
Unit
Unit
setScrollContainer(isScrollContainer: Boolean)
Unit
setScrollIndicators(indicators: Int)
Unit
setScrollX(value: Int)
Unit
setScrollY(value: Int)
Unit
Unit
setSelected(selected: Boolean)
Unit
setSoundEffectsEnabled(soundEffectsEnabled: Boolean)
Unit
setStateDescription(stateDescription: CharSequence!)
Unit
Unit
Unit

This function is deprecated.

Unit
setTag(tag: Any!)
Unit
setTextAlignment(textAlignment: Int)
Unit
setTextDirection(textDirection: Int)
Unit
Unit
setTop(top: Int)
Unit
Unit
Unit
setTransitionName(transitionName: String!)
Unit
Unit
setTranslationX(translationX: Float)
Unit
setTranslationY(translationY: Float)
Unit
setTranslationZ(translationZ: Float)
Unit
setVerticalFadingEdgeEnabled(verticalFadingEdgeEnabled: Boolean)
Unit
setVerticalScrollBarEnabled(verticalScrollBarEnabled: Boolean)
Unit
Unit
Unit
Unit
Unit
setVisibility(visibility: Int)
Unit
setWillNotCacheDrawing(willNotCacheDrawing: Boolean)

This function is deprecated.

Unit
setWillNotDraw(willNotDraw: Boolean)
Unit
Unit
setX(x: Float)
Unit
setY(y: Float)
Unit
setZ(z: Float)
Boolean
ActionMode!
Unit
Boolean
startDrag(
    data: ClipData!,
    shadowBuilder: View.DragShadowBuilder!,
    myLocalState: Any!,
    flags: Int
)

This function is deprecated.

Boolean
startDragAndDrop(
    data: ClipData!,
    shadowBuilder: View.DragShadowBuilder!,
    myLocalState: Any!,
    flags: Int
)
Boolean
Unit
String!
Unit
Unit
Unit
Unit
Boolean
Boolean

This function is deprecated.

Boolean

Public constructors

MotionLabel

Added in 2.2.0-alpha13
MotionLabel(context: Context!)

MotionLabel

Added in 2.2.0-alpha13
MotionLabel(context: Context!, attrs: AttributeSet?)

MotionLabel

Added in 2.2.0-alpha13
MotionLabel(context: Context!, attrs: AttributeSet?, defStyleAttr: Int)

Public functions

getRound

Added in 2.2.0-alpha13
fun getRound(): Float

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

Returns
Float

Radius of curvature

getRoundPercent

Added in 2.2.0-alpha13
fun getRoundPercent(): Float

Get the fractional corner radius of curvature.

Returns
Float

Fractional radius of curvature with respect to smallest size

getScaleFromTextSize

Added in 2.2.0-alpha13
fun getScaleFromTextSize(): Float

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

Added in 2.2.0-alpha13
fun getTextBackgroundPanX(): 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

Returns
Float

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

getTextBackgroundPanY

Added in 2.2.0-alpha13
fun getTextBackgroundPanY(): 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

Returns
Float

pan in y. Where 0 is centered NaN if not set

getTextBackgroundRotate

Added in 2.2.0-alpha13
fun getTextBackgroundRotate(): Float

gets the rotation

Returns
Float

the rotation in degrees

getTextBackgroundZoom

Added in 2.2.0-alpha13
fun getTextBackgroundZoom(): Float

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

Returns
Float

the zoom factor

getTextOutlineColor

Added in 2.2.0-alpha13
fun getTextOutlineColor(): Int

getTextPanX

Added in 2.2.0-alpha13
fun getTextPanX(): Float

Pan the Texture in the text in the x axis.

Returns
Float

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

getTextPanY

Added in 2.2.0-alpha13
fun getTextPanY(): Float

Pan the Texture in the text in the y axis.

Returns
Float

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

getTextureHeight

Added in 2.2.0-alpha13
fun getTextureHeight(): Float

Pan the Texture in the text in the y axis.

Returns
Float

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

getTextureWidth

Added in 2.2.0-alpha13
fun getTextureWidth(): Float

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

Returns
Float

the width of the texture

getTypeface

Added in 2.2.0-alpha13
fun getTypeface(): Typeface!
Returns
Typeface!

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

See also
setTypeface

layout

Added in 2.2.0-alpha13
fun layout(l: Float, t: Float, r: Float, b: Float): Unit

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.

layout

fun layout(l: Int, t: Int, r: Int, b: Int): Unit

setGravity

Added in 2.2.0-alpha13
fun setGravity(gravity: Int): Unit

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.

ref android.R.styleable#TextView_gravity

See also
Gravity

setRound

Added in 2.2.0-alpha13
@RequiresApi(value = Build.VERSION_CODES.LOLLIPOP)
fun setRound(round: Float): Unit

Set the corner radius of curvature

Parameters
round: Float

the radius of curvature NaN = default meaning roundPercent in effect

setRoundPercent

Added in 2.2.0-alpha13
@RequiresApi(value = Build.VERSION_CODES.LOLLIPOP)
fun setRoundPercent(round: Float): Unit

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

Parameters
round: Float

the radius of curvature as a fraction of the smaller width

setScaleFromTextSize

Added in 2.2.0-alpha13
fun setScaleFromTextSize(size: Float): Unit

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
size: Float

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

setText

Added in 2.2.0-alpha13
fun setText(text: CharSequence!): Unit

set text

Parameters
text: CharSequence!

setTextBackgroundPanX

Added in 2.2.0-alpha13
fun setTextBackgroundPanX(pan: Float): Unit

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
pan: Float

sets the pan in X. Where 0 is centered

setTextBackgroundPanY

Added in 2.2.0-alpha13
fun setTextBackgroundPanY(pan: Float): Unit

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
pan: Float

sets the pan in X. Where 0 is centered

setTextBackgroundRotate

Added in 2.2.0-alpha13
fun setTextBackgroundRotate(rotation: Float): Unit

sets the rotation angle of the image in degrees

Parameters
rotation: Float

angle in degrees

setTextBackgroundZoom

Added in 2.2.0-alpha13
fun setTextBackgroundZoom(zoom: Float): Unit

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

Parameters
zoom: Float

the zoom factor

setTextFillColor

Added in 2.2.0-alpha13
fun setTextFillColor(color: Int): Unit

Set the color of the text.

Parameters
color: Int

the color of the text

setTextOutlineColor

Added in 2.2.0-alpha13
fun setTextOutlineColor(color: Int): Unit

Sets the color of the text outline.

Parameters
color: Int

the color of the outline of the text

setTextOutlineThickness

Added in 2.2.0-alpha13
fun setTextOutlineThickness(width: Float): Unit

Set outline thickness

Parameters
width: Float

setTextPanX

Added in 2.2.0-alpha13
fun setTextPanX(textPanX: Float): Unit

Pan the Texture in the text in the x axis.

Parameters
textPanX: Float

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

setTextPanY

Added in 2.2.0-alpha13
fun setTextPanY(textPanY: Float): Unit

Pan the Texture in the text in the y axis.

Parameters
textPanY: Float

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

setTextSize

Added in 2.2.0-alpha13
fun setTextSize(size: Float): Unit

set text size

Parameters
size: Float

the size of the text

See also
setTextSize

setTextureHeight

Added in 2.2.0-alpha13
fun setTextureHeight(mTextureHeight: Float): Unit

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

Parameters
mTextureHeight: Float

the height of the texture

setTextureWidth

Added in 2.2.0-alpha13
fun setTextureWidth(mTextureWidth: Float): Unit

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

Parameters
mTextureWidth: Float

set the width of the texture Float.NaN clears setting

setTypeface

Added in 2.2.0-alpha13
fun setTypeface(tf: Typeface!): Unit

set the typeface

Parameters
tf: Typeface!

Protected functions

onDraw

protected fun onDraw(canvas: Canvas): Unit

onMeasure

protected fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int): Unit