From 1deb6b3c4b71a00a89ae4505d426b49b5f892d78 Mon Sep 17 00:00:00 2001 From: Gangphon Date: Fri, 2 Feb 2024 22:03:34 +0800 Subject: [PATCH] player --- .../app/src/main/java/com/xixun/xixunplayer/SrcAnaClock.java | 5 ++--- .../src/main/java/com/xixun/xixunplayer/SrcDigiClock.java | 2 +- .../src/main/java/com/xixun/xixunplayer/SrcDigitalClock.java | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcAnaClock.java b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcAnaClock.java index 60eff72..a48e0f3 100644 --- a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcAnaClock.java +++ b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcAnaClock.java @@ -33,8 +33,7 @@ public class SrcAnaClock extends View implements Choreographer.FrameCallback { super(prog.getContext()); var timeZoneStr = source.str("timeZone"); //if(timeZoneStr!=null) timeZone = ZoneId.of(timeZoneStr); - TimeZone timeZone = null; - if(timeZoneStr!=null) timeZone = TimeZone.getTimeZone(timeZoneStr); + var timeZone = timeZoneStr==null ? null : TimeZone.getTimeZone(timeZoneStr); calendar = timeZone==null ? Calendar.getInstance() : Calendar.getInstance(timeZone); var sideLen = Math.min(w, h); @@ -127,7 +126,7 @@ public class SrcAnaClock extends View implements Choreographer.FrameCallback { void cal() { //var time = timeZone==null ? LocalTime.now() : LocalTime.now(timeZone); - calendar.setTimeInMillis(lastSec); + calendar.setTimeInMillis(lastSec*1000); sAngle = calendar.get(Calendar.SECOND) * 6; mAngle = calendar.get(Calendar.MINUTE) * 6 + sAngle/60; hAngle = calendar.get(Calendar.HOUR_OF_DAY) * 30 + mAngle/12; diff --git a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcDigiClock.java b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcDigiClock.java index 6fd1003..1a7ebf0 100644 --- a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcDigiClock.java +++ b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcDigiClock.java @@ -238,7 +238,7 @@ public class SrcDigiClock extends LinearBox implements Choreographer.FrameCallba void cal() { //var dt = timeZone==null ? LocalDateTime.now() : LocalDateTime.now(timeZone); - calendar.setTimeInMillis(lastSec); + calendar.setTimeInMillis(lastSec*1000); var hms = timeptn.format(calendar.getTime()); ampmComp.setImageBitmap(imgs.get(calendar.get(Calendar.HOUR_OF_DAY) < 12?"AM":"PM")); hourComps[0].setImageBitmap(imgs.get(hms.substring(0,1))); diff --git a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcDigitalClock.java b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcDigitalClock.java index 9dfa269..c792180 100644 --- a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcDigitalClock.java +++ b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/SrcDigitalClock.java @@ -58,7 +58,7 @@ public class SrcDigitalClock extends WebView implements Choreographer.FrameCallb } void cal() { - calendar.setTimeInMillis(lastSec); + calendar.setTimeInMillis(lastSec*1000); var htm = html; if(hasYear) htm = htm.replace("%y", Long.toString(calendar.get(Calendar.YEAR))); try {