mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
11/18/12 12:01 PM (13 years ago)

Can't seem to get icons to show (eclipse/android)

Hi all, Finally getting some progress on android! Current issue: Even through I've placed the icons directly into /assets/BT_Docs/ (then cleaning project), running in the emulator the icons are not there (for both the button menu and navigation bar). Any ideas? Cheers, David https://buzztouchmods.com
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
11/18/12 12:03 PM (13 years ago)
Images are supposed to go in the res/drawable folder in Eclipse/Android. Chris https://www.churchphoneapps.com
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
11/18/12 12:03 PM (13 years ago)
Hi @MrDavid, You check if has the correct path? LA
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
11/18/12 12:05 PM (13 years ago)
Great catch @chris1! LA
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/18/12 12:08 PM (13 years ago)
Chris you rock. Throwing them in there now, I was using Marks adding files to your app documentation but I think he said BT_Docs? I saw some images. https://www.buzztouch.com/files/howtos/Adding_Files_To_A_Project_v1.0.pdf Cheers, David https://buzztouchmods.com
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/18/12 12:13 PM (13 years ago)
Yup works! Gotta say, android is UGLY. The icons take up the entire button (is the button even showing, or just the icons?) for some reason the icons are black on the navigational bar too. Headache. David https://buzztouchmods.com
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
11/18/12 12:16 PM (13 years ago)
Welcome to android..lol it's better than it was though. LA
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/18/12 12:28 PM (13 years ago)
It was WORSE? lol! if(iconName.length() > 1){ if(BT_fileManager.getResourceIdFromBundle("drawable", iconName) > 0){ ImageView i = new ImageView(this); i.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); i.setScaleType(ScaleType.CENTER_INSIDE); i.setMaxWidth(buttonSize); i.setMaxHeight(buttonSize); i.setImageDrawable(BT_fileManager.getDrawableByName(iconName)); bgColor.addView(i); } } Need to make it so that the button menu doesn't take my icons and stretch them over the entire button - scale type doesn't seem to make a difference but it should! http://developer.android.com/reference/android/widget/ImageView.ScaleType.html Any idea? David
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/18/12 01:51 PM (13 years ago)
Example: http://s12.postimage.org/ee78v8gff/button_menu.png Looks like android won't even show the button background, instead, it makes the background disapear, and then streches my icons rather then just centering them inside the button. Changes to i.setScaleType(ScaleType.CENTER_INSIDE); seem to have no effect (CENTER_CROP, etc), even after saving and cleaning. I would feel humiliated giving this app to my client as is, the android version looks horrid, any help would be appreciated from you android guru's! Cheers and thanks so much! David https://buzztouchmods.com
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
11/18/12 02:34 PM (13 years ago)
Haha! Feel our PAIN you smug iOS devs! If you can make a good looking android app that actually works you can do ANYTHING! Seriously, as a general rule, the src folder is for functionality and the res folder is for layout/design, so find the relevant code in the xml file in the res folder and try adding something like: android:scaleType="center" or android:scaleType="centerCrop" etc or even an exact dimension: android:maxWidth="72dp" android:maxHeight="72dp" On the plus side, there's a lot of flexibility with android, so two people might produce two similar app but write very different code.
 
munny1
Veteran developer
Profile
Posts: 176
Reg: Jun 20, 2012
Earth
8,010
like
11/18/12 03:31 PM (13 years ago)
This is why I am not on Android (thank goodness)! @David good luck w/ the button issue!
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/18/12 04:21 PM (13 years ago)
LOL rave! Evil little android dev. I tried adding android:scaleType="centerCrop"; into screen_menubuttons.xml, but I just received a error. If someone can hop on teamviewer and give it a go, I'll give you a hug. EDIT: I'm attempting to mess with menu_buttons_item.xml, all of these xml and java files, what's the difference? David https://buzztouchmods.com
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
11/18/12 05:15 PM (13 years ago)
pm'd @MrDavid
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/18/12 05:58 PM (13 years ago)
Got your PM, will reply. Still looking for a solution, it seems almost NONE of the changes I make even effect the buttons slightly - super frustrating. David https://buzztouchmods.com
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
11/19/12 06:42 AM (13 years ago)
@MrDavid, The java screen handles the action of the xml interface, which is how I remember them. Did you try using "Gravity" which might help. You tring to center them or make them smaller? LA
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
11/19/12 08:07 AM (13 years ago)
and then once you get all those buttons set-up and aligned... Just wait until someone with a large device shows it to you and they are all over the place again. Unfortunately I've not had good luck custoimizing Android to this degree yet. I'm itching to play with that Graphical Builder, but no time currently. A simple button layout would be do-able in that, but modifying Davids source to resize these is gong to be a tricky job. you can keep copying and modifying the xml files.... Best advice I can give now is to not try to duplicate the ios app. Android IS different. Don't be afraid to change the design to fit the functionality you have. you might call it a trade off of sorts. I have much better luck when i approach android as NOT trying to mimmic an ios app. and for sure read this... http://coding.smashingmagazine.com/2011/06/30/designing-for-android/
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
11/19/12 08:51 AM (13 years ago)
You only need to put them in the folders m and high/density and they will crop themselves. At least this is my experience. LA
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
11/19/12 09:13 AM (13 years ago)
 

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.