Skip to content

Commit

Permalink
Scroll selected annotation into view when opening sidebar Closes #184.
Browse files Browse the repository at this point in the history
Upping versionCode to 116
  • Loading branch information
Dima-Android committed Nov 7, 2024
1 parent 77a985a commit 53ccf71
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2228,8 +2228,19 @@ class PdfReaderViewModel @Inject constructor(
}

fun toggleSideBar() {
val newShowSideBarState = !viewState.showSideBar
updateState {
copy(showSideBar = !showSideBar)
copy(showSideBar = newShowSideBarState)
}
val selectedAnnotationKey = viewState.selectedAnnotationKey
if (newShowSideBarState && selectedAnnotationKey != null) {
val index = viewState.sortedKeys.indexOf(selectedAnnotationKey)
triggerEffect(
PdfReaderViewEffect.ShowPdfAnnotationAndUpdateAnnotationsList(
index,
false
)
)
}
}

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/BuildConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ object BuildConfig {
const val compileSdkVersion = 34
const val targetSdk = 34

val versionCode = 115 // Must be updated on every build
val versionCode = 116 // Must be updated on every build
val version = Version(
major = 1,
minor = 0,
Expand Down

0 comments on commit 53ccf71

Please sign in to comment.