File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
AnkiDroid/src/main/java/com/ichi2 Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import android.widget.LinearLayout
2424import android.widget.TextView
2525import com.ichi2.anki.databinding.ViewStudyCountsBinding
2626import com.ichi2.anki.libanki.sched.Counts
27+ import com.ichi2.utils.UiUtil
2728
2829/* *
2930 * Displays New, Learn, and Review counts.
@@ -47,9 +48,7 @@ class StudyCountsView : LinearLayout {
4748 }
4849 text =
4950 if (counts.activeQueue == queue) {
50- SpannableString (newText).apply {
51- setSpan(UnderlineSpan (), 0 , length, 0 )
52- }
51+ UiUtil .underline(newText)
5352 } else {
5453 newText
5554 }
Original file line number Diff line number Diff line change @@ -18,8 +18,10 @@ package com.ichi2.utils
1818import android.app.Dialog
1919import android.graphics.Typeface
2020import android.text.Spannable
21+ import android.text.SpannableString
2122import android.text.SpannableStringBuilder
2223import android.text.style.StyleSpan
24+ import android.text.style.UnderlineSpan
2325import android.view.ViewGroup
2426import android.widget.Spinner
2527
@@ -30,6 +32,11 @@ object UiUtil {
3032 return str
3133 }
3234
35+ fun underline (string : String ): Spannable =
36+ SpannableString (string).apply {
37+ setSpan(UnderlineSpan (), 0 , length, 0 )
38+ }
39+
3340 fun Spinner.setSelectedValue (value : Any? ) {
3441 for (position in 0 until this .adapter.count) {
3542 if (this .adapter.getItem(position) != value) continue
You can’t perform that action at this time.
0 commit comments