Skip to content

Commit

Permalink
Merge pull request #195 from nagyrobi/patch-5
Browse files Browse the repository at this point in the history
Update wallpaper every 15 minutes
  • Loading branch information
thanksmister authored May 26, 2020
2 parents 28d09c3 + e8ffbae commit 80a9f33
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ class ScreenSaverView : RelativeLayout {
}
}

// TODO we could set a timer here to reload the image at set interval
// reload image every 15 minutes
private val wallPaperRunnable = object : Runnable {
override fun run() {
setScreenSaverView()
//wallPaperHandler?.postDelayed(this, TimeUnit.SECONDS.toMillis(900L))
wallPaperHandler?.postDelayed(this, TimeUnit.SECONDS.toMillis(900L))
}
}

Expand All @@ -97,6 +97,7 @@ class ScreenSaverView : RelativeLayout {
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
timeHandler?.removeCallbacks(timeRunnable)
wallPaperHandler?.removeCallbacks(wallPaperRunnable)
}

fun init(hasWallpaper: Boolean, hasClock: Boolean) {
Expand Down

0 comments on commit 80a9f33

Please sign in to comment.