Revision dd874ae8
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/screens/RubikScreenDone.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 |
|
... | ... | |
39 | 38 |
|
40 | 39 |
public class RubikScreenDone extends RubikScreenAbstract |
41 | 40 |
{ |
42 |
private ImageButton mBackButton; |
|
41 |
private TransparentImageButton mBackButton;
|
|
43 | 42 |
|
44 | 43 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
45 | 44 |
|
... | ... | |
76 | 75 |
LinearLayout layoutRight = new LinearLayout(act); |
77 | 76 |
layoutRight.setLayoutParams(paramsR); |
78 | 77 |
|
79 |
setupBackButton(act,width);
|
|
78 |
setupBackButton(act); |
|
80 | 79 |
|
81 | 80 |
layoutRight.addView(mBackButton); |
82 | 81 |
layoutBot.addView(layoutLeft); |
... | ... | |
85 | 84 |
|
86 | 85 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
87 | 86 |
|
88 |
private void setupBackButton(final RubikActivity act, final float width)
|
|
87 |
private void setupBackButton(final RubikActivity act) |
|
89 | 88 |
{ |
90 | 89 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_back,R.drawable.ui_medium_back, R.drawable.ui_big_back, R.drawable.ui_huge_back); |
91 |
mBackButton = new TransparentImageButton(act, icon, width, LinearLayout.LayoutParams.MATCH_PARENT);
|
|
90 |
mBackButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE);
|
|
92 | 91 |
|
93 | 92 |
mBackButton.setOnClickListener( new View.OnClickListener() |
94 | 93 |
{ |
Also available in: Unified diff
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.