public void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes, String maxValue) {
        final Resources resource = getResources();
        final float density = resource.getDisplayMetrics().density;

        mNumber = new TextView(context);
        mNumber.setGravity(Gravity.CENTER);
        mNumber.setText(maxValue);
        mNumber.setMaxLines(1);
        mNumber.setSingleLine(true);
        UiCompat.setTextDirection(mNumber, 5); //5 is TEXT_DIRECTION_LOCALE
        mNumber.setVisibility(View.INVISIBLE);

        // reset text size
        resetSizes(maxValue);

        mSeparation = (int) (SEPARATION_DP * density);

        mBalloonMarkerDrawable = new BalloonMarkerDrawable(ColorStateList.valueOf(Color.TRANSPARENT), 0);
        mBalloonMarkerDrawable.setCallback(this);
        mBalloonMarkerDrawable.setMarkerListener(this);
        mBalloonMarkerDrawable.setExternalOffset(getPaddingBottom());

        UiCompat.setOutlineProvider(this, mBalloonMarkerDrawable);

        if (attrs != null) {

            TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BalloonMarker,
                    defStyleAttr, defStyleRes);
            int textPadding = a.getDimensionPixelSize(R.styleable.BalloonMarker_gMarkerTextPadding,
                    resource.getDimensionPixelSize(R.dimen.g_balloonMarker_textPadding));
            int textAppearanceId = a.getResourceId(R.styleable.BalloonMarker_gMarkerTextAppearance,
                    R.style.Genius_Widget_BalloonMarker_TextAppearance);
            ColorStateList color = a.getColorStateList(R.styleable.BalloonMarker_gMarkerBackgroundColor);
            String fontFile = a.getString(R.styleable.BalloonMarker_gFont);

            mSeparation = a.getDimensionPixelSize(R.styleable.BalloonMarker_gMarkerSeparation,
                    resource.getDimensionPixelSize(R.dimen.g_balloonMarker_separation));

            a.recycle();

            setTextPadding(textPadding);
            setTextAppearance(textAppearanceId);
            setBackgroundColor(color);

            //Elevation for android 5+
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                float elevation = a.getDimension(R.styleable.BalloonMarker_gMarkerElevation, ELEVATION_DP * density);
                this.setElevation(elevation);
            }

            // Check for IDE preview render
            if (!this.isInEditMode()) {
                // Font
                if (fontFile != null && fontFile.length() > 0) {
                    Typeface typeface = Ui.getFont(getContext(), fontFile);
                    if (typeface != null) setTypeface(typeface);
                }
            }
        }
    }
This is a BalloonMarker used to {@link SeekBar}
<p>
<p><strong>XML attributes</strong></p>
<p>
See {@link net.qiujuer.genius.ui.R.styleable#BalloonMarker_gFont Attributes},
{@link net.qiujuer.genius.ui.R.styleable#BalloonMarker_gMarkerBackgroundColor Attributes},
{@link net.qiujuer.genius.ui.R.styleable#BalloonMarker_gMarkerElevation Attributes}
{@link net.qiujuer.genius.ui.R.styleable#BalloonMarker_gMarkerSeparation Attributes}
{@link net.qiujuer.genius.ui.R.styleable#BalloonMarker_gMarkerTextAppearance Attributes}
{@link net.qiujuer.genius.ui.R.styleable#BalloonMarker_gMarkerTextPadding Attributes}
caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/BalloonMarker.java