File tree Expand file tree Collapse file tree 2 files changed +41
-1
lines changed
src/main/java/com/mikepenz/iconics/view Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -25,5 +25,5 @@ if (project.hasProperty('pushall') || project.hasProperty('librarycoreonly')) {
2525}
2626
2727dependencies {
28- compile ' com.android.support:support-v4 :23.1.0'
28+ compile ' com.android.support:appcompat-v7 :23.1.0'
2929}
Original file line number Diff line number Diff line change 1+ package com .mikepenz .iconics .view ;
2+
3+ import android .content .Context ;
4+ import android .os .Build ;
5+ import android .support .v7 .widget .AppCompatButton ;
6+ import android .util .AttributeSet ;
7+ import android .widget .TextView ;
8+
9+ import com .mikepenz .iconics .Iconics ;
10+
11+ public class IconicsCompatButton extends AppCompatButton {
12+
13+ public IconicsCompatButton (Context context ) {
14+ super (context );
15+ }
16+
17+ public IconicsCompatButton (Context context , AttributeSet attrs ) {
18+ super (context , attrs );
19+ }
20+
21+ public IconicsCompatButton (Context context , AttributeSet attrs , int defStyle ) {
22+ super (context , attrs , defStyle );
23+ }
24+
25+ @ Override
26+ public void setText (CharSequence text , TextView .BufferType type ) {
27+ // NOTES:
28+ // 1. Need to disable the All Caps option to make Spannable work properly!
29+ // 2. This method will be called from the constructor of the super class
30+ if (Build .VERSION .SDK_INT > Build .VERSION_CODES .ICE_CREAM_SANDWICH ) {
31+ setAllCaps (false );
32+ }
33+
34+ if (!isInEditMode ()) {
35+ super .setText (new Iconics .IconicsBuilder ().ctx (getContext ()).on (text ).build (), type );
36+ } else {
37+ super .setText (text , type );
38+ }
39+ }
40+ }
You can’t perform that action at this time.
0 commit comments