Revision 7ea57482
Added by Leszek Koltunski about 5 years ago
| src/main/java/org/distorted/main/RubikActivity.java | ||
|---|---|---|
| 55 | 55 |
public static final float LARGE_MARGIN = 0.025f; |
| 56 | 56 |
public static final float BUTTON_TEXT_SIZE = 0.05f; |
| 57 | 57 |
public static final float TITLE_TEXT_SIZE = 0.06f; |
| 58 |
public static final float BITMAP_TEXT_SIZE = 0.06f; |
|
| 58 |
public static final float SOLVER_BMP_H_SIZE = 0.11f; |
|
| 59 |
public static final float SOLVER_BMP_V_SIZE = 0.06f; |
|
| 59 | 60 |
public static final float MENU_ITEM_SIZE = 0.12f; |
| 60 | 61 |
public static final float PATTERN_GROUP_TEXT = 0.03f; |
| 61 | 62 |
public static final float PATTERN_CHILD_TEXT = 0.02f; |
| src/main/java/org/distorted/states/RubikStateSolver.java | ||
|---|---|---|
| 27 | 27 |
import android.graphics.drawable.Drawable; |
| 28 | 28 |
import android.os.Bundle; |
| 29 | 29 |
import androidx.core.content.ContextCompat; |
| 30 |
import android.util.TypedValue; |
|
| 31 | 30 |
import android.view.View; |
| 32 |
import android.widget.Button; |
|
| 33 | 31 |
import android.widget.ImageButton; |
| 34 | 32 |
import android.widget.LinearLayout; |
| 35 | 33 |
|
| ... | ... | |
| 55 | 53 |
private int mCurrentColor; |
| 56 | 54 |
private int[] mFaceColors; |
| 57 | 55 |
private int mNumFaces; |
| 58 |
private float mTitleSize, mButtonSize, mBitmapSize;
|
|
| 56 |
private float mBitmapSize; |
|
| 59 | 57 |
|
| 60 | 58 |
private RubikObjectList mCurrentObject; |
| 61 | 59 |
private int mCurrentObjectSize; |
| ... | ... | |
| 75 | 73 |
{
|
| 76 | 74 |
float width = act.getScreenWidthInPixels(); |
| 77 | 75 |
float heigh = act.getScreenHeightInPixels(); |
| 78 |
mButtonSize = width*RubikActivity.BUTTON_TEXT_SIZE; |
|
| 79 |
mTitleSize = width*RubikActivity.TITLE_TEXT_SIZE; |
|
| 80 |
mBitmapSize = heigh*RubikActivity.BITMAP_TEXT_SIZE; |
|
| 76 |
|
|
| 77 |
int sizeV = (int)(heigh*RubikActivity.SOLVER_BMP_V_SIZE); |
|
| 78 |
int sizeH = (int)(width*RubikActivity.SOLVER_BMP_H_SIZE); |
|
| 79 |
|
|
| 80 |
mBitmapSize = Math.min(sizeV,sizeH); |
|
| 81 | 81 |
|
| 82 | 82 |
mWeakAct = new WeakReference<>(act); |
| 83 | 83 |
|
Also available in: Unified diff
Compute the size of the Solver icon correctly.