I search around stackoverflow and find next related topics:
- How can i style an Android Switch?
- Custom switch widget in Android 4
- Set switchStyle - get error resource not found - why?
I also find bugreport on google group: Issue 36636: Unable to override style switchStyle And at last find new probles with Switch widget:
I tried to make my own Preference.SwitchPreference and define layout with Switch widget
android:id="@+android:id/switchWidget" android:layout_width="wrap_content" android:layout_height="wrap_content" android:thumb="@drawable/switch_thumb" android:layout_gravity="center" android:padding="16dip" android:focusable="false" />
but I get an compliation error: Error: Resource is not public. (at 'id' with value '@+android:id/switchWidget'). So I can't use this way.
- Second way I tried to extend Switch class add set resources from code. But I find that method setThumbResource is availible only from API 16. But I still can't apply @+android:id/switchWidget because it's not public.
So, How can I get custom Switch Preference for SDK API 15 ??? Or how can I customize Switch in Preferences?