[android-developers] Re: Custom Spinner with two TextViews and a RadioButton
Thanks for the suggestion Mark. CheckedTextView works fine. -- 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: Custom Spinner
To customize the way that the spinner drop down looks I think you need to use your own custom layout instead of using the standard android layout android.R.layout.simple_spinner_dropdown_item You can find the xml layout definition for android.R.layout.simple_spinner_dropdown_item at the following link. Just copy the layout file and modify it to suit your needs. http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/layout/simple_spinner_dropdown_item.xml;h=7006b09e2193f2d02961138c932aa1dfb424318a;hb=HEAD -- 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 To unsubscribe, reply using remove me as the subject.
Re: [android-developers] Re: Custom Spinner
I tried it, it just reduces the width of the text in the drop down but not the width of drop down. On Tue, Apr 13, 2010 at 6:20 AM, skyhigh skyhigh1...@gmail.com wrote: To customize the way that the spinner drop down looks I think you need to use your own custom layout instead of using the standard android layout android.R.layout.simple_spinner_dropdown_item You can find the xml layout definition for android.R.layout.simple_spinner_dropdown_item at the following link. Just copy the layout file and modify it to suit your needs. http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/layout/simple_spinner_dropdown_item.xml;h=7006b09e2193f2d02961138c932aa1dfb424318a;hb=HEAD -- 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 To unsubscribe, reply using remove me as the subject. -- 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: Custom Spinner
Hi, Thanks for your reply. I need a spinner, which when clicked I get a drop down view which do not cover the entire width of the screen. In my application i display all the items of the sdcard in table layout. I have a spinner on top of my application with some options. So when i click the spinner, i get a drop down, which covers the entire width of screen, and so i cant see any items of sdcard. But i want to see the items on the layout. How can i do that? thanks in advance. On Thu, Mar 11, 2010 at 11:43 AM, Kumar Bibek coomar@gmail.com wrote: It is possible. But we need to know first what your requirements are. You can fully customize any widget. Thanks and Regards, Kumar Bibek. On Mar 9, 6:42 pm, mmkr manutd...@gmail.com wrote: Hi all, The default drop down view of the spinner occupies the entire width of the screen. I tried to create a custom spinner which occupies only some portion of the width of the screen, but I'm unable to do. I want to see the objects behind the drop down. Here is what i tried, I changed the drop down view as, adapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item); instead of adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); In the layout.simple_spinner_dropdown_item.xml file I specified the width, but it still occupies the entire width. Can any one help. Is there any other view which is similar to spinner but I should be able to see the background objects like a alert dialog. Is it really possible? Please reply. 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://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: Custom Spinner
Hi Bob, Even i gave up on that. Finally i created a custom layout which displays the list of items( the items which i want to display in the spinner ), in a listview, at any position on the screen. We can create a listview with any height and width, using LayoutParams , my requirement is fulfilled, but not the way i intended to do. Instead of using a spinner drop down view we can use a list view to display the items, which looks like a customized spinner drop down. On Thu, Mar 11, 2010 at 2:58 PM, Bob Kerns r...@acm.org wrote: I was trying to do the same thing about 24 hours ago. I finally gave up, and made what I wanted to coexist with the Spinner be part of the view inside the spinner. I could find no combination of things that allowed the layout to both size the text to the left, and left-align the text within the spinner. The items within the spinner are created disconnected from the view hierarchy, and so they don't have any interaction with the parent's layout at that point, and I couldn't figure out any way to inject the proper interaction when they do come together. On Mar 9, 5:42 am, mmkr manutd...@gmail.com wrote: Hi all, The default drop down view of the spinner occupies the entire width of the screen. I tried to create a custom spinner which occupies only some portion of the width of the screen, but I'm unable to do. I want to see the objects behind the drop down. Here is what i tried, I changed the drop down view as, adapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item); instead of adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_it em); In the layout.simple_spinner_dropdown_item.xml file I specified the width, but it still occupies the entire width. Can any one help. Is there any other view which is similar to spinner but I should be able to see the background objects like a alert dialog. Is it really possible? Please reply. 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://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: Custom Spinner
Hi, Thanks for your reply. I need a spinner, which when clicked I get a drop down view which do not cover the entire width of the screen. In my application i display all the items of the sdcard in table layout. I have a spinner on top of my application with some options. So when i click the spinner, i get a drop down, which covers the entire width of screen, and so i cant see any items of sdcard. But i want to see the items on the layout. How can i do that? thanks in advance. On Thu, Mar 11, 2010 at 11:43 AM, Kumar Bibek coomar@gmail.com wrote: It is possible. But we need to know first what your requirements are. You can fully customize any widget. Thanks and Regards, Kumar Bibek. On Mar 9, 6:42 pm, mmkr manutd...@gmail.com wrote: Hi all, The default drop down view of the spinner occupies the entire width of the screen. I tried to create a custom spinner which occupies only some portion of the width of the screen, but I'm unable to do. I want to see the objects behind the drop down. Here is what i tried, I changed the drop down view as, adapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item); instead of adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); In the layout.simple_spinner_dropdown_item.xml file I specified the width, but it still occupies the entire width. Can any one help. Is there any other view which is similar to spinner but I should be able to see the background objects like a alert dialog. Is it really possible? Please reply. 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://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
[android-developers] Re: Custom Spinner
I was trying to do the same thing about 24 hours ago. I finally gave up, and made what I wanted to coexist with the Spinner be part of the view inside the spinner. I could find no combination of things that allowed the layout to both size the text to the left, and left-align the text within the spinner. The items within the spinner are created disconnected from the view hierarchy, and so they don't have any interaction with the parent's layout at that point, and I couldn't figure out any way to inject the proper interaction when they do come together. On Mar 9, 5:42 am, mmkr manutd...@gmail.com wrote: Hi all, The default drop down view of the spinner occupies the entire width of the screen. I tried to create a custom spinner which occupies only some portion of the width of the screen, but I'm unable to do. I want to see the objects behind the drop down. Here is what i tried, I changed the drop down view as, adapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item); instead of adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_it em); In the layout.simple_spinner_dropdown_item.xml file I specified the width, but it still occupies the entire width. Can any one help. Is there any other view which is similar to spinner but I should be able to see the background objects like a alert dialog. Is it really possible? Please reply. 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: Custom Spinner
I should add that yes, I could write my own parent widget. However, I really think this is a bug in Spinner. Using it with RelativeView leads to it basically ignoring the layout parameters. Anomalies like this make the toolkit that much harder and more frustrating to use. Is this a known bug? I don't see one on it. Is there something I'm missing? As a workaround, I think that rather than reimplementing RelativeView, a wrapper view around the Spinner that imposes the layout constraints properly to/from the child would be better. Or perhaps a subclass of Spinner with the bug fixed... It isn't clear to me if the problem is with the measure or the layout pass. It doesn't appear to be due to failure to relayout on change, since I wasn't able to change the behavior by forcing a relayout. Anyway, incorporating the additional stuff directly into the adapter's views was a simpler approach for me than handling the layout myself, and had some UI advantages as well. I wonder if ListView's have the same problem? On Mar 11, 1:28 am, Bob Kerns r...@acm.org wrote: I was trying to do the same thing about 24 hours ago. I finally gave up, and made what I wanted to coexist with the Spinner be part of the view inside the spinner. I could find no combination of things that allowed the layout to both size the text to the left, and left-align the text within the spinner. The items within the spinner are created disconnected from the view hierarchy, and so they don't have any interaction with the parent's layout at that point, and I couldn't figure out any way to inject the proper interaction when they do come together. On Mar 9, 5:42 am, mmkr manutd...@gmail.com wrote: Hi all, The default drop down view of the spinner occupies the entire width of the screen. I tried to create a custom spinner which occupies only some portion of the width of the screen, but I'm unable to do. I want to see the objects behind the drop down. Here is what i tried, I changed the drop down view as, adapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item); instead of adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_it em); In the layout.simple_spinner_dropdown_item.xml file I specified the width, but it still occupies the entire width. Can any one help. Is there any other view which is similar to spinner but I should be able to see the background objects like a alert dialog. Is it really possible? Please reply. 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: Custom Spinner
It is possible. But we need to know first what your requirements are. You can fully customize any widget. Thanks and Regards, Kumar Bibek. On Mar 9, 6:42 pm, mmkr manutd...@gmail.com wrote: Hi all, The default drop down view of the spinner occupies the entire width of the screen. I tried to create a custom spinner which occupies only some portion of the width of the screen, but I'm unable to do. I want to see the objects behind the drop down. Here is what i tried, I changed the drop down view as, adapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item); instead of adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); In the layout.simple_spinner_dropdown_item.xml file I specified the width, but it still occupies the entire width. Can any one help. Is there any other view which is similar to spinner but I should be able to see the background objects like a alert dialog. Is it really possible? Please reply. 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