Links

Friday, August 14, 2015

Incompatible changes

Scaloid 4.0 is best with Android API Level 16, while still supports Level 10

Scaloid 4.0 distribution is compiled with Android API Level 16, still retaining compatibility with Level 10. Accessor methods and deprecation warning is based on API Level 16, so you have to carefully check the availability of API if you target lower version of Android. In our experience on building an App for Gingerbread, currently we found no obstruction that prevents building a Scaloid app for older devices.

To compile with Scaloid 4.0, you have to specify build time Android API in project.properties file as android-16 or higher.

LocalServiceConnection

Usual use case of LocalServiceConnection is:

val service = new LocalServiceConnection[MyService]
//...
service {
myService => // do something with myService
}

The implementation of apply() is changed to:

def apply[T](f: S => Unit): Unit = service.fold(onConnected(f))(f)

The block will be executed later if the service is not connected yet. Formally it was just did nothing when the service is not connected yet. This behavior now becomes ifAvailable. Then all the code using apply(...) should be changed to ifAvailable(...).

SArrayAdapter

Constructor parameter of SArrayAdapter is now java.util.List.

spinnerDialog

spinnerDialog returns Future[ProgressDialog].

End of incompatible changes

More convenient press-and-hold action

We provided the press-and-hold action callback from the last release. The sample code below increases the number on the TextView in every 100 milliseconds:

Thursday, August 6, 2015

XML is wordy and not programmable. One of the major goal of Scaloid is to replace XMLs with Scala code, to be more concise, type-safe and programmable. Scaloid 4.0-RC2 provides a new way to build StateListDrawable without XML. For example, given the XML drawable selector: