Skip to content

Commit 03a2397

Browse files
committed
Removing context from spans (cont)
1 parent f850c6b commit 03a2397

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/formatting/LineBlockFormatter.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ class LineBlockFormatter(editor: AztecText) : AztecFormatter(editor) {
104104
}
105105

106106
val span = AztecHorizontalRuleSpan(
107-
editor.context,
108107
AppCompatResources.getDrawable(editor.context, R.drawable.img_hr)!!,
109108
nestingLevel,
110109
AztecAttributes(),
@@ -134,7 +133,7 @@ class LineBlockFormatter(editor: AztecText) : AztecFormatter(editor) {
134133
fun insertImage(inline: Boolean, drawable: Drawable?, attributes: Attributes, onImageTappedListener: AztecText.OnImageTappedListener?,
135134
onMediaDeletedListener: AztecText.OnMediaDeletedListener?) {
136135
val nestingLevel = if (inline) IAztecNestable.getNestingLevelAt(editableText, selectionStart) else 0
137-
val span = AztecImageSpan(editor.context, drawable, nestingLevel, AztecAttributes(attributes), onImageTappedListener,
136+
val span = AztecImageSpan(drawable, nestingLevel, AztecAttributes(attributes), onImageTappedListener,
138137
onMediaDeletedListener, editor)
139138
insertMediaSpan(inline, span)
140139
}

aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecVideoSpan.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class AztecVideoSpan(context: Context, drawable: Drawable?, override var nesting
1212
var onVideoTappedListener: AztecText.OnVideoTappedListener? = null,
1313
onMediaDeletedListener: AztecText.OnMediaDeletedListener? = null,
1414
editor: AztecText? = null) :
15-
AztecMediaSpan(context, drawable, attributes, onMediaDeletedListener, editor), IAztecFullWidthImageSpan, IAztecSpan {
15+
AztecMediaSpan(drawable, attributes, onMediaDeletedListener, editor), IAztecFullWidthImageSpan, IAztecSpan {
1616
override val TAG: String = "video"
1717

1818
init {

wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/HiddenGutenbergPlugin.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class HiddenGutenbergPlugin @JvmOverloads constructor(private val aztecText: Azt
6161
output.setSpan(
6262
GutenbergInlineCommentSpan(
6363
text,
64-
aztecText.context,
6564
AppCompatResources.getDrawable(aztecText.context, android.R.drawable.ic_menu_help)!!,
6665
nestingLevel
6766
),

wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/spans/GutenbergInlineCommentSpan.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
package org.wordpress.aztec.plugins.wpcomments.spans
22

3-
import android.content.Context
43
import android.graphics.drawable.Drawable
54
import org.wordpress.aztec.AztecText
65
import org.wordpress.aztec.spans.AztecDynamicImageSpan
76
import org.wordpress.aztec.spans.IAztecFullWidthImageSpan
87
import java.lang.ref.WeakReference
98

10-
class GutenbergInlineCommentSpan @JvmOverloads constructor(val commentText: String, context: Context, drawable: Drawable, override var nestingLevel: Int, editor: AztecText? = null) :
11-
AztecDynamicImageSpan(context, drawable), IAztecFullWidthImageSpan {
9+
class GutenbergInlineCommentSpan @JvmOverloads constructor(val commentText: String, drawable: Drawable, override var nestingLevel: Int, editor: AztecText? = null) :
10+
AztecDynamicImageSpan(drawable), IAztecFullWidthImageSpan {
1211

1312
init {
1413
textView = WeakReference(editor)

0 commit comments

Comments
 (0)