Skip to content

Commit

Permalink
Address some lifecycle issues
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Nov 3, 2023
1 parent 93bb834 commit 9505a62
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
9 changes: 7 additions & 2 deletions README-CHANGES.xml
Original file line number Diff line number Diff line change
Expand Up @@ -350,19 +350,24 @@
<c:change date="2023-10-25T00:00:00+00:00" summary="Fixed crash on Reader screen due to more than one Fragment instance."/>
</c:changes>
</c:release>
<c:release date="2023-11-03T10:24:54+00:00" is-open="true" ticket-system="org.lyrasis.jira" version="1.8.0">
<c:release date="2023-11-03T14:15:29+00:00" is-open="true" ticket-system="org.lyrasis.jira" version="1.8.0">
<c:changes>
<c:change date="2023-10-30T00:00:00+00:00" summary="Removed the Android 12+ devices default splash screen."/>
<c:change date="2023-10-31T00:00:00+00:00" summary="Reduce audio book related crashes.">
<c:tickets>
<c:ticket id="PP-565"/>
</c:tickets>
</c:change>
<c:change date="2023-11-03T10:24:54+00:00" summary="Fix a possible crash if an audio book fails to open.">
<c:change date="2023-11-03T00:00:00+00:00" summary="Fix a possible crash if an audio book fails to open.">
<c:tickets>
<c:ticket id="PP-672"/>
</c:tickets>
</c:change>
<c:change date="2023-11-03T14:15:29+00:00" summary="Address some R2 lifecycle issues.">
<c:tickets>
<c:ticket id="PP-676"/>
</c:tickets>
</c:change>
</c:changes>
</c:release>
</c:releases>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,23 @@ class Reader2Activity : AppCompatActivity(R.layout.reader2) {
)
}

@Deprecated("Deprecated in Java")
override fun onBackPressed() {
if (this.tocFragment.isVisible) {
this.tocClose()
} else if (this.searchFragment.isVisible) {
this.searchClose()
} else {
super.onBackPressed()
if (this::tocFragment.isInitialized) {
if (this.tocFragment.isVisible) {
this.tocClose()
return
}
}

if (this::searchFragment.isInitialized) {
if (this.searchFragment.isVisible) {
this.searchClose()
return
}
}

super.onBackPressed()
}

/**
Expand Down

0 comments on commit 9505a62

Please sign in to comment.