oppia-android icon indicating copy to clipboard operation
oppia-android copied to clipboard

Fix part of #5732: Introduce Flashback button

Open subhajitxyz opened this issue 6 months ago • 14 comments

Explanation

Fixes part of #5732

  • Introduce flashback_button_item.xml, FlashbackButtonViewModel.
  • Implement logic in StatePlayerRecyclerViewAssembler to show flashback button.
  • Add tests in StateFragmentTest.

Essential Checklist

  • [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • [x] Any changes to scripts/assets files have their rationale included in the PR explanation.
  • [x] The PR follows the style guide.
  • [x] The PR does not contain any unnecessary code changes from Android Studio (reference).
  • [x] The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • [x] The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

Light Mode Mobile

Normal Rotate
Light Rotate

Dark Mode Mobile

Normal Rotate
Light Rotate

Light Mode Tablet

Normal Rotate
Light Rotate

Dark Mode Tablet

Normal Rotate
Light Rotate

https://github.com/user-attachments/assets/73b32b7c-77bf-43e5-8824-5ead786e6eb4

If your PR includes UI-related changes, then:

  • Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
  • For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
  • Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
  • For PRs introducing new UI elements or color changes, both light and dark mode screenshots must be included
  • Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing

subhajitxyz avatar Jun 05 '25 18:06 subhajitxyz

Coverage Report

Results

Number of files assessed: 5 Overall Coverage: 0.00% Coverage Analysis: FAIL :x:

Failure Cases

File Failure Reason Status
FlashbackButtonViewModel.ktapp/src/main/java/org/oppia/android/app/player/state/itemviewmodel/FlashbackButtonViewModel.kt
No appropriate test file found for app/src/main/java/org/oppia/android/app/player/state/itemviewmodel/FlashbackButtonViewModel.kt. :x:

Exempted coverage

Files exempted from coverage
File Exemption Reason
StateFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
StateFragment.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
StateItemViewModel.ktapp/src/main/java/org/oppia/android/app/player/state/itemviewmodel/StateItemViewModel.kt
This file is exempted from having a test file; skipping coverage check.
StatePlayerRecyclerViewAssembler.ktapp/src/main/java/org/oppia/android/app/player/state/StatePlayerRecyclerViewAssembler.kt
This file is exempted from having a test file; skipping coverage check.

Refer test_file_exemptions.textproto for the comprehensive list of file exemptions and their required coverage percentages.

To learn more, visit the Oppia Android Code Coverage wiki page

github-actions[bot] avatar Jun 05 '25 20:06 github-actions[bot]

Coverage Report

Results

Number of files assessed: 5 Overall Coverage: 0.00% Coverage Analysis: PASS :white_check_mark:

Exempted coverage

Files exempted from coverage
File Exemption Reason
StateFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
StateFragment.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
StateItemViewModel.ktapp/src/main/java/org/oppia/android/app/player/state/itemviewmodel/StateItemViewModel.kt
This file is exempted from having a test file; skipping coverage check.
FlashbackButtonViewModel.ktapp/src/main/java/org/oppia/android/app/player/state/itemviewmodel/FlashbackButtonViewModel.kt
This file is exempted from having a test file; skipping coverage check.
StatePlayerRecyclerViewAssembler.ktapp/src/main/java/org/oppia/android/app/player/state/StatePlayerRecyclerViewAssembler.kt
This file is exempted from having a test file; skipping coverage check.

Refer test_file_exemptions.textproto for the comprehensive list of file exemptions and their required coverage percentages.

To learn more, visit the Oppia Android Code Coverage wiki page

github-actions[bot] avatar Jun 06 '25 11:06 github-actions[bot]

PTAL, @adhiamboperes

subhajitxyz avatar Jun 07 '25 04:06 subhajitxyz

@theayushyadav11, could you please take a first pass review on this PR?

adhiamboperes avatar Jun 09 '25 09:06 adhiamboperes

Thanks @subhajitxyz , took a initial pass and everything seems good to me.

theayushyadav11 avatar Jun 09 '25 20:06 theayushyadav11

APK & AAB differences analysis

Note that this is a summarized snapshot. See the CI artifacts for detailed differences.

Dev

Expand to see flavor specifics

Universal APK

APK file size: 19 MiB (old), 19 MiB (new), 3558 bytes (Added)

APK download size (estimated): 17 MiB (old), 17 MiB (new), 3566 bytes (Added)

Method count: 260768 (old), 260814 (new), 46 (Added)

Features: 2 (old), 2 (new), 0 (No change)

Permissions: 6 (old), 6 (new), 0 (No change)

Resources: 6901 (old), 6904 (new), 3 (Added)

  • Anim: 43 (old), 43 (new), 0 (No change)
  • Animator: 26 (old), 26 (new), 0 (No change)
  • Array: 15 (old), 15 (new), 0 (No change)
  • Attr: 922 (old), 922 (new), 0 (No change)
  • Bool: 9 (old), 9 (new), 0 (No change)
  • Color: 975 (old), 975 (new), 0 (No change)
  • Dimen: 1080 (old), 1080 (new), 0 (No change)
  • Drawable: 383 (old), 383 (new), 0 (No change)
  • Id: 1297 (old), 1298 (new), 1 (Added):
    • id/flashback_button (added)
  • Integer: 37 (old), 37 (new), 0 (No change)
  • Interpolator: 11 (old), 11 (new), 0 (No change)
  • Layout: 382 (old), 383 (new), 1 (Added):
    • layout/flashback_button_item (added)
  • Menu: 3 (old), 3 (new), 0 (No change)
  • Mipmap: 1 (old), 1 (new), 0 (No change)
  • Plurals: 10 (old), 10 (new), 0 (No change)
  • Raw: 2 (old), 2 (new), 0 (No change)
  • String: 863 (old), 864 (new), 1 (Added):
    • string/state_flashback_button (added)
  • Style: 836 (old), 836 (new), 0 (No change)
  • Xml: 6 (old), 6 (new), 0 (No change)

Lesson assets: 111 (old), 111 (new), 0 (No change)

AAB differences

Expand to see AAB specifics

Supported configurations:

  • hdpi (same)
  • ldpi (same)
  • mdpi (same)
  • tvdpi (same)
  • xhdpi (same)
  • xxhdpi (same)
  • xxxhdpi (same)

Base APK

APK file size: 18 MiB (old), 18 MiB (new), 3554 bytes (Added) APK download size (estimated): 17 MiB (old), 17 MiB (new), 5568 bytes (Added) Method count: 260768 (old), 260814 (new), 46 (Added) Resources: 6851 (old), 6854 (new), 3 (Added)

  • Id: 1297 (old), 1298 (new), 1 (Added)
  • Layout: 382 (old), 383 (new), 1 (Added)
  • String: 863 (old), 864 (new), 1 (Added)

Configuration hdpi

APK file size: 50 KiB (old), 50 KiB (new), 0 bytes (No change) APK download size (estimated): 18 KiB (old), 18 KiB (new), 0 bytes (No change)

Configuration ldpi

APK file size: 49 KiB (old), 49 KiB (new), 0 bytes (No change) APK download size (estimated): 14 KiB (old), 14 KiB (new), 0 bytes (No change)

Configuration mdpi

APK file size: 45 KiB (old), 45 KiB (new), 0 bytes (No change) APK download size (estimated): 14 KiB (old), 14 KiB (new), 0 bytes (No change)

Configuration tvdpi

APK file size: 86 KiB (old), 86 KiB (new), 0 bytes (No change) APK download size (estimated): 29 KiB (old), 29 KiB (new), 0 bytes (No change)

Configuration xhdpi

APK file size: 57 KiB (old), 57 KiB (new), 0 bytes (No change) APK download size (estimated): 21 KiB (old), 21 KiB (new), 0 bytes (No change)

Configuration xxhdpi

APK file size: 63 KiB (old), 63 KiB (new), 0 bytes (No change) APK download size (estimated): 29 KiB (old), 29 KiB (new), 0 bytes (No change)

Configuration xxxhdpi

APK file size: 63 KiB (old), 63 KiB (new), 0 bytes (No change) APK download size (estimated): 28 KiB (old), 28 KiB (new), 0 bytes (No change)

Alpha

Expand to see flavor specifics

Universal APK

APK file size: 11 MiB (old), 11 MiB (new), 4006 bytes (Added)

APK download size (estimated): 10 MiB (old), 10 MiB (new), 2325 bytes (Added)

Method count: 116124 (old), 116156 (new), 32 (Added)

Features: 2 (old), 2 (new), 0 (No change)

Permissions: 6 (old), 6 (new), 0 (No change)

Resources: 5855 (old), 5858 (new), 3 (Added)

  • Anim: 33 (old), 33 (new), 0 (No change)
  • Animator: 24 (old), 24 (new), 0 (No change)
  • Array: 14 (old), 14 (new), 0 (No change)
  • Attr: 888 (old), 888 (new), 0 (No change)
  • Bool: 8 (old), 8 (new), 0 (No change)
  • Color: 826 (old), 826 (new), 0 (No change)
  • Dimen: 806 (old), 806 (new), 0 (No change)
  • Drawable: 345 (old), 345 (new), 0 (No change)
  • Id: 1241 (old), 1242 (new), 1 (Added):
    • id/flashback_button (added)
  • Integer: 32 (old), 32 (new), 0 (No change)
  • Interpolator: 11 (old), 11 (new), 0 (No change)
  • Layout: 342 (old), 343 (new), 1 (Added):
    • layout/flashback_button_item (added)
  • Menu: 1 (old), 1 (new), 0 (No change)
  • Mipmap: 1 (old), 1 (new), 0 (No change)
  • Plurals: 10 (old), 10 (new), 0 (No change)
  • String: 795 (old), 796 (new), 1 (Added):
    • string/state_flashback_button (added)
  • Style: 477 (old), 477 (new), 0 (No change)
  • Xml: 1 (old), 1 (new), 0 (No change)

Lesson assets: 111 (old), 111 (new), 0 (No change)

AAB differences

Expand to see AAB specifics

Supported configurations:

  • hdpi (same)
  • ldpi (same)
  • mdpi (same)
  • tvdpi (same)
  • xhdpi (same)
  • xxhdpi (same)
  • xxxhdpi (same)

Base APK

APK file size: 11 MiB (old), 11 MiB (new), 4010 bytes (Added) APK download size (estimated): 10 MiB (old), 10 MiB (new), 7722 bytes (Added) Method count: 116124 (old), 116156 (new), 32 (Added) Resources: 5812 (old), 5815 (new), 3 (Added)

  • Id: 1241 (old), 1242 (new), 1 (Added)
  • Layout: 342 (old), 343 (new), 1 (Added)
  • String: 795 (old), 796 (new), 1 (Added)

Configuration hdpi

APK file size: 43 KiB (old), 43 KiB (new), 0 bytes (No change) APK download size (estimated): 17 KiB (old), 17 KiB (new), 0 bytes (No change)

Configuration ldpi

APK file size: 44 KiB (old), 44 KiB (new), 0 bytes (No change) APK download size (estimated): 13 KiB (old), 13 KiB (new), 0 bytes (No change)

Configuration mdpi

APK file size: 38 KiB (old), 38 KiB (new), 0 bytes (No change) APK download size (estimated): 13 KiB (old), 13 KiB (new), 0 bytes (No change)

Configuration tvdpi

APK file size: 73 KiB (old), 73 KiB (new), 0 bytes (No change) APK download size (estimated): 27 KiB (old), 27 KiB (new), 0 bytes (No change)

Configuration xhdpi

APK file size: 50 KiB (old), 50 KiB (new), 0 bytes (No change) APK download size (estimated): 20 KiB (old), 20 KiB (new), 0 bytes (No change)

Configuration xxhdpi

APK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change) APK download size (estimated): 28 KiB (old), 28 KiB (new), 0 bytes (No change)

Configuration xxxhdpi

APK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change) APK download size (estimated): 27 KiB (old), 27 KiB (new), 0 bytes (No change)

Beta

Expand to see flavor specifics

Universal APK

APK file size: 11 MiB (old), 11 MiB (new), 3698 bytes (Added)

APK download size (estimated): 10 MiB (old), 10 MiB (new), 4232 bytes (Added)

Method count: 116130 (old), 116162 (new), 32 (Added)

Features: 2 (old), 2 (new), 0 (No change)

Permissions: 6 (old), 6 (new), 0 (No change)

Resources: 5855 (old), 5858 (new), 3 (Added)

  • Anim: 33 (old), 33 (new), 0 (No change)
  • Animator: 24 (old), 24 (new), 0 (No change)
  • Array: 14 (old), 14 (new), 0 (No change)
  • Attr: 888 (old), 888 (new), 0 (No change)
  • Bool: 8 (old), 8 (new), 0 (No change)
  • Color: 826 (old), 826 (new), 0 (No change)
  • Dimen: 806 (old), 806 (new), 0 (No change)
  • Drawable: 345 (old), 345 (new), 0 (No change)
  • Id: 1241 (old), 1242 (new), 1 (Added):
    • id/flashback_button (added)
  • Integer: 32 (old), 32 (new), 0 (No change)
  • Interpolator: 11 (old), 11 (new), 0 (No change)
  • Layout: 342 (old), 343 (new), 1 (Added):
    • layout/flashback_button_item (added)
  • Menu: 1 (old), 1 (new), 0 (No change)
  • Mipmap: 1 (old), 1 (new), 0 (No change)
  • Plurals: 10 (old), 10 (new), 0 (No change)
  • String: 795 (old), 796 (new), 1 (Added):
    • string/state_flashback_button (added)
  • Style: 477 (old), 477 (new), 0 (No change)
  • Xml: 1 (old), 1 (new), 0 (No change)

Lesson assets: 111 (old), 111 (new), 0 (No change)

AAB differences

Expand to see AAB specifics

Supported configurations:

  • hdpi (same)
  • ldpi (same)
  • mdpi (same)
  • tvdpi (same)
  • xhdpi (same)
  • xxhdpi (same)
  • xxxhdpi (same)

Base APK

APK file size: 11 MiB (old), 11 MiB (new), 3702 bytes (Added) APK download size (estimated): 10 MiB (old), 10 MiB (new), 1545 bytes (Added) Method count: 116130 (old), 116162 (new), 32 (Added) Resources: 5812 (old), 5815 (new), 3 (Added)

  • Id: 1241 (old), 1242 (new), 1 (Added)
  • Layout: 342 (old), 343 (new), 1 (Added)
  • String: 795 (old), 796 (new), 1 (Added)

Configuration hdpi

APK file size: 43 KiB (old), 43 KiB (new), 0 bytes (No change) APK download size (estimated): 17 KiB (old), 17 KiB (new), 0 bytes (No change)

Configuration ldpi

APK file size: 44 KiB (old), 44 KiB (new), 0 bytes (No change) APK download size (estimated): 13 KiB (old), 13 KiB (new), 0 bytes (No change)

Configuration mdpi

APK file size: 38 KiB (old), 38 KiB (new), 0 bytes (No change) APK download size (estimated): 13 KiB (old), 13 KiB (new), 0 bytes (No change)

Configuration tvdpi

APK file size: 73 KiB (old), 73 KiB (new), 0 bytes (No change) APK download size (estimated): 27 KiB (old), 27 KiB (new), 0 bytes (No change)

Configuration xhdpi

APK file size: 50 KiB (old), 50 KiB (new), 0 bytes (No change) APK download size (estimated): 20 KiB (old), 20 KiB (new), 0 bytes (No change)

Configuration xxhdpi

APK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change) APK download size (estimated): 28 KiB (old), 28 KiB (new), 0 bytes (No change)

Configuration xxxhdpi

APK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change) APK download size (estimated): 27 KiB (old), 27 KiB (new), 0 bytes (No change)

Ga

Expand to see flavor specifics

Universal APK

APK file size: 11 MiB (old), 11 MiB (new), 3678 bytes (Added)

APK download size (estimated): 10 MiB (old), 10 MiB (new), 1678 bytes (Added)

Method count: 116130 (old), 116162 (new), 32 (Added)

Features: 2 (old), 2 (new), 0 (No change)

Permissions: 6 (old), 6 (new), 0 (No change)

Resources: 5855 (old), 5858 (new), 3 (Added)

  • Anim: 33 (old), 33 (new), 0 (No change)
  • Animator: 24 (old), 24 (new), 0 (No change)
  • Array: 14 (old), 14 (new), 0 (No change)
  • Attr: 888 (old), 888 (new), 0 (No change)
  • Bool: 8 (old), 8 (new), 0 (No change)
  • Color: 826 (old), 826 (new), 0 (No change)
  • Dimen: 806 (old), 806 (new), 0 (No change)
  • Drawable: 345 (old), 345 (new), 0 (No change)
  • Id: 1241 (old), 1242 (new), 1 (Added):
    • id/flashback_button (added)
  • Integer: 32 (old), 32 (new), 0 (No change)
  • Interpolator: 11 (old), 11 (new), 0 (No change)
  • Layout: 342 (old), 343 (new), 1 (Added):
    • layout/flashback_button_item (added)
  • Menu: 1 (old), 1 (new), 0 (No change)
  • Mipmap: 1 (old), 1 (new), 0 (No change)
  • Plurals: 10 (old), 10 (new), 0 (No change)
  • String: 795 (old), 796 (new), 1 (Added):
    • string/state_flashback_button (added)
  • Style: 477 (old), 477 (new), 0 (No change)
  • Xml: 1 (old), 1 (new), 0 (No change)

Lesson assets: 111 (old), 111 (new), 0 (No change)

AAB differences

Expand to see AAB specifics

Supported configurations:

  • hdpi (same)
  • ldpi (same)
  • mdpi (same)
  • tvdpi (same)
  • xhdpi (same)
  • xxhdpi (same)
  • xxxhdpi (same)

Base APK

APK file size: 11 MiB (old), 11 MiB (new), 3682 bytes (Added) APK download size (estimated): 10 MiB (old), 10 MiB (new), 384 bytes (Added) Method count: 116130 (old), 116162 (new), 32 (Added) Resources: 5812 (old), 5815 (new), 3 (Added)

  • Id: 1241 (old), 1242 (new), 1 (Added)
  • Layout: 342 (old), 343 (new), 1 (Added)
  • String: 795 (old), 796 (new), 1 (Added)

Configuration hdpi

APK file size: 43 KiB (old), 43 KiB (new), 0 bytes (No change) APK download size (estimated): 17 KiB (old), 17 KiB (new), 0 bytes (No change)

Configuration ldpi

APK file size: 44 KiB (old), 44 KiB (new), 0 bytes (No change) APK download size (estimated): 13 KiB (old), 13 KiB (new), 0 bytes (No change)

Configuration mdpi

APK file size: 38 KiB (old), 38 KiB (new), 0 bytes (No change) APK download size (estimated): 13 KiB (old), 13 KiB (new), 0 bytes (No change)

Configuration tvdpi

APK file size: 73 KiB (old), 73 KiB (new), 0 bytes (No change) APK download size (estimated): 27 KiB (old), 27 KiB (new), 0 bytes (No change)

Configuration xhdpi

APK file size: 50 KiB (old), 50 KiB (new), 0 bytes (No change) APK download size (estimated): 20 KiB (old), 20 KiB (new), 0 bytes (No change)

Configuration xxhdpi

APK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change) APK download size (estimated): 28 KiB (old), 28 KiB (new), 0 bytes (No change)

Configuration xxxhdpi

APK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change) APK download size (estimated): 27 KiB (old), 27 KiB (new), 0 bytes (No change)

github-actions[bot] avatar Jun 10 '25 04:06 github-actions[bot]

Unassigning @adhiamboperes since the review is done.

oppiabot[bot] avatar Jun 10 '25 12:06 oppiabot[bot]

Hi @subhajitxyz, it looks like some changes were requested on this pull request by @adhiamboperes. PTAL. Thanks!

oppiabot[bot] avatar Jun 10 '25 12:06 oppiabot[bot]

Coverage Report

Results

Number of files assessed: 5 Overall Coverage: 0.00% Coverage Analysis: PASS :white_check_mark:

Exempted coverage

Files exempted from coverage
File Exemption Reason
FlashbackButtonViewModel.ktapp/src/main/java/org/oppia/android/app/player/state/itemviewmodel/FlashbackButtonViewModel.kt
This file is exempted from having a test file; skipping coverage check.
StateItemViewModel.ktapp/src/main/java/org/oppia/android/app/player/state/itemviewmodel/StateItemViewModel.kt
This file is exempted from having a test file; skipping coverage check.
StateFragment.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
StateFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
StatePlayerRecyclerViewAssembler.ktapp/src/main/java/org/oppia/android/app/player/state/StatePlayerRecyclerViewAssembler.kt
This file is exempted from having a test file; skipping coverage check.

Refer test_file_exemptions.textproto for the comprehensive list of file exemptions and their required coverage percentages.

To learn more, visit the Oppia Android Code Coverage wiki page

github-actions[bot] avatar Jun 11 '25 16:06 github-actions[bot]

PTAL @adhiamboperes, Update tests with both feature flag on and off. Added UI proof in PR description.

subhajitxyz avatar Jun 16 '25 17:06 subhajitxyz

Unassigning @subhajitxyz since a re-review was requested. @subhajitxyz, please make sure you have addressed all review comments. Thanks!

oppiabot[bot] avatar Jun 16 '25 17:06 oppiabot[bot]

Hi @subhajitxyz, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks!

oppiabot[bot] avatar Jun 18 '25 08:06 oppiabot[bot]

@subhajitxyz, just checking, shouldn't the base branch for this PR be develop? I believe the earlier PR wasalreaady merged?

adhiamboperes avatar Jun 20 '25 13:06 adhiamboperes

Hi @adhiamboperes , I have updated tests.

subhajitxyz avatar Jun 22 '25 05:06 subhajitxyz

Hi @subhajitxyz, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks!

oppiabot[bot] avatar Jun 23 '25 09:06 oppiabot[bot]

Thanks @subhajitxyz, latest changes LGTM.

Please fix the base branch issue. Ok. I will update.

subhajitxyz avatar Jun 23 '25 09:06 subhajitxyz

Noted, could you please include the PR numbers in the description going forward?

adhiamboperes avatar Jun 23 '25 09:06 adhiamboperes

Noted, could you please include the PR numbers in the description going forward?

Done.

subhajitxyz avatar Jun 24 '25 05:06 subhajitxyz