Last active
October 10, 2023 17:44
-
-
Save arriolac/6e52a62c711d68c7179f82a3d074287c to your computer and use it in GitHub Desktop.
Refactoring CheckBox to not be stateful
This file contains hidden or 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
// Copyright 2023 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
class CheckBox(context: Context) : View(context) { | |
override fun performClick(): Boolean { | |
// Refactor: prevent the checkbox from toggling when clicked | |
// toggleCheck() | |
return super.performClick() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment