Project

General

Profile

« Previous | Next » 

Revision 1db2a539

Added by Leszek Koltunski almost 2 years ago

More fixes for UI in case of extreme screen (w/h) ratios ( from 1.0 to 2.0 ).

View differences:

src/main/java/org/distorted/dialogs/RubikDialogPattern.java
54 54
    DisplayMetrics displaymetrics = new DisplayMetrics();
55 55
    act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
56 56

  
57
    int scrWidth = displaymetrics.widthPixels;
58
    final float titleSize= scrWidth*RubikActivity.BIG_TEXT_SIZE;
59
    final float okSize   = scrWidth*RubikActivity.DIALOG_BUTTON_SIZE;
60
    final int   tabHeight= (int)(scrWidth*RubikActivity.TAB_HEIGHT);
61
    final int   tabWidth = (int)(scrWidth*RubikActivity.TAB_WIDTH);
57
    int h = displaymetrics.heightPixels;
58
    final float titleSize= h*RubikActivity.TAB_TEXT_SIZE;
59
    final float okSize   = h*RubikActivity.TAB_BUTTON_SIZE;
60
    final int   tabHeight= (int)(h*RubikActivity.TAB_HEIGHT);
61
    final int   tabWidth = (int)(h*RubikActivity.TAB_WIDTH);
62 62

  
63 63
    LayoutInflater layoutInflater = act.getLayoutInflater();
64 64
    TextView tv = (TextView) layoutInflater.inflate(R.layout.dialog_title, null);
src/main/java/org/distorted/dialogs/RubikDialogScores.java
52 52
    DisplayMetrics displaymetrics = new DisplayMetrics();
53 53
    act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
54 54

  
55
    int scrWidth = displaymetrics.widthPixels;
56
    final float titleSize= scrWidth*RubikActivity.BIG_TEXT_SIZE;
57
    final float okSize   = scrWidth*RubikActivity.DIALOG_BUTTON_SIZE;
58
    final int   tabHeight= (int)(scrWidth*RubikActivity.TAB_HEIGHT);
59
    final int   tabWidth = (int)(scrWidth*RubikActivity.TAB_WIDTH);
55
    int h = displaymetrics.heightPixels;
56
    final float titleSize= h*RubikActivity.TAB_TEXT_SIZE;
57
    final float okSize   = h*RubikActivity.TAB_BUTTON_SIZE;
58
    final int   tabHeight= (int)(h*RubikActivity.TAB_HEIGHT);
59
    final int   tabWidth = (int)(h*RubikActivity.TAB_WIDTH);
60 60

  
61 61
    LayoutInflater layoutInflater = act.getLayoutInflater();
62 62
    TextView tv = (TextView) layoutInflater.inflate(R.layout.dialog_title, null);
src/main/java/org/distorted/dialogs/RubikDialogTutorial.java
54 54

  
55 55
    DisplayMetrics displaymetrics = new DisplayMetrics();
56 56
    act.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
57
    int scrWidth = displaymetrics.widthPixels;
58
    final float titleSize= scrWidth*RubikActivity.BIG_TEXT_SIZE;
59
    final float okSize   = scrWidth*RubikActivity.DIALOG_BUTTON_SIZE;
60
    final int   tabHeight= (int)(scrWidth*RubikActivity.TAB_HEIGHT);
61
    final int   tabWidth = (int)(scrWidth*RubikActivity.TAB_WIDTH);
57

  
58
    int h = displaymetrics.heightPixels;
59
    final float titleSize= h*RubikActivity.TAB_TEXT_SIZE;
60
    final float okSize   = h*RubikActivity.TAB_BUTTON_SIZE;
61
    final int   tabHeight= (int)(h*RubikActivity.TAB_HEIGHT);
62
    final int   tabWidth = (int)(h*RubikActivity.TAB_WIDTH);
62 63

  
63 64
    LayoutInflater layoutInflater = act.getLayoutInflater();
64 65
    TextView tv = (TextView) layoutInflater.inflate(R.layout.dialog_title, null);
src/main/java/org/distorted/dialogs/RubikDialogTutorialPagerAdapter.java
61 61
    {
62 62
    DisplayMetrics metrics = mAct.getResources().getDisplayMetrics();
63 63

  
64
    mViews[position] = new RubikDialogTutorialView(mAct, metrics.widthPixels, position);
64
    mViews[position] = new RubikDialogTutorialView(mAct, metrics.heightPixels, position);
65 65
    collection.addView(mViews[position]);
66 66

  
67 67
    return mViews[position];
src/main/java/org/distorted/dialogs/RubikDialogTutorialView.java
38 38

  
39 39
public class RubikDialogTutorialView extends FrameLayout
40 40
  {
41
  public static final float PANE_HEIGHT  = 0.06f;
41 42
  private boolean mCanClick;
42 43

  
43 44
///////////////////////////////////////////////////////////////////////////////////////////////////
......
56 57

  
57 58
///////////////////////////////////////////////////////////////////////////////////////////////////
58 59

  
59
  public RubikDialogTutorialView(FragmentActivity act, int width, int position)
60
  public RubikDialogTutorialView(FragmentActivity act, int height, int position)
60 61
    {
61 62
    super(act);
62 63

  
......
79 80
    if( tutorials!=null )
80 81
      {
81 82
      clickPossible(true);
82
      int widthT = (int)(width* RubikActivity.TUTORIAL_ITEM_TEXT);
83
      int size = (int)(height*PANE_HEIGHT);
83 84

  
84 85
      RubikActivity ract = (RubikActivity)getContext();
85 86
      Resources res = act.getResources();
......
100 101

  
101 102
        int countryID = res.getIdentifier(coun, "drawable", packageName);
102 103

  
103
        View row = createRow(ract, countryID, desc, url, auth, widthT, objectOrdinal, colorB, colorT);
104
        View row = createRow(ract, countryID, desc, url, auth, size, objectOrdinal, colorB, colorT);
104 105
        layout.addView(row);
105 106
        }
106 107

  
src/main/java/org/distorted/main/RubikActivity.java
68 68

  
69 69
    public static final float PADDING             = 0.01f;
70 70
    public static final float SMALL_MARGIN        = 0.004f;
71
    public static final float MEDIUM_MARGIN       = 0.015f;
72 71
    public static final float BUTTON_TEXT_SIZE    = 0.05f;
73 72
    public static final float TITLE_TEXT_SIZE     = 0.06f;
74 73
    public static final float SOLVER_BMP_H_SIZE   = 0.11f;
......
77 76
    public static final float PATTERN_CHILD_TEXT  = 0.02f;
78 77
    public static final float SCORES_LEVEL_TEXT   = 0.035f;
79 78
    public static final float SCORES_ITEM_TEXT    = 0.030f;
80
    public static final float TUTORIAL_ITEM_TEXT  = 0.100f;
81 79
    public static final float DIALOG_BUTTON_SIZE  = 0.06f;
82 80
    public static final float BIG_TEXT_SIZE       = 0.05f;
83 81
    public static final float SMALL_TEXT_SIZE     = 0.035f;
84
    public static final float TAB_WIDTH           = 0.100f;
85
    public static final float TAB_HEIGHT          = 0.100f;
82
    public static final float TAB_WIDTH           = 0.066f;
83
    public static final float TAB_HEIGHT          = 0.066f;
84
    public static final float TAB_TEXT_SIZE       = 0.033f;
85
    public static final float TAB_BUTTON_SIZE     = 0.040f;
86 86
    public static final float POPUP_PADDING       = 0.028f;
87 87
    public static final float POPUP_MARGIN        = 0.016f;
88 88

  

Also available in: Unified diff