An expandable Android TextView written in Kotlin
expandable-textview / tm.charlie.expandabletextview / ExpandableTextView
open class ExpandableTextView : AppCompatTextView
| SavedState | class SavedState : BaseSavedStateProtected class that is being used to save and restore ExpandableTextView’s state on configuration change. |
| State | enum class StateEnum representing current state of the ExpandableTextView. |
| <init> | ExpandableTextView(context: Context)ExpandableTextView(context: Context, attrs: AttributeSet?)ExpandableTextView(context: Context, attrs: AttributeSet?, defStyleAttr: Int) |
| animationDuration | var animationDuration: IntDuration of expand/collapse animation in milliseconds. 300 by default. |
| collapseInterpolator | var collapseInterpolator: TimeInterpolatorInterpolator applied to collapse animation. AccelerateDecelerateInterpolator by default |
| collapsedHeight | var collapsedHeight: Int |
| collapsedLines | var collapsedLines: IntMaximum number of lines in collapsed state. Integer.MAX_VALUE by default. |
| expandInterpolator | var expandInterpolator: TimeInterpolatorInterpolator applied to expand animation. AccelerateDecelerateInterpolator by default. |
| expandedHeight | var expandedHeight: Int |
| expandedLines | var expandedLines: IntMaximum number of lines in the expanded state. Integer.MAX_VALUE by default. |
| layoutHeight | var layoutHeight: Int |
| onStateChangeListener | var onStateChangeListener: ExpandableTextView.(oldState: State, newState: State) -> UnitProtected listener that is being called when this ExpandableTextView changes its state. Use public onStateChange to set the listener. |
| state | var state: StateCurrent State of this ExpandableTextView. Read-only property. Static by default. |
| collapse | fun collapse(withAnimation: Boolean = true, forceCollapse: Boolean = false): BooleanCollapses this ExpandableTextView if its state is Expanded. |
| expand | fun expand(withAnimation: Boolean = true, forceExpand: Boolean = false): BooleanExpands this ExpandableTextView if its state is Collapsed. |
| initAttrs | fun initAttrs(attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0): Unit |
| onRestoreInstanceState | open fun onRestoreInstanceState(state: Parcelable): Unit |
| onSaveInstanceState | open fun onSaveInstanceState(): Parcelable |
| onSizeChanged | open fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int): Unit |
| onStateChange | fun onStateChange(func: ExpandableTextView.(oldState: State, newState: State) -> Unit): UnitListener which is being called when ExpandableTextView changes its state. |
| onTextChanged | open fun onTextChanged(text: CharSequence?, start: Int, lengthBefore: Int, lengthAfter: Int): Unit |
| setEllipsize | open fun ~~setEllipsize~~(where: TruncateAt?): Unit |
| setMaxLines | open fun ~~setMaxLines~~(maxLines: Int): Unit |
| toggle | fun toggle(withAnimation: Boolean = true): BooleanExpands this ExpandableTextView if the state is Collapsed, collapses if the state is Expanded and does nothing otherwise. |
| updateState | fun updateState(): Unit |