Revision 58fd2ec0
Added by Leszek Koltunski 3 months ago
src/main/java/org/distorted/main/MainObjectPopup.java | ||
---|---|---|
64 | 64 |
|
65 | 65 |
RubikObject object = RubikObjectList.getObject(ordinal); |
66 | 66 |
|
67 |
///////// SOLVER ////////////////////////////////////////////////// |
|
67 | 68 |
Button b1 = layout.findViewById(R.id.objectSolver); |
68 | 69 |
|
69 | 70 |
if( object!=null && object.hasSolver() ) |
... | ... | |
87 | 88 |
} |
88 | 89 |
else b1.setVisibility(GONE); |
89 | 90 |
|
91 |
///////// PATTERN ///////////////////////////////////////////////// |
|
90 | 92 |
Button b2 = layout.findViewById(R.id.objectPattern); |
91 | 93 |
|
92 | 94 |
if( object!=null && object.hasPatterns() ) |
... | ... | |
110 | 112 |
} |
111 | 113 |
else b2.setVisibility(GONE); |
112 | 114 |
|
115 |
///////// TUTORIALS /////////////////////////////////////////////// |
|
113 | 116 |
Button b3 = layout.findViewById(R.id.objectTutorial); |
114 | 117 |
|
115 | 118 |
if( object!=null && object.hasExtras() ) |
... | ... | |
133 | 136 |
} |
134 | 137 |
else b3.setVisibility(GONE); |
135 | 138 |
|
139 |
///////// INFO //////////////////////////////////////////////////// |
|
136 | 140 |
Button b4 = layout.findViewById(R.id.objectInfo); |
137 | 141 |
|
138 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,levelHeight); |
|
139 |
params.setMargins(marginH,firstButtonShown ? marginV : marginH,marginH,marginV); |
|
140 |
b4.setLayoutParams(params); |
|
142 |
LinearLayout.LayoutParams paramsInfo = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,levelHeight);
|
|
143 |
paramsInfo.setMargins(marginH,firstButtonShown ? marginV : marginH,marginH,marginV);
|
|
144 |
b4.setLayoutParams(paramsInfo);
|
|
141 | 145 |
b4.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize); |
142 | 146 |
|
143 | 147 |
b4.setOnClickListener( new View.OnClickListener() |
... | ... | |
150 | 154 |
} |
151 | 155 |
}); |
152 | 156 |
|
157 |
///////// CONFIG ////////////////////////////////////////////////// |
|
158 |
Button b5 = layout.findViewById(R.id.objectConfig); |
|
159 |
|
|
160 |
LinearLayout.LayoutParams paramsConfig = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,levelHeight); |
|
161 |
paramsConfig.setMargins(marginH,marginV,marginH,marginV); |
|
162 |
b5.setLayoutParams(paramsConfig); |
|
163 |
b5.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize); |
|
164 |
|
|
165 |
b5.setOnClickListener( new View.OnClickListener() |
|
166 |
{ |
|
167 |
@Override |
|
168 |
public void onClick(View v) |
|
169 |
{ |
|
170 |
mPopup.dismiss(); |
|
171 |
act.switchToConfig(ordinal); |
|
172 |
} |
|
173 |
}); |
|
174 |
|
|
175 |
///////// LEVELS ////////////////////////////////////////////////// |
|
153 | 176 |
TextView levels = layout.findViewById(R.id.objectLevels); |
154 | 177 |
levels.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize); |
155 | 178 |
|
Also available in: Unified diff
Initial support for configuring the stickers.