Skip to content

Instantly share code, notes, and snippets.

@molidev8
Created December 7, 2022 19:03
Show Gist options
  • Save molidev8/b22a471a1c8e4246a4cb46166669c2dd to your computer and use it in GitHub Desktop.
Save molidev8/b22a471a1c8e4246a4cb46166669c2dd to your computer and use it in GitHub Desktop.
CustomSwitchFactory
object CustomSwitchFactory {
fun build(type: CustomSwitchType): CustomSwitchManager = when (type) {
CustomSwitchType.CustomThumbBigSwitch -> CustomSwitchThumbBig()
CustomSwitchType.CustomThumbSmallSwitch -> CustomSwitchThumbSmall()
CustomSwitchType.CustomTrackPillSwitch -> CustomSwitchThumbPill()
CustomSwitchType.Vanilla -> CustomSwitchVanilla()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment