Skip to content

Commit

Permalink
Merge branch 'toptensoftware#13'
Browse files Browse the repository at this point in the history
  • Loading branch information
clydebarrow committed Aug 27, 2019
2 parents 881385c + 86a2893 commit 8ca6916
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xcore/src/main/java/com/controlj/layout/FrameGroup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import com.controlj.shim.CxFactory
* determine where in the FrameGroup the child appears. The position of each child is independent of
* all other children
*/
open class FrameGroup(layout: Layout = Layout()) : ViewGroup(layout) {
open class FrameGroup(layout: Layout = Layout(), name: String = "") : ViewGroup(layout, name) {

/**
* The measured size of a frame group is the smallest box that will enclose all its subviews.
Expand Down
5 changes: 5 additions & 0 deletions xcore/src/main/java/com/controlj/layout/Layout.kt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ class Layout(
return Layout(widthMode = Mode.MatchParent, heightMode = Mode.MatchParent)
}

fun matchWidth(): Layout = Layout(widthMode = Mode.MatchParent)
fun matchHeight(): Layout = Layout(heightMode = Mode.MatchParent)
fun weightedWidth(weight: Double = 1.0): Layout = Layout(widthMode = Mode.Weighted, weight = weight)
fun weightedHeight(weight: Double = 1.0): Layout = Layout(heightMode = Mode.Weighted, weight = weight)

fun absolute(width: Double, height: Double): Layout {
return Layout(width, Mode.Absolute, height, Mode.Absolute)
}
Expand Down

0 comments on commit 8ca6916

Please sign in to comment.