I'm making a watch face for my android wear watch and in the config activity I want a switch. The switch looks like a usual android switch (picture 1) but I want it to look like the new switchs in android wear 2.0 (picture 2). How did google do them?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The switch in picture 2 is a SwitchPreference which is (at least currently) only supported in a PreferenceFragment.
回答2:
In the latest update we added a RoundSwitch style which should do exactly what you need.
See here: Support Library Wear R.style