Refactor: Move a few method calls from BoardFragment into Simon; preparing to implement all game logic within Simon. Add a few code comments; correct second "until" to "before" on help screen.
Refactor: eliminate unneeded field "gameOn". Quirk: I noticed incorrect presses after game ends will keep displaying the "Incorrect..." toast, no big deal but it was unexpected behavior.
Huge refactor: design still reflected a muddle division of responsibilities between BoardFragment (formerly SimonListener) and Simon. Simon wasn't encapsulating the responsibilities it should and also had references to android View objects; after configuration changes, all button presses would automatically be marked "wrong" because when the new Activity created it had new view objects that did not match the ones Simon was monitoring (in addition to a memory leak). That is why for several revisions the Android manifest has android:orientation="locked".
After all this, the game behavior is exactly the same. But, it is a reference project for a better division of responsibilities between classes, and UI independence of Simon, which no longer has any reference to the UI or any android classes at all (with the exception of Android's log utility).
Bugfix: previous commit introduced bug: pressing Begin Game does not clear previous play list but merely adds to it (I removed the statement to set the play list back to blank on pressing new game - not thinking). So I put it back.
Added feature: during a game, matching a pattern but adding extra keys loses the game as before. The game does not display the losing message when pressing keys when no game is active (before the refactor, the game could do this, but it did this by SimonListener turning off the onClickListener for the buttons. Now, BoardFragment is always listening to the buttons and sending the events to Simon, but Simon ignores the events if the game is not active.
Finally, after all that refactoring: It is now possible to change the device orientation or make other configuration changes while the game is in progress. Both ScoreBarFragment and BoardFragment now maintain state, so that Simon can continue to use their callback interfaces when the Activity itself destroys and recreates. The score and round will update properly, and the game will recognize the correct melody after orientation changes.
Internal Refactor: Previously, Simon posted score updates using the ScoreBarUpdate interface, this worked although it required that ScoreBarUpdate retain instance on configuration changes and BoardFragment didn't have an instance to the ScoreBarFragment (since it is reference through the static XML layout, it needed a no argument constructor, requiring me to pass the interface in the BoardFragment.begin() method which was clumsy).
Now, Simon has a ScoreUpdate observable. MainActivity registers ScoreBarFragment which now implements Observer. Any change to ScoreUpdate's values automatically triggers a notification to any observers. ScoreBarFragment is now setRetainInstance(false) as it does not have any state to retain.
Issues: Changing orientation causes no problems for a game in progress but the "Begin Game" button no longer works after orientation change. I suspect this was also true for the previous version that allowed orientation change but used ScoreBarUpdate. This is strange, my best idea right now is to try using a click listener rather than specifying onClick in the XML.
Incidental change: Score and Round no longer display "--" before starting a new game. It is just blank.
Refactor: change static XML layout for button onClick method to onClickListener (nested class BeginGameListener).
Issue: After orientation change, begin game button doesn't work. It is possible to finish playing the current game normally if a game is in progress.