This repository was archived by the owner on Jul 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
java/com/droidbond/loadingbutton Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ android {
1313 minSdkVersion 15
1414 targetSdkVersion 28
1515 versionCode 1
16- versionName " 0.1.2 "
16+ versionName " 0.1.4 "
1717
1818 testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
1919
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import android.graphics.PorterDuff
77import android.graphics.Typeface
88import android.support.annotation.NonNull
99import android.support.annotation.Nullable
10+ import android.support.v4.content.res.ResourcesCompat
1011import android.util.AttributeSet
1112import android.util.Log
1213import android.view.Gravity
@@ -96,7 +97,13 @@ class LoadingButton @JvmOverloads constructor(
9697 var size = array!! .getDimension(R .styleable.app_textSize, 14f * Resources .getSystem().displayMetrics.density)
9798 size / = Resources .getSystem().displayMetrics.density
9899
99- tvText!! .textSize = size
100+ tvText?.textSize = size
101+
102+ if (array!! .hasValue(R .styleable.app_customFontFamily)) {
103+ val fontId = array!! .getResourceId(R .styleable.app_customFontFamily, - 1 )
104+ val typeface = ResourcesCompat .getFont(context, fontId)
105+ tvText?.typeface = typeface
106+ }
100107
101108 array?.recycle()
102109 }
Original file line number Diff line number Diff line change 77 <attr name =" textSize" format =" dimension" />
88 <attr name =" progressColor" format =" color" />
99 <attr name =" background" format =" reference" />
10+ <attr name =" customFontFamily" format =" reference" />
1011 <attr name =" progressBarSize" format =" enum" >
1112 <enum name =" large" value =" 64" />
1213 <enum name =" medium" value =" 48" />
You can’t perform that action at this time.
0 commit comments