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