AztecEditor-Android icon indicating copy to clipboard operation
AztecEditor-Android copied to clipboard

AztecTagHandler loadingDrawable miss match xml set resource

Open liufsd opened this issue 8 years ago • 1 comments

if you delete 'loadImages' function, you will see this issue. Because the AztecTagHandler get 'loadingDrawable' wrong.

Maybe you can do like this:

   class AztecTagHandler(val context: Context, val drawableLoading: Int = -1, val plugins: List<IAztecPlugin> = ArrayList()) : Html.TagHandler {
    private var order = 0

    private val loadingDrawable: Drawable

    init {
        if (drawableLoading == -1) {
            val styles = context.obtainStyledAttributes(R.styleable.AztecText)
            loadingDrawable = ContextCompat.getDrawable(context, styles.getResourceId(R.styleable.AztecText_drawableLoading, R.drawable.ic_image_loading))
            styles.recycle()
        } else {
            loadingDrawable = ContextCompat.getDrawable(context, drawableLoading)
        }
    }

liufsd avatar Nov 17 '17 01:11 liufsd

Not sure I understand where the problem is located. Wonder why we need to delete a function (loadImages) in the code to reproduce the issue?

daniloercoli avatar Jan 31 '18 17:01 daniloercoli