Project

General

Profile

« Previous | Next » 

Revision 919b830e

Added by Leszek Koltunski over 1 year ago

Some improvements to blocking, mostly to the names of variables.

View differences:

src/main/java/org/distorted/bandaged/BandagedPlayLibInterface.java
96 96

  
97 97
///////////////////////////////////////////////////////////////////////////////////////////////////
98 98

  
99
  private void reportUIProblem(int place, long pause, long resume, long time)
99
  private void reportScramblingProblem(int place, long pause, long resume, long time)
100 100
    {
101
    String error = "UI BLOCK "+place+" blocked for "+time;
101
    String error = "SCRAMBLING BLOCK "+place+" blocked for "+time;
102 102

  
103 103
    if( BuildConfig.DEBUG )
104 104
       {
......
116 116

  
117 117
///////////////////////////////////////////////////////////////////////////////////////////////////
118 118

  
119
  private void reportTouchProblem(int place, long pause, long resume, long time)
119
  private void reportRotationProblem(int place, long pause, long resume, long time)
120 120
    {
121
    String error = "TOUCH BLOCK "+place+" blocked for "+time;
121
    String error = "ROTATION BLOCK "+place+" blocked for "+time;
122 122

  
123 123
    if( BuildConfig.DEBUG )
124 124
       {
......
160 160
    {
161 161
    switch(type)
162 162
      {
163
      case BlockController.TYPE_UI    : reportUIProblem(place,pause,resume,time); break;
164
      case BlockController.TYPE_TOUCH : reportTouchProblem(place,pause,resume,time); break;
165
      case BlockController.TYPE_THREAD: reportThreadProblem(place,pause,resume,time); break;
163
      case BlockController.TYPE_SCRAMBLING: reportScramblingProblem(place,pause,resume,time); break;
164
      case BlockController.TYPE_ROTATION  : reportRotationProblem(place,pause,resume,time); break;
165
      case BlockController.TYPE_THREAD    : reportThreadProblem(place,pause,resume,time); break;
166 166
      }
167 167
    }
168 168

  
src/main/java/org/distorted/config/ConfigObjectLibInterface.java
58 58

  
59 59
///////////////////////////////////////////////////////////////////////////////////////////////////
60 60

  
61
  private void reportUIProblem(int place, long pause, long resume, long time)
61
  private void reportScramblingProblem(int place, long pause, long resume, long time)
62 62
    {
63
    String error = "UI BLOCK "+place+" blocked for "+time;
63
    String error = "SCRAMBLING BLOCK "+place+" blocked for "+time;
64 64

  
65 65
    if( BuildConfig.DEBUG )
66 66
       {
......
78 78

  
79 79
///////////////////////////////////////////////////////////////////////////////////////////////////
80 80

  
81
  private void reportTouchProblem(int place, long pause, long resume, long time)
81
  private void reportRotationProblem(int place, long pause, long resume, long time)
82 82
    {
83
    String error = "TOUCH BLOCK "+place+" blocked for "+time;
83
    String error = "ROTATION BLOCK "+place+" blocked for "+time;
84 84

  
85 85
    if( BuildConfig.DEBUG )
86 86
       {
......
122 122
    {
123 123
    switch(type)
124 124
      {
125
      case BlockController.TYPE_UI    : reportUIProblem(place,pause,resume,time); break;
126
      case BlockController.TYPE_TOUCH : reportTouchProblem(place,pause,resume,time); break;
127
      case BlockController.TYPE_THREAD: reportThreadProblem(place,pause,resume,time); break;
125
      case BlockController.TYPE_SCRAMBLING: reportScramblingProblem(place,pause,resume,time); break;
126
      case BlockController.TYPE_ROTATION  : reportRotationProblem(place,pause,resume,time); break;
127
      case BlockController.TYPE_THREAD    : reportThreadProblem(place,pause,resume,time); break;
128 128
      }
129 129
    }
130 130
}
src/main/java/org/distorted/config/ConfigScreen.java
81 81
        @Override
82 82
        public void onClick(View v)
83 83
          {
84
          if( act.getControl().isUINotBlocked() && mObjectOrdinal!=ordinal )
84
          if( mObjectOrdinal!=ordinal )
85 85
            {
86 86
            mObjectOrdinal = ordinal;
87 87
            act.changeObject(mObjectOrdinal);
......
136 136
          setupObjectWindow(act,width,height);
137 137
          }
138 138

  
139
        if( act.getControl().isUINotBlocked())
140
          {
141
          int rowCount = Math.min(mMaxRowCount,mRowCount);
142
          View popupView = mObjectPopup.getContentView();
143
          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
144
          displayPopup(act,view,mObjectPopup,mObjectSize*mColCount,mObjectSize*rowCount+5*margin,margin,margin);
145
          }
139
        int rowCount = Math.min(mMaxRowCount,mRowCount);
140
        View popupView = mObjectPopup.getContentView();
141
        popupView.setSystemUiVisibility(RubikActivity.FLAGS);
142
        displayPopup(act,view,mObjectPopup,mObjectSize*mColCount,mObjectSize*rowCount+5*margin,margin,margin);
146 143
        }
147 144
      });
148 145
    }
src/main/java/org/distorted/helpers/MovesController.java
134 134
  public void onActionFinished(final long effectID)
135 135
    {
136 136
    mCanPrevMove = true;
137
    mControl.unblockTouch();
137
    mControl.unblockRotation();
138 138
    }
139 139

  
140 140
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/main/RubikObjectLibInterface.java
328 328

  
329 329
///////////////////////////////////////////////////////////////////////////////////////////////////
330 330

  
331
  private void reportUIProblem(int place, long pause, long resume, long time)
331
  private void reportScramblingProblem(int place, long pause, long resume, long time)
332 332
    {
333
    String error = "UI BLOCK "+place+" blocked for "+time;
333
    String error = "SCRAMBLING BLOCK "+place+" blocked for "+time;
334 334

  
335 335
    if( BuildConfig.DEBUG )
336 336
       {
......
348 348

  
349 349
///////////////////////////////////////////////////////////////////////////////////////////////////
350 350

  
351
  private void reportTouchProblem(int place, long pause, long resume, long time)
351
  private void reportRotationProblem(int place, long pause, long resume, long time)
352 352
    {
353
    String error = "TOUCH BLOCK "+place+" blocked for "+time;
353
    String error = "ROTATION BLOCK "+place+" blocked for "+time;
354 354

  
355 355
    if( BuildConfig.DEBUG )
356 356
       {
......
392 392
    {
393 393
    switch(type)
394 394
      {
395
      case BlockController.TYPE_UI    : reportUIProblem(place,pause,resume,time); break;
396
      case BlockController.TYPE_TOUCH : reportTouchProblem(place,pause,resume,time); break;
397
      case BlockController.TYPE_THREAD: reportThreadProblem(place,pause,resume,time); break;
395
      case BlockController.TYPE_SCRAMBLING: reportScramblingProblem(place,pause,resume,time); break;
396
      case BlockController.TYPE_ROTATION  : reportRotationProblem(place,pause,resume,time); break;
397
      case BlockController.TYPE_THREAD    : reportThreadProblem(place,pause,resume,time); break;
398 398
      }
399 399
    }
400 400

  
src/main/java/org/distorted/screens/RubikScreenPlay.java
141 141
          setupObjectWindow(act,width,height);
142 142
          }
143 143

  
144
        if( act.getControl().isUINotBlocked())
145
          {
146
          int rowCount = Math.min(mMaxRowCount,mRowCount);
147
          View popupView = mObjectPopup.getContentView();
148
          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
149
          displayPopup(act,view,mObjectPopup,mObjectSize*mColCount,mObjectSize*rowCount+5*margin,margin,margin);
150
          }
144
        int rowCount = Math.min(mMaxRowCount,mRowCount);
145
        View popupView = mObjectPopup.getContentView();
146
        popupView.setSystemUiVisibility(RubikActivity.FLAGS);
147
        displayPopup(act,view,mObjectPopup,mObjectSize*mColCount,mObjectSize*rowCount+5*margin,margin,margin);
151 148
        }
152 149
      });
153 150
    }
......
171 168
          setupMenuWindow(act,width,height);
172 169
          }
173 170

  
174
        if( act.getControl().isUINotBlocked())
175
          {
176
          View popupView = mMenuPopup.getContentView();
177
          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
178
          setupLevelButtonVisibilityAndColor(act);
179
          displayPopup(act,view,mMenuPopup,mMenuLayoutWidth,mMenuLayoutHeight,(int)(-mMenuLayoutWidth/2 + width/6),0);
180
          }
171
        View popupView = mMenuPopup.getContentView();
172
        popupView.setSystemUiVisibility(RubikActivity.FLAGS);
173
        setupLevelButtonVisibilityAndColor(act);
174
        displayPopup(act,view,mMenuPopup,mMenuLayoutWidth,mMenuLayoutHeight,(int)(-mMenuLayoutWidth/2 + width/6),0);
181 175
        }
182 176
      });
183 177
    }
......
215 209
        @Override
216 210
        public void onClick(View v)
217 211
          {
218
          if( obj!=null && act.getControl().isUINotBlocked() && ScreenList.getCurrentScreen()==ScreenList.PLAY )
212
          if( obj!=null && act.getControl().isScramblingAndSolvingNotBlocked() && ScreenList.getCurrentScreen()==ScreenList.PLAY )
219 213
            {
220 214
            if( obj.isFree() )
221 215
              {
......
498 492
          {
499 493
          ObjectControl control = act.getControl();
500 494

  
501
          if(control.isUINotBlocked())
495
          if( control.isScramblingAndSolvingNotBlocked() )
502 496
            {
503 497
            if( mMenuPopup!=null ) mMenuPopup.dismiss();
504 498

  
src/main/java/org/distorted/tutorials/TutorialObjectLibInterface.java
67 67

  
68 68
///////////////////////////////////////////////////////////////////////////////////////////////////
69 69

  
70
  private void reportUIProblem(int place, long pause, long resume, long time)
70
  private void reportScramblingProblem(int place, long pause, long resume, long time)
71 71
    {
72
    String error = "UI BLOCK "+place+" blocked for "+time;
72
    String error = "SCRAMBLING BLOCK "+place+" blocked for "+time;
73 73

  
74 74
    if( BuildConfig.DEBUG )
75 75
       {
......
87 87

  
88 88
///////////////////////////////////////////////////////////////////////////////////////////////////
89 89

  
90
  private void reportTouchProblem(int place, long pause, long resume, long time)
90
  private void reportRotationProblem(int place, long pause, long resume, long time)
91 91
    {
92
    String error = "TOUCH BLOCK "+place+" blocked for "+time;
92
    String error = "ROTATION BLOCK "+place+" blocked for "+time;
93 93

  
94 94
    if( BuildConfig.DEBUG )
95 95
       {
......
131 131
    {
132 132
    switch(type)
133 133
      {
134
      case BlockController.TYPE_UI    : reportUIProblem(place,pause,resume,time); break;
135
      case BlockController.TYPE_TOUCH : reportTouchProblem(place,pause,resume,time); break;
136
      case BlockController.TYPE_THREAD: reportThreadProblem(place,pause,resume,time); break;
134
      case BlockController.TYPE_SCRAMBLING: reportScramblingProblem(place,pause,resume,time); break;
135
      case BlockController.TYPE_ROTATION  : reportRotationProblem(place,pause,resume,time); break;
136
      case BlockController.TYPE_THREAD    : reportThreadProblem(place,pause,resume,time); break;
137 137
      }
138 138
    }
139 139

  

Also available in: Unified diff