Add default ViewController.loadView implementation
This commit is contained in:
parent
b6982e04e4
commit
200a9eea27
|
@ -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
|
||||
|
|
|
@ -21,11 +21,7 @@ class CoordinateConversionTests {
|
|||
|
||||
@BeforeEach
|
||||
fun setup() {
|
||||
viewController = object: ViewController() {
|
||||
override fun loadView() {
|
||||
view = View()
|
||||
}
|
||||
}
|
||||
viewController = object: ViewController() {}
|
||||
window = Window(viewController)
|
||||
}
|
||||
|
||||
|
|
|
@ -21,11 +21,7 @@ class WindowLayoutTests {
|
|||
|
||||
@BeforeEach
|
||||
fun setup() {
|
||||
viewController = object: ViewController() {
|
||||
override fun loadView() {
|
||||
view = View()
|
||||
}
|
||||
}
|
||||
viewController = object: ViewController() {}
|
||||
window = Window(viewController)
|
||||
}
|
||||
|
||||
|
|
|
@ -23,11 +23,7 @@ class StackViewLayoutTests {
|
|||
|
||||
@BeforeEach
|
||||
fun setup() {
|
||||
viewController = object: ViewController() {
|
||||
override fun loadView() {
|
||||
view = View()
|
||||
}
|
||||
}
|
||||
viewController = object: ViewController() {}
|
||||
window = Window(viewController)
|
||||
}
|
||||
|
||||
|
|
|
@ -31,11 +31,7 @@ class ViewHoverTests {
|
|||
|
||||
@BeforeEach
|
||||
fun setup() {
|
||||
viewController = object: ViewController() {
|
||||
override fun loadView() {
|
||||
view = View()
|
||||
}
|
||||
}
|
||||
viewController = object: ViewController() {}
|
||||
window = Window(viewController)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue