Skip to content

Commit 566a557

Browse files
committed
Fix javadocs
1 parent 96cd3b1 commit 566a557

2 files changed

Lines changed: 18 additions & 15 deletions

File tree

robototextview/src/main/java/com/devspark/robototextview/style/RobotoTypefaceSpan.java

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import com.devspark.robototextview.util.RobotoTypefaceManager;
1010

1111
/**
12-
* Span for replacing typeface
12+
* Span for replacing typeface.
1313
*/
1414
public class RobotoTypefaceSpan extends MetricAffectingSpan {
1515

@@ -21,29 +21,32 @@ public class RobotoTypefaceSpan extends MetricAffectingSpan {
2121
/**
2222
* Constructor to use with default typeface (regular).
2323
*
24-
* @param context The Context the span is using in, through which it can access the current theme, resources, etc.
24+
* @param context The Context the span is using in, through which it can
25+
* access the current theme, resources, etc.
2526
*/
2627
public RobotoTypefaceSpan(Context context) {
2728
this(context, RobotoTypefaceManager.Typeface.ROBOTO_REGULAR);
2829
}
2930

3031
/**
31-
* Constructor to use with Typeface Id.
32+
* Constructor to use with typeface id.
3233
*
33-
* @param context The Context the span is using in, through which it can access the current theme, resources, etc.
34-
* @param typefaceId Typeface Id ({@link com.devspark.robototextview.util.RobotoTypefaceManager.Typeface})
34+
* @param context The Context the span is using in, through which it can
35+
* access the current theme, resources, etc.
36+
* @param typefaceId Typeface id ({@link RobotoTypefaceManager.Typeface})
3537
*/
3638
public RobotoTypefaceSpan(Context context, int typefaceId) {
3739
mTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceId);
3840
}
3941

4042
/**
41-
* Constructor to use with set of parameters
43+
* Constructor to use with set of parameters.
4244
*
43-
* @param context The Context the span is using in, through which it can access the current theme, resources, etc.
44-
* @param fontFamily The value of "fontFamily" attribute ({@link com.devspark.robototextview.util.RobotoTypefaceManager.FontFamily})
45-
* @param textWeight The value of "textWeight" attribute ({@link com.devspark.robototextview.util.RobotoTypefaceManager.TextWeight})
46-
* @param textStyle The value of "textStyle" attribute ({@link com.devspark.robototextview.util.RobotoTypefaceManager.TextStyle})
45+
* @param context The Context the span is using in, through which it can
46+
* access the current theme, resources, etc.
47+
* @param fontFamily The value of "fontFamily" attribute ({@link RobotoTypefaceManager.FontFamily})
48+
* @param textWeight The value of "textWeight" attribute ({@link RobotoTypefaceManager.TextWeight})
49+
* @param textStyle The value of "textStyle" attribute ({@link RobotoTypefaceManager.TextStyle})
4750
*/
4851
public RobotoTypefaceSpan(Context context, int fontFamily, int textWeight, int textStyle) {
4952
mTypeface = RobotoTypefaceManager.obtainTypeface(context, fontFamily, textWeight, textStyle);
@@ -58,4 +61,5 @@ public void updateDrawState(TextPaint ds) {
5861
public void updateMeasureState(TextPaint paint) {
5962
RobotoTextViewUtils.setTypeface(paint, mTypeface);
6063
}
61-
}
64+
65+
}

robototextview/src/main/java/com/devspark/robototextview/util/RobotoTextViewUtils.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ public static void initTypeface(TextView textView, Context context, AttributeSet
7676
* @param typeface The specify typeface
7777
*/
7878
public static void setTypeface(TextView textView, Typeface typeface) {
79-
//For making the font anti-aliased.
80-
textView.setPaintFlags(textView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
79+
textView.setPaintFlags(textView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
8180
textView.setTypeface(typeface);
8281
}
8382

@@ -88,8 +87,8 @@ public static void setTypeface(TextView textView, Typeface typeface) {
8887
* @param typeface The specify typeface
8988
*/
9089
public static void setTypeface(Paint paint, Typeface typeface) {
91-
paint.setFlags(paint.getFlags() | Paint.SUBPIXEL_TEXT_FLAG);
90+
paint.setFlags(paint.getFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
9291
paint.setTypeface(typeface);
9392
}
9493

95-
}
94+
}

0 commit comments

Comments
 (0)