Revision 21efc7d7
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/config/ConfigScreenPane.java | ||
---|---|---|
108 | 108 |
float textSize = height*TEXT_RATIO; |
109 | 109 |
int padding = (int)(height*PADDING_RATIO); |
110 | 110 |
|
111 |
LinearLayout detailsLayout = (LinearLayout)inflate( act, R.layout.config_details , null); |
|
112 |
LinearLayout difficultyLayout = (LinearLayout)inflate( act, R.layout.config_difficulty, null); |
|
113 |
LinearLayout meshLayout = (LinearLayout)inflate( act, R.layout.config_mesh , null); |
|
114 |
|
|
115 |
detailsLayout.setPadding(padding,padding,padding,padding/2); |
|
111 |
LinearLayout configLayout = act.findViewById(R.id.configLayout); |
|
112 |
LinearLayout nameLayout = configLayout.findViewById(R.id.configLayoutName); |
|
113 |
LinearLayout authorLayout = configLayout.findViewById(R.id.configLayoutAuthor); |
|
114 |
LinearLayout difficultyLayout= configLayout.findViewById(R.id.configLayoutDifficulty); |
|
115 |
LinearLayout meshLayout = configLayout.findViewById(R.id.configLayoutMesh); |
|
116 |
|
|
117 |
nameLayout.setPadding(padding,padding,padding,padding/2); |
|
118 |
authorLayout.setPadding(padding,padding/2,padding,padding/2); |
|
116 | 119 |
difficultyLayout.setPadding(padding,padding/2,padding,padding/2); |
117 | 120 |
meshLayout.setPadding(padding,padding/2,padding,padding); |
118 | 121 |
|
119 |
LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, 1.00f); |
|
120 |
LinearLayout.LayoutParams params2 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, 1.00f); |
|
121 |
LinearLayout.LayoutParams params3 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, 1.05f); |
|
122 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, 1.00f); |
|
123 |
params.bottomMargin = 0; |
|
124 |
params.topMargin = padding; |
|
125 |
params.leftMargin = padding; |
|
126 |
params.rightMargin = padding; |
|
122 | 127 |
|
123 |
detailsLayout.setLayoutParams(params1); |
|
124 |
difficultyLayout.setLayoutParams(params2); |
|
125 |
meshLayout.setLayoutParams(params3); |
|
128 |
nameLayout.setLayoutParams(params); |
|
129 |
authorLayout.setLayoutParams(params); |
|
130 |
difficultyLayout.setLayoutParams(params); |
|
131 |
meshLayout.setLayoutParams(params); |
|
126 | 132 |
|
127 | 133 |
TextView text; |
128 |
text = detailsLayout.findViewById(R.id.configDetailsTitle); |
|
129 |
text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); |
|
130 |
text = detailsLayout.findViewById(R.id.configDetailsName1); |
|
134 |
text = nameLayout.findViewById(R.id.configDetailsName1); |
|
131 | 135 |
text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); |
132 |
text = detailsLayout.findViewById(R.id.configDetailsName2);
|
|
136 |
text = nameLayout.findViewById(R.id.configDetailsName2);
|
|
133 | 137 |
text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); |
134 |
text = detailsLayout.findViewById(R.id.configDetailsAuthor1);
|
|
138 |
text = authorLayout.findViewById(R.id.configDetailsAuthor1);
|
|
135 | 139 |
text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); |
136 |
text = detailsLayout.findViewById(R.id.configDetailsAuthor2);
|
|
140 |
text = authorLayout.findViewById(R.id.configDetailsAuthor2);
|
|
137 | 141 |
text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); |
138 |
|
|
139 | 142 |
text = difficultyLayout.findViewById(R.id.configDifficultyTitle); |
140 | 143 |
text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); |
141 | 144 |
text = meshLayout.findViewById(R.id.configMeshTitle); |
... | ... | |
160 | 163 |
} |
161 | 164 |
}); |
162 | 165 |
|
163 |
LinearLayout layout = act.findViewById(R.id.configLayout); |
|
164 |
layout.removeAllViews(); |
|
165 |
layout.addView(detailsLayout); |
|
166 |
layout.addView(difficultyLayout); |
|
167 |
layout.addView(meshLayout); |
|
168 |
|
|
169 | 166 |
updatePane(act,objectOrdinal); |
170 | 167 |
} |
171 | 168 |
} |
Also available in: Unified diff
Progress with Config UI.