MCPcopy Create free account
hub / github.com/Card-Forge/forge / doLayout

Method doLayout

forge-gui-mobile/src/forge/toolbox/FDialog.java:85–105  ·  view source on GitHub ↗
(float width, float height)

Source from the content-addressed store, hash-verified

83 }
84
85 @Override
86 protected final void doLayout(float width, float height) {
87 boolean firstReveal = (totalHeight == 0);
88 float contentHeight = layoutAndGetHeight(width, height - VPrompt.HEIGHT - 2 * MSG_HEIGHT);
89 totalHeight = contentHeight + VPrompt.HEIGHT;
90 lastDy = 0; //reset whenever main layout occurs
91
92 if (btnMiddle != null) {
93 btnMiddle.setLeft((width - btnMiddle.getWidth()) / 2);
94 if (!title.isEmpty()) {
95 totalHeight += MSG_HEIGHT; //leave room for title above middle button
96 }
97 }
98 prompt.setBounds(0, totalHeight - VPrompt.HEIGHT, width, VPrompt.HEIGHT);
99
100 updateDisplayTop();
101
102 if (firstReveal) { //start reveal animation after dialog first laid out
103 updateRevealAnimation(3 * Forge.getScreenHeight());
104 }
105 }
106
107 private void updateDisplayTop() {
108 //shift all children into position

Callers

nothing calls this directly

Calls 8

layoutAndGetHeightMethod · 0.95
updateDisplayTopMethod · 0.95
updateRevealAnimationMethod · 0.95
getScreenHeightMethod · 0.95
setLeftMethod · 0.80
getWidthMethod · 0.65
isEmptyMethod · 0.65
setBoundsMethod · 0.45

Tested by

no test coverage detected