AlphabetSideBar

class AlphabetSideBar @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.attr.Default_AlphabetSideBar_Style, @StyleRes defStyleRes: Int = R.style.BaseAlphabetSideBar) : View

AlphabetSideBar.

Since

0.5.4

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.attr.Default_AlphabetSideBar_Style, @StyleRes defStyleRes: Int = R.style.BaseAlphabetSideBar)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
interface LetterListener

Interface definition for a callback to be invoked when the indicator letters is updated.

Link copied to clipboard
annotation class LOCATION

Properties

Link copied to clipboard
Link copied to clipboard

The color-int of alphabet sidebar, bezier curve and bubble.

Link copied to clipboard
private val mBackgroundPaint: Paint
Link copied to clipboard
private val mBackgroundRectF: RectF
Link copied to clipboard

The color-int of current indicator letter in the alphabet sidebar.

Link copied to clipboard
Link copied to clipboard

The color-int of letter in the alphabet sidebar.

Link copied to clipboard
private val mBarTextPaint: Paint
Link copied to clipboard

The size of letter in the alphabet sidebar.

Link copied to clipboard
private val mBezierPath: Path
Link copied to clipboard
private val mBubbleDistance: Float
Link copied to clipboard
private val mBubbleRadius: Float
Link copied to clipboard

The color-int of letter in the bubble.

Link copied to clipboard
private val mBubbleTextPaint: Paint
Link copied to clipboard

The size of letter in the bubble.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val mDefaultLocation: Int
Link copied to clipboard
private val mIndexCount: Int
Link copied to clipboard
private var mIndicatorIndex: Int

The index of the current indicator letter in mAlphabet.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val mPointA: PointF
Link copied to clipboard
private val mPointB: PointF
Link copied to clipboard
private val mPointC: PointF
Link copied to clipboard
private val mPointD: PointF
Link copied to clipboard
private val mPointE: PointF
Link copied to clipboard

Used to save the index of previous indicator letter in mAlphabet. Prevent mLetterListener from being called repeatedly.

Link copied to clipboard

Functions

Link copied to clipboard
private fun checkIsIndexValid(): Boolean
Link copied to clipboard
private fun getBarBeyondHeight(): Float

Returns the difference between the distance from the first bubble to the top of the view and the distance from the sidebar to the top of the view

Link copied to clipboard
private fun getBarCircleRadius(): Float

Returns the radius of the top and bottom semicircles of the sidebar.

Link copied to clipboard
private fun getBarTextBaseLine(): Float

Return the distance length between 50% of the letter height which is in the alphabet sidebar and the baseline. Used to ensure that the drawn text is in the center.

Link copied to clipboard
private fun getBarTextHeight(): Float

Return the height of the letter in the alphabet sidebar.

Link copied to clipboard
private fun getBarWidth(): Float

Get the width of alphabet side bar.

Link copied to clipboard

Return the distance length between 50% of the letter height which is in the bubble and the baseline. Used to ensure that the drawn text is in the center.

Link copied to clipboard

Get index of current indicator letter in mAlphabet.

Link copied to clipboard
protected open override fun onDraw(canvas: Canvas)
Link copied to clipboard
protected open override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)
Link copied to clipboard
open override fun onTouchEvent(event: MotionEvent): Boolean
Link copied to clipboard
open override fun performClick(): Boolean
Link copied to clipboard
fun setFavoriteIcon(@Size(value = 1) favicon: String)

Set favorite icon string.

Link copied to clipboard
fun setIndicatorLetterTargetIndex(@Size(value = 1) alphabet: Alphabet, targetIndex: Int)

Set target index of the alphabet by targetIndex. If mLetterListener is not null, it will also call LetterListener.onIndicatorLetterTargetUpdate.

Link copied to clipboard
Link copied to clipboard
fun setLocation(location: Int)