Revision 4fb1fc0d
Added by Leszek Koltunski over 5 years ago
| src/main/java/org/distorted/states/RubikStateDone.java | ||
|---|---|---|
| 23 | 23 |
import android.util.TypedValue; |
| 24 | 24 |
import android.view.LayoutInflater; |
| 25 | 25 |
import android.view.View; |
| 26 |
import android.widget.Button; |
|
| 26 |
import android.widget.ImageButton;
|
|
| 27 | 27 |
import android.widget.LinearLayout; |
| 28 | 28 |
import android.widget.TextView; |
| 29 | 29 |
|
| ... | ... | |
| 62 | 62 |
layoutBot.removeAllViews(); |
| 63 | 63 |
|
| 64 | 64 |
LinearLayout.LayoutParams paramsL = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1); |
| 65 |
LinearLayout.LayoutParams paramsR = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,2); |
|
| 66 |
|
|
| 65 | 67 |
LinearLayout layoutLeft = new LinearLayout(act); |
| 66 | 68 |
layoutLeft.setLayoutParams(paramsL); |
| 67 | 69 |
LinearLayout layoutRight = new LinearLayout(act); |
| 68 |
layoutRight.setLayoutParams(paramsL);
|
|
| 70 |
layoutRight.setLayoutParams(paramsR);
|
|
| 69 | 71 |
|
| 70 | 72 |
int padding = (int)(width*RubikActivity.PADDING); |
| 71 | 73 |
int margin = (int)(width*RubikActivity.MARGIN); |
| ... | ... | |
| 76 | 78 |
params.leftMargin = margin; |
| 77 | 79 |
params.rightMargin = margin; |
| 78 | 80 |
|
| 79 |
Button back = new Button(act); |
|
| 81 |
final int icon = RubikActivity.getDrawable(R.drawable.ui_small_back,R.drawable.ui_medium_back, R.drawable.ui_big_back, R.drawable.ui_huge_back); |
|
| 82 |
|
|
| 83 |
ImageButton back = new ImageButton(act); |
|
| 80 | 84 |
back.setLayoutParams(params); |
| 81 | 85 |
back.setPadding(padding,0,padding,0); |
| 82 |
back.setTextSize(TypedValue.COMPLEX_UNIT_PX, buttonSize); |
|
| 83 |
back.setText(R.string.back); |
|
| 86 |
back.setImageResource(icon); |
|
| 84 | 87 |
|
| 85 | 88 |
back.setOnClickListener( new View.OnClickListener() |
| 86 | 89 |
{
|
Also available in: Unified diff
Progress with UI