@@ -9,6 +9,7 @@ import android.text.style.BulletSpan
9
9
import android.text.style.ClickableSpan
10
10
import android.view.View
11
11
import android.widget.TextView
12
+ import androidx.appcompat.app.AppCompatActivity
12
13
import org.xml.sax.Attributes
13
14
import javax.inject.Inject
14
15
@@ -23,6 +24,7 @@ private const val CUSTOM_CONCEPT_CARD_TAG = "oppia-concept-card-link"
23
24
class HtmlParser private constructor(
24
25
private val urlImageParserFactory : UrlImageParser .Factory ,
25
26
private val gcsResourceName : String ,
27
+ private val activity : AppCompatActivity ,
26
28
private val entityType : String ,
27
29
private val entityId : String ,
28
30
private val imageCenterAlign : Boolean ,
@@ -73,7 +75,7 @@ class HtmlParser private constructor(
73
75
val end = spannableBuilder.getSpanEnd(it)
74
76
spannableBuilder.removeSpan(it)
75
77
spannableBuilder.setSpan(
76
- ImprovedBulletSpan (),
78
+ ImprovedBulletSpan (activity ),
77
79
start,
78
80
end,
79
81
Spanned .SPAN_INCLUSIVE_EXCLUSIVE
@@ -125,13 +127,15 @@ class HtmlParser private constructor(
125
127
}
126
128
127
129
/* * Factory for creating new [HtmlParser]s. */
128
- class Factory @Inject constructor(private val urlImageParserFactory : UrlImageParser .Factory ) {
130
+ class Factory @Inject constructor(
131
+ private val urlImageParserFactory : UrlImageParser .Factory , private val activity : AppCompatActivity
132
+ ) {
129
133
/* *
130
134
* Returns a new [HtmlParser] with the specified entity type and ID for loading images, and an optionally specified
131
135
* [CustomOppiaTagActionListener] for handling custom Oppia tag events.
132
136
*/
133
137
fun create (gcsResourceName : String , entityType : String , entityId : String , imageCenterAlign : Boolean , customOppiaTagActionListener : CustomOppiaTagActionListener ? = null): HtmlParser {
134
- return HtmlParser (urlImageParserFactory, gcsResourceName, entityType, entityId, imageCenterAlign, customOppiaTagActionListener)
138
+ return HtmlParser (urlImageParserFactory, gcsResourceName, activity, entityType, entityId, imageCenterAlign, customOppiaTagActionListener)
135
139
}
136
140
}
137
141
}
0 commit comments