Skip to content

Commit

Permalink
Fix topic-play-expanded-list (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
rt4914 authored Nov 7, 2019
1 parent a9d3e63 commit 4f6476a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ class TopicPlayFragment : InjectableFragment(), ExpandedChapterListIndexListener

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
if (savedInstanceState != null) {
currentExpandedChapterListIndex = savedInstanceState.getInt(KEY_CURRENT_EXPANDED_LIST_INDEX)
currentExpandedChapterListIndex = savedInstanceState.getInt(KEY_CURRENT_EXPANDED_LIST_INDEX, -1)
if (currentExpandedChapterListIndex == -1) {
currentExpandedChapterListIndex = null
}
}
return topicPlayFragmentPresenter.handleCreateView(
inflater,
Expand All @@ -36,7 +39,7 @@ class TopicPlayFragment : InjectableFragment(), ExpandedChapterListIndexListener

override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
if(currentExpandedChapterListIndex!=null) {
if (currentExpandedChapterListIndex != null) {
outState.putInt(KEY_CURRENT_EXPANDED_LIST_INDEX, currentExpandedChapterListIndex!!)
}
}
Expand Down

0 comments on commit 4f6476a

Please sign in to comment.