diff --git a/app/src/main/java/com/lukas/music/song/chords/Chord.kt b/app/src/main/java/com/lukas/music/song/chords/Chord.kt index b823fbb..4400dae 100644 --- a/app/src/main/java/com/lukas/music/song/chords/Chord.kt +++ b/app/src/main/java/com/lukas/music/song/chords/Chord.kt @@ -21,7 +21,9 @@ var interval = Interval(note) set(value) { field = value - note = value.distance + if (note != value.distance) { + note = value.distance + } } fun getNotes(root: Note): Array { diff --git a/app/src/main/java/com/lukas/music/song/chords/Chord.kt b/app/src/main/java/com/lukas/music/song/chords/Chord.kt index b823fbb..4400dae 100644 --- a/app/src/main/java/com/lukas/music/song/chords/Chord.kt +++ b/app/src/main/java/com/lukas/music/song/chords/Chord.kt @@ -21,7 +21,9 @@ var interval = Interval(note) set(value) { field = value - note = value.distance + if (note != value.distance) { + note = value.distance + } } fun getNotes(root: Note): Array { diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditChordFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditChordFragment.kt index 9415cca..bd7a3d9 100644 --- a/app/src/main/java/com/lukas/music/ui/fragments/EditChordFragment.kt +++ b/app/src/main/java/com/lukas/music/ui/fragments/EditChordFragment.kt @@ -46,6 +46,9 @@ } else Interval.IntervalName.NAMES binding.pitchSpinner.setup(pitches, chord.interval.name.ordinal) { chord.note = Scale.MAJOR.steps[it] + if (binding.typeSpinner.selectedItemPosition == 0) { + chord.chordType = Scale.MAJOR.chordTypes[chord.interval.name.ordinal] + } songFragment.updateChords() } }