[android-developers] switch widget reseting styles on inflating
Hi, Does anyone have ani idea why a switch widget placed in a xml file with defined textOn and textOff values resets these attributes, styles and other things, when the xml file(view) is inflated with LayoutInflater ? 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Re: switch widget reseting styles on inflating
LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:id=@+id/inputsLayout android:layout_width=match_parent android:layout_height=wrap_content android:orientation=horizontal TextView android:id=@+id/reportName android:layout_width=wrap_content android:layout_height=wrap_content android:layout_gravity=left / Switch android:id=@+id/yesNoSwitch android:layout_width=wrap_content android:layout_height=wrap_content android:layout_gravity=right android:textOff=no android:textOn=yes / ImageButton android:layout_width=wrap_content android:layout_height=wrap_content android:id=@+id/camera android:layout_gravity=right style=@style/ImgButton android:src=@drawable/device_access_camera / /LinearLayout This is where i got declared the switch.(report_task_form.xml) Then I use the LayoutInflater - LayoutInflater inflater = (LayoutInflater)activity.getApplicationContext().getSystemService (Context.LAYOUT_INFLATER_SERVICE); LinearLayout layout = (LinearLayout) inflater.inflate(R.layout. report_task_form, null); Then i simple use addView to add this layout to another. The result are - https://www.dropbox.com/s/cex7rq08fmi02tv/Screen%20Shot%202013-07-22%20at%204.45.46%20PM.png and https://www.dropbox.com/s/m3hryjtujoc6icx/Screen%20Shot%202013-07-22%20at%204.48.34%20PM.png Any ideas ? -- -- 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Re: switch widget reseting styles on inflating
if I just copy the xml for the switch in other view, which isn't inflated the text is changed - https://www.dropbox.com/s/bn8vlfq5vr2wzck/Screen%20Shot%202013-07-22%20at%205.04.07%20PM.png Something is happening when the view is inflated and is happening to only this widget. I already tested the inflate logic it with togglebutton, but in that case everything 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Re: switch widget reseting styles on inflating
I finally managed to see where the problem is. The thing is that I should have taken the inflater from the getLayoutInflater() method of the used activity. -- -- 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: switch widget reseting styles on inflating
my problem is something like this - http://stackoverflow.com/questions/14925743/androd-switch-widget-texton-and-textoff-not-working-as-expected. But I'm 100% sure that I use a theme extending Holo.Light ... -- -- 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Vertical Datepicker
Just in case if someone is facing the same problem, here's the solution: The datePicker basic layout is LinearLayout, so it's pretty simple to get it with getChildAt(int position) and change it's orientation to vertical. This made the trick for me. The other big problem about this datePicker is changing it's divider colors - it's NumberPicker divider color and it's CalendarView divider color. Changing the divider color and the related colors of CalendarView is pretty simple(it's done by changing the appropriate style items), but the dividers of the NumberPickers are kind of big problem. The real issue is that the field for changing the divider's drawable is a private one by default. So I managed to find some workarounds to this problem: 1. Use NP widget NumberPicker 2. Use Reflection to access the field mSelectionDivider and change it's value. I hope these workarounds will help someone :) -- -- 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Vertical Datepicker
Hi guys, I'm wondering if is it possible to switch the orientation of a DatePicker. I mean by default the numberPicker with the day, month and year appears first(if you look from left to right and horizontally) and the CalendarView appears second. I want the same order but vertically, i.e. NumberPicker and below him - CalendarView. Thank you in advance -- -- 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.