Project

General

Profile

Download (21.4 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / states / RubikStatePlay.java @ 15846fe4

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is free software: you can redistribute it and/or modify                            //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Magic Cube is distributed in the hope that it will be useful,                                 //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19

    
20
package org.distorted.states;
21

    
22
import android.content.Context;
23
import android.content.SharedPreferences;
24
import android.graphics.drawable.BitmapDrawable;
25
import android.os.Build;
26
import android.os.Bundle;
27
import android.util.DisplayMetrics;
28
import android.util.TypedValue;
29
import android.view.Gravity;
30
import android.view.LayoutInflater;
31
import android.view.View;
32
import android.view.ViewGroup;
33
import android.widget.AdapterView;
34
import android.widget.ArrayAdapter;
35
import android.widget.Button;
36
import android.widget.ImageButton;
37
import android.widget.LinearLayout;
38
import android.widget.PopupWindow;
39
import android.widget.TextView;
40

    
41
import androidx.annotation.NonNull;
42
import androidx.appcompat.widget.AppCompatSpinner;
43

    
44
import org.distorted.dialogs.RubikDialogAbout;
45
import org.distorted.dialogs.RubikDialogScores;
46
import org.distorted.main.R;
47
import org.distorted.main.RubikActivity;
48
import org.distorted.main.RubikPreRender;
49
import org.distorted.objects.RubikObject;
50
import org.distorted.objects.RubikObjectList;
51

    
52
import java.util.ArrayList;
53

    
54
///////////////////////////////////////////////////////////////////////////////////////////////////
55

    
56
public class RubikStatePlay extends RubikStateAbstract implements AdapterView.OnItemSelectedListener,
57
                                                                  RubikPreRender.ActionFinishedListener
58
  {
59
  private static final int DURATION_MILLIS = 750;
60
  private static final int DEF_LEVEL =  1;
61
  public  static final int DEF_OBJECT= RubikObjectList.CUBE.ordinal();
62
  public  static final int DEF_SIZE  =  3;
63

    
64
  private static int[] BUTTON_LABELS = { R.string.scores, R.string.patterns, R.string.solver, R.string.about };
65
  private static final int NUM_BUTTONS = BUTTON_LABELS.length;
66

    
67
  private ImageButton mObjButton, mMenuButton, mPrevButton, mSolveButton;
68
  private Button mPlayButton;
69
  private PopupWindow mObjectPopup, mMenuPopup;
70
  private int mObject = DEF_OBJECT;
71
  private int mSize   = DEF_SIZE;
72
  private int mObjectLayoutWidth, mMenuLayoutHeight;
73
  private LinearLayout mObjectLayout, mMenuLayout;
74
  private AppCompatSpinner mLevelSpinner;
75
  private ArrayAdapter<String> mSpinnerAdapter;
76
  private int mLevelValue;
77
  private float mButtonSize, mTitleSize;
78

    
79
  private ArrayList<Move> mMoves;
80
  private boolean mCanPrevMove;
81

    
82
  private static class Move
83
    {
84
    private int mAxis, mRow, mAngle;
85

    
86
    Move(int axis, int row, int angle)
87
      {
88
      mAxis = axis;
89
      mRow  = row;
90
      mAngle= angle;
91
      }
92
    }
93

    
94
///////////////////////////////////////////////////////////////////////////////////////////////////
95

    
96
  void leaveState(RubikActivity act)
97
    {
98

    
99
    }
100

    
101
///////////////////////////////////////////////////////////////////////////////////////////////////
102

    
103
  void enterState(final RubikActivity act)
104
    {
105
    DisplayMetrics metrics = act.getResources().getDisplayMetrics();
106
    final float scale = metrics.density;
107

    
108
    float width = act.getScreenWidthInPixels();
109
    mButtonSize = width*RubikActivity.BUTTON_TEXT_SIZE;
110
    mTitleSize  = width*RubikActivity.TITLE_TEXT_SIZE;
111

    
112
    mCanPrevMove = true;
113

    
114
    if( mMoves==null ) mMoves = new ArrayList<>();
115
    else               mMoves.clear();
116

    
117
    // TOP ////////////////////////////
118
    LinearLayout layoutTop = act.findViewById(R.id.upperBar);
119
    layoutTop.removeAllViews();
120

    
121
    setupObjectButton(act,scale);
122
    layoutTop.addView(mObjButton);
123
    setupLevelSpinner(act,scale);
124
    layoutTop.addView(mLevelSpinner);
125
    setupPlayButton(act,scale);
126
    layoutTop.addView(mPlayButton);
127

    
128
    setupObjectWindow(act, scale);
129

    
130
    // BOT ////////////////////////////
131

    
132
    LinearLayout layoutLeft = act.findViewById(R.id.mainBarLeft);
133
    layoutLeft.removeAllViews();
134

    
135
    setupPrevButton(act,scale,width);
136
    layoutLeft.addView(mPrevButton);
137
    setupSolveButton(act,scale,width);
138
    layoutLeft.addView(mSolveButton);
139

    
140
    LinearLayout layoutRight = act.findViewById(R.id.mainBarRight);
141
    layoutRight.removeAllViews();
142

    
143
    setupMenuButton(act,scale);
144
    layoutRight.addView(mMenuButton);
145

    
146
    setupMenuWindow(act, scale);
147
    }
148

    
149
///////////////////////////////////////////////////////////////////////////////////////////////////
150

    
151
  private void setupObjectButton(final RubikActivity act, final float scale)
152
    {
153
    int padding = (int)(3*scale + 0.5f);
154
    LinearLayout.LayoutParams objectParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1.2f);
155
    mObjButton = new ImageButton(act);
156
    mObjButton.setLayoutParams(objectParams);
157
    mObjButton.setPadding(padding,0,padding,0);
158
    mObjButton.setImageResource(R.drawable.cube_menu);
159

    
160
    mObjButton.setOnClickListener( new View.OnClickListener()
161
      {
162
      @Override
163
      public void onClick(View view)
164
        {
165
        if( act.getPreRender().canPlay() )
166
          {
167
          int total = RubikObjectList.getTotal();
168
          boolean vertical = act.isVertical();
169
          mObjectLayout.setOrientation(vertical ? LinearLayout.VERTICAL:LinearLayout.HORIZONTAL);
170

    
171
          int width  = view.getWidth();
172
          int layhei = mObjectLayoutWidth * (vertical? total:1);
173
          int laywid = mObjectLayoutWidth * (vertical? 1:total);
174

    
175
          mObjectPopup.showAsDropDown(view, (width-laywid)/2, 0, Gravity.LEFT);
176

    
177
          if( android.os.Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1 )
178
            {
179
            mObjectPopup.update(view, laywid, layhei);
180
            }
181
          }
182
        }
183
      });
184
    }
185

    
186
///////////////////////////////////////////////////////////////////////////////////////////////////
187

    
188
  private void setupLevelSpinner(final RubikActivity act, final float scale)
189
    {
190
    int padding = (int)(scale* 10 + 0.5f);
191
    int margin  = (int)(scale*  3 + 0.5f);
192
    LinearLayout.LayoutParams spinnerLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1.0f);
193
    spinnerLayoutParams.topMargin    = margin;
194
    spinnerLayoutParams.bottomMargin = margin;
195
    spinnerLayoutParams.leftMargin   = margin;
196
    spinnerLayoutParams.rightMargin  = margin;
197

    
198
    mLevelSpinner = new AppCompatSpinner(act);
199
    mLevelSpinner.setLayoutParams(spinnerLayoutParams);
200
    mLevelSpinner.setPadding(padding,0,padding,0);
201
    mLevelSpinner.setBackgroundResource(R.drawable.spinner);
202
    mLevelSpinner.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
203

    
204
    mLevelSpinner.setOnItemSelectedListener(this);
205
    int sizeIndex = RubikObjectList.getSizeIndex(mObject,mSize);
206
    int maxLevel = RubikObjectList.getMaxLevel(mObject, sizeIndex);
207
    String[] levels = new String[maxLevel];
208

    
209
    for(int i=0; i<maxLevel; i++)
210
      {
211
      levels[i] = act.getString(R.string.lv_placeholder,i+1);
212
      }
213

    
214
    if( mLevelValue>maxLevel ) mLevelValue=1;
215

    
216
    mSpinnerAdapter = new ArrayAdapter<String>(act, android.R.layout.simple_spinner_item, levels)
217
      {
218
      @NonNull
219
      public View getView(int position, View convertView, @NonNull ViewGroup parent)
220
        {
221
        View v = super.getView(position, convertView, parent);
222
        TextView tv = ((TextView) v);
223
        tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, mButtonSize);
224
        return v;
225
        }
226
      };
227

    
228
    mSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
229
    mLevelSpinner.setAdapter(mSpinnerAdapter);
230
    mLevelSpinner.setSelection(mLevelValue-1);
231
    }
232

    
233
///////////////////////////////////////////////////////////////////////////////////////////////////
234

    
235
  private void setupPlayButton(final RubikActivity act, final float scale)
236
    {
237
    int padding = (int)(3*scale + 0.5f);
238
    LinearLayout.LayoutParams backParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT, 1.2f);
239
    mPlayButton = new Button(act);
240
    mPlayButton.setLayoutParams(backParams);
241
    mPlayButton.setPadding(padding,0,padding,0);
242
    mPlayButton.setTextSize(TypedValue.COMPLEX_UNIT_PX, mButtonSize);
243
    mPlayButton.setText(R.string.play);
244

    
245
    mPlayButton.setOnClickListener( new View.OnClickListener()
246
      {
247
      @Override
248
      public void onClick(View v)
249
        {
250
        act.getPreRender().scrambleObject(mLevelValue);
251
        }
252
      });
253
    }
254

    
255
///////////////////////////////////////////////////////////////////////////////////////////////////
256

    
257
  private void setupMenuButton(final RubikActivity act, final float scale)
258
    {
259
    int padding = (int)(3*scale + 0.5f);
260
    LinearLayout.LayoutParams objectParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
261
    mMenuButton = new ImageButton(act);
262
    mMenuButton.setLayoutParams(objectParams);
263
    mMenuButton.setPadding(padding,0,padding,0);
264
    mMenuButton.setImageResource(R.drawable.menu);
265

    
266
    mMenuButton.setOnClickListener( new View.OnClickListener()
267
      {
268
      @Override
269
      public void onClick(View view)
270
        {
271
        if( act.getPreRender().canPlay() )
272
          {
273
          int total = RubikObjectList.getTotal();
274
          boolean vertical = act.isVertical();
275
          mMenuLayout.setOrientation(vertical ? LinearLayout.VERTICAL:LinearLayout.HORIZONTAL);
276

    
277
          mMenuPopup.showAsDropDown(view, 0, -3*mMenuLayoutHeight, Gravity.LEFT);
278
          mMenuPopup.update();
279
          }
280
        }
281
      });
282
    }
283

    
284
///////////////////////////////////////////////////////////////////////////////////////////////////
285

    
286
  private void setupSolveButton(final RubikActivity act, final float scale, final float width)
287
    {
288
    int padding = (int)(3*scale + 0.5f);
289
    int widthBut = (int)(width/6);
290
    LinearLayout.LayoutParams backParams = new LinearLayout.LayoutParams(widthBut, LinearLayout.LayoutParams.MATCH_PARENT);
291
    mSolveButton = new ImageButton(act);
292
    mSolveButton.setLayoutParams(backParams);
293
    mSolveButton.setPadding(padding,0,padding,0);
294
    mSolveButton.setImageResource(R.drawable.cube_solve);
295

    
296
    mSolveButton.setOnClickListener( new View.OnClickListener()
297
      {
298
      @Override
299
      public void onClick(View v)
300
        {
301
        act.getPreRender().solveObject();
302
        }
303
      });
304
    }
305

    
306
///////////////////////////////////////////////////////////////////////////////////////////////////
307

    
308
  private void setupPrevButton(final RubikActivity act, final float scale, final float width)
309
    {
310
    int padding = (int)(3*scale + 0.5f);
311
    int widthBut = (int)(width/6);
312
    LinearLayout.LayoutParams backParams = new LinearLayout.LayoutParams(widthBut, LinearLayout.LayoutParams.MATCH_PARENT);
313
    mPrevButton = new ImageButton(act);
314
    mPrevButton.setLayoutParams(backParams);
315
    mPrevButton.setPadding(padding,0,padding,0);
316
    mPrevButton.setImageResource(R.drawable.cube_back);
317

    
318
    mPrevButton.setOnClickListener( new View.OnClickListener()
319
      {
320
      @Override
321
      public void onClick(View v)
322
        {
323
        RubikPreRender pre = act.getPreRender();
324
        backMove(pre);
325
        }
326
      });
327
    }
328

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

    
331
  private void setupObjectWindow(final RubikActivity act, final float scale)
332
    {
333
    LayoutInflater layoutInflater = (LayoutInflater)act.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
334
    final View layout = layoutInflater.inflate(R.layout.popup_objects, null);
335
    mObjectLayout = layout.findViewById(R.id.popup);
336

    
337
    mObjectPopup = new PopupWindow(act);
338
    mObjectPopup.setContentView(layout);
339
    mObjectPopup.setFocusable(true);
340
    int margin = (int)(5*scale + 0.5f);
341

    
342
    BitmapDrawable bd = (BitmapDrawable) act.getResources().getDrawable(R.drawable.cube2);
343
    int cubeWidth  = bd.getIntrinsicWidth();
344
    mObjectLayoutWidth = (int)(cubeWidth + 2*margin + 0.5f);
345

    
346
    for(int object=0; object<RubikObjectList.NUM_OBJECTS; object++)
347
      {
348
      final RubikObjectList list = RubikObjectList.getObject(object);
349
      final int[] sizes = list.getSizes();
350
      int[] icons = list.getIconIDs();
351
      int len = sizes.length;
352
      final int obj = object;
353

    
354
      for(int i=0; i<len; i++)
355
        {
356
        final int size = i;
357

    
358
        LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
359
        p.setMargins(margin, margin, margin, margin);
360

    
361
        ImageButton button = new ImageButton(act);
362
        button.setLayoutParams(p);
363

    
364
        button.setBackgroundResource(icons[i]);
365
        button.setOnClickListener( new View.OnClickListener()
366
          {
367
          @Override
368
          public void onClick(View v)
369
            {
370
            if( act.getPreRender().canPlay() && RubikState.getCurrentState()==RubikState.PLAY )
371
              {
372
              mObject = obj;
373
              mSize   = sizes[size];
374
              act.changeObject(list,sizes[size], true);
375
              adjustSpinner(act);
376
              }
377

    
378
            mObjectPopup.dismiss();
379
            }
380
          });
381

    
382
        mObjectLayout.addView(button);
383
        }
384
      }
385
    }
386

    
387
///////////////////////////////////////////////////////////////////////////////////////////////////
388

    
389
  private void setupMenuWindow(final RubikActivity act, final float scale)
390
    {
391
    LayoutInflater layoutInflater = (LayoutInflater)act.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
392
    final View layout = layoutInflater.inflate(R.layout.popup_objects, null);
393
    mMenuLayout = layout.findViewById(R.id.popup);
394

    
395
    mMenuPopup = new PopupWindow(act);
396
    mMenuPopup.setContentView(layout);
397
    mMenuPopup.setFocusable(true);
398
    int margin = (int)(5*scale + 0.5f);
399

    
400
    LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
401
    p.setMargins(margin, margin, margin, margin);
402

    
403
    for(int i=0; i<NUM_BUTTONS; i++)
404
      {
405
      final int but = i;
406
      Button button = new Button(act);
407
      button.setLayoutParams(p);
408
      button.setText(BUTTON_LABELS[i]);
409

    
410
      button.setOnClickListener( new View.OnClickListener()
411
        {
412
        @Override
413
        public void onClick(View v)
414
          {
415
          mMenuPopup.dismiss();
416
          Action(act,but);
417
          }
418
        });
419

    
420
      mMenuLayout.addView(button);
421
      }
422

    
423
    mMenuLayoutHeight= (int)(margin + NUM_BUTTONS*(mButtonSize+margin));
424
    }
425

    
426
///////////////////////////////////////////////////////////////////////////////////////////////////
427

    
428
  private void backMove(RubikPreRender pre)
429
    {
430
    if( mCanPrevMove )
431
      {
432
      int numMoves = mMoves.size();
433

    
434
      if( numMoves>0 )
435
        {
436
        Move move = mMoves.remove(numMoves-1);
437
        RubikObject object = pre.getObject();
438

    
439
        int axis  = move.mAxis;
440
        int row   = (1<<move.mRow);
441
        int angle = move.mAngle;
442
        int numRot= Math.abs(angle*object.getBasicAngle()/360);
443

    
444
        if( angle!=0 )
445
          {
446
          mCanPrevMove = false;
447
          pre.addRotation(this, axis, row, -angle, numRot*DURATION_MILLIS);
448
          }
449
        else
450
          {
451
          android.util.Log.e("solution", "error: trying to back move of angle 0");
452
          }
453
        }
454
      else
455
        {
456
        android.util.Log.e("solv", "error: no moves to back!");
457
        }
458
      }
459
    }
460
///////////////////////////////////////////////////////////////////////////////////////////////////
461

    
462
  private void Action(RubikActivity act, int button)
463
    {
464
    switch(button)
465
      {
466
      case 0: RubikStatePlay play = (RubikStatePlay) RubikState.PLAY.getStateClass();
467
              int object = play.getObject();
468
              int size   = play.getSize();
469
              int sizeIndex = RubikObjectList.getSizeIndex(object,size);
470

    
471
              Bundle bundle = new Bundle();
472
              bundle.putInt("tab", RubikObjectList.pack(object,sizeIndex) );
473
              bundle.putBoolean("submitting", false);
474

    
475
              RubikDialogScores scores = new RubikDialogScores();
476
              scores.setArguments(bundle);
477
              scores.show(act.getSupportFragmentManager(), null);
478
              break;
479
      case 1: RubikState.switchState(act,RubikState.PATT);
480
              break;
481
      case 2: RubikState.switchState(act,RubikState.SVER);
482
              break;
483
      case 3: RubikDialogAbout diag = new RubikDialogAbout();
484
              diag.show(act.getSupportFragmentManager(), null);
485
              break;
486
      }
487
    }
488

    
489
///////////////////////////////////////////////////////////////////////////////////////////////////
490

    
491
  public void savePreferences(SharedPreferences.Editor editor)
492
    {
493
    editor.putInt("statePlay_level" , mLevelValue);
494
    editor.putInt("statePlay_object", mObject);
495
    editor.putInt("statePlay_size"  , mSize);
496

    
497
    if( mObjectPopup!=null )
498
      {
499
      mObjectPopup.dismiss();
500
      mObjectPopup = null;
501
      }
502

    
503
    if( mMenuPopup!=null )
504
      {
505
      mMenuPopup.dismiss();
506
      mMenuPopup = null;
507
      }
508
    }
509

    
510
///////////////////////////////////////////////////////////////////////////////////////////////////
511

    
512
  public void restorePreferences(SharedPreferences preferences)
513
    {
514
    mLevelValue = preferences.getInt("statePlay_level" , DEF_LEVEL );
515
    mObject     = preferences.getInt("statePlay_object", DEF_OBJECT);
516
    mSize       = preferences.getInt("statePlay_size"  , DEF_SIZE  );
517
    }
518

    
519
///////////////////////////////////////////////////////////////////////////////////////////////////
520

    
521
  public boolean setObjectAndSize(RubikActivity act, RubikObjectList obj, int size)
522
    {
523
    if( mObject!=obj.ordinal() || mSize != size )
524
      {
525
      boolean success = false;
526

    
527
      for( int s: obj.getSizes() )
528
        if( s==size )
529
          {
530
          success = true;
531
          break;
532
          }
533

    
534
      if( success )
535
        {
536
        mObject = obj.ordinal();
537
        mSize   = size;
538

    
539
        if( mLevelSpinner!=null ) adjustSpinner(act);
540
        }
541

    
542
      return success;
543
      }
544

    
545
    return true;
546
    }
547

    
548
///////////////////////////////////////////////////////////////////////////////////////////////////
549

    
550
  private void adjustSpinner(RubikActivity act)
551
    {
552
    int sizeIndex = RubikObjectList.getSizeIndex(mObject,mSize);
553
    int maxLevel  = RubikObjectList.getMaxLevel(mObject, sizeIndex);
554
    String[] levels = new String[maxLevel];
555

    
556
    for(int i=0; i<maxLevel; i++)
557
      {
558
      levels[i] = act.getString(R.string.lv_placeholder,i+1);
559
      }
560

    
561
    mSpinnerAdapter = new ArrayAdapter<String>(act, android.R.layout.simple_spinner_item, levels)
562
      {
563
      @NonNull
564
      public View getView(int position, View convertView, @NonNull ViewGroup parent)
565
        {
566
        View v = super.getView(position, convertView, parent);
567
        TextView tv = ((TextView) v);
568
        tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, mButtonSize);
569
        return v;
570
        }
571
      };
572

    
573
    mSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
574
    mLevelSpinner.setAdapter(mSpinnerAdapter);
575
    }
576

    
577
///////////////////////////////////////////////////////////////////////////////////////////////////
578

    
579
  int getLevel()
580
    {
581
    return mLevelValue;
582
    }
583

    
584
///////////////////////////////////////////////////////////////////////////////////////////////////
585

    
586
  public void addMove(int axis, int row, int angle)
587
    {
588
    mMoves.add(new Move(axis,row,angle));
589
    }
590

    
591
///////////////////////////////////////////////////////////////////////////////////////////////////
592

    
593
  public int getObject()
594
    {
595
    return mObject;
596
    }
597

    
598
///////////////////////////////////////////////////////////////////////////////////////////////////
599

    
600
  public int getSize()
601
    {
602
    return mSize;
603
    }
604

    
605
///////////////////////////////////////////////////////////////////////////////////////////////////
606

    
607
  public void onItemSelected(AdapterView<?> parent, View view, int pos, long id)
608
    {
609
    mLevelValue = pos+1;
610
    }
611

    
612
///////////////////////////////////////////////////////////////////////////////////////////////////
613

    
614
  public void onNothingSelected(AdapterView<?> parent) { }
615

    
616
///////////////////////////////////////////////////////////////////////////////////////////////////
617

    
618
  public void onActionFinished(final long effectID)
619
    {
620
    mCanPrevMove = true;
621
    }
622
  }
(5-5/9)