mars

Project View

 

Project View

 be careful, this API may change at any time in future versions, use only at your own risk.

Our library provides the ability to get and change (soon) views of custom views and activities.

You can use the View Manager that is predefined in SketchwareProject

val project = SketchwareProjects(_folder_).getProjects()[0] // only for example
project.viewManager // there is already defined viewManager

or you can define the logic file manager:

val viewManager = ViewManager(_view_file_)

Let's get view:

viewManager.getView("main") // gets widgets in the MainActivity
// or if you want, for example, get fab in MainActivity, do next:
val fab = view.getView("main", "fab").single()
println(fab.name) // prints fab haha very useful example :)

Or if you want to edit some view:

viewManager.editView("main") {
    // there ArrayList in lambda's context, do everything you want with this.
    ...
}

Post a Comment

0 Comments