1. Specify onClick and onLongClick at onceNormally, 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:
From Scaloid 4.1, this can be even more compactly rewritten as:
def touched() = toast("hi!") SButton("Touch me", touched()).onLongClick(touched())
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.
SButton("Touch me", toast("hi!"), 0)
2. Fix a bug on LocalServiceConnectionPreviously,
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
Using Scaloid 4.1Scaloid is released to central maven repository.
For a maven project:
or for an sbt project:
<dependency> <groupId>org.scaloid</groupId> <artifactId>scaloid_2.11</artifactId> <version>4.1</version> </dependency>
libraryDependencies += "org.scaloid" %% "scaloid" % "4.1"