From 9741d689d0260d70cbd5abc124efcd7f748688e3 Mon Sep 17 00:00:00 2001 From: Gangphon Date: Wed, 10 Jul 2024 21:46:34 +0800 Subject: [PATCH] Update SrcCountdown.java --- .../com/xixun/xixunplayer/SrcCountdown.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcCountdown.java b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcCountdown.java index 3f9de52..8b7d4a9 100644 --- a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcCountdown.java +++ b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcCountdown.java @@ -14,20 +14,32 @@ import gnph.util.NumFmts; public class SrcCountdown extends WebView implements Choreographer.FrameCallback { long targetTime; - String html, lineHeight, prefix; - boolean hasDay, hasHour, hasMin, hasSec; + String html, lineHeight, prefix, suffix; + boolean isUp, hasDay, hasHour, hasMin, hasSec; public SrcCountdown(Prog prog, JSMap json) { super(prog.getContext()); - setBackgroundColor(Color.TRANSPARENT); + try { + var backColor = json.str("backColor"); + setBackgroundColor(backColor==null ? Color.TRANSPARENT : Color.parseColor(backColor)); + } catch (Exception ignored) { + setBackgroundColor(Color.TRANSPARENT); + } setVerticalScrollBarEnabled(false); setHorizontalScrollBarEnabled(false); setInitialScale(100); + isUp = json.bool("isUp"); html = json.stnn("html"); lineHeight = json.str("lineHeight"); prefix = ""; + suffix = ""; + try { + var aaa = html.substring(0, 16).trim(); + if(aaa.startsWith("", "text/html", "UTF-8", null); + loadDataWithBaseURL(null, prefix+htm+suffix, "text/html", "UTF-8", null); } long lastSec;