Skip to content

Commit 33cca9a

Browse files
committed
Removing the rest of the context from spans.
1 parent 03a2397 commit 33cca9a

File tree

5 files changed

+4
-10
lines changed

5 files changed

+4
-10
lines changed

media-placeholders/src/main/java/org/wordpress/aztec/placeholders/PlaceholderManager.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class PlaceholderManager(
9999
?: throw IllegalArgumentException("Adapter for inserted type not found. Register it with `registerAdapter` method")
100100
val attrs = getAttributesForMedia(type, attributes)
101101
val drawable = buildPlaceholderDrawable(adapter, attrs)
102-
aztecText.insertMediaSpan(AztecPlaceholderSpan(aztecText.context, drawable, 0, attrs,
102+
aztecText.insertMediaSpan(AztecPlaceholderSpan(drawable, 0, attrs,
103103
this, aztecText, WeakReference(adapter), TAG = htmlTag))
104104
insertContentOverSpanWithId(attrs.getValue(UUID_ATTRIBUTE))
105105
}
@@ -166,7 +166,7 @@ class PlaceholderManager(
166166
attrs.setValue(UUID_ATTRIBUTE, uuid)
167167
attrs.setValue(TYPE_ATTRIBUTE, type)
168168
val drawable = buildPlaceholderDrawable(adapter, attrs)
169-
val span = AztecPlaceholderSpan(aztecText.context, drawable, 0, attrs,
169+
val span = AztecPlaceholderSpan(drawable, 0, attrs,
170170
this, aztecText, WeakReference(adapter), TAG = htmlTag)
171171
aztecText.replaceMediaSpan(span) { attributes ->
172172
attributes.getValue(UUID_ATTRIBUTE) == uuid
@@ -460,7 +460,6 @@ class PlaceholderManager(
460460
aztecAttributes.setValue(UUID_ATTRIBUTE, generateUuid())
461461
val drawable = runBlocking { buildPlaceholderDrawable(adapter, aztecAttributes) }
462462
val span = AztecPlaceholderSpan(
463-
context = aztecText.context,
464463
drawable = drawable,
465464
nestingLevel = nestingLevel,
466465
attributes = aztecAttributes,

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class WordPressCommentsPlugin(private val visualEditor: AztecText) : IInlineSpan
4242
output.setSpan(
4343
WordPressCommentSpan(
4444
text,
45-
visualEditor.context,
4645
AppCompatResources.getDrawable(visualEditor.context, R.drawable.img_more)!!,
4746
nestingLevel
4847
),
@@ -59,7 +58,6 @@ class WordPressCommentsPlugin(private val visualEditor: AztecText) : IInlineSpan
5958
output.setSpan(
6059
WordPressCommentSpan(
6160
text,
62-
visualEditor.context,
6361
AppCompatResources.getDrawable(visualEditor.context, R.drawable.img_page)!!,
6462
nestingLevel
6563
),

wordpress-comments/src/main/java/org/wordpress/aztec/plugins/wpcomments/spans/WordPressCommentSpan.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 WordPressCommentSpan @JvmOverloads constructor(val commentText: String, context: Context, drawable: Drawable, override var nestingLevel: Int, editor: AztecText? = null) :
11-
AztecDynamicImageSpan(context, drawable), IAztecFullWidthImageSpan {
9+
class WordPressCommentSpan @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)

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class MoreToolbarButton(val visualEditor: AztecText) : IToolbarButton {
3030

3131
val span = WordPressCommentSpan(
3232
WordPressCommentSpan.Comment.MORE.html,
33-
visualEditor.context,
3433
AppCompatResources.getDrawable(visualEditor.context, R.drawable.img_more)!!,
3534
nestingLevel,
3635
visualEditor

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class PageToolbarButton(val visualEditor: AztecText) : IToolbarButton {
3030

3131
val span = WordPressCommentSpan(
3232
WordPressCommentSpan.Comment.PAGE.html,
33-
visualEditor.context,
3433
AppCompatResources.getDrawable(visualEditor.context, R.drawable.img_page)!!,
3534
nestingLevel,
3635
visualEditor

0 commit comments

Comments
 (0)