I have a Fragment which has a button. When creating a Fragment, I want to get a UiSettings instance from the fragment and change whether the button should be shown. You can get the idea looking here. So my code is:
class MyFragment extends Fragment{
private Button button;
private UiSettings settings;
public getUiSettings(){
return settings;
}
}
class UiSettings{
private boolean showButton = true;
//setters and getters go here
}
My question is how do I trigger button visibility depending on UiSettings, and how do I connect button visibility state to the changes in UiSettings?