mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Custom glide builder now also accepts a custom url
This commit is contained in:
parent
231eab549c
commit
8243173e29
24 changed files with 54 additions and 26 deletions
|
|
@ -12,6 +12,8 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class MusicUtil {
|
||||
private static final String TAG = "MusicUtil";
|
||||
|
|
@ -91,4 +93,21 @@ public class MusicUtil {
|
|||
String uri = MusicUtil.getSongFileUri(song);
|
||||
return MediaItem.fromUri(uri);
|
||||
}
|
||||
|
||||
public static CharSequence HTMLParser(String toParse) {
|
||||
if (toParse != null && containsHTML(toParse)) {
|
||||
return Html.fromHtml(toParse, Html.FROM_HTML_MODE_LEGACY);
|
||||
}
|
||||
else {
|
||||
return toParse;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean containsHTML(String toParse) {
|
||||
String HTML_PATTERN = "<(\"[^\"]*\"|'[^']*'|[^'\">])*>";
|
||||
Pattern pattern = Pattern.compile(HTML_PATTERN);
|
||||
|
||||
Matcher matcher = pattern.matcher(toParse);
|
||||
return matcher.find();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue