diff options
Diffstat (limited to 'vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/androvdr/widget/FontAwesomeTextView.java')
-rw-r--r-- | vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/androvdr/widget/FontAwesomeTextView.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/androvdr/widget/FontAwesomeTextView.java b/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/androvdr/widget/FontAwesomeTextView.java new file mode 100644 index 0000000..a6b5b42 --- /dev/null +++ b/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/androvdr/widget/FontAwesomeTextView.java @@ -0,0 +1,36 @@ +package de.androvdr.widget; + +import android.content.Context; +import android.graphics.Typeface; +import android.support.annotation.Nullable; +import android.util.AttributeSet; +import android.widget.TextView; + +/** + * Created by lado on 17.11.17. + */ + +public class FontAwesomeTextView extends TextView { + public FontAwesomeTextView(Context context) { + super(context); + initFontAwesome(); + } + + public FontAwesomeTextView(Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + initFontAwesome(); + } + + public FontAwesomeTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + initFontAwesome(); + } + + private void initFontAwesome() { + if (isInEditMode() == false) { + setTypeface(FontAwesome.getFontAwesome(getContext().getApplicationContext().getApplicationContext())); + } + } + + +} |