Back to project page RoboBinding-gallery.
The source code is released under:
Apache License
If you think the Android project RoboBinding-gallery listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.robobinding.gallery.presentationmodel; // w w w . ja va 2 s.c o m import org.robobinding.annotation.DependsOnStateOf; import org.robobinding.annotation.PresentationModel; /** * @author Cheng Wei * @version $Revision: 1.0 $ * @since 1.0 */ @PresentationModel public class MenuPresentationModel { private boolean enabled; private boolean visible; private boolean groupEnabled; private boolean groupVisible; public MenuPresentationModel() { this.enabled = true; this.visible = true; this.groupEnabled = true; this.groupVisible = true; } public void toggleTitle() { setGroupEnabled(!groupEnabled); } @DependsOnStateOf("groupEnabled") public String getTitle() { if (groupEnabled) { return "Disable group"; } else { return "Enable group"; } } public boolean isEnabled() { return enabled; } public boolean isVisible() { return visible; } public boolean isGroupEnabled() { return groupEnabled; } public void setGroupEnabled(boolean newGroupEnabled) { this.groupEnabled = newGroupEnabled; } public boolean isGroupVisible() { return groupVisible; } }