Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Commit e95ea43

Browse files
committed
Fix NewAPI warning
1 parent 1348e92 commit e95ea43

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/java/io/supernova/toolkit/example/MainActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import android.graphics.Color;
44
import android.graphics.PointF;
55
import android.os.Bundle;
6+
import android.support.v4.content.ContextCompat;
7+
import android.support.v4.content.res.ResourcesCompat;
68
import android.support.v7.app.AppCompatActivity;
79
import android.text.SpannableString;
810
import android.text.Spanned;
@@ -74,7 +76,7 @@ private void setupLetterSpacingExample() {
7476
LetterSpacingSpan shrinkingSpan = new LetterSpacingSpan(-0.1f);
7577
spannableString.setSpan(shrinkingSpan, 30, spannableString.length() - 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
7678

77-
FontSpan span = new FontSpan(this.getResources().getFont(R.font.font_lato_black));
79+
FontSpan span = new FontSpan(ResourcesCompat.getFont(this, R.font.font_lato_light));
7880
spannableString.setSpan(span, 5, 15, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
7981

8082
// Pass spannable text to the view

0 commit comments

Comments
 (0)