Fork me on GitHub

Monday, December 28, 2015

Scaloid 4.1 is released

I just released Scaloid 4.1. This version has two notable changes:

1. Specify onClick and onLongClick at once

Normally, most of the buttons does nothing on long click, because programmers doesn't specifically allocate any behavior on it. In the current touch-input UIs, there are no common visual guide for user to determine something is able to being long touched or not; So I believe that it is better for user that buttons are assigned a default behavior for long touch. However, this was generally not so fun to write:
def touched() = toast("hi!")
SButton("Touch me", touched()).onLongClick(touched())
From Scaloid 4.1, this can be even more compactly rewritten as:
SButton("Touch me", toast("hi!"), 0)
The third parameter specifies an interval of repeating calls when it is press-and-hold. If we specify it as '0', it is called once.

2. Fix a bug on LocalServiceConnection

Previously, LocalServiceConnection[S <: LocalService].apply(f: S => Unit) gives an instance of dead service when the service is killed and newly created. Now it is fixed and always gives the correct service to the function f.

Using Scaloid 4.1

Scaloid is released to central maven repository.

For a maven project:
or for an sbt project:
libraryDependencies += "org.scaloid" %% "scaloid" % "4.1"