Add default ViewController.loadView implementation

This commit is contained in:
Shadowfacts 2019-08-08 22:10:48 -04:00
parent b6982e04e4
commit 200a9eea27
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
5 changed files with 9 additions and 21 deletions

View File

@ -63,8 +63,12 @@ abstract class ViewController {
*
* This method should only be called by the framework. After the [view] property is set, the framework is
* responsible for initializing its [View.window]/[View.solver] properties and calling [View.wasAdded].
*
* The default implementation simply creates a [View] and does nothing else with it.
*/
abstract fun loadView()
open fun loadView() {
view = View()
}
/**
* This method is called after the view is loaded, it's properties are initialized, and [View.wasAdded] has been

View File

@ -21,11 +21,7 @@ class CoordinateConversionTests {
@BeforeEach
fun setup() {
viewController = object: ViewController() {
override fun loadView() {
view = View()
}
}
viewController = object: ViewController() {}
window = Window(viewController)
}

View File

@ -21,11 +21,7 @@ class WindowLayoutTests {
@BeforeEach
fun setup() {
viewController = object: ViewController() {
override fun loadView() {
view = View()
}
}
viewController = object: ViewController() {}
window = Window(viewController)
}

View File

@ -23,11 +23,7 @@ class StackViewLayoutTests {
@BeforeEach
fun setup() {
viewController = object: ViewController() {
override fun loadView() {
view = View()
}
}
viewController = object: ViewController() {}
window = Window(viewController)
}

View File

@ -31,11 +31,7 @@ class ViewHoverTests {
@BeforeEach
fun setup() {
viewController = object: ViewController() {
override fun loadView() {
view = View()
}
}
viewController = object: ViewController() {}
window = Window(viewController)
}