Revision e3c74c0f
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/states/RubikStateSolver.java | ||
---|---|---|
28 | 28 |
import android.os.Bundle; |
29 | 29 |
import androidx.core.content.ContextCompat; |
30 | 30 |
import android.util.DisplayMetrics; |
31 |
import android.util.TypedValue; |
|
31 | 32 |
import android.view.View; |
32 | 33 |
import android.widget.Button; |
33 | 34 |
import android.widget.ImageButton; |
... | ... | |
57 | 58 |
private int mCurrentColor; |
58 | 59 |
private int[] mFaceColors; |
59 | 60 |
private int mNumFaces; |
61 |
private float mTitleSize, mButtonSize; |
|
60 | 62 |
|
61 | 63 |
private RubikObjectList mCurrentObject; |
62 | 64 |
private int mCurrentObjectSize; |
... | ... | |
74 | 76 |
|
75 | 77 |
void enterState(final RubikActivity act) |
76 | 78 |
{ |
79 |
float width = act.getScreenWidthInPixels(); |
|
80 |
mButtonSize = width*RubikActivity.BUTTON_TEXT_SIZE; |
|
81 |
mTitleSize = width*RubikActivity.TITLE_TEXT_SIZE; |
|
82 |
|
|
77 | 83 |
mWeakAct = new WeakReference<>(act); |
78 | 84 |
|
79 | 85 |
mSolving = false; |
... | ... | |
187 | 193 |
mSolveButton = new Button(act); |
188 | 194 |
mSolveButton.setLayoutParams(backParams); |
189 | 195 |
mSolveButton.setPadding(padding,0,padding,0); |
196 |
mSolveButton.setTextSize(TypedValue.COMPLEX_UNIT_PX, mButtonSize); |
|
190 | 197 |
mSolveButton.setText(R.string.solve); |
191 | 198 |
|
192 | 199 |
mSolveButton.setOnClickListener( new View.OnClickListener() |
... | ... | |
215 | 222 |
mBackButton = new Button(act); |
216 | 223 |
mBackButton.setLayoutParams(backParams); |
217 | 224 |
mBackButton.setPadding(padding,0,padding,0); |
225 |
mBackButton.setTextSize(TypedValue.COMPLEX_UNIT_PX, mButtonSize); |
|
218 | 226 |
mBackButton.setText(R.string.back); |
219 | 227 |
|
220 | 228 |
mBackButton.setOnClickListener( new View.OnClickListener() |
Also available in: Unified diff
Improvements to the UI - make it proportional regardless of the physical screen size. (Part 1)