Revision 4c0cd600
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/uistate/RubikStateSolving.java | ||
---|---|---|
72 | 72 |
layoutTop.addView(mTime); |
73 | 73 |
|
74 | 74 |
// BOT //////////////////////////// |
75 |
LinearLayout layoutBot = act.findViewById(R.id.mainBar); |
|
76 |
layoutBot.removeAllViews(); |
|
75 |
LinearLayout layoutLeft = act.findViewById(R.id.mainBarLeft); |
|
76 |
layoutLeft.removeAllViews(); |
|
77 |
LinearLayout layoutRight = act.findViewById(R.id.mainBarRight); |
|
78 |
layoutRight.removeAllViews(); |
|
77 | 79 |
|
78 | 80 |
DisplayMetrics metrics = act.getResources().getDisplayMetrics(); |
79 | 81 |
float scale = metrics.density; |
80 |
int size = (int)(60*scale +0.5f); |
|
81 | 82 |
int padding = (int)(5*scale + 0.5f); |
82 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,size,0.5f); |
|
83 |
|
|
84 |
Button buttonL = new Button(act); |
|
85 |
buttonL.setLayoutParams(params); |
|
86 |
buttonL.setId(BUTTON_ID_BACK); |
|
87 |
buttonL.setPadding(padding,0,padding,0); |
|
88 |
buttonL.setText(R.string.back); |
|
89 |
buttonL.setOnClickListener(act); |
|
90 |
layoutBot.addView(buttonL); |
|
83 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT); |
|
91 | 84 |
|
92 | 85 |
mBack = new Button(act); |
93 | 86 |
mBack.setLayoutParams(params); |
... | ... | |
95 | 88 |
mBack.setPadding(padding,0,padding,0); |
96 | 89 |
mBack.setText(R.string.back); |
97 | 90 |
mBack.setOnClickListener(act); |
98 |
layoutBot.addView(mBack); |
|
99 |
|
|
100 |
buttonL.setVisibility(android.view.View.INVISIBLE); |
|
91 |
layoutRight.addView(mBack); |
|
101 | 92 |
} |
102 | 93 |
|
103 | 94 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Change the series of Object buttons in the Play state into a PopupWindow.