Skip to content

Commit

Permalink
fix(browser): remove redundant ViewModel call
Browse files Browse the repository at this point in the history
unnecessary logging from logs of 'setColumn[1/2]'
  • Loading branch information
david-allison authored and lukstbit committed Jun 19, 2024
1 parent 1842858 commit 5c8919f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AnkiDroid/src/main/java/com/ichi2/anki/CardBrowser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,10 @@ open class CardBrowser :
).apply {
setDropDownViewResource(R.layout.spinner_custom_layout)
}
setSelection(COLUMN1_KEYS.indexOf(viewModel.column1))
onItemSelectedListener = BasicItemSelectedListener { pos, _ ->
viewModel.setColumn1(COLUMN1_KEYS[pos])
}
setSelection(COLUMN1_KEYS.indexOf(viewModel.column1))
}

// Setup the column 2 heading as a spinner so that users can easily change the column type
Expand All @@ -498,11 +498,11 @@ open class CardBrowser :
// The custom layout for the adapter is used to prevent the overlapping of various interactive components on the screen
setDropDownViewResource(R.layout.spinner_custom_layout)
}
setSelection(COLUMN2_KEYS.indexOf(viewModel.column2))
// Create a new list adapter with updated column map any time the user changes the column
onItemSelectedListener = BasicItemSelectedListener { pos, _ ->
viewModel.setColumn2(COLUMN2_KEYS[pos])
}
setSelection(COLUMN2_KEYS.indexOf(viewModel.column2))
}
}

Expand Down

0 comments on commit 5c8919f

Please sign in to comment.