Example usage for android.graphics Paint HINTING_ON

List of usage examples for android.graphics Paint HINTING_ON

Introduction

In this page you can find the example usage for android.graphics Paint HINTING_ON.

Prototype

int HINTING_ON

To view the source code for android.graphics Paint HINTING_ON.

Click Source Link

Document

Font hinter option that enables font hinting.

Usage

From source file:im.ene.ribbon.FixedActionTabView.java

public FixedActionTabView(final BottomNavigationView parent, boolean expanded, final MenuParser.Menu menu) {
    super(parent, expanded, menu);

    final Resources res = getResources();
    this.paddingTopActive = res.getDimensionPixelSize(R.dimen.ribbon_fixed_active_item_padding_top);
    this.paddingTopInactive = res.getDimensionPixelSize(R.dimen.ribbon_fixed_inactive_item_padding_top);
    this.paddingBottom = res.getDimensionPixelSize(R.dimen.ribbon_fixed_item_padding_bottom);
    this.paddingHorizontal = res.getDimensionPixelSize(R.dimen.ribbon_fixed_item_padding_horizontal);
    this.textSizeInactive = res.getDimensionPixelSize(R.dimen.ribbon_fixed_inactive_item_text_size);
    this.iconSize = res.getDimensionPixelSize(R.dimen.ribbon_fixed_item_icon_size);

    this.animationDuration = menu.getItemAnimationDuration();
    this.colorActive = menu.getColorActive();
    this.colorInactive = menu.getColorInactive();
    this.centerY = paddingTopActive;
    this.canvasTextScale = expanded ? TEXT_SCALE_ACTIVE : 1f;
    this.iconTranslation = expanded ? 0 : (paddingTopInactive - paddingTopActive);

    log(TAG, DEBUG, "colors: %x, %x", colorInactive, colorActive);

    this.textPaint.setColor(Color.WHITE);
    this.textPaint.setHinting(Paint.HINTING_ON);
    this.textPaint.setLinearText(true);
    this.textPaint.setSubpixelText(true);
    this.textPaint.setTextSize(textSizeInactive);
    this.textPaint.setColor(expanded ? colorActive : colorInactive);
}