Project

General

Profile

« Previous | Next » 

Revision 7c1b6441

Added by Leszek Koltunski 13 days ago

Improvements to the Phased Solver app

View differences:

src/main/java/org/distorted/phasedsolver/SolverActivity.java
194 194
      });
195 195
    }
196 196

  
197
///////////////////////////////////////////////////////////////////////////////////////////////////
198

  
199
  public void Scramble(View v)
200
    {
201
    ObjectControl control = getControl();
202
    control.fastScrambleObject(1000,20);
203
    mLowerPane.clearMoves(this);
204

  
205
    mNumMoves = 0;
206
    mMoves = "";
207
    mText.setText(mMoves);
208
    }
209

  
197 210
///////////////////////////////////////////////////////////////////////////////////////////////////
198 211

  
199 212
  public void Reset(View v)
src/main/java/org/distorted/phasedsolver/SolverLowerPane.java
207 207

  
208 208
  void clearMoves(SolverActivity act)
209 209
    {
210
    setMoves(act,null,0);
210
    for(int p=0; p<mNumPhases; p++) mMoves[p] = null;
211
    mNumMoves = 0;
212
    mCurrPhase= 0;
213
    mCurrMove = 0;
214

  
215
    setText(act);
211 216
    }
212 217

  
213 218
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/res/layout/mainlayout.xml
31 31
            android:textAppearance="?android:attr/textAppearanceMedium"
32 32
            android:layout_gravity="center_vertical"/>
33 33

  
34
        <Button
35
            android:id="@+id/solverScramble"
36
            android:layout_width="0dp"
37
            android:layout_height="match_parent"
38
            android:layout_weight="1.0"
39
            android:gravity="center_vertical|center"
40
            android:text="@string/scramble"
41
            android:onClick="Scramble"
42
            android:textAppearance="?android:attr/textAppearanceMedium"
43
            android:layout_gravity="center_vertical"/>
44

  
34 45
        <Button
35 46
            android:id="@+id/solverSolve"
36 47
            android:layout_width="0dp"
src/main/res/values/strings.xml
1 1
<resources>
2 2
    <string name="app_name">Phased Solver</string>
3 3
    <string name="solve">Solve</string>
4
    <string name="scramble">Scramble</string>
4 5
    <string name="reset">Reset</string>
5 6
</resources>

Also available in: Unified diff