summaryrefslogtreecommitdiff
path: root/vdrmanager/app/src/main/java/de/androvdr/widget/FontAwesomeButton.java
blob: 22c4de1c89786e8488694bf73b0a14cbff4d5aa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package de.androvdr.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;

/**
 * Created by lado on 04.05.15.
 */
public class FontAwesomeButton extends Button {


    public FontAwesomeButton(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        initFontAwesome();

    }

    public FontAwesomeButton(Context context, AttributeSet attrs) {
        super(context, attrs);
        initFontAwesome();

    }

    public FontAwesomeButton(Context context) {
        super(context);
        initFontAwesome();
    }

    private void initFontAwesome(){
        if(isInEditMode() == false) {
            setTypeface(FontAwesome.getFontAwesome(getContext().getApplicationContext().getApplicationContext()));
        }
    }

}