Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): deprecated warning Html.fromHtml #230

Merged
merged 1 commit into from
Sep 29, 2023
Merged

fix(android): deprecated warning Html.fromHtml #230

merged 1 commit into from
Sep 29, 2023

Conversation

seamlink-aalves
Copy link

@seamlink-aalves seamlink-aalves commented Apr 10, 2023

This is just a fix for a deprecation warning in the build process (deprecated in JAVA)

Description

Changed from Html to HtmlCompat

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

@erisu erisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@erisu erisu changed the title fix: deprecated warning Html.fromHtml fix(android): deprecated warning Html.fromHtml Sep 29, 2023
@erisu erisu merged commit 9ddbcf7 into havesource:master Sep 29, 2023
@MiguelQueiroz
Copy link

By the way about this. Im having issue with long text being overflow and truncated and cannot expand. Usually using a big text style would solve it, but no.. Is it because of the "from html" which is removing line feeds?

@erisu
Copy link

erisu commented Oct 27, 2023

@MiguelQueiroz could you maybe open a new ticket and provide steps to reproduction and screenshot? If you have solution, PR is also welcome.

Based on this PR, it should have stayed the same...

We know that Html.fromHtml was deprecated in API 24.

We know that fromHtml:

Returns displayable styled text from the provided HTML string with the legacy flags FROM_HTML_MODE_LEGACY.

Would except HtmlCompat.fromHtml(source, HtmlCompat.FROM_HTML_MODE_LEGACY) to produce the same results as before.

There is one statement on the HtmlCompat docs that might be what your seeing?

Invokes fromHtml on API 24 or newer, otherwise flags are ignored and fromHtml is used.

Could the flag FROM_HTML_MODE_LEGACY flag be ignored?

Anyways, I would suggest submitting a new ticket.

Also, I want to point out that v4.0.0 of this plugin requires Cordova-Android >= 12.0.0, which defined the default minSdkVersion to 24. The minSdkVersion could be lowered but is not really supported. Since Html.fromHtml is deprecated in API 24, I think reverting wouldnt be the correct solution either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants