Skip to content

Instantly share code, notes, and snippets.

@thunderrabbit
Created June 8, 2011 06:07
Show Gist options
  • Save thunderrabbit/1013872 to your computer and use it in GitHub Desktop.
Save thunderrabbit/1013872 to your computer and use it in GitHub Desktop.
pseudo code for some animated menus
public class AnimatedMenu extends Activity implements Animation.AnimationListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.animated_menu);
// set up stuff that animates animated_menu
}
// methods for animation listener
}
public class ButtonsIncludedOnMostMenusButNotAll {
// handlers for buttons
}
public class MainMenu extends AnimatedMenu {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_menu);
// set up buttons for the main menu
// insert ButtonsIncludedOnMostMenusButNotAll
}
}
public class SecondMenu extends AnimatedMenu {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.second_menu);
// set up buttons for the second menu
// insert ButtonsIncludedOnMostMenusButNotAll
}
}
// this menu know how to animate,
// but doesn't include buttons from ButtonsIncludedOnMostMenusButNotAll
public class ThirdMenu extends AnimatedMenu {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.third_menu);
// set up buttons for the third menu
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment