Commit fa9def8a authored by David's avatar David

Put it in there!

parent f3ca1ac0
Pipeline #6 failed with stages
in 8 seconds
package `is`.kow.deskscreen.ticker
import `is`.kow.deskscreen.Styles
import com.github.thomasnield.rxkotlinfx.doOnNextFx
import io.reactivex.Completable
import io.reactivex.Observable
......@@ -21,7 +22,6 @@ import java.nio.file.Paths
import java.time.Clock
import java.time.LocalDateTime
import java.time.ZoneId
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
import java.util.concurrent.ConcurrentLinkedQueue
import java.util.concurrent.TimeUnit
......@@ -31,7 +31,7 @@ import kotlin.random.Random
open class TickerEntry<out T : Node>(
val title: String,
val content: T,
val reschedule: Boolean = false
var reschedule: Boolean = false
) {
open fun updateObservable(): Completable? = null
}
......@@ -59,6 +59,12 @@ class TickerView : View() {
this.prefHeight = 30.0
style {
Styles.gugiFont15px?.let {
font = it
}
}
//Somehow need to animate all the things
marqueeView.inside(this)
this.add(marqueeView)
......@@ -118,40 +124,14 @@ class TickerView : View() {
}
val entries2 = listOf(
TickerEntry<Node>("time", createText(ZonedDateTime.now().format(DateTimeFormatter.ISO_ZONED_DATE_TIME)))
)
val entries = listOf(
currentTime,
TickerEntry<Node>("blorp", createText("Third!")),
TickerEntry<Node>("blerp", createText("this is the second")),
TickerEntry<Node>("another", createText("This is happening")),
TickerEntry<Node>("time", createText(ZonedDateTime.now().format(DateTimeFormatter.ISO_ZONED_DATE_TIME))),
cpuTemp
)
Observable.fromIterable(entries)
.observeOn(Schedulers.computation())
.concatMap { tickerEntry ->
Observable.interval(1, TimeUnit.SECONDS)
.take(1)
.map {
tickerEntry
}
}
.doOnNext {
logger.debug("Queuing a ticker")
//marqueeView.tickEntries.onNext(it)
marqueeView.enqueueTickEntry(it)
}
.subscribe()
Observable.fromIterable(entries2)
.delay(30, TimeUnit.SECONDS)
.doOnNext {
logger.debug("Adding older things")
marqueeView.enqueueTickEntry(it)
}.subscribe()
entries.forEach {
marqueeView.enqueueTickEntry(it)
}
}
}
......
......@@ -5,7 +5,6 @@ import `is`.kow.deskscreen.TransitionsController
import `is`.kow.deskscreen.jira.JiraView
import `is`.kow.deskscreen.temperature.TemperatureView
import `is`.kow.deskscreen.ticker.TickerView
import `is`.kow.deskscreen.wx.DarkSkyCurrentConditionsView
import `is`.kow.deskscreen.wx.weathergov.WeatherGovWidgetView
import javafx.geometry.Pos
import javafx.scene.layout.Priority
......@@ -16,7 +15,7 @@ class DefaultView : View() {
val logger = KotlinLogging.logger {}
val mainDotsView: MainDotsView by inject()
val tickerView : TickerView by inject()
val tickerView: TickerView by inject()
val namePlateView: NamePlateView by inject()
val jiraView: JiraView by inject()
val temperatureView: TemperatureView by inject()
......@@ -48,15 +47,6 @@ class DefaultView : View() {
paddingRight = 3.0
}
}
vbox {
vgrow = Priority.NEVER
alignment = Pos.BOTTOM_RIGHT
hbox {
hgrow = Priority.ALWAYS
alignment = Pos.BASELINE_RIGHT
this.add(find(TimeTempView::class).root)
}
}
}
//Is this not an event handler?
......
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