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/RubikScreenReady.java
23 23
import android.util.TypedValue;
24 24
import android.view.LayoutInflater;
25 25
import android.view.View;
26
import android.widget.ImageButton;
27 26
import android.widget.LinearLayout;
28 27
import android.widget.TextView;
29 28

  
......
35 34

  
36 35
public class RubikScreenReady extends RubikScreenBase
37 36
  {
38
  private ImageButton mBackButton;
37
  private TransparentImageButton mBackButton;
39 38

  
40 39
///////////////////////////////////////////////////////////////////////////////////////////////////
41 40

  
......
60 59
    label.setText(R.string.ready);
61 60
    layoutTop.addView(label);
62 61

  
63
    setupBackButton(act,width);
64
    createBottomPane(act,width,mBackButton);
62
    setupBackButton(act);
63
    createBottomPane(act,mBackButton,null);
65 64
    }
66 65

  
67 66
///////////////////////////////////////////////////////////////////////////////////////////////////
68 67

  
69
  private void setupBackButton(final RubikActivity act, final float width)
68
  private void setupBackButton(final RubikActivity act)
70 69
    {
71 70
    int icon = RubikActivity.getDrawable(R.drawable.ui_small_back,R.drawable.ui_medium_back, R.drawable.ui_big_back, R.drawable.ui_huge_back);
72
    mBackButton = new TransparentImageButton(act, icon, width, LinearLayout.LayoutParams.MATCH_PARENT);
71
    mBackButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE);
73 72

  
74 73
    mBackButton.setOnClickListener( new View.OnClickListener()
75 74
      {

Also available in: Unified diff