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/RubikScreenSolving.java
26 26
import android.util.TypedValue;
27 27
import android.view.LayoutInflater;
28 28
import android.view.View;
29
import android.widget.ImageButton;
30 29
import android.widget.LinearLayout;
31 30
import android.widget.TextView;
32 31

  
......
49 48
  private boolean mRunning;
50 49
  private final RubikScores mScores;
51 50
  private long mElapsed;
52
  private ImageButton mBackButton;
51
  private TransparentImageButton mBackButton;
53 52

  
54 53
///////////////////////////////////////////////////////////////////////////////////////////////////
55 54

  
......
85 84
    mTime.setText(act.getString(R.string.tm_placeholder,elapsed/60,elapsed%60));
86 85
    layoutTop.addView(mTime);
87 86

  
88
    setupBackButton(act,width);
89
    createBottomPane(act,width,mBackButton);
87
    setupBackButton(act);
88
    createBottomPane(act,mBackButton,null);
90 89
    }
91 90

  
92 91
///////////////////////////////////////////////////////////////////////////////////////////////////
93 92

  
94
  private void setupBackButton(final RubikActivity act, final float width)
93
  private void setupBackButton(final RubikActivity act)
95 94
    {
96 95
    int icon = RubikActivity.getDrawable(R.drawable.ui_small_back,R.drawable.ui_medium_back, R.drawable.ui_big_back, R.drawable.ui_huge_back);
97
    mBackButton = new TransparentImageButton(act, icon, width, LinearLayout.LayoutParams.MATCH_PARENT);
96
    mBackButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE);
98 97

  
99 98
    mBackButton.setOnClickListener( new View.OnClickListener()
100 99
      {

Also available in: Unified diff