Created
December 7, 2022 19:01
-
-
Save molidev8/85f895d01f907ff66b77828a19634217 to your computer and use it in GitHub Desktop.
A CustomView child
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomSwitchThumbPill : CustomSwitchManager { | |
private lateinit var binding: CustomSwitchThumbPillBinding | |
override fun initView( | |
context: Context, | |
viewGroup: ViewGroup, | |
animText: Boolean, | |
manual: Boolean, | |
textVisible: Boolean, | |
text: String | |
) { | |
binding = CustomSwitchThumbPillBinding.inflate(LayoutInflater.from(context), viewGroup, true) | |
setText(text) | |
} | |
override fun setAnimText(shouldAnim: Boolean) { | |
// do something | |
} | |
override fun setManual(shouldBeManual: Boolean) { | |
// do something | |
} | |
override fun setTextVisible(shouldBeVisible: Boolean) { | |
// do something | |
} | |
override fun setText(text: String) { | |
binding.switchHint.text = text | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment