Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 291

mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
01/11/13 08:12 PM (13 years ago)

Tutorial Android: Customize Android Menu Button Padding

In case you want push your button menu down to your Android button menus or start the menu near the middle, while keeping the grid option. Here is how you do it.. In your Android Project go to around line: 442 in the src/BT_screen_menuButtons.java file //table row holds parts... TableRow tr = null; if(tmpRowCounter < buttonsPerRow){ tr = new TableRow(this); tr.setLayoutParams(trLp); tr.setPadding(0, 0, 0, 0); } For my app I changed the value in the tr.setPadding from (0,0,0,0) to the following: tr.setPadding(10, 350, 20, 50); Edit: Explanation of the values above credit to @eJucomm first value left margin second value, top. all rows will get lower together when value goes higher Second to last value cuts off on the right side if larger than 20 Last value, between rows. Higher value larger margin between Before http://www.snurlz.com/wp-content/uploads/padding1android.png After http://www.snurlz.com/wp-content/uploads/padding2android.png Have fun! I'll follow up with the same instructions for iOS that was first introduced to me by Broomla in a forum posted based on one of his apps!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/11/13 11:31 PM (13 years ago)
Great stuff, thanks! Cheers! -- Smug
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
01/11/13 11:31 PM (13 years ago)
Yup yup. Another good tip!
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
01/11/13 11:49 PM (13 years ago)
Ace! Always wanted to know how to do this. Thanks.
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/12/13 07:15 AM (13 years ago)
Great tip @mysps! LA
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
01/12/13 09:18 AM (13 years ago)
thanks, great stuff. used this hack a while back. Def miss seeing broomla @ here. last time I saw him I sent him some animation code and he's been in the hinterlands since. Hope he's well, he was brilliant and had a great design eye. I'm guessing he's conversing with some more techie ios types somewhere, he really wanted to talk complex methods and stuff.
 
HelperDev
Lost but trying
Profile
Posts: 49
Reg: Nov 16, 2012
New York
3,090
like
01/31/14 11:27 AM (11 years ago)
Worked for me, thanks!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.