diff --git a/CHANGELOG.md b/CHANGELOG.md index baa16e6..4b920b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ Change Log ========== +## Version 4.0.0 + +_2017-07-26_ + + * Support AppCompat v26.0.0. Changed attribute names: + - `typeface` -> `robotoTypeface` + - `fontFamily` -> `robotoFontFamily` + - `textWeight` -> `robotoTextWeight` + - `textStyle` -> `robotoTextStyle` + + ## Version 3.0.0 _2017-02-14_ diff --git a/README.md b/README.md index 17c6266..6f4a349 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,16 @@ Supported fonts: +Deprecated :cry: +---------- + +This project is deprecated in favor of the [native implementation](https://developer.android.com/preview/features/fonts-in-xml.html) introduced in Android O. + + Compatibility ------------- -This library is compatible from API 9 (Android 2.3). +This library is compatible from API 14 (Android 4.0). Download @@ -32,7 +38,7 @@ Download Gradle: ```groovy -compile 'com.github.johnkil.android-robototextview:robototextview:3.0.0' +compile 'com.github.johnkil.android-robototextview:robototextview:4.0.0' ``` Maven: @@ -41,7 +47,7 @@ Maven: com.github.johnkil.android-robototextview robototextview - 3.0.0 + 4.0.0 aar ``` @@ -52,7 +58,7 @@ Usage #### In XML -To set up a typeface you must specify the parameter `typeface`: +To set up a typeface you must specify the parameter `robotoTypeface`: ``` xml + app:robotoTypeface="roboto_light_italic"/> ``` -or specify a set of parameters `fontFamily`, `textWeight` and `textStyle`: +or specify a set of parameters `robotoFontFamily`, `robotoTextWeight` and `robotoTextStyle`: ``` xml + app:robotoFontFamily="roboto" + app:robotoTextWeight="light" + app:robotoTextStyle="italic"/> ``` Set up typeface in code: @@ -137,7 +143,7 @@ and specify the typeface in xml: xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:typeface="roboto_light_italic" + app:robotoTypeface="roboto_light_italic" tools:ignore="MissingPrefix"/> ``` @@ -159,7 +165,7 @@ android.applicationVariants.all{ variant -> if (file.getName().contains("RobotoSlab")) { println("delete " + file.getName() + " font") file.delete() - }; + } } } } diff --git a/build.gradle b/build.gradle index e8c54fd..7237490 100644 --- a/build.gradle +++ b/build.gradle @@ -14,6 +14,7 @@ buildscript { allprojects { repositories { + google() jcenter() } } diff --git a/dependencies.gradle b/dependencies.gradle index c034fe8..b2d894a 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,14 +1,14 @@ ext.versions = [ - minSdk : 9, - targetSdk : 25, - compileSdk : 25, - buildTools : '25.0.2', + minSdk : 14, + targetSdk : 26, + compileSdk : 26, + buildTools : '26.0.1', - androidGradlePlugin : '2.3.0-beta3', - versionsGradlePlugin: '0.14.0', + androidGradlePlugin : '2.3.3', + versionsGradlePlugin: '0.15.0', junit : '4.12', - supportLib : '25.1.1' + supportLib : '26.0.0' ] ext.gradlePlugins = [ diff --git a/gradle.properties b/gradle.properties index 2620da1..29e0d3b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ GROUP=com.github.johnkil.android-robototextview -VERSION_NAME=3.0.0 +VERSION_NAME=4.0.0 -POM_DESCRIPTION=Implementation of the fragment with the ability to display indeterminate progress indicator when you are waiting for the initial dataImplementation of a TextView and all its direct/indirect subclasses with native support for the Roboto fonts, includes the brand new Roboto Slab and Roboto Mono fonts. +POM_DESCRIPTION=Implementation of a TextView and all its direct/indirect subclasses with native support for the Roboto fonts, includes the brand new Roboto Slab and Roboto Mono fonts. POM_URL=https://github.com/johnkil/Android-RobotoTextView POM_SCM_URL=https://github.com/johnkil/Android-RobotoTextView diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 3743dc9..7f4c491 100755 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a852c1c..a538c14 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Sun Feb 12 01:14:28 MSK 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip diff --git a/gradlew b/gradlew index 4453cce..cccdd3d 100755 --- a/gradlew +++ b/gradlew @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS="" # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -155,7 +155,7 @@ if $cygwin ; then fi # Escape application args -save ( ) { +save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } diff --git a/robototextview-sample/src/main/res/layout/activity_inflater.xml b/robototextview-sample/src/main/res/layout/activity_inflater.xml index 5b54fda..37913c4 100644 --- a/robototextview-sample/src/main/res/layout/activity_inflater.xml +++ b/robototextview-sample/src/main/res/layout/activity_inflater.xml @@ -39,14 +39,14 @@ android:layout_height="wrap_content" android:text="Roboto Thin & " android:textSize="22sp" - app:typeface="roboto_thin"/> + app:robotoTypeface="roboto_thin"/> + app:robotoTypeface="roboto_thin_italic"/> @@ -60,14 +60,14 @@ android:layout_height="wrap_content" android:text="Roboto Light & " android:textSize="22sp" - app:typeface="roboto_light"/> + app:robotoTypeface="roboto_light"/> + app:robotoTypeface="roboto_light_italic"/> @@ -81,14 +81,14 @@ android:layout_height="wrap_content" android:text="Roboto Regular & " android:textSize="22sp" - app:typeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_italic"/> @@ -102,14 +102,14 @@ android:layout_height="wrap_content" android:text="Roboto Medium & " android:textSize="22sp" - app:typeface="roboto_medium"/> + app:robotoTypeface="roboto_medium"/> + app:robotoTypeface="roboto_medium_italic"/> @@ -123,14 +123,14 @@ android:layout_height="wrap_content" android:text="Roboto Bold & " android:textSize="22sp" - app:typeface="roboto_bold"/> + app:robotoTypeface="roboto_bold"/> + app:robotoTypeface="roboto_bold_italic"/> @@ -144,14 +144,14 @@ android:layout_height="wrap_content" android:text="Roboto Black & " android:textSize="22sp" - app:typeface="roboto_black"/> + app:robotoTypeface="roboto_black"/> + app:robotoTypeface="roboto_black_italic"/> @@ -165,14 +165,14 @@ android:layout_height="wrap_content" android:text="Roboto Condensed Light & " android:textSize="22sp" - app:typeface="roboto_condensed_light"/> + app:robotoTypeface="roboto_condensed_light"/> + app:robotoTypeface="roboto_condensed_light_italic"/> @@ -186,14 +186,14 @@ android:layout_height="wrap_content" android:text="Roboto Condensed Regular & " android:textSize="22sp" - app:typeface="roboto_condensed_regular"/> + app:robotoTypeface="roboto_condensed_regular"/> + app:robotoTypeface="roboto_condensed_italic"/> @@ -207,14 +207,14 @@ android:layout_height="wrap_content" android:text="Roboto Condensed Bold & " android:textSize="22sp" - app:typeface="roboto_condensed_bold"/> + app:robotoTypeface="roboto_condensed_bold"/> + app:robotoTypeface="roboto_condensed_bold_italic"/> + app:robotoTypeface="roboto_slab_thin"/> @@ -241,7 +241,7 @@ android:layout_height="wrap_content" android:text="Roboto Slab Light" android:textSize="22sp" - app:typeface="roboto_slab_light"/> + app:robotoTypeface="roboto_slab_light"/> @@ -255,7 +255,7 @@ android:layout_height="wrap_content" android:text="Roboto Slab Regular" android:textSize="22sp" - app:typeface="roboto_slab_regular"/> + app:robotoTypeface="roboto_slab_regular"/> + app:robotoTypeface="roboto_slab_bold"/> @@ -282,14 +282,14 @@ android:layout_height="wrap_content" android:text="Roboto Mono Thin & " android:textSize="22sp" - app:typeface="roboto_mono_thin"/> + app:robotoTypeface="roboto_mono_thin"/> + app:robotoTypeface="roboto_mono_thin_italic"/> @@ -303,14 +303,14 @@ android:layout_height="wrap_content" android:text="Roboto Mono Light & " android:textSize="22sp" - app:typeface="roboto_mono_light"/> + app:robotoTypeface="roboto_mono_light"/> + app:robotoTypeface="roboto_mono_light_italic"/> @@ -324,14 +324,14 @@ android:layout_height="wrap_content" android:text="Roboto Mono Regular & " android:textSize="22sp" - app:typeface="roboto_mono_regular"/> + app:robotoTypeface="roboto_mono_regular"/> + app:robotoTypeface="roboto_mono_italic"/> @@ -345,14 +345,14 @@ android:layout_height="wrap_content" android:text="Roboto Mono Medium & " android:textSize="22sp" - app:typeface="roboto_mono_medium"/> + app:robotoTypeface="roboto_mono_medium"/> + app:robotoTypeface="roboto_mono_medium_italic"/> @@ -366,14 +366,14 @@ android:layout_height="wrap_content" android:text="Roboto Mono Bold & " android:textSize="22sp" - app:typeface="roboto_mono_bold"/> + app:robotoTypeface="roboto_mono_bold"/> + app:robotoTypeface="roboto_mono_bold_italic"/> diff --git a/robototextview-sample/src/main/res/layout/activity_main.xml b/robototextview-sample/src/main/res/layout/activity_main.xml index 6e76dc4..957b3de 100644 --- a/robototextview-sample/src/main/res/layout/activity_main.xml +++ b/robototextview-sample/src/main/res/layout/activity_main.xml @@ -46,14 +46,14 @@ android:layout_height="wrap_content" android:text="Roboto Thin & " android:textSize="22sp" - app:typeface="roboto_thin"/> + app:robotoTypeface="roboto_thin"/> + app:robotoTypeface="roboto_thin_italic"/> @@ -67,14 +67,14 @@ android:layout_height="wrap_content" android:text="Roboto Light & " android:textSize="22sp" - app:typeface="roboto_light"/> + app:robotoTypeface="roboto_light"/> + app:robotoTypeface="roboto_light_italic"/> @@ -88,14 +88,14 @@ android:layout_height="wrap_content" android:text="Roboto Regular & " android:textSize="22sp" - app:typeface="roboto_regular"/> + app:robotoTypeface="roboto_regular"/> + app:robotoTypeface="roboto_italic"/> @@ -109,14 +109,14 @@ android:layout_height="wrap_content" android:text="Roboto Medium & " android:textSize="22sp" - app:typeface="roboto_medium"/> + app:robotoTypeface="roboto_medium"/> + app:robotoTypeface="roboto_medium_italic"/> @@ -130,14 +130,14 @@ android:layout_height="wrap_content" android:text="Roboto Bold & " android:textSize="22sp" - app:typeface="roboto_bold"/> + app:robotoTypeface="roboto_bold"/> + app:robotoTypeface="roboto_bold_italic"/> @@ -151,14 +151,14 @@ android:layout_height="wrap_content" android:text="Roboto Black & " android:textSize="22sp" - app:typeface="roboto_black"/> + app:robotoTypeface="roboto_black"/> + app:robotoTypeface="roboto_black_italic"/> @@ -172,14 +172,14 @@ android:layout_height="wrap_content" android:text="Roboto Condensed Light & " android:textSize="22sp" - app:typeface="roboto_condensed_light"/> + app:robotoTypeface="roboto_condensed_light"/> + app:robotoTypeface="roboto_condensed_light_italic"/> @@ -193,14 +193,14 @@ android:layout_height="wrap_content" android:text="Roboto Condensed Regular & " android:textSize="22sp" - app:typeface="roboto_condensed_regular"/> + app:robotoTypeface="roboto_condensed_regular"/> + app:robotoTypeface="roboto_condensed_italic"/> @@ -214,14 +214,14 @@ android:layout_height="wrap_content" android:text="Roboto Condensed Bold & " android:textSize="22sp" - app:typeface="roboto_condensed_bold"/> + app:robotoTypeface="roboto_condensed_bold"/> + app:robotoTypeface="roboto_condensed_bold_italic"/> + app:robotoTypeface="roboto_slab_thin"/> @@ -248,7 +248,7 @@ android:layout_height="wrap_content" android:text="Roboto Slab Light" android:textSize="22sp" - app:typeface="roboto_slab_light"/> + app:robotoTypeface="roboto_slab_light"/> @@ -262,7 +262,7 @@ android:layout_height="wrap_content" android:text="Roboto Slab Regular" android:textSize="22sp" - app:typeface="roboto_slab_regular"/> + app:robotoTypeface="roboto_slab_regular"/> + app:robotoTypeface="roboto_slab_bold"/> @@ -289,14 +289,14 @@ android:layout_height="wrap_content" android:text="Roboto Mono Thin & " android:textSize="22sp" - app:typeface="roboto_mono_thin"/> + app:robotoTypeface="roboto_mono_thin"/> + app:robotoTypeface="roboto_mono_thin_italic"/> @@ -310,14 +310,14 @@ android:layout_height="wrap_content" android:text="Roboto Mono Light & " android:textSize="22sp" - app:typeface="roboto_mono_light"/> + app:robotoTypeface="roboto_mono_light"/> + app:robotoTypeface="roboto_mono_light_italic"/> @@ -331,14 +331,14 @@ android:layout_height="wrap_content" android:text="Roboto Mono Regular & " android:textSize="22sp" - app:typeface="roboto_mono_regular"/> + app:robotoTypeface="roboto_mono_regular"/> + app:robotoTypeface="roboto_mono_italic"/> @@ -352,14 +352,14 @@ android:layout_height="wrap_content" android:text="Roboto Mono Medium & " android:textSize="22sp" - app:typeface="roboto_mono_medium"/> + app:robotoTypeface="roboto_mono_medium"/> + app:robotoTypeface="roboto_mono_medium_italic"/> @@ -373,14 +373,14 @@ android:layout_height="wrap_content" android:text="Roboto Mono Bold & " android:textSize="22sp" - app:typeface="roboto_mono_bold"/> + app:robotoTypeface="roboto_mono_bold"/> + app:robotoTypeface="roboto_mono_bold_italic"/> diff --git a/robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java b/robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java index 756e708..7336b5c 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java +++ b/robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java @@ -162,8 +162,8 @@ private RobotoTypefaces() {} * Obtain typeface. * * @param context The Context the widget is running in, through which it can access the current theme, resources, etc. - * @param typefaceValue The value of "typeface" attribute - * @return specify {@link Typeface} or throws IllegalArgumentException if unknown `typeface` attribute value. + * @param typefaceValue The value of "robotoTypeface" attribute + * @return specify {@link Typeface} or throws IllegalArgumentException if unknown `robotoTypeface` attribute value. */ @NonNull public static Typeface obtainTypeface(@NonNull Context context, @RobotoTypeface int typefaceValue) { @@ -179,9 +179,9 @@ public static Typeface obtainTypeface(@NonNull Context context, @RobotoTypeface * Obtain typeface. * * @param context The Context the widget is running in, through which it can access the current theme, resources, etc. - * @param fontFamily The value of "fontFamily" attribute - * @param textWeight The value of "textWeight" attribute - * @param textStyle The value of "textStyle" attribute + * @param fontFamily The value of "robotoFontFamily" attribute + * @param textWeight The value of "robotoTextWeight" attribute + * @param textStyle The value of "robotoTextStyle" attribute * @return specify {@link Typeface} or throws IllegalArgumentException. */ @NonNull @@ -210,8 +210,8 @@ public static Typeface obtainTypeface(@NonNull Context context, @RobotoFontFamil typeface = TYPEFACE_ROBOTO_BLACK; break; default: - throw new IllegalArgumentException("`textWeight` attribute value " + textWeight + - " is not supported for this font family " + fontFamily + + throw new IllegalArgumentException("`robotoTextWeight` attribute value " + textWeight + + " is not supported for this fontFamily " + fontFamily + " and textStyle " + textStyle); } } else if (textStyle == TEXT_STYLE_ITALIC) { @@ -235,12 +235,12 @@ public static Typeface obtainTypeface(@NonNull Context context, @RobotoFontFamil typeface = TYPEFACE_ROBOTO_BLACK_ITALIC; break; default: - throw new IllegalArgumentException("`textWeight` attribute value " + textWeight + - " is not supported for this font family " + fontFamily + + throw new IllegalArgumentException("`robotoTextWeight` attribute value " + textWeight + + " is not supported for this fontFamily " + fontFamily + " and textStyle " + textStyle); } } else { - throw new IllegalArgumentException("`textStyle` attribute value " + textStyle + + throw new IllegalArgumentException("`robotoTextStyle` attribute value " + textStyle + " is not supported for this fontFamily " + fontFamily); } } else if (fontFamily == FONT_FAMILY_ROBOTO_CONDENSED) { @@ -256,8 +256,8 @@ public static Typeface obtainTypeface(@NonNull Context context, @RobotoFontFamil typeface = TYPEFACE_ROBOTO_CONDENSED_BOLD; break; default: - throw new IllegalArgumentException("`textWeight` attribute value " + textWeight + - " is not supported for this font family " + fontFamily + + throw new IllegalArgumentException("`robotoTextWeight` attribute value " + textWeight + + " is not supported for this fontFamily " + fontFamily + " and textStyle " + textStyle); } } else if (textStyle == TEXT_STYLE_ITALIC) { @@ -272,12 +272,12 @@ public static Typeface obtainTypeface(@NonNull Context context, @RobotoFontFamil typeface = TYPEFACE_ROBOTO_CONDENSED_BOLD_ITALIC; break; default: - throw new IllegalArgumentException("`textWeight` attribute value " + textWeight + - " is not supported for this font family " + fontFamily + + throw new IllegalArgumentException("`robotoTextWeight` attribute value " + textWeight + + " is not supported for this fontFamily " + fontFamily + " and textStyle " + textStyle); } } else { - throw new IllegalArgumentException("`textStyle` attribute value " + textStyle + + throw new IllegalArgumentException("`robotoTextStyle` attribute value " + textStyle + " is not supported for this fontFamily " + fontFamily); } } else if (fontFamily == FONT_FAMILY_ROBOTO_SLAB) { @@ -296,12 +296,12 @@ public static Typeface obtainTypeface(@NonNull Context context, @RobotoFontFamil typeface = TYPEFACE_ROBOTO_SLAB_BOLD; break; default: - throw new IllegalArgumentException("`textWeight` attribute value " + textWeight + - " is not supported for this font family " + fontFamily + + throw new IllegalArgumentException("`robotoTextWeight` attribute value " + textWeight + + " is not supported for this fontFamily " + fontFamily + " and textStyle " + textStyle); } } else { - throw new IllegalArgumentException("`textStyle` attribute value " + textStyle + + throw new IllegalArgumentException("`robotoTextStyle` attribute value " + textStyle + " is not supported for this fontFamily " + fontFamily); } } else if (fontFamily == FONT_FAMILY_ROBOTO_MONO) { @@ -323,8 +323,8 @@ public static Typeface obtainTypeface(@NonNull Context context, @RobotoFontFamil typeface = TYPEFACE_ROBOTO_MONO_BOLD; break; default: - throw new IllegalArgumentException("`textWeight` attribute value " + textWeight + - " is not supported for this font family " + fontFamily + + throw new IllegalArgumentException("`robotoTextWeight` attribute value " + textWeight + + " is not supported for this fontFamily " + fontFamily + " and textStyle " + textStyle); } } else if (textStyle == TEXT_STYLE_ITALIC) { @@ -345,16 +345,16 @@ public static Typeface obtainTypeface(@NonNull Context context, @RobotoFontFamil typeface = TYPEFACE_ROBOTO_MONO_BOLD_ITALIC; break; default: - throw new IllegalArgumentException("`textWeight` attribute value " + textWeight + - " is not supported for this font family " + fontFamily + + throw new IllegalArgumentException("`robotoTextWeight` attribute value " + textWeight + + " is not supported for this fontFamily " + fontFamily + " and textStyle " + textStyle); } } else { - throw new IllegalArgumentException("`textStyle` attribute value " + textStyle + + throw new IllegalArgumentException("`robotoTextStyle` attribute value " + textStyle + " is not supported for this fontFamily " + fontFamily); } } else { - throw new IllegalArgumentException("Unknown `fontFamily` attribute value " + fontFamily); + throw new IllegalArgumentException("Unknown `robotoFontFamily` attribute value " + fontFamily); } return obtainTypeface(context, typeface); } @@ -364,8 +364,8 @@ public static Typeface obtainTypeface(@NonNull Context context, @RobotoFontFamil * * @param context The Context the widget is running in, through which it can * access the current theme, resources, etc. - * @param typeface The value of "typeface" attribute - * @return Roboto {@link Typeface} or throws IllegalArgumentException if unknown `typeface` attribute value. + * @param typeface The value of "robotoTypeface" attribute + * @return Roboto {@link Typeface} or throws IllegalArgumentException if unknown `robotoTypeface` attribute value. */ @NonNull private static Typeface createTypeface(@NonNull Context context, @RobotoTypeface int typeface) { @@ -468,7 +468,7 @@ private static Typeface createTypeface(@NonNull Context context, @RobotoTypeface path = "fonts/RobotoMono-BoldItalic.ttf"; break; default: - throw new IllegalArgumentException("Unknown `typeface` attribute value " + typeface); + throw new IllegalArgumentException("Unknown `robotoTypeface` attribute value " + typeface); } return Typeface.createFromAsset(context.getAssets(), path); } @@ -482,13 +482,13 @@ private static Typeface createTypeface(@NonNull Context context, @RobotoTypeface */ @NonNull public static Typeface obtainTypeface(@NonNull Context context, @NonNull TypedArray attrs) { - if (attrs.hasValue(R.styleable.RobotoTextView_typeface)) { - @RobotoTypeface int typefaceValue = attrs.getInt(R.styleable.RobotoTextView_typeface, TYPEFACE_ROBOTO_REGULAR); + if (attrs.hasValue(R.styleable.RobotoTextView_robotoTypeface)) { + @RobotoTypeface int typefaceValue = attrs.getInt(R.styleable.RobotoTextView_robotoTypeface, TYPEFACE_ROBOTO_REGULAR); return obtainTypeface(context, typefaceValue); } else { - @RobotoFontFamily int fontFamily = attrs.getInt(R.styleable.RobotoTextView_fontFamily, FONT_FAMILY_ROBOTO); - @RobotoTextWeight int textWeight = attrs.getInt(R.styleable.RobotoTextView_textWeight, TEXT_WEIGHT_NORMAL); - @RobotoTextStyle int textStyle = attrs.getInt(R.styleable.RobotoTextView_textStyle, TEXT_STYLE_NORMAL); + @RobotoFontFamily int fontFamily = attrs.getInt(R.styleable.RobotoTextView_robotoFontFamily, FONT_FAMILY_ROBOTO); + @RobotoTextWeight int textWeight = attrs.getInt(R.styleable.RobotoTextView_robotoTextWeight, TEXT_WEIGHT_NORMAL); + @RobotoTextStyle int textStyle = attrs.getInt(R.styleable.RobotoTextView_robotoTextStyle, TEXT_STYLE_NORMAL); return obtainTypeface(context, fontFamily, textWeight, textStyle); } } @@ -520,7 +520,7 @@ public static void setUpTypeface(@NonNull TextView textView, @NonNull Context co * Set up typeface for TextView. * * @param textView The text view - * @param typeface The value of "typeface" attribute + * @param typeface The value of "robotoTypeface" attribute */ public static void setUpTypeface(@NonNull TextView textView, @RobotoTypeface int typeface) { setUpTypeface(textView, obtainTypeface(textView.getContext(), typeface)); @@ -530,9 +530,9 @@ public static void setUpTypeface(@NonNull TextView textView, @RobotoTypeface int * Set up typeface for TextView. * * @param textView The text view - * @param fontFamily The value of "fontFamily" attribute - * @param textWeight The value of "textWeight" attribute - * @param textStyle The value of "textStyle" attribute + * @param fontFamily The value of "robotoFontFamily" attribute + * @param textWeight The value of "robotoTextWeight" attribute + * @param textStyle The value of "robotoTextStyle" attribute */ public static void setUpTypeface(@NonNull TextView textView, @RobotoFontFamily int fontFamily, @RobotoTextWeight int textWeight, @RobotoTextStyle int textStyle) { diff --git a/robototextview/src/main/java/com/devspark/robototextview/style/RobotoTypefaceSpan.java b/robototextview/src/main/java/com/devspark/robototextview/style/RobotoTypefaceSpan.java index 0787d28..b2fbc2c 100644 --- a/robototextview/src/main/java/com/devspark/robototextview/style/RobotoTypefaceSpan.java +++ b/robototextview/src/main/java/com/devspark/robototextview/style/RobotoTypefaceSpan.java @@ -39,7 +39,7 @@ public RobotoTypefaceSpan(Context context) { * * @param context The Context the span is using in, through which it can * access the current theme, resources, etc. - * @param typeface The value of "typeface" attribute + * @param typeface The value of "robotoTypeface" attribute */ public RobotoTypefaceSpan(Context context, @RobotoTypeface int typeface) { this.typeface = RobotoTypefaces.obtainTypeface(context, typeface); @@ -50,9 +50,9 @@ public RobotoTypefaceSpan(Context context, @RobotoTypeface int typeface) { * * @param context The Context the span is using in, through which it can * access the current theme, resources, etc. - * @param fontFamily The value of "fontFamily" attribute - * @param textWeight The value of "textWeight" attribute - * @param textStyle The value of "textStyle" attribute + * @param fontFamily The value of "robotoFontFamily" attribute + * @param textWeight The value of "robotoTextWeight" attribute + * @param textStyle The value of "robotoTextStyle" attribute */ public RobotoTypefaceSpan(Context context, @RobotoFontFamily int fontFamily, @RobotoTextWeight int textWeight, @RobotoTextStyle int textStyle) { diff --git a/robototextview/src/main/res/values/attrs.xml b/robototextview/src/main/res/values/attrs.xml index 77e5b8a..cb8a82d 100644 --- a/robototextview/src/main/res/values/attrs.xml +++ b/robototextview/src/main/res/values/attrs.xml @@ -18,112 +18,112 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + @@ -158,14 +158,14 @@ - + - + @@ -174,7 +174,7 @@ - +