mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
Fix usage of deprecated function String.fromHtml(String)
String.fromHtml(String) is now deprecated. This patch fixes that by adding a method to Utils that selects the appropriate function based on the user's platform.
This commit is contained in:
parent
67dfa170d2
commit
14326ae3d0
2 changed files with 19 additions and 2 deletions
|
|
@ -2,10 +2,11 @@ package fr.free.nrw.commons.ui.widget;
|
|||
|
||||
import android.content.Context;
|
||||
import android.support.v7.widget.AppCompatTextView;
|
||||
import android.text.Html;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import fr.free.nrw.commons.Utils;
|
||||
|
||||
/**
|
||||
* An {@link AppCompatTextView} which formats the text to HTML displayable text and makes any
|
||||
* links clickable.
|
||||
|
|
@ -16,6 +17,6 @@ public class HtmlTextView extends AppCompatTextView {
|
|||
super(context, attrs);
|
||||
|
||||
setMovementMethod(LinkMovementMethod.getInstance());
|
||||
setText(Html.fromHtml(getText().toString()));
|
||||
setText(Utils.fromHtml(getText().toString()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue