[android-developers] Re: Drawable Query
Sadly, Android doesn't support sub folders. Nothing to do here. On Tuesday, October 9, 2012 8:47:47 PM UTC+2, Daz wrote: I am working on a simple animation using the animation-list attribute. I have all my sequenced images in the drawable-xhdpi folder and the first line of my XML looks like this: item android:drawable=@drawable/animation_0 android:duration=30 / To keep things tidy, I decided to create a new folder called seq inside of the drawable-xhdpi and moved my images inside. Of course I got errors in my animation.xml file, so I changed the first line to: item android:drawable=@drawable/seq/animation_0 android:duration= 30 / Still showing an error so could someone help. Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Drawable Query
Sounds like you want to use assets instead of resources. Assets support subfolders. On Tuesday, October 9, 2012 1:47:47 PM UTC-5, Daz wrote: I am working on a simple animation using the animation-list attribute. I have all my sequenced images in the drawable-xhdpi folder and the first line of my XML looks like this: item android:drawable=@drawable/animation_0 android:duration=30 / To keep things tidy, I decided to create a new folder called seq inside of the drawable-xhdpi and moved my images inside. Of course I got errors in my animation.xml file, so I changed the first line to: item android:drawable=@drawable/seq/animation_0 android:duration= 30 / Still showing an error so could someone help. Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Drawable is not drawn after setDrawableByLayerId
Since this hits the top of my search list for this issue, I thought I would give this thread an answer... From what I can tell, LayerDrawable. setDrawableByLayerId is useless on lots of devices (strangely works well on Nexus S). I suggest building a new LayerDrawable instead. On Wednesday, February 3, 2010 1:06:12 PM UTC-6, tt6 wrote: Hi, I'm having a problem with displaying a drawable. I have a ImageButton and a LayerDrawable. I set up an array of Drawable that has one Drawable for the background (index 0) and one for the image (index 1). The button would display different background on different states of the button. What I've done is when the button state changes I replace the background Drawable like: elements[0] = background drawable object elements[1] = image drawable object layers = new LayerDrawable(elements); layers.setId(0, 0); layers.setId(1, 1); ... LayerDrawable ld = (LayerDrawable)button.getDrawable(); boolean result = ld.setDrawableByLayerId(0, new backgroundDrawable); ... The problem is the initial old background is gone but the new one is not displayed. What have I done wrong or missed? Thank you! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Drawable set on an ImageView ignores setBounds and reverts to original bounds on orientation change.
Anyone? I'd appreciate any pointers. I can't even figure out whether this is a bug or a coding error. On Feb 24, 10:49 am, Kiran Rao techie.curi...@gmail.com wrote: I've been struggling with this strange problem for quite some time. A brief summary of the issue is this: An ImageView's Drawable in portrait orientation with a certain bounds set on it, on changing orientation and returning to portrait, does not retain the set bounds. Instead it reverts to its original bounds. This is in spite of forcefully setting the explicit bounds on orientation change. Do note that any bounds that you later set on Click etc are obeyed. I worked around this by abandoning the ImageView in favor of a custom View object and setting the Drawable using drawBitmap() within onDraw(). But could anyone point out what I was doing wrong in the ImageView approach? Links describing the issue in detail: 1) StackOverflow thread -http://stackoverflow.com/q/9237932/570930 2) Sample project illustrating the issue, a debug version which logs in more detail, and my solution involving custom View - Uploaded on Google Project Hosting -http://code.google.com/p/android-drawable--invalidation-on-orientatio... Thanks in Advance Regards, Kiran Rao. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: drawable resources is stored in RAM at startup?
Thanks, could any explain why this happened, I want to know memory strategy for Drawable? On 19 Лис, 22:04, Dianne Hackborn hack...@android.com wrote: You shouldn't modify a Drawable without first calling .mutate() on it (and using the Drawable that is returned, no the original). On Fri, Nov 19, 2010 at 6:39 AM, viktor victor.scherb...@gmail.com wrote: Hi everyone, Drawable resource is set as background for second layouts (Second activity). My problem is, I get Drawable from resources end set color filter to that, than I set this drawable to layout (First activity). On second activity I don't set color filter but background remain the same. How does an app work with resources, is it cache effect or reference to the same drawable in RAM? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: drawable resources is stored in RAM at startup?
On Fri, Nov 19, 2010 at 1:39 PM, viktor victor.scherb...@gmail.com wrote: could any explain why this happened, I want to know memory strategy for Drawable? It generally is described in the documentation for that method: http://developer.android.com/reference/android/graphics/drawable/Drawable.html#mutate() Because drawables are used a *lot* it is very valuable to not have to have a totally separate copy of each of them for the vast majority of cases where this isn't needed. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Drawable not maintaining size within an ImageView
Sorry! Just to clarify, I've also tried setting the ImageView's layout params as per the example using: drawableContainer.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); Thanks! On Jun 30, 10:04 am, Cardy andy.ca...@gmail.com wrote: Hi, I'm trying to add a drawable to a layout, using an ImageView, but the drawable doesn't maintain its size and is rendered at 1dp x 1dp. I've called ImageView.setAdjustViewBounds as per the android documentation but this doesn't seem to help. The Drawable is only visible when the ImageView's height and width are set and the drawable is then rendered at those dimensions. Here's the code and layout: rect_blue.xml --- ?xml version=1.0 encoding=utf-8? shape xmlns:android=http://schemas.android.com/apk/res/android; android:height=50dp android:width=100dp android:shape=rectangle solid android:color=#00FF / corners android:radius=5dp / /shape FlipView.java (Derived from FrameLayout) --- ImageView drawableContainer = new ImageView(context); drawableContainer.setImageResource(R.drawable.rect_blue); drawableContainer.setAdjustViewBounds(true); this.AddView(drawableContainer); Layout Overview -- RelativeLayout - FrameLayout - ImageView (With drawable set as content) I'm sure I'm doing pretty much exacly the same as the example here:http://developer.android.com/guide/topics/graphics/2d-graphics.html. Could it be because I'm using a FrameLayout that this is not working? Thanks! Andy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Drawable resource images
Thanks for the reply. Is there a maximum length to the name of a drawable resource? On May 28, 4:02 pm, Mark Murphy mmur...@commonsware.com wrote: John Gaby wrote: Can I have sub-folders to hold my drawable resources. For example can I store an image in, say, 'res/drawable/content/images/myimage.jpg' and then find that resource via a call to: id = context.getResources().getIdentifier(com.mycompany.myprog:drawable/ content/images/myimage, null, null); No, sorry. Also, are jpeg files supported and drawable resources? Yes: http://developer.android.com/guide/appendix/media-formats.html -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.0 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Drawable resource images
John Gaby wrote: Thanks for the reply. Is there a maximum length to the name of a drawable resource? Probably. Whatever the maximum length of a Java identifier is would likely be the limiting factor. Don't know what that is off the top of my head though. 256? 128? -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.0 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Drawable resource images
According to the Java Language Specifications: An identifier is an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter. (Section 3.8) On Fri, May 28, 2010 at 4:18 PM, Mark Murphy mmur...@commonsware.com wrote: John Gaby wrote: Thanks for the reply. Is there a maximum length to the name of a drawable resource? Probably. Whatever the maximum length of a Java identifier is would likely be the limiting factor. Don't know what that is off the top of my head though. 256? 128? -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.0 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Drawable resource XML alias
On May 15, 4:38 pm, String sterling.ud...@googlemail.com wrote: On May 15, 7:07 am, skink psk...@gmail.com wrote: BitmapDrawable bd = (BitmapDrawable) res.getDrawable(R.drawable.name2) and then: bd.getBitmap() IIRC Ha, that did the trick. Apparently Resources.getDrawable() works with an XML drawable proxy, but BitmapFactory.decodeResource() does not. Unless someone has a good explanation why this would be so, I'm inclined to call that a bug and write it up at b.android.com. Anyone? no, it's not a bug everything in res/drawable/*.xml is a Drawable (BitmapDrawable, GradientDrawable, etc), you can decode only ordinary images (.png, .jog, .gif) - however i'm not sure if you can decode .9.pngs (nine patch drawables) pskink -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Drawable resource XML alias
On May 15, 2:59 am, String sterling.ud...@googlemail.com wrote: On May 14, 6:12 pm, Mark Murphy mmur...@commonsware.com wrote: http://idunnolol.com/android/drawables.html Thanks for this link. Hadn't seen that one before. Your syntax may work just as is. Unfortunately, it doesn't. I thought it looked plausible too, but naturally I tried it (along with a host of other variations) before posting here. A call to BitmapFactory.decodeResource(resources, R.drawable.name2) returns null with every XML syntax I've tried, including the one from my original post. So, has anyone gotten this to work? bitmap tag defines BitmapDrawable so you can call: BitmapDrawable bd = (BitmapDrawable) res.getDrawable(R.drawable.name2) and then: bd.getBitmap() IIRC pskink -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Drawable resource XML alias
On May 15, 7:07 am, skink psk...@gmail.com wrote: BitmapDrawable bd = (BitmapDrawable) res.getDrawable(R.drawable.name2) and then: bd.getBitmap() IIRC Ha, that did the trick. Apparently Resources.getDrawable() works with an XML drawable proxy, but BitmapFactory.decodeResource() does not. Unless someone has a good explanation why this would be so, I'm inclined to call that a bug and write it up at b.android.com. Anyone? FWIW, my final XML syntax looks like this: ?xml version=1.0 encoding=UTF-8? bitmap xmlns:android=http://schemas.android.com/apk/res/android; android:src=@drawable/name1/bitmap I'm not sure if the android namespace is required, but it works like this, and it's probably good practice. String -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Drawable resource XML alias
On May 14, 6:12 pm, Mark Murphy mmur...@commonsware.com wrote: http://idunnolol.com/android/drawables.html Thanks for this link. Hadn't seen that one before. Your syntax may work just as is. Unfortunately, it doesn't. I thought it looked plausible too, but naturally I tried it (along with a host of other variations) before posting here. A call to BitmapFactory.decodeResource(resources, R.drawable.name2) returns null with every XML syntax I've tried, including the one from my original post. So, has anyone gotten this to work? String -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: drawable-hdpi not appearing in eclipse emulator
In fairness, Cameron, the docs don't actually say that android:anyDensity=false causes resources to be pulled from mdpi. The documentation for that attribute is buried in the middle of the Support for Multiple Screens page, and mostly talks about pixel density math. The confusion is compounded by the fact that, as Dianne says, the system is able to pull some resources from other directories anyway. I know it caused me some hair-pulling when I first started into serious multiple-density support; adding a sentence like the system will pull resources from the mdpi folder to the docs could be of real benefit. String On May 12, 4:40 am, Dianne Hackborn hack...@android.com wrote: Again, if you want to support multiple densities DON'T SAY YOU DON'T SUPPORT THEM. Seriously! :) The first thing to do is get rid of android:anyDensity=false so the system doesn't try to make your app think it is running in mdpi. If you still have problems after that, then we can talk about that. But until you stop telling the system to do this to you, I don't see much of a problem that it is in fact doing it. On Tue, May 11, 2010 at 1:45 PM, Cameron.M.Johnson cameron.m.john...@gmail.com wrote: This is from the Android Dev Guide http://developer.android.com/guide/ practices/screens_support.html Pre-scaling of resources (such as image assets) For example, if the current screen's density is high, the platform loads resources that are tagged with the qualifier hdpi and uses them without scaling. If no such resources are available, the platform uses the default resources instead, scaling them from the baseline density (medium) to high. This is what I based my question off of. Here it says as long as I have the hdpi qualifier, it will automatically choose images from that folder for a high density screen. Is this not correct or am I missing something? I could always hard code statements to check the current screens density and preload the PNG graphics that correspond to it. I am just curious if this actually works. The upscaling of the graphics work, but not the automatic qualifier choosing. Cam On May 11, 1:28 pm, Dianne Hackborn hack...@android.com wrote: You told it you don't support densities with android:anyDensity=false. Thus it will run your app as if it is the original density, mdpi. In some cases the framework may be able to actually load the correct density resource and seamlessly use it while you still think you are running in mdpi... but not always, and really, if you are coding your app to support multiple densities, you shouldn't tell Android that you don't support densities. :) On Tue, May 11, 2010 at 12:01 PM, Cameron.M.Johnson cameron.m.john...@gmail.com wrote: Hi there, So I have this game running on Android 1.6, and I put the different density images in their respective folders res/drawable-hdpi/image.png res/drawable-mdpi/image.png res/drawable-ldpi/image.png I made each image a different color so I can tell if it is loading the right image. When I test my program on different density screens it only chooses the mdpi images. It scales them to match the correct dpi but doesn't choose the right folder. It just defaults to mdpi. In the manifest I have, android:normalScreens=true android:anyDensity=false Anyone have a similar problem? I'm sure it is something simple that I am overlooking but I can't figure it out. From what I read on the Android Support Multiple Screens guide is that you should just have to put the different density images in their correct folders and Android will do the rest. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.comandroid-developers%252Bu nsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group athttp://
[android-developers] Re: drawable-hdpi not appearing in eclipse emulator
This is from the Android Dev Guide http://developer.android.com/guide/ practices/screens_support.html Pre-scaling of resources (such as image assets) For example, if the current screen's density is high, the platform loads resources that are tagged with the qualifier hdpi and uses them without scaling. If no such resources are available, the platform uses the default resources instead, scaling them from the baseline density (medium) to high. This is what I based my question off of. Here it says as long as I have the hdpi qualifier, it will automatically choose images from that folder for a high density screen. Is this not correct or am I missing something? I could always hard code statements to check the current screens density and preload the PNG graphics that correspond to it. I am just curious if this actually works. The upscaling of the graphics work, but not the automatic qualifier choosing. Cam On May 11, 1:28 pm, Dianne Hackborn hack...@android.com wrote: You told it you don't support densities with android:anyDensity=false. Thus it will run your app as if it is the original density, mdpi. In some cases the framework may be able to actually load the correct density resource and seamlessly use it while you still think you are running in mdpi... but not always, and really, if you are coding your app to support multiple densities, you shouldn't tell Android that you don't support densities. :) On Tue, May 11, 2010 at 12:01 PM, Cameron.M.Johnson cameron.m.john...@gmail.com wrote: Hi there, So I have this game running on Android 1.6, and I put the different density images in their respective folders res/drawable-hdpi/image.png res/drawable-mdpi/image.png res/drawable-ldpi/image.png I made each image a different color so I can tell if it is loading the right image. When I test my program on different density screens it only chooses the mdpi images. It scales them to match the correct dpi but doesn't choose the right folder. It just defaults to mdpi. In the manifest I have, android:normalScreens=true android:anyDensity=false Anyone have a similar problem? I'm sure it is something simple that I am overlooking but I can't figure it out. From what I read on the Android Support Multiple Screens guide is that you should just have to put the different density images in their correct folders and Android will do the rest. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: drawable-hdpi not appearing in eclipse emulator
Again, if you want to support multiple densities DON'T SAY YOU DON'T SUPPORT THEM. Seriously! :) The first thing to do is get rid of android:anyDensity=false so the system doesn't try to make your app think it is running in mdpi. If you still have problems after that, then we can talk about that. But until you stop telling the system to do this to you, I don't see much of a problem that it is in fact doing it. On Tue, May 11, 2010 at 1:45 PM, Cameron.M.Johnson cameron.m.john...@gmail.com wrote: This is from the Android Dev Guide http://developer.android.com/guide/ practices/screens_support.html Pre-scaling of resources (such as image assets) For example, if the current screen's density is high, the platform loads resources that are tagged with the qualifier hdpi and uses them without scaling. If no such resources are available, the platform uses the default resources instead, scaling them from the baseline density (medium) to high. This is what I based my question off of. Here it says as long as I have the hdpi qualifier, it will automatically choose images from that folder for a high density screen. Is this not correct or am I missing something? I could always hard code statements to check the current screens density and preload the PNG graphics that correspond to it. I am just curious if this actually works. The upscaling of the graphics work, but not the automatic qualifier choosing. Cam On May 11, 1:28 pm, Dianne Hackborn hack...@android.com wrote: You told it you don't support densities with android:anyDensity=false. Thus it will run your app as if it is the original density, mdpi. In some cases the framework may be able to actually load the correct density resource and seamlessly use it while you still think you are running in mdpi... but not always, and really, if you are coding your app to support multiple densities, you shouldn't tell Android that you don't support densities. :) On Tue, May 11, 2010 at 12:01 PM, Cameron.M.Johnson cameron.m.john...@gmail.com wrote: Hi there, So I have this game running on Android 1.6, and I put the different density images in their respective folders res/drawable-hdpi/image.png res/drawable-mdpi/image.png res/drawable-ldpi/image.png I made each image a different color so I can tell if it is loading the right image. When I test my program on different density screens it only chooses the mdpi images. It scales them to match the correct dpi but doesn't choose the right folder. It just defaults to mdpi. In the manifest I have, android:normalScreens=true android:anyDensity=false Anyone have a similar problem? I'm sure it is something simple that I am overlooking but I can't figure it out. From what I read on the Android Support Multiple Screens guide is that you should just have to put the different density images in their correct folders and Android will do the rest. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer
[android-developers] Re: drawable, drawable-land, drawable-hdpi, drawable-mdpi, drawable-lpdi
I looked forever for that, and there it is. Thanks, James On Nov 15, 9:21 pm, adamphillips12 adamphillip...@gmail.com wrote: That would work fine but resource types have precedence, you need to name them correctly. drawable-land-hdpi etc, see the documentation for the full order: http://developer.android.com/guide/topics/resources/resources-i18n.ht... On Nov 16, 2:18 pm, Digital Agua reltubse...@gmail.com wrote: I have a question that I hope someone can help me out with. I have an app that I started in 1.6. It used images that were specific to portrait and landscape layouts. I put these in the corresponding drawable folders, for example: drawable/image01,png drawable-land/image01.png when I created a new project with 2.0 it gave me the following folders. drawable drawable-hdpi drawable-mdpi drawable-lpdi when I look at the documentation around these folders it all seems very straight forward. I assumed that you were able to create the following folders drawable-hdpi-land drawable-mdpi-land drawable-lpdi-land and everything would work as before. The image directory would swap automagically pulling the appropriately laid out image depending on your screen orientation. Unfortunately it does not. The SDK seems to get confused, and if I clean the project, the folders come up as poorly named. Does anybody have any insight as to how this works in 2.0? Any help would be greatly appreciated. Thanks, James -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: drawable, drawable-land, drawable-hdpi, drawable-mdpi, drawable-lpdi
That would work fine but resource types have precedence, you need to name them correctly. drawable-land-hdpi etc, see the documentation for the full order: http://developer.android.com/guide/topics/resources/resources-i18n.html#AlternateResources On Nov 16, 2:18 pm, Digital Agua reltubse...@gmail.com wrote: I have a question that I hope someone can help me out with. I have an app that I started in 1.6. It used images that were specific to portrait and landscape layouts. I put these in the corresponding drawable folders, for example: drawable/image01,png drawable-land/image01.png when I created a new project with 2.0 it gave me the following folders. drawable drawable-hdpi drawable-mdpi drawable-lpdi when I look at the documentation around these folders it all seems very straight forward. I assumed that you were able to create the following folders drawable-hdpi-land drawable-mdpi-land drawable-lpdi-land and everything would work as before. The image directory would swap automagically pulling the appropriately laid out image depending on your screen orientation. Unfortunately it does not. The SDK seems to get confused, and if I clean the project, the folders come up as poorly named. Does anybody have any insight as to how this works in 2.0? Any help would be greatly appreciated. Thanks, James -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Drawable tilemode repat only vertically
hi, only repeat vertically,u can use BitmapDrawable.setTileModeX(int TileMode); 2009/8/19 Klaus Kartou kar...@gmail.com Hi! Is there a way to specify that a drawable should only be repeated vertically and then stretched horizontally? At the momemt I use the following which repeates the drawable both in the vertical and horizontal direction: ?xml version=1.0 encoding=utf-8? bitmap xmlns:android=http://schemas.android.com/apk/res/android; android:src=@drawable/wallpaper android:tileMode=repeat /bitmap Best regards, Klaus --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable
How can we use map to map give one example. plz On Aug 28, 10:21 am, quill quill...@163.com wrote: Use a map to map your key and drawable id. On Aug 28, 12:48 pm, Sasi Kumar sasikumar.it1...@gmail.com wrote: my code is:- Drawabel partlycloud=res.getDrawable(R.drawable.a65_color_31); I have more images like a65_color_31 a66_color_31 a67_color_31 a68_color_31 a69_color_31 a70_color_31 a71_color_31 If user gives input as 67 then my drawable should be Drawabel partlycloud=res.getDrawable(R.drawable.a67_color_31); if it is 70 Drawabel partlycloud=res.getDrawable(R.drawable.a70_color_31); like this i have more than 100 images how can give in simple code with less codes. please reply me.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable
Use a map to map your key and drawable id. On Aug 28, 12:48 pm, Sasi Kumar sasikumar.it1...@gmail.com wrote: my code is:- Drawabel partlycloud=res.getDrawable(R.drawable.a65_color_31); I have more images like a65_color_31 a66_color_31 a67_color_31 a68_color_31 a69_color_31 a70_color_31 a71_color_31 If user gives input as 67 then my drawable should be Drawabel partlycloud=res.getDrawable(R.drawable.a67_color_31); if it is 70 Drawabel partlycloud=res.getDrawable(R.drawable.a70_color_31); like this i have more than 100 images how can give in simple code with less codes. please reply me.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable
HI Put the resources in to the integer array from call like this image=BitmapFactory.decodeStream(context.getResources() .openRawResource(images[i])); On Fri, Aug 28, 2009 at 10:18 AM, Sasi Kumar sasikumar.it1...@gmail.comwrote: my code is:- Drawabel partlycloud=res.getDrawable(R.drawable.a65_color_31); I have more images like a65_color_31 a66_color_31 a67_color_31 a68_color_31 a69_color_31 a70_color_31 a71_color_31 If user gives input as 67 then my drawable should be Drawabel partlycloud=res.getDrawable(R.drawable.a67_color_31); if it is 70 Drawabel partlycloud=res.getDrawable(R.drawable.a70_color_31); like this i have more than 100 images how can give in simple code with less codes. please reply me.. -- Regards --- Desu Vinod Kumar vinny.s...@gmail.com 09176147148 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable cannot draw into Canvas
You need to set the bounds of the drawable first. On Tue, May 26, 2009 at 9:35 AM, Jay pathomp...@gmail.com wrote: I want to load an icon from resource and draw over it. But I cannot get it into a canvas. Can anyone please help me with the code below. If I uncomment c.drawColor(), I get blue color as expected. So the problem is on icon.draw(). Drawable icon = getResources().getDrawable(R.drawable.icon2); Bitmap bitmap = Bitmap.createBitmap(icon.getIntrinsicWidth(), icon.getIntrinsicHeight(), Bitmap.Config.ARGB_); Canvas c = new Canvas(bitmap); icon.draw(c); //c.drawColor(Color.BLUE); ImageView iv = (ImageView)findViewById(R.id.icon); iv.setImageBitmap(bitmap); Thanks, Jay -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable or Uri for Notification icon
Looking for comments on this On Mar 24, 11:20 pm, android_dev esks...@gmail.com wrote: --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable doesn't load sometimes
Romain, What is the bug number for this? Was it fixed in the 1.0 r2 SDK? - Cheryl On Nov 12, 7:25 am, blindfold seeingwithso...@gmail.com wrote: Interesting. In case this Android bug/feature not only applies to input streams, this might also explain why I no longer had memory related crashes on the G1 after recently switching to using BitmapFactory.decodeResource(getResources() instead of getResources ().getDrawable() to retrieve background images from my resources. Regards On Nov 12, 5:30 am, Romain Guy romain...@google.com wrote: This is a known bug. Here is a workaround: in = new BufferedInputStream(new URL(getUrl(size)).openStream(), IO_BUFFER_SIZE); final ByteArrayOutputStream dataStream = new ByteArrayOutputStream(); out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE); copy(in, out); out.flush(); final byte[] data = dataStream.toByteArray(); bitmap = BitmapFactory.decodeByteArray(data, 0, data.length); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable doesn't load sometimes
It wasn't fixed in 1.0r2. We cannot put fixes in the SDK if they are not available on the phones. Also, the bug is internal, it's not on the external tracker. On Mon, Dec 15, 2008 at 11:30 PM, Cheryl Sedota cherylsed...@gmail.com wrote: Romain, What is the bug number for this? Was it fixed in the 1.0 r2 SDK? - Cheryl On Nov 12, 7:25 am, blindfold seeingwithso...@gmail.com wrote: Interesting. In case this Android bug/feature not only applies to input streams, this might also explain why I no longer had memory related crashes on the G1 after recently switching to using BitmapFactory.decodeResource(getResources() instead of getResources ().getDrawable() to retrieve background images from my resources. Regards On Nov 12, 5:30 am, Romain Guy romain...@google.com wrote: This is a known bug. Here is a workaround: in = new BufferedInputStream(new URL(getUrl(size)).openStream(), IO_BUFFER_SIZE); final ByteArrayOutputStream dataStream = new ByteArrayOutputStream(); out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE); copy(in, out); out.flush(); final byte[] data = dataStream.toByteArray(); bitmap = BitmapFactory.decodeByteArray(data, 0, data.length); -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable doesn't load sometimes
Romain, Can you please give details on the exact problem with the current 1.0 SDK? Should we avoid Drawables completely in favor of setting resource id's or bitmap objects? Or is the problem specific to a use case like loading remote images (via URL)? Based on the comment above that BitmapFactory.decodeResource(getResources()...) behaves better than getResources().getDrawable() I am assuming local images are problematic as well? Thanks!! Cheryl On Dec 15, 4:46 pm, Romain Guy romain...@google.com wrote: It wasn't fixed in 1.0r2. We cannot put fixes in the SDK if they are not available on the phones. Also, the bug is internal, it's not on the external tracker. On Mon, Dec 15, 2008 at 11:30 PM, Cheryl Sedota cherylsed...@gmail.com wrote: Romain, What is the bug number for this? Was it fixed in the 1.0 r2 SDK? - Cheryl On Nov 12, 7:25 am, blindfold seeingwithso...@gmail.com wrote: Interesting. In case this Android bug/feature not only applies to input streams, this might also explain why I no longer had memory related crashes on the G1 after recently switching to using BitmapFactory.decodeResource(getResources() instead of getResources ().getDrawable() to retrieve background images from my resources. Regards On Nov 12, 5:30 am, Romain Guy romain...@google.com wrote: This is a known bug. Here is a workaround: in = new BufferedInputStream(new URL(getUrl(size)).openStream(), IO_BUFFER_SIZE); final ByteArrayOutputStream dataStream = new ByteArrayOutputStream(); out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE); copy(in, out); out.flush(); final byte[] data = dataStream.toByteArray(); bitmap = BitmapFactory.decodeByteArray(data, 0, data.length); -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable doesn't load sometimes
It has nothing to do with Drawables, it's just a buffering issue with loading large bitmaps over slow connections. Local images are NOT problematic at all, and BitmapFactory.decodeResource() is certainly not better than getResources().getDrawable() since the latter pretty much uses the former :) On Tue, Dec 16, 2008 at 12:55 AM, Cheryl Sedota cherylsed...@gmail.com wrote: Romain, Can you please give details on the exact problem with the current 1.0 SDK? Should we avoid Drawables completely in favor of setting resource id's or bitmap objects? Or is the problem specific to a use case like loading remote images (via URL)? Based on the comment above that BitmapFactory.decodeResource(getResources()...) behaves better than getResources().getDrawable() I am assuming local images are problematic as well? Thanks!! Cheryl On Dec 15, 4:46 pm, Romain Guy romain...@google.com wrote: It wasn't fixed in 1.0r2. We cannot put fixes in the SDK if they are not available on the phones. Also, the bug is internal, it's not on the external tracker. On Mon, Dec 15, 2008 at 11:30 PM, Cheryl Sedota cherylsed...@gmail.com wrote: Romain, What is the bug number for this? Was it fixed in the 1.0 r2 SDK? - Cheryl On Nov 12, 7:25 am, blindfold seeingwithso...@gmail.com wrote: Interesting. In case this Android bug/feature not only applies to input streams, this might also explain why I no longer had memory related crashes on the G1 after recently switching to using BitmapFactory.decodeResource(getResources() instead of getResources ().getDrawable() to retrieve background images from my resources. Regards On Nov 12, 5:30 am, Romain Guy romain...@google.com wrote: This is a known bug. Here is a workaround: in = new BufferedInputStream(new URL(getUrl(size)).openStream(), IO_BUFFER_SIZE); final ByteArrayOutputStream dataStream = new ByteArrayOutputStream(); out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE); copy(in, out); out.flush(); final byte[] data = dataStream.toByteArray(); bitmap = BitmapFactory.decodeByteArray(data, 0, data.length); -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable doesn't load sometimes
Interesting. In case this Android bug/feature not only applies to input streams, this might also explain why I no longer had memory related crashes on the G1 after recently switching to using BitmapFactory.decodeResource(getResources() instead of getResources ().getDrawable() to retrieve background images from my resources. Regards On Nov 12, 5:30 am, Romain Guy [EMAIL PROTECTED] wrote: This is a known bug. Here is a workaround: in = new BufferedInputStream(new URL(getUrl(size)).openStream(), IO_BUFFER_SIZE); final ByteArrayOutputStream dataStream = new ByteArrayOutputStream(); out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE); copy(in, out); out.flush(); final byte[] data = dataStream.toByteArray(); bitmap = BitmapFactory.decodeByteArray(data, 0, data.length); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable doesn't load sometimes
This is a known bug. Here is a workaround: in = new BufferedInputStream(new URL(getUrl(size)).openStream(), IO_BUFFER_SIZE); final ByteArrayOutputStream dataStream = new ByteArrayOutputStream(); out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE); copy(in, out); out.flush(); final byte[] data = dataStream.toByteArray(); bitmap = BitmapFactory.decodeByteArray(data, 0, data.length); On Tue, Nov 11, 2008 at 8:14 PM, Obormot [EMAIL PROTECTED] wrote: Hi, guys. I load Drawables (jpeg pictures) from URLs the following way: URL urlO = new URL(url); URLConnection urlC = urlO.openConnection(); InputStream is = urlC.getInputStream(); return Drawable.createFromStream(is, url); It's funky that sometimes it returns null and sometimes some incompletely loaded drawable. I see the following errors in the log: 11-11 22:01:41.693: DEBUG/skia(1314): xx failure to skip request 3954 actual 3372 11-11 22:01:41.693: DEBUG/skia(1314): xxx jpeg error 91 Miscellaneous marker 0x%02x, length %u As I understand Drawable is somehow asynchronously loaded. How would you recommend me go around this issue? I use those drawables for example as markers on the map. -- Romain Guy www.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable doesn't load sometimes
It did help! Thanks a lot! Of course, I now create a bunch of unnecessary objects, but hope it'll be fixed soon... On Nov 11, 10:30 pm, Romain Guy [EMAIL PROTECTED] wrote: This is a known bug. Here is a workaround: in = new BufferedInputStream(new URL(getUrl(size)).openStream(), IO_BUFFER_SIZE); final ByteArrayOutputStream dataStream = new ByteArrayOutputStream(); out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE); copy(in, out); out.flush(); final byte[] data = dataStream.toByteArray(); bitmap = BitmapFactory.decodeByteArray(data, 0, data.length); On Tue, Nov 11, 2008 at 8:14 PM, Obormot [EMAIL PROTECTED] wrote: Hi, guys. I load Drawables (jpeg pictures) from URLs the following way: URL urlO = new URL(url); URLConnection urlC = urlO.openConnection(); InputStream is = urlC.getInputStream(); return Drawable.createFromStream(is, url); It's funky that sometimes it returns null and sometimes some incompletely loaded drawable. I see the following errors in the log: 11-11 22:01:41.693: DEBUG/skia(1314): xx failure to skip request 3954 actual 3372 11-11 22:01:41.693: DEBUG/skia(1314): xxx jpeg error 91 Miscellaneous marker 0x%02x, length %u As I understand Drawable is somehow asynchronously loaded. How would you recommend me go around this issue? I use those drawables for example as markers on the map. -- Romain Guywww.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable in XML referencing other drawables by state.
It's probably because MapView doesn't set the state of the bubbles. In fact it works well with state_focused, but we have to handle the focus ourself, I had to override the onTap functions to set the focus myself. I am not sure to understand the concept of focused overlay item... On 12 sep, 18:16, Romain Guy [EMAIL PROTECTED] wrote: It's probably because MapView doesn't set the state of the bubbles. Have you tried android:state_selected? On Fri, Sep 12, 2008 at 4:00 AM, Guillaume Perrot [EMAIL PROTECTED] wrote: I found two interesting drawables in ApiDemos: selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_pressed=true android:drawable=@drawable/ black_opaque_box / item android:drawable=@drawable/black_box / /selector layer-list xmlns:android=http://schemas.android.com/apk/res/ android item android:drawable=@drawable/progress_circular_background / itemrotate android:pivotX=50% android:pivotY=50% android:fromDegrees=0 android:toDegrees=360 android:drawable=@drawable/progress_particle / /item /layer-list I found no documentation for this kind of drawable. In ItemizedOverlay we can use drawables with state_focused is handled. I tried to pass the following drawable (bubble.xml) selector xmlns:android=http://schemas.android.com/apk/res/android; item android:drawable=@drawable/bubble_normal / item android:state_focused=true android:drawable=@drawable/bubble_focused / /selector Unfortunately, my map always show bubble_normal even if there is a focused item (I checked that). I suppose I have to use another tag than selector but I didn't found in the documentation which tag to use nor all possible tag list. -- Romain Guywww.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable in XML referencing other drawables by state.
For those who are interested: @Override protected boolean onTap(int index) { /* Set focus on tapped item so that he's drawn over others */ setFocus(getItem(index)); /* Consume tap event */ return true; } @Override public boolean onTap(GeoPoint p, MapView mapView) { /* * Here, the user tapped outside a location bubble, consume event to prevent * super to remove the focus. */ return true; } If you recall populate to update your ItemizedOverlay the focus will also be lost. And the sample drawable: ?xml version=1.0 encoding=utf-8? selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_focused=true android:drawable=@drawable/bubble_focused / item android:drawable=@drawable/bubble_normal / /selector On 22 sep, 10:26, Guillaume Perrot [EMAIL PROTECTED] wrote: It's probably because MapView doesn't set the state of the bubbles. In fact it works well with state_focused, but we have to handle the focus ourself, I had to override the onTap functions to set the focus myself. I am not sure to understand the concept of focused overlay item... On 12 sep, 18:16, Romain Guy [EMAIL PROTECTED] wrote: It's probably because MapView doesn't set the state of the bubbles. Have you tried android:state_selected? On Fri, Sep 12, 2008 at 4:00 AM, Guillaume Perrot [EMAIL PROTECTED] wrote: I found two interesting drawables in ApiDemos: selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_pressed=true android:drawable=@drawable/ black_opaque_box / item android:drawable=@drawable/black_box / /selector layer-list xmlns:android=http://schemas.android.com/apk/res/ android item android:drawable=@drawable/progress_circular_background / itemrotate android:pivotX=50% android:pivotY=50% android:fromDegrees=0 android:toDegrees=360 android:drawable=@drawable/progress_particle / /item /layer-list I found no documentation for this kind of drawable. In ItemizedOverlay we can use drawables with state_focused is handled. I tried to pass the following drawable (bubble.xml) selector xmlns:android=http://schemas.android.com/apk/res/android; item android:drawable=@drawable/bubble_normal / item android:state_focused=true android:drawable=@drawable/bubble_focused / /selector Unfortunately, my map always show bubble_normal even if there is a focused item (I checked that). I suppose I have to use another tag than selector but I didn't found in the documentation which tag to use nor all possible tag list. -- Romain Guywww.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable in XML referencing other drawables by state.
In fact I was hacking focus to handle a selection mechanism. It will be useful in a next version of the SDK to have both states handled. I also found in the documentation: It also dispatches Tap and Focus- change events to optional listeners. But we can only listen to focus-change, I had to implement tap listener myself. On 22 sep, 10:37, Guillaume Perrot [EMAIL PROTECTED] wrote: For those who are interested: @Override protected boolean onTap(int index) { /* Set focus on tapped item so that he's drawn over others */ setFocus(getItem(index)); /* Consume tap event */ return true; } @Override public boolean onTap(GeoPoint p, MapView mapView) { /* * Here, the user tapped outside a location bubble, consume event to prevent * super to remove the focus. */ return true; } If you recall populate to update your ItemizedOverlay the focus will also be lost. And the sample drawable: ?xml version=1.0 encoding=utf-8? selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_focused=true android:drawable=@drawable/bubble_focused / item android:drawable=@drawable/bubble_normal / /selector On 22 sep, 10:26, Guillaume Perrot [EMAIL PROTECTED] wrote: It's probably because MapView doesn't set the state of the bubbles. In fact it works well with state_focused, but we have to handle the focus ourself, I had to override the onTap functions to set the focus myself. I am not sure to understand the concept of focused overlay item... On 12 sep, 18:16, Romain Guy [EMAIL PROTECTED] wrote: It's probably because MapView doesn't set the state of the bubbles. Have you tried android:state_selected? On Fri, Sep 12, 2008 at 4:00 AM, Guillaume Perrot [EMAIL PROTECTED] wrote: I found two interesting drawables in ApiDemos: selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_pressed=true android:drawable=@drawable/ black_opaque_box / item android:drawable=@drawable/black_box / /selector layer-list xmlns:android=http://schemas.android.com/apk/res/ android item android:drawable=@drawable/progress_circular_background / itemrotate android:pivotX=50% android:pivotY=50% android:fromDegrees=0 android:toDegrees=360 android:drawable=@drawable/progress_particle / /item /layer-list I found no documentation for this kind of drawable. In ItemizedOverlay we can use drawables with state_focused is handled. I tried to pass the following drawable (bubble.xml) selector xmlns:android=http://schemas.android.com/apk/res/android; item android:drawable=@drawable/bubble_normal / item android:state_focused=true android:drawable=@drawable/bubble_focused / /selector Unfortunately, my map always show bubble_normal even if there is a focused item (I checked that). I suppose I have to use another tag than selector but I didn't found in the documentation which tag to use nor all possible tag list. -- Romain Guywww.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable in XML referencing other drawables by state.
The selector drawable tries each item in order, until it finds the first that matches the current state. So you want the one with the least specific state (in this case the one that requires no states) to be after ones with more specific state requirements. On Sep 12, 4:00 am, Guillaume Perrot [EMAIL PROTECTED] wrote: I found two interesting drawables in ApiDemos: selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_pressed=true android:drawable=@drawable/ black_opaque_box / item android:drawable=@drawable/black_box / /selector layer-list xmlns:android=http://schemas.android.com/apk/res/ android item android:drawable=@drawable/progress_circular_background / itemrotate android:pivotX=50% android:pivotY=50% android:fromDegrees=0 android:toDegrees=360 android:drawable=@drawable/progress_particle / /item /layer-list I found no documentation for this kind of drawable. In ItemizedOverlay we can use drawables with state_focused is handled. I tried to pass the following drawable (bubble.xml) selector xmlns:android=http://schemas.android.com/apk/res/android; item android:drawable=@drawable/bubble_normal / item android:state_focused=true android:drawable=@drawable/bubble_focused / /selector Unfortunately, my map always show bubble_normal even if there is a focused item (I checked that). I suppose I have to use another tag than selector but I didn't found in the documentation which tag to use nor all possible tag list. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable in XML referencing other drawables by state.
Luckily, it's what I've done, but I will try to remember that for future drawables :p On 22 sep, 10:51, hackbod [EMAIL PROTECTED] wrote: The selector drawable tries each item in order, until it finds the first that matches the current state. So you want the one with the least specific state (in this case the one that requires no states) to be after ones with more specific state requirements. On Sep 12, 4:00 am, Guillaume Perrot [EMAIL PROTECTED] wrote: I found two interesting drawables in ApiDemos: selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_pressed=true android:drawable=@drawable/ black_opaque_box / item android:drawable=@drawable/black_box / /selector layer-list xmlns:android=http://schemas.android.com/apk/res/ android item android:drawable=@drawable/progress_circular_background / itemrotate android:pivotX=50% android:pivotY=50% android:fromDegrees=0 android:toDegrees=360 android:drawable=@drawable/progress_particle / /item /layer-list I found no documentation for this kind of drawable. In ItemizedOverlay we can use drawables with state_focused is handled. I tried to pass the following drawable (bubble.xml) selector xmlns:android=http://schemas.android.com/apk/res/android; item android:drawable=@drawable/bubble_normal / item android:state_focused=true android:drawable=@drawable/bubble_focused / /selector Unfortunately, my map always show bubble_normal even if there is a focused item (I checked that). I suppose I have to use another tag than selector but I didn't found in the documentation which tag to use nor all possible tag list. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable in XML referencing other drawables by state.
Oh, it explains what it fails the first time. I didn't realize the second time I tested it, I used the right order. Thanks for that tip ! On 22 sep, 10:51, hackbod [EMAIL PROTECTED] wrote: The selectordrawabletries each item in order, until it finds the first that matches the current state. So you want the one with the least specific state (in this case the one that requires no states) to be after ones with more specific state requirements. On Sep 12, 4:00 am, Guillaume Perrot [EMAIL PROTECTED] wrote: I found two interesting drawables in ApiDemos: selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_pressed=true android:drawable=@drawable/ black_opaque_box / item android:drawable=@drawable/black_box / /selector layer-list xmlns:android=http://schemas.android.com/apk/res/ android item android:drawable=@drawable/progress_circular_background / itemrotate android:pivotX=50% android:pivotY=50% android:fromDegrees=0 android:toDegrees=360 android:drawable=@drawable/progress_particle / /item /layer-list I found no documentation for this kind ofdrawable. In ItemizedOverlay we can use drawables with state_focused is handled. I tried to pass the followingdrawable(bubble.xml) selector xmlns:android=http://schemas.android.com/apk/res/android; item android:drawable=@drawable/bubble_normal / item android:state_focused=true android:drawable=@drawable/bubble_focused / /selector Unfortunately, my map always show bubble_normal even if there is a focused item (I checked that). I suppose I have to use another tag than selector but I didn't found in the documentation which tag to use nor all possible tag list. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawable in XML referencing other drawables by state.
I didn't realize I was using the wrong order in my first test, and the right order in my recent test... Thanks for the tip hackbod, I'll try to remember that for future drawables... On 22 sep, 10:51, hackbod [EMAIL PROTECTED] wrote: The selectordrawabletries each item in order, until it finds the first that matches the current state. So you want the one with the least specific state (in this case the one that requires no states) to be after ones with more specific state requirements. On Sep 12, 4:00 am, Guillaume Perrot [EMAIL PROTECTED] wrote: I found two interesting drawables in ApiDemos: selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_pressed=true android:drawable=@drawable/ black_opaque_box / item android:drawable=@drawable/black_box / /selector layer-list xmlns:android=http://schemas.android.com/apk/res/ android item android:drawable=@drawable/progress_circular_background / itemrotate android:pivotX=50% android:pivotY=50% android:fromDegrees=0 android:toDegrees=360 android:drawable=@drawable/progress_particle / /item /layer-list I found no documentation for this kind ofdrawable. In ItemizedOverlay we can use drawables with state_focused is handled. I tried to pass the followingdrawable(bubble.xml) selector xmlns:android=http://schemas.android.com/apk/res/android; item android:drawable=@drawable/bubble_normal / item android:state_focused=true android:drawable=@drawable/bubble_focused / /selector Unfortunately, my map always show bubble_normal even if there is a focused item (I checked that). I suppose I have to use another tag than selector but I didn't found in the documentation which tag to use nor all possible tag list. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---