chinalwb / Android-Rich-text-Editor

Android Rich Text Editor With customized spans - 富文本编辑器 - Don't miss this one :)
Apache License 2.0
841 stars 169 forks source link

Remove Images/Videos From AREedittext #129

Open AKKaung opened 3 years ago

AKKaung commented 3 years ago

Everything is fine. But what I want to talk about here is how to delete or remove images / videos in this edittext I would like you to answer if it is convenient.

chinalwb commented 3 years ago

Hi @AKKaung sorry for late response.

If you are using AREdittext, then you should have understood this:

AREditText + IARE_Toolbar (it's an interface). EditText (the input area) and Toolbar (the styling tools) are standalone component themselves. I.e.: you have the choice to decide whether to show the Toolbar, and where to place it, below or bottom of the AREditText, left or right to the AREditText, or any other alignment because the toolbar itself is a HorizontalScrollView (default implementation is ARE_ToolbarDefault), and also you can decide what toolitem to be added to the toolbar.

So the toolbar items (the image / video for your case) are being added into your toolbar by yourself, right?

Take a look at in the demo package: ARE_DefaultToolbarActivity.java. ::

 private void initToolbar() {
        mToolbar = this.findViewById(R.id.areToolbar);
        IARE_ToolItem bold = new ARE_ToolItem_MyBold();
        IARE_ToolItem youtube = new ARE_ToolItem_Youtube();
        IARE_ToolItem italic = new ARE_ToolItem_Italic();
        IARE_ToolItem underline = new ARE_ToolItem_Underline();
        IARE_ToolItem strikethrough = new ARE_ToolItem_Strikethrough();
        IARE_ToolItem fontSize = new ARE_ToolItem_FontSize();
        IARE_ToolItem fontColor = new ARE_ToolItem_FontColor();
        IARE_ToolItem backgroundColor = new ARE_ToolItem_BackgroundColor();
        IARE_ToolItem quote = new ARE_ToolItem_Quote();
        IARE_ToolItem listNumber = new ARE_ToolItem_ListNumber();
        IARE_ToolItem listBullet = new ARE_ToolItem_ListBullet();
        IARE_ToolItem hr = new ARE_ToolItem_Hr();
        IARE_ToolItem link = new ARE_ToolItem_Link();
        IARE_ToolItem subscript = new ARE_ToolItem_Subscript();
        IARE_ToolItem superscript = new ARE_ToolItem_Superscript();
        IARE_ToolItem left = new ARE_ToolItem_AlignmentLeft();
        IARE_ToolItem center = new ARE_ToolItem_AlignmentCenter();
        IARE_ToolItem right = new ARE_ToolItem_AlignmentRight();
        IARE_ToolItem image = new ARE_ToolItem_Image();
        IARE_ToolItem video = new ARE_ToolItem_Video();
        IARE_ToolItem at = new ARE_ToolItem_At();

        mToolbar.addToolbarItem(bold);
        mToolbar.addToolbarItem(youtube);
        mToolbar.addToolbarItem(italic);
        mToolbar.addToolbarItem(underline);
        mToolbar.addToolbarItem(strikethrough);
        mToolbar.addToolbarItem(fontSize);
        mToolbar.addToolbarItem(fontColor);
        mToolbar.addToolbarItem(backgroundColor);
        mToolbar.addToolbarItem(quote);
        mToolbar.addToolbarItem(listNumber);
        mToolbar.addToolbarItem(listBullet);
        mToolbar.addToolbarItem(hr);
        mToolbar.addToolbarItem(link);
        mToolbar.addToolbarItem(subscript);
        mToolbar.addToolbarItem(superscript);
        mToolbar.addToolbarItem(left);
        mToolbar.addToolbarItem(center);
        mToolbar.addToolbarItem(right);
        mToolbar.addToolbarItem(image);
        mToolbar.addToolbarItem(video);
        mToolbar.addToolbarItem(at);

        mEditText = this.findViewById(R.id.arEditText);
        mEditText.setToolbar(mToolbar);
        mEditText.setImageStrategy(imageStrategy);
        mEditText.setVideoStrategy(mVideoStrategy);

        setHtml();

        initToolbarArrow();
    }

Hope it helps, thanks!

AKKaung commented 3 years ago

I means not from toolbar. Just from this -> By clicking this 'x' button on image . . .

remo

I'd be very grateful if you answer this.

chinalwb commented 3 years ago

OK I got your point. No schedule for fixing this in this community version. Waiting for the commercial version please. Thanks!

AKKaung commented 3 years ago

Glad to hear that. Thank for your recognition. I hope you so.