File tree Expand file tree Collapse file tree 2 files changed +1
-6
lines changed
AnkiDroid/src/main/java/com/ichi2/anki Expand file tree Collapse file tree 2 files changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -1916,16 +1916,12 @@ open class CardBrowser :
19161916
19171917 private fun saveScrollingState (id : CardOrNoteId ) {
19181918 viewModel.cards.indexOf(id).takeIf { it >= 0 }?.let { position ->
1919- val layoutManager = cardsListView.layoutManager as LinearLayoutManager
1920- val firstVisiblePosition = layoutManager.findFirstVisibleItemPosition()
1921- val view = cardsListView.getChildAt(position - firstVisiblePosition)
19221919 viewModel.lastSelectedPosition = position
1923- viewModel.oldCardTopOffset = view?.top ? : 0
19241920 }
19251921 }
19261922
19271923 private fun autoScrollTo (newPosition : Int ) {
1928- (cardsListView.layoutManager as LinearLayoutManager ).scrollToPositionWithOffset (newPosition, viewModel.oldCardTopOffset )
1924+ (cardsListView.layoutManager as LinearLayoutManager ).scrollToPosition (newPosition)
19291925 }
19301926}
19311927
Original file line number Diff line number Diff line change @@ -97,7 +97,6 @@ class CardBrowserViewModel(
9797) : ViewModel(),
9898 SharedPreferencesProvider by preferences {
9999 var lastSelectedPosition: Int = 0
100- var oldCardTopOffset: Int = 0
101100
102101 // TODO: abstract so we can use a `Context` and `pref_display_filenames_in_browser_key`
103102 val showMediaFilenames = sharedPrefs().getBoolean(" card_browser_show_media_filenames" , false )
You can’t perform that action at this time.
0 commit comments