Revision 39176a1f
Added by Leszek Koltunski almost 2 years ago
src/main/java/org/distorted/bandaged/BandagedCreatorScreen.java | ||
---|---|---|
25 | 25 |
import android.app.Activity; |
26 | 26 |
import android.content.SharedPreferences; |
27 | 27 |
import android.graphics.Bitmap; |
28 |
import android.util.TypedValue; |
|
28 | 29 |
import android.view.View; |
29 | 30 |
import android.view.ViewGroup; |
30 | 31 |
import android.widget.AdapterView; |
... | ... | |
32 | 33 |
import android.widget.ImageView; |
33 | 34 |
import android.widget.LinearLayout; |
34 | 35 |
import android.widget.Spinner; |
36 |
import android.widget.TextView; |
|
35 | 37 |
|
36 | 38 |
import org.distorted.external.RubikFiles; |
37 | 39 |
import org.distorted.helpers.TransparentImageButton; |
... | ... | |
51 | 53 |
private final ArrayList<BandagedCreatorObjectView> mViews; |
52 | 54 |
private Spinner mSpinnerX, mSpinnerY, mSpinnerZ; |
53 | 55 |
private boolean mSpinnersReady; |
56 |
private float mTextSize; |
|
54 | 57 |
|
55 | 58 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
56 | 59 |
|
... | ... | |
149 | 152 |
{ |
150 | 153 |
mAct = new WeakReference<>(act); |
151 | 154 |
mObjectView = act.findViewById(R.id.bandagedCreatorView); |
155 |
mTextSize = act.getScreenHeightInPixels()*BandagedCreatorActivity.SPINNER_TEXT_SIZE; |
|
152 | 156 |
|
153 | 157 |
int width = act.getScreenWidthInPixels(); |
154 | 158 |
int height = act.getScreenHeightInPixels(); |
... | ... | |
180 | 184 |
|
181 | 185 |
mSpinnerX = act.findViewById(R.id.bandagedCreatorX); |
182 | 186 |
mSpinnerX.setOnItemSelectedListener(this); |
183 |
ArrayAdapter<String> adX = new ArrayAdapter<>(act, android.R.layout.simple_spinner_item, createSizes("X") );
|
|
187 |
ArrayAdapter<String> adX = new ArrayAdapter<>(act, R.layout.spinner_item, createSizes("X") );
|
|
184 | 188 |
adX.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); |
185 | 189 |
mSpinnerX.setAdapter(adX); |
186 | 190 |
|
187 | 191 |
mSpinnerY = act.findViewById(R.id.bandagedCreatorY); |
188 | 192 |
mSpinnerY.setOnItemSelectedListener(this); |
189 |
ArrayAdapter<String> adY = new ArrayAdapter<>(act, android.R.layout.simple_spinner_item, createSizes("Y") );
|
|
193 |
ArrayAdapter<String> adY = new ArrayAdapter<>(act, R.layout.spinner_item, createSizes("Y") );
|
|
190 | 194 |
adY.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); |
191 | 195 |
mSpinnerY.setAdapter(adY); |
192 | 196 |
|
193 | 197 |
mSpinnerZ = act.findViewById(R.id.bandagedCreatorZ); |
194 | 198 |
mSpinnerZ.setOnItemSelectedListener(this); |
195 |
ArrayAdapter<String> adZ = new ArrayAdapter<>(act, android.R.layout.simple_spinner_item, createSizes("Z") );
|
|
199 |
ArrayAdapter<String> adZ = new ArrayAdapter<>(act, R.layout.spinner_item, createSizes("Z") );
|
|
196 | 200 |
adZ.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); |
197 | 201 |
mSpinnerZ.setAdapter(adZ); |
198 | 202 |
|
... | ... | |
341 | 345 |
{ |
342 | 346 |
int spinnerID = parent.getId(); |
343 | 347 |
|
348 |
((TextView) view).setTextSize(TypedValue.COMPLEX_UNIT_PX,mTextSize); |
|
349 |
|
|
344 | 350 |
if( spinnerID==R.id.bandagedCreatorX ) |
345 | 351 |
{ |
346 | 352 |
mX = pos; |
Also available in: Unified diff
Make the size of the text in the spinners in the bandaged activity look right on all screen sizes.