wordpress-mobile / AztecEditor-Android

A reusable native Android rich text editor component.
Mozilla Public License 2.0
675 stars 112 forks source link

How to change text color? #819

Closed jrcacd closed 4 years ago

MrFuFuFu commented 4 years ago

Any answer for that?

hypest commented 4 years ago

Aztec inherits from EditText and the setTextColor() method and friends are normally available to set the text color.

Will close this ticket now.

MrFuFuFu commented 4 years ago

WechatIMG2

What I mean is like this. Well, I have already done this in my app and maybe can submit a PR later.

hypest commented 4 years ago

Oh, I see. The way Aztec supports rendering individual colored words/characters is via inline CSS in the HTML input. See these tests for examples: https://github.com/wordpress-mobile/AztecEditor-Android/blob/develop/aztec/src/test/kotlin/org/wordpress/aztec/HtmlAttributeStyleColorTest.kt#L35-L42.

jrcacd commented 4 years ago

Can Aztec have a button with a pallete for choosing the color?

hypest commented 4 years ago

Can Aztec have a button with a pallete for choosing the color?

From a design point of view, yes, I think it could. From the implementation side, I think it could take some effort for those who'll implemented it to hook up the relevant Span classes to support adding/setting/removing while in editing mode.

jrcacd commented 4 years ago

Can Aztec have a button with a pallete for choosing the color?

From a design point of view, yes, I think it could. From the implementation side, I think it could take some effort for those who'll implemented it to hook up the relevant Span classes to support adding/setting/removing while in editing mode.

That would be awesome.

duyvt88 commented 3 years ago

@MrFuFuFu Could you please submit your code? I would like to have that capability. Or could you please give me a guide to do it? Many Thanks,

MrFuFuFu commented 3 years ago

@duyvt88 thanks for asking. I did somehow managed to change the color, but somehow, it doesn't work as I expected. I'm now using https://github.com/wasabeef/richeditor-android it works great and easy to manage.

duyvt88 commented 3 years ago

@duyvt88 thanks for asking. I did somehow managed to change the color, but somehow, it doesn't work as I expected. I'm now using https://github.com/wasabeef/richeditor-android it works great and easy to manage. @MrFuFuFu Thanks for your reply. I will try it now.