Last active
January 20, 2017 18:37
-
-
Save dalwadi2/e5f8795a8797148fca1372498c28686d to your computer and use it in GitHub Desktop.
Custom font textview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package in.vaksys.notificationtest; | |
import android.content.Context; | |
import android.graphics.Typeface; | |
import android.util.AttributeSet; | |
import android.widget.TextView; | |
/** | |
* Created by Harsh on 15-03-2016. | |
*/ | |
public class MyCustomTextView extends TextView { | |
public MyCustomTextView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
this.setTypeface(Typeface.createFromAsset(context.getAssets(), | |
"fonts/YOUR_CUSTOM_FONT.ttf")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment