Commit 29af6e46 authored by Christophe Beyls's avatar Christophe Beyls

Replace deprecated methods with newer equivalents

parent 1c926b1c
......@@ -7,15 +7,14 @@ import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.BulletSpan;
import android.text.style.LeadingMarginSpan;
import androidx.annotation.NonNull;
import androidx.collection.CircularIntArray;
import androidx.core.text.HtmlCompat;
import org.xml.sax.XMLReader;
import java.util.Iterator;
import java.util.Locale;
import androidx.annotation.NonNull;
import androidx.collection.CircularIntArray;
/**
* Various methods to transform strings
*
......@@ -123,14 +122,12 @@ public class StringUtils {
return source;
}
@SuppressWarnings("deprecation")
public static String stripHtml(@NonNull String html) {
return trimEnd(Html.fromHtml(html)).toString();
return trimEnd(HtmlCompat.fromHtml(html, HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_LIST_ITEM)).toString();
}
@SuppressWarnings("deprecation")
public static CharSequence parseHtml(@NonNull String html, Resources res) {
return trimEnd(Html.fromHtml(html, null, new ListsTagHandler(res)));
return trimEnd(HtmlCompat.fromHtml(html, HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_LIST_ITEM, null, new ListsTagHandler(res)));
}
public static CharSequence trimEnd(@NonNull CharSequence source) {
......
......@@ -6,7 +6,6 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.ViewTreeObserver;
import com.github.chrisbanes.photoview.PhotoView;
/**
......@@ -54,13 +53,12 @@ public class SaveStatePhotoView extends PhotoView {
super.onRestoreInstanceState(ss.getSuperState());
getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@SuppressWarnings("deprecation")
@Override
public void onGlobalLayout() {
float scale = Math.max(ss.scale, getMinimumScale());
scale = Math.min(scale, getMaximumScale());
setScale(scale, getWidth() * ss.pivotX, getHeight() * ss.pivotY, false);
getViewTreeObserver().removeGlobalOnLayoutListener(this);
getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment