Project

General

Profile

« Previous | Next » 

Revision 1bd07548

Added by Leszek Koltunski over 4 years ago

Improvements to the UI - make it proportional regardless of the physical screen size. (Part 2)

View differences:

src/main/java/org/distorted/main/RubikActivity.java
47 47
public class RubikActivity extends AppCompatActivity
48 48
{
49 49
    public static final float BUTTON_TEXT_SIZE = 0.05f;
50
    public static final float TITLE_TEXT_SIZE = 0.05f;
50
    public static final float TITLE_TEXT_SIZE  = 0.06f;
51
    public static final float BITMAP_TEXT_SIZE = 0.09f;
51 52

  
52 53
    private boolean mJustStarted;
53 54
    private FirebaseAnalytics mFirebaseAnalytics;
src/main/java/org/distorted/states/RubikStateSolver.java
49 49

  
50 50
public class RubikStateSolver extends RubikStateAbstract
51 51
  {
52
  private static final int BITMAP_SIZE = 35;
53

  
54 52
  private static Bitmap[] mBitmap;
55 53
  private ImageButton[] mColorButton;
56 54
  private Button mBackButton, mSolveButton;
......
58 56
  private int mCurrentColor;
59 57
  private int[] mFaceColors;
60 58
  private int mNumFaces;
61
  private float mTitleSize, mButtonSize;
59
  private float mTitleSize, mButtonSize, mBitmapSize;
62 60

  
63 61
  private RubikObjectList mCurrentObject;
64 62
  private int mCurrentObjectSize;
......
79 77
    float width = act.getScreenWidthInPixels();
80 78
    mButtonSize = width*RubikActivity.BUTTON_TEXT_SIZE;
81 79
    mTitleSize  = width*RubikActivity.TITLE_TEXT_SIZE;
80
    mBitmapSize = width*RubikActivity.BITMAP_TEXT_SIZE;
82 81

  
83 82
    mWeakAct = new WeakReference<>(act);
84 83

  
......
129 128

  
130 129
  private void setupBitmaps(float scale)
131 130
    {
132
    final int SIZE = (int)(scale*BITMAP_SIZE);
133
    final float R = SIZE*0.10f;
134
    final float M = SIZE*0.05f;
131
    final int SIZE = (int)mBitmapSize;
132
    final float R = SIZE*0.15f;
133
    final float M = SIZE*0.08f;
135 134

  
136 135
    mBitmap = new Bitmap[mNumFaces];
137 136

  

Also available in: Unified diff