Skip to content

Commit

Permalink
Merge pull request #86 from pserwylo/reinit-preferences
Browse files Browse the repository at this point in the history
Fix theme changing by reinitialising preferences each time.
  • Loading branch information
juleskers authored Jan 3, 2024
2 parents b7a30b2 + efeffa2 commit 81f07cf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/src/main/java/com/nicobrailo/pianoli/PianoCanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PianoCanvas extends SurfaceView implements SurfaceHolder.Callback, PianoLi

private final int screen_size_y, screen_size_x;
private final Drawable gearIcon;
private final Theme theme;
private Theme theme;

private Map<Integer, Integer> touch_pointer_to_keys = new HashMap<>();
private SoundSet soundSet;
Expand All @@ -63,8 +63,6 @@ public PianoCanvas(Context context, AttributeSet as, int defStyle) {
this.setFocusable(true);
this.getHolder().addCallback(this);

theme = Theme.fromPreferences(context);

final Point screen_size = new Point();
final AppCompatActivity ctx;
try {
Expand Down Expand Up @@ -100,6 +98,7 @@ public PianoCanvas(Context context, AttributeSet as, int defStyle) {
public void reInitPiano(Context context, String prefSoundset) {
Log.i("PianOli::PianoCanvas", "re-initialising Piano");
this.piano = new Piano(screen_size_x, screen_size_y);
this.theme = Theme.fromPreferences(context);

// for config trigger updates
piano.addListener(appConfigTrigger);
Expand Down

0 comments on commit 81f07cf

Please sign in to comment.