Project

General

Profile

« Previous | Next » 

Revision 7a60305a

Added by Leszek Koltunski almost 2 years ago

New button in the solver screen: reset all textures.

View differences:

src/main/java/org/distorted/screens/RubikScreenSolver.java
44 44

  
45 45
public class RubikScreenSolver extends RubikScreenAbstract
46 46
  {
47
  private static final int RESET_DURATION = 1000;
48

  
47 49
  private static Bitmap[] mBitmap;
48 50
  private ImageButton[] mColorButton;
49
  private TransparentImageButton mBackButton, mSolveButton;
51
  private TransparentImageButton mResetButton,mBackButton, mSolveButton;
50 52
  private boolean mSolving;
51 53
  private int mCurrentColor;
52 54
  private int[] mFaceColors;
......
115 117
    LinearLayout layoutBot = act.findViewById(R.id.lowerBar);
116 118
    layoutBot.removeAllViews();
117 119

  
120
    setupResetButton(act);
118 121
    setupSolveButton(act);
119 122
    setupBackButton(act);
120 123

  
121
    layoutL.addView(mSolveButton);
124
    layoutL.addView(mResetButton);
125
    layoutM.addView(mSolveButton);
122 126
    layoutR.addView(mBackButton);
123 127

  
124 128
    layoutBot.addView(layoutL);
......
242 246
      }
243 247
    }
244 248

  
249
///////////////////////////////////////////////////////////////////////////////////////////////////
250

  
251
  private void setupResetButton(final RubikActivity act)
252
    {
253
    int icon = RubikActivity.getDrawable(R.drawable.ui_small_reset,R.drawable.ui_medium_reset, R.drawable.ui_big_reset, R.drawable.ui_huge_reset);
254
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT);
255
    mResetButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
256

  
257
    mResetButton.setOnClickListener( new View.OnClickListener()
258
      {
259
      @Override
260
      public void onClick(View v)
261
        {
262
        ObjectControl control = act.getControl();
263
        control.resetTextureMapsEffect(RESET_DURATION);
264
        }
265
      });
266
    }
267

  
245 268
///////////////////////////////////////////////////////////////////////////////////////////////////
246 269

  
247 270
  private void setupSolveButton(final RubikActivity act)

Also available in: Unified diff