Project

General

Profile

« Previous | Next » 

Revision dd874ae8

Added by Leszek Koltunski over 2 years ago

Convert the theme to be a MaterialTheme and the TransparentImageButton to be a MaterialButton - the first forced by the second, and the second because a MaterialButton gives us control over the location of the icon in top of it. We need that because of the new 'solve/scramble' split-button in the lower right of the Play screen.

View differences:

src/main/java/org/distorted/screens/RubikScreenSolver.java
50 50
  {
51 51
  private static Bitmap[] mBitmap;
52 52
  private ImageButton[] mColorButton;
53
  private ImageButton mBackButton, mSolveButton;
53
  private TransparentImageButton mBackButton, mSolveButton;
54 54
  private boolean mSolving;
55 55
  private int mCurrentColor;
56 56
  private int[] mFaceColors;
......
118 118
    LinearLayout layoutBot = act.findViewById(R.id.lowerBar);
119 119
    layoutBot.removeAllViews();
120 120

  
121
    setupSolveButton(act,width);
122
    setupBackButton(act,width);
121
    setupSolveButton(act);
122
    setupBackButton(act);
123 123

  
124 124
    layoutLeft.addView(mSolveButton);
125 125
    layoutRight.addView(mBackButton);
......
209 209

  
210 210
///////////////////////////////////////////////////////////////////////////////////////////////////
211 211

  
212
  private void setupSolveButton(final RubikActivity act, final float width)
212
  private void setupSolveButton(final RubikActivity act)
213 213
    {
214 214
    final int icon = RubikActivity.getDrawable(R.drawable.ui_small_solve,R.drawable.ui_medium_solve, R.drawable.ui_big_solve, R.drawable.ui_huge_solve);
215
    mSolveButton = new TransparentImageButton(act,icon,width, LinearLayout.LayoutParams.MATCH_PARENT);
215
    mSolveButton = new TransparentImageButton(act,icon,LinearLayout.LayoutParams.MATCH_PARENT,TransparentImageButton.GRAVITY_MIDDLE);
216 216

  
217 217
    mSolveButton.setOnClickListener( new View.OnClickListener()
218 218
      {
......
232 232

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

  
235
  private void setupBackButton(final RubikActivity act, final float width)
235
  private void setupBackButton(final RubikActivity act)
236 236
    {
237 237
    final int icon = RubikActivity.getDrawable(R.drawable.ui_small_back,R.drawable.ui_medium_back, R.drawable.ui_big_back, R.drawable.ui_huge_back);
238
    mBackButton = new TransparentImageButton(act, icon, width, LinearLayout.LayoutParams.MATCH_PARENT);
238
    mBackButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE);
239 239

  
240 240
    mBackButton.setOnClickListener( new View.OnClickListener()
241 241
      {

Also available in: Unified diff