Created
November 11, 2018 21:12
-
-
Save zmdominguez/55bda05e5d26dba341f58b70cbe123c5 to your computer and use it in GitHub Desktop.
Effectively Wrangling Views via Groups
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
@BindView(R.id.checkbox) CheckBox mCheckbox; | |
@BindView(R.id.container) ViewGroup mContainer; | |
@Override | |
public void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_constraint); | |
ButterKnife.bind(this); | |
mCheckbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { | |
@Override | |
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { | |
if (isChecked) { | |
mContainer.setVisibility(View.VISIBLE); | |
} else { | |
mContainer.setVisibility(View.GONE); | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment