Skip to content

Commit

Permalink
Fix issue, that when note is edited, the highlighted note sometimes
Browse files Browse the repository at this point in the history
changes without good reason.
  • Loading branch information
thetwom committed Oct 20, 2021
1 parent e462c28 commit f265d37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 33 deletions.
7 changes: 4 additions & 3 deletions app/src/main/java/de/moekadu/metronome/SoundChooser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,8 @@ class SoundChooser(context : Context, attrs : AttributeSet?, defStyleAttr: Int)
plusButton.setOnClickListener {
val newNote = controlButtons.lastOrNull()?.note?.clone()?.apply { uid = UId.create() }
?: NoteListItem(defaultNote, 1.0f, NoteDuration.Quarter)
nextActiveControlButtonUidOnNoteListChange = newNote.uid
if (status == Status.Static)
nextActiveControlButtonUidOnNoteListChange = newNote.uid
stateChangedListener?.addNote(newNote)
}
deleteButton.setOnClickListener {
Expand Down Expand Up @@ -1203,8 +1204,8 @@ class SoundChooser(context : Context, attrs : AttributeSet?, defStyleAttr: Int)
controlButtons.find { it.uid == nextActiveControlButtonUidOnNoteListChange }?.let {
setActiveControlButton(it, 0L)
}
nextActiveControlButtonUidOnNoteListChange = null
}
nextActiveControlButtonUidOnNoteListChange = null

activeControlButton?.noteDuration?.let { noteDuration ->
if (noteDuration != noteDurationBefore)
Expand Down Expand Up @@ -1260,7 +1261,7 @@ class SoundChooser(context : Context, attrs : AttributeSet?, defStyleAttr: Int)
private fun deleteNote(uid: UId?) {
if (uid == null)
return
if (activeControlButton?.uid == uid) {
if (activeControlButton?.uid == uid && status == Status.Static) {
val buttonIndex = controlButtons.indexOf(activeControlButton)
nextActiveControlButtonUidOnNoteListChange =
if (buttonIndex < 0 || controlButtons.size <= 1) null
Expand Down
31 changes: 1 addition & 30 deletions fastlane/metadata/android/en-US/changelogs/42.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,4 @@
v4.0.0:
- Notes with different speeds
- UI improvements
- Mute Button
- More accurate tick visualization (still to be tested)
- Choose between different tick visualizations

v4.0.1:
- Fix: That tick visualization did sometimes not stop.
- Fix: Stop showing active scene title when when it is deleted.
- Fix: Animation issues.

v4.1.0:
- Improved selection of different beat durations
- Slight UI changes to better fit different aspect ratios
- Fix: UI issue with note editor and high-dpi devices
- Fix: Avoid overlap of bpm-text and slide-to-scenes-image
- Fix: Incorrect note sizes for large displays

v4.1.2:
- Consider plurals in strings.

v4.1.3:
- Update dependencies.
- Increase opacity in bounce tick visualization a bit.

v4.1.4:
- Bring app to background when "back"-button is pressed.
- Update French translations (thanks to brilnius)

v4.2.0:
- Player controls in scenes view
- Fix issue that after edit of a scene the notelist was not always updated
- Fix issue, that when editing a note, sometimes the position jumps arbitrarily

0 comments on commit f265d37

Please sign in to comment.