Project

General

Profile

« Previous | Next » 

Revision 2afc6754

Added by Leszek Koltunski over 2 years ago

Move RubikControl to objectlib (as 'ObjectAutomator')
Hide ObjectPreRender inside objectlib and move its APi to ObjectControl.

View differences:

src/main/java/org/distorted/screens/RubikScreenPlay.java
35 35
import android.widget.PopupWindow;
36 36
import android.widget.ScrollView;
37 37

  
38
import org.distorted.objectlib.main.ObjectControl;
38 39
import org.distorted.objectlib.main.ObjectType;
39 40

  
40 41
import org.distorted.main.R;
41 42
import org.distorted.main.RubikActivity;
42
import org.distorted.objectlib.main.ObjectPreRender;
43 43
import org.distorted.dialogs.RubikDialogAbout;
44 44
import org.distorted.dialogs.RubikDialogPattern;
45 45
import org.distorted.dialogs.RubikDialogScores;
......
59 59

  
60 60
  private static final int[] BUTTON_LABELS = { R.string.scores,
61 61
                                               R.string.patterns,
62
                                            //   R.string.control,
63 62
                                               R.string.solver,
64 63
                                               R.string.tutorials,
65 64
                                               R.string.about };
......
149 148
      @Override
150 149
      public void onClick(View view)
151 150
        {
152
        if( mObjectPopup!=null && act.getPreRender().isUINotBlocked())
151
        if( mObjectPopup!=null && act.getControl().isUINotBlocked())
153 152
          {
154 153
          int rowCount = Math.min(mMaxRowCount,mRowCount);
155 154
          View popupView = mObjectPopup.getContentView();
......
174 173
      @Override
175 174
      public void onClick(View view)
176 175
        {
177
        if( mPlayPopup!=null && act.getPreRender().isUINotBlocked())
176
        if( mPlayPopup!=null && act.getControl().isUINotBlocked())
178 177
          {
179 178
          View popupView = mPlayPopup.getContentView();
180 179
          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
......
202 201
      @Override
203 202
      public void onClick(View view)
204 203
        {
205
        if( mMenuPopup!=null && act.getPreRender().isUINotBlocked())
204
        if( mMenuPopup!=null && act.getControl().isUINotBlocked())
206 205
          {
207 206
          View popupView = mMenuPopup.getContentView();
208 207
          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
......
271 270
        @Override
272 271
        public void onClick(View v)
273 272
          {
274
          if( act.getPreRender().isUINotBlocked() && ScreenList.getCurrentScreen()== ScreenList.PLAY )
273
          if( act.getControl().isUINotBlocked() && ScreenList.getCurrentScreen()== ScreenList.PLAY )
275 274
            {
276 275
            mObject = ObjectType.getObject(obj);
277 276
            act.changeObject(list, true);
......
373 372
              pDiag.setArguments(pBundle);
374 373
              pDiag.show( act.getSupportFragmentManager(), RubikDialogPattern.getDialogTag() );
375 374
              break;
376
/*
377
      case 2: RubikControl control = RubikControl.getInstance();
378
              //control.animateAll(act);
379
              control.animateRotate(act);
380
              break;
381
 */
382 375
      case 2: ScreenList.switchScreen(act, ScreenList.SVER);
383 376
              break;
384 377
      case 3: RubikDialogTutorial tDiag = new RubikDialogTutorial();
......
406 399
      @Override
407 400
      public void onClick(View v)
408 401
        {
409
        act.getPreRender().solveObject();
402
        act.getControl().solveObject();
410 403
        mMovesController.clearMoves(act);
411 404
        }
412 405
      });
......
557 550
        @Override
558 551
        public void onClick(View v)
559 552
          {
560
          ObjectPreRender pre = act.getPreRender();
553
          ObjectControl control = act.getControl();
561 554

  
562
          if(pre.isUINotBlocked())
555
          if(control.isUINotBlocked())
563 556
            {
564 557
            if( mPlayPopup!=null ) mPlayPopup.dismiss();
565 558
            mLevelValue = level;
566
            pre.scrambleObject(scrambles);
559
            control.scrambleObject(scrambles);
567 560
            }
568 561
          }
569 562
        });

Also available in: Unified diff