Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Rd4dev/oppia-android int…
Browse files Browse the repository at this point in the history
…o Issue#5015-AddCIToOppiaAndroidWiki(checkTOC)
  • Loading branch information
Rd4dev committed Oct 9, 2024
2 parents 7cbad11 + 5f58b8f commit 2f15577
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.oppia.android.app.topic.revisioncard
import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.activity.OnBackPressedCallback
import org.oppia.android.app.activity.ActivityComponentImpl
import org.oppia.android.app.activity.InjectableAutoLocalizedAppCompatActivity
import org.oppia.android.app.model.ProfileId
Expand Down Expand Up @@ -56,6 +57,15 @@ class RevisionCardActivity :
subtopicListSize
)
}
onBackPressedDispatcher.addCallback(
this,
object : OnBackPressedCallback(/* enabled = */ true) {
override fun handleOnBackPressed() {
revisionCardActivityPresenter.setReadingTextSizeMedium()
onReturnToTopicRequested()
}
}
)
}

override fun handleOnOptionsItemSelected(itemId: Int) {
Expand Down Expand Up @@ -115,13 +125,6 @@ class RevisionCardActivity :
revisionCardActivityPresenter.dismissConceptCard()
}

// TODO(#5404): Migrate to a back pressed dispatcher.
@Deprecated("Deprecated in Java")
override fun onBackPressed() {
revisionCardActivityPresenter.setReadingTextSizeMedium()
onReturnToTopicRequested()
}

override fun onDefaultFontSizeLoaded(readingTextSize: ReadingTextSize) {
revisionCardActivityPresenter.loadRevisionCardFragment(readingTextSize)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ class RevisionCardActivityPresenter @Inject constructor(
binding.revisionCardToolbar.setNavigationOnClickListener {
(activity as ReturnToTopicClickListener).onReturnToTopicRequested()
fontScaleConfigurationUtil.adjustFontScale(activity, ReadingTextSize.MEDIUM_TEXT_SIZE)
@Suppress("DEPRECATION") // TODO(#5404): Migrate to a back pressed dispatcher.
activity.onBackPressed()
activity.onBackPressedDispatcher.onBackPressed()
}
if (!accessibilityService.isScreenReaderEnabled()) {
binding.revisionCardToolbarTitle.setOnClickListener {
Expand Down

0 comments on commit 2f15577

Please sign in to comment.