Revision 15846fe4
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/states/RubikStateReady.java | ||
---|---|---|
25 | 25 |
import android.view.LayoutInflater; |
26 | 26 |
import android.view.View; |
27 | 27 |
import android.widget.Button; |
28 |
import android.widget.ImageButton; |
|
28 | 29 |
import android.widget.LinearLayout; |
29 | 30 |
import android.widget.TextView; |
30 | 31 |
|
... | ... | |
35 | 36 |
|
36 | 37 |
public class RubikStateReady extends RubikStateAbstract |
37 | 38 |
{ |
39 |
private ImageButton mPrevButton; |
|
40 |
|
|
41 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
42 |
|
|
38 | 43 |
void leaveState(RubikActivity act) |
39 | 44 |
{ |
40 | 45 |
|
... | ... | |
64 | 69 |
LinearLayout layoutLeft = act.findViewById(R.id.mainBarLeft); |
65 | 70 |
layoutLeft.removeAllViews(); |
66 | 71 |
|
72 |
setupPrevMoveButtom(act,scale,width); |
|
73 |
layoutLeft.addView(mPrevButton); |
|
74 |
|
|
67 | 75 |
LinearLayout layoutRight = act.findViewById(R.id.mainBarRight); |
68 | 76 |
layoutRight.removeAllViews(); |
69 | 77 |
|
... | ... | |
88 | 96 |
layoutRight.addView(back); |
89 | 97 |
} |
90 | 98 |
|
99 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
100 |
|
|
101 |
private void setupPrevMoveButtom(final RubikActivity act, float scale, float width) |
|
102 |
{ |
|
103 |
int padding = (int)( 3*scale + 0.5f); |
|
104 |
int widthBut= (int)(width/6); |
|
105 |
|
|
106 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(widthBut,LinearLayout.LayoutParams.MATCH_PARENT); |
|
107 |
mPrevButton = new ImageButton(act); |
|
108 |
mPrevButton.setLayoutParams(params); |
|
109 |
mPrevButton.setPadding(padding,0,padding,0); |
|
110 |
mPrevButton.setImageResource(R.drawable.cube_back); |
|
111 |
|
|
112 |
mPrevButton.setOnClickListener( new View.OnClickListener() |
|
113 |
{ |
|
114 |
@Override |
|
115 |
public void onClick(View v) |
|
116 |
{ |
|
117 |
// empty |
|
118 |
} |
|
119 |
}); |
|
120 |
} |
|
121 |
|
|
91 | 122 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
92 | 123 |
|
93 | 124 |
public void savePreferences(SharedPreferences.Editor editor) |
Also available in: Unified diff
cube_back and cube_solve buttons.