Skip to content

Instantly share code, notes, and snippets.

@markojerkic
Created April 8, 2017 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markojerkic/75509f03d3cf864c542f40c763fd8fc1 to your computer and use it in GitHub Desktop.
Save markojerkic/75509f03d3cf864c542f40c763fd8fc1 to your computer and use it in GitHub Desktop.
ViewSwitcher
switchButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(viewSwitcher.getCurrentView() == ratingBar) {
viewSwitcher.showNext();//if the current view is the RatingBar, then show
} //the next one, which is the TextView
else {
viewSwitcher.showPrevious();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment