This PR adds support to preview the theme for the Sudoku board when selecting a theme or when customizing the theme colors.
SudokuBoardThemePreference
The SudokuBoardThemePreference class is a custom preference that extends ListPreference and adds a Sudoku board view on top of the list of themes to allow the player to see the theme changes in-line before deciding to commit to a new theme. This dialog also supports cancelation (and the theme won't be applied).
SudokuBoardCustomThemePreferenceGroup
The SudokuBoardCustomThemePreferenceGroup class is a custom preference group to hold the ColorPickerPreferences that control the custom theme colors. This dialog is almost identical to the theme picker dialog, but because the UI is managed by preference objects, the underlying implementation is quite different. To reuse as much of the existing logic as possible, this class is implemented as a PreferenceGroup and simulates what the PreferenceScreen class does, but with some customized dialog elements.
Additional changes
A ThemeUtils class to hold the common theme functions shared across the two new theme preference dialogs.
Moved the fill-in-notes functionality into the CellCollection class so it can be reused elsewhere.
Scenarios Tested
On the emulator and physical device:
Verified switching between various themes in the theme dialog.
Verified choosing new theme colors in the custom theme dialog.
Verified view updates correctly when theme or colors change.
Verified opening and interacting with the main Sudoku activity.
Verified the settings menu in two languages (no translations, just checking for bugs).
This PR adds support to preview the theme for the Sudoku board when selecting a theme or when customizing the theme colors.
SudokuBoardThemePreference
The
SudokuBoardThemePreference
class is a custom preference that extends ListPreference and adds a Sudoku board view on top of the list of themes to allow the player to see the theme changes in-line before deciding to commit to a new theme. This dialog also supports cancelation (and the theme won't be applied).SudokuBoardCustomThemePreferenceGroup
The
SudokuBoardCustomThemePreferenceGroup
class is a custom preference group to hold the ColorPickerPreferences that control the custom theme colors. This dialog is almost identical to the theme picker dialog, but because the UI is managed by preference objects, the underlying implementation is quite different. To reuse as much of the existing logic as possible, this class is implemented as a PreferenceGroup and simulates what the PreferenceScreen class does, but with some customized dialog elements.Additional changes
ThemeUtils
class to hold the common theme functions shared across the two new theme preference dialogs.CellCollection
class so it can be reused elsewhere.Scenarios Tested
On the emulator and physical device: