ogarcia / opensudoku

Open Source Sudoku game for Android.
GNU General Public License v3.0
328 stars 144 forks source link

Theme Preview #50

Closed jlnordin closed 4 years ago

jlnordin commented 4 years ago

This PR adds support to preview the theme for the Sudoku board when selecting a theme or when customizing the theme colors.

SudokuBoardThemePreference

Theme Preview Dialog 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

Custom Theme Preview Dialog 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

Scenarios Tested

On the emulator and physical device:

ChrisLane commented 4 years ago

Ooh great! I was just about to do this myself :smile: Will do some of my own testing.

ogarcia commented 4 years ago

It looks awesome! :clap: :clap: I was out for holidays, in next week I'll merge and upload code :wink: