SwitchCompat

SwitchCompat is a version of the Switch widget which on devices back to API v7. It does not
make any attempt to use the platform provided widget on those devices which it is available
normally.

A Switch is a two-state toggle switch widget that can select between two
options. The user may drag the "thumb" back and forth to choose the selected option,
or simply tap to toggle as if it were a checkbox. The text
property controls the text displayed in the label for the switch, whereas the
off and on text
controls the text on the thumb. Similarly, the
textAppearance and the related
setTypeface() methods control the typeface and style of label text, whereas the
switchTextAppearance and
the related setSwitchTypeface() methods control that of the thumb.

Sets the typeface and style in which the text should be displayed on the
switch, and turns on the fake bold and italic bits in the Paint if the
Typeface that you provided does not have all the bits in the
style that you specified.

setSwitchTypeface

Sets the typeface in which the text should be displayed on the switch.
Note that not all Typeface families actually have bold and italic
variants, so you may need to use
setSwitchTypeface(Typeface, int) to get the appearance
that you actually want.

Parameters

typeface

Typeface

setSwitchTypeface

Sets the typeface and style in which the text should be displayed on the
switch, and turns on the fake bold and italic bits in the Paint if the
Typeface that you provided does not have all the bits in the
style that you specified.