Libraryless. Click here for Pure Java version (1202L/8K/29K).
| 1 | !7 | 
| 2 | |
| 3 | import android.widget.*; | 
| 4 | import android.view.View; | 
| 5 | |
| 6 | p {
 | 
| 7 |   androidUI(r {
 | 
| 8 | LinearLayout ll = new LinearLayout(androidActivity()); | 
| 9 | ll.setOrientation(ll.HORIZONTAL); | 
| 10 |     Button btn = aButton("TEST");
 | 
| 11 | ll.addView(btn); | 
| 12 | LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( | 
| 13 | LinearLayout.LayoutParams.WRAP_CONTENT, | 
| 14 | LinearLayout.LayoutParams.WRAP_CONTENT); | 
| 15 | params.gravity = 1; // center_horizontal | 
| 16 | btn.setLayoutParams(params); | 
| 17 | btn.setGravity(1); | 
| 18 | androidShow(aCenterAndSouth(new ASingleComponentPanel, ll)); | 
| 19 | //androidShow(new ASingleComponentPanel); | 
| 20 | }); | 
| 21 | } | 
Began life as a copy of #1008243
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, nbgitpuheiab, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1008253 | 
| Snippet name: | Try to center a LinearLayout horizontally [ARGH] | 
| Eternal ID of this version: | #1008253/13 | 
| Text MD5: | 673e3e8ea1c1dc9d6163b912921de07c | 
| Transpilation MD5: | b9aef14f2a06035cb3d289a7a78d496e | 
| Author: | stefan | 
| Category: | javax / android | 
| Type: | JavaX source code (Android) | 
| Public (visible to everyone): | Yes | 
| Archived (hidden from active list): | No | 
| Created/modified: | 2017-05-03 13:20:16 | 
| Source code size: | 630 bytes / 21 lines | 
| Pitched / IR pitched: | No / No | 
| Views / Downloads: | 723 / 820 | 
| Version history: | 12 change(s) | 
| Referenced in: | [show references] |