Project

General

Profile

« Previous | Next » 

Revision 09784afd

Added by Leszek Koltunski about 3 years ago

Improve the test - now it will hopefully not crash on slow devices.

View differences:

release/output-metadata.json
10 10
    {
11 11
      "type": "SINGLE",
12 12
      "filters": [],
13
      "versionCode": 26,
14
      "versionName": "1.6.3",
13
      "versionCode": 27,
14
      "versionName": "1.6.4",
15 15
      "outputFile": "distorted-cube-release.apk"
16 16
    }
17 17
  ]
src/main/java/org/distorted/main/RubikActivity.java
55 55

  
56 56
///////////////////////////////////////////////////////////////////////////////////////////////////
57 57

  
58
public class RubikActivity extends AppCompatActivity implements RubikDebug.ActivityChanger, EffectListener
58
public class RubikActivity extends AppCompatActivity implements RubikDebug.ActivityChanger, RubikPreRender.ActionFinishedListener
59 59
{
60 60
    public static final float PADDING             = 0.01f;
61 61
    public static final float MARGIN              = 0.004f;
......
267 267
        scores.setCountry(this);
268 268
        }
269 269

  
270
RubikPreRender pre = view.getPreRender();
271
pre.destroyNewObject();
272
RubikDebug.addDebug("RubikActivity: onResume");
270
      RubikDebug.addDebug("RubikActivity: onResume");
273 271

  
274 272
      boolean success = false;
275 273
      RubikStatePlay play = (RubikStatePlay) StateList.PLAY.getStateClass();
......
623 621

  
624 622
    int angle = 360 / object.getBasicAngle();
625 623

  
626
    object.addNewRotation(1,1,angle,1000,this);
624
    pre.addRotation(this,1,1,angle,1000);
627 625
    }
628 626

  
629 627
///////////////////////////////////////////////////////////////////////////////////////////////////
630 628

  
631
  public void effectFinished(final long effectID)
629
  public void onActionFinished(final long effectID)
632 630
    {
633 631
    RubikDebug debug = RubikDebug.getInstance();
634 632
    debug.onReturned();
src/main/java/org/distorted/main/RubikDebug.java
28 28

  
29 29
public class RubikDebug
30 30
  {
31
  private static final int CHECK_INTERVAL = 1000;
31
  private static final int LOOP_INTERVAL = 500;
32
  private static final int LOOP_NUM1     = 5;
33
  private static final int LOOP_NUM2     = 9;
32 34

  
33 35
  private String mDebug;
34 36
  private long mResumeTime;
......
66 68

  
67 69
  private void check(int loopNum)
68 70
    {
69
    if( loopNum==1 )
71
    if( loopNum==LOOP_NUM1 )
70 72
      {
71 73
      mChanger.assign();
72 74
      }
73
    if( loopNum==4 )
75
    if( loopNum==LOOP_NUM2 )
74 76
      {
75 77
      if( mNumReturned!=1 )
76 78
        {
......
122 124
      @Override
123 125
      public void run()
124 126
        {
125
        if( mLoopNum==5 )
127
        if( mLoopNum==LOOP_NUM2 )
126 128
          {
127 129
          timer.cancel();
128 130
          }
129 131

  
130 132
        check(mLoopNum++);
131 133
        }
132
      } ,CHECK_INTERVAL, CHECK_INTERVAL);
134
      } ,LOOP_INTERVAL, LOOP_INTERVAL);
133 135
    }
134 136

  
135 137
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff