ScreensController - MVC-framework to use only Services instead of Activities.
It is useful when you need to create one application for a device and prevent exit from the app.
//Application onCreate
@Override
public void onCreate() {
super.onCreate();
ScreensController.set(new GeneratedScreensController(Application.this), new MainScreen(), null);
}
class MainScreen : Screen() {
init {
layout = R.layout.screen_main
theme = R.style.NoBarAppTheme
}
}
@ViewController(screen = MainScreen::class)
class MainController {
@OnBind
fun onBindView(sc: ScreensController, v: View, data: Any?) {
// do something
}
}
@ViewController(screen = EmployeeScreen::class)
@ViewController(screen = ConfirmScreen::class)
@ViewController(screen = CardRegistrationScreen::class)
@ViewController(screen = FingerRegistrationScreen::class)
class FingerScannerController {
@OnBind
fun onBindView(sc: ScreensController, view: View, data: Any?) {
// do something
}
@OnHide
fun onHide() {
// do something
}
}
dependencies {
implementation project(":sc")
kapt project(":sc-processor")
}