RobertApikyan / SegmentedControl

Android SegmentedControl + multi row support
Apache License 2.0
162 stars 30 forks source link

How to set typeface? #1

Closed drunkendaddy closed 6 years ago

drunkendaddy commented 6 years ago

How do I change the font?

RobertApikyan commented 6 years ago

Hi, for font change, there is a new attribute in release 1.0.1

from XML use app:fontAssetPath="fonts/newFont.ttf" and specify .ttf or .otf file path (in this case it's located in assets/fonts/newFont.ttf) programmatically segmentedControl.setTypeFace(typeface)

here is Gradle configs for release 1.0.1

In your app module build.gradle dependencies { compile 'com.github.RobertApikyan:SegmentedControl:release_1.0.1' }

in application module build.gradle allprojects { repositories { maven { url 'https://jitpack.io' } } }