Revision dd874ae8
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/helpers/MovesController.java | ||
---|---|---|
23 | 23 |
|
24 | 24 |
import android.app.Activity; |
25 | 25 |
import android.view.View; |
26 |
import android.widget.ImageButton; |
|
27 | 26 |
import android.widget.LinearLayout; |
28 | 27 |
|
29 | 28 |
import org.distorted.objectlib.helpers.MovesFinished; |
... | ... | |
54 | 53 |
private final ArrayList<Move> mMoves; |
55 | 54 |
private boolean mCanPrevMove; |
56 | 55 |
private ObjectControl mControl; |
57 |
private ImageButton mPrevButton; |
|
56 |
private TransparentImageButton mPrevButton;
|
|
58 | 57 |
|
59 | 58 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
60 | 59 |
// PUBLIC API |
... | ... | |
126 | 125 |
public void run() |
127 | 126 |
{ |
128 | 127 |
if( mPrevButton!=null ) |
129 |
mPrevButton.setImageResource(getPrevIcon(on));
|
|
128 |
mPrevButton.setIconResource(getPrevIcon(on));
|
|
130 | 129 |
} |
131 | 130 |
}); |
132 | 131 |
} |
... | ... | |
164 | 163 |
|
165 | 164 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
166 | 165 |
|
167 |
public void setupButton(final Activity act, ObjectControl control, final float width)
|
|
166 |
public void setupButton(final Activity act, ObjectControl control) |
|
168 | 167 |
{ |
169 | 168 |
final int icon = getPrevIcon( !mMoves.isEmpty() ); |
170 |
mPrevButton = new TransparentImageButton(act, icon, width, LinearLayout.LayoutParams.MATCH_PARENT);
|
|
169 |
mPrevButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE);
|
|
171 | 170 |
|
172 | 171 |
mPrevButton.setOnClickListener( new View.OnClickListener() |
173 | 172 |
{ |
... | ... | |
181 | 180 |
|
182 | 181 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
183 | 182 |
|
184 |
public ImageButton getButton() |
|
183 |
public TransparentImageButton getButton()
|
|
185 | 184 |
{ |
186 | 185 |
return mPrevButton; |
187 | 186 |
} |
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.