From d5a37010309c5d1a98c02d0fd22e63e1217d6ee0 Mon Sep 17 00:00:00 2001 From: afohrman Date: Fri, 13 Jan 2023 15:42:52 +0000 Subject: [PATCH] [Docs][Switch] Updated inaccurate anatomy diagram labels and a couple of other minor tweaks. Resolves https://github.com/material-components/material-components-android/issues/3165. PiperOrigin-RevId: 501844880 --- docs/components/Switch.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/components/Switch.md b/docs/components/Switch.md index 83184c4620d..35849ec0740 100644 --- a/docs/components/Switch.md +++ b/docs/components/Switch.md @@ -27,7 +27,7 @@ as "Wi-fi" and "Bluetooth"](assets/switch/switch_hero.png) ## Using switches -Before you can use Material switches, you need to add a dependency to the +Before you can use Material switches, you need to add a dependency on the Material Components for Android library. For more information, go to the [Getting started](https://github.com/material-components/material-components-android/tree/master/docs/getting-started.md) page. @@ -59,8 +59,8 @@ indicate its current state. **Note:** Since version 1.7.0, the new `MaterialSwitch` class will replace the obsolete `SwitchMaterial` class. In most cases you should be able to just -replace all `SwitchMaterial` class reference with `MaterialSwitch` to enjoy the -default look and feel. Please refer to the following sections if you need to +replace all `SwitchMaterial` class reference with `MaterialSwitch` to achieve +the default look and feel. Please refer to the following sections if you need to customize the new styles. **Note:** For the old `SwitchMaterial` documentation, please refer to @@ -125,8 +125,8 @@ track: ![Switch anatomy diagram](assets/switch/switch_anatomy.png) -1. Thumb -2. Track +1. Track +2. Thumb 3. Icon (optional) ### Switch attributes @@ -150,7 +150,7 @@ Element | Attribute | Related method(s) **Color** | `app:thumbIconTint` | `setThumbIconTintList`
`getThumbIconTintList` | `?attr/colorSurfaceVariant` (unchecked)
`?attr/colorOnPrimaryContainer` (checked) You can add an optional icon to enhance the on/off indication of your custom -switch by assiging `app:thumbIcon`. This icon will be centered and displayed on +switch by assigning `app:thumbIcon`. This icon will be centered and displayed on top of the thumb drawable. ### Track attributes