diff --git a/XixunPlayer/app/build.gradle b/XixunPlayer/app/build.gradle index e18d8b1..77c4b86 100644 --- a/XixunPlayer/app/build.gradle +++ b/XixunPlayer/app/build.gradle @@ -11,7 +11,7 @@ android { minSdk 24 targetSdk 34 versionCode 1 - versionName "1.0.22-tts" + versionName "1.0.23-sche" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/MainActivity.java b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/MainActivity.java index 4aa8a1b..fddcf5d 100644 --- a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/MainActivity.java +++ b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/MainActivity.java @@ -386,7 +386,8 @@ public class MainActivity extends ComponentActivity implements Choreographer.Fra if(Util.buf.length()>1000000) Util.buf.replace(0, 100000, ""); Util.println("isDiff: "+isDiff+" endMs: "+lastPage.endMilli+" millis:"+milli); syncProg(isDiff ? milli : lastPage.endMilli); - Util.println("after. curAva: "+progView.curAva+" endMs: "+page(progView.curAva).endMilli); + if(progView.avas.isEmpty()) Util.println("after. No Avas"); + else Util.println("after. curAva: "+progView.curAva+" endMs: "+page(progView.curAva).endMilli); choreographer.postFrameCallback(this); canAdd = false; for(var call : progView.calls) call.doFrame(milli); diff --git a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/Prog.java b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/Prog.java index b895f9b..3efd5ea 100644 --- a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/Prog.java +++ b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/Prog.java @@ -15,6 +15,7 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import gnph.util.Dates; import gnph.util.JSList; @@ -498,7 +499,7 @@ public class Prog extends AbsLayout { public static class Sche { long startDate = -1, endDate = -1; int startTime = -1, endTime = -1; - JSList weeks; + HashSet weeks; } public static class Page { @@ -531,7 +532,7 @@ public class Prog extends AbsLayout { if(notInRange(sche.startDate, local, sche.endDate)) continue; if(notInRange(sche.startTime, time, sche.endTime)) continue; if(sche.weeks==null) return true; - if(week==-1) week = (local / 86400000L + 3) % 7 + 1; + if(week==-1) week = (local / 86400000L + 4) % 7; if(sche.weeks.contains(week)) return true; } return false; @@ -582,7 +583,10 @@ public class Prog extends AbsLayout { } if(sche.startDate==sche.endDate) sche.startDate = sche.endDate = -1; JSList weekFilter = schedule.jslist("weekFilter"); - if(weekFilter!=null && ! weekFilter.isEmpty() && weekFilter.size() < 7) sche.weeks = weekFilter; + if(weekFilter!=null && ! weekFilter.isEmpty() && weekFilter.size() < 7) { + sche.weeks = new HashSet<>(); + for(var week : weekFilter) sche.weeks.add(week.intValue() % 7); + } if(sches==null) sches = new ArrayList<>(); sches.add(sche); }