Skip to content

Fix #6145: Fix Admin PIN tablet layout - #6370

Open
samarthshukla20 wants to merge 3 commits into
oppia:developfrom
samarthshukla20:fix/admin-auth-tablet-background
Open

Fix #6145: Fix Admin PIN tablet layout#6370
samarthshukla20 wants to merge 3 commits into
oppia:developfrom
samarthshukla20:fix/admin-auth-tablet-background

Conversation

@samarthshukla20

@samarthshukla20 samarthshukla20 commented Aug 22, 2026

Copy link
Copy Markdown

Explanation

Fixes #6145

This PR fixes the Admin PIN tablet layout where the screen background did not
stretch across the full available width, resulting in large empty spaces around
the content.

The fix changes the NestedScrollView width to 0dp, allowing it to fill the
available width using its existing start and end constraints while preserving
the existing centered content layout.

Essential Checklist

  • The PR title starts with "Fix #bugnum: "
  • The explanation section above starts with "Fixes #bugnum: "
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio.
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers.

Disclosure of LLM Usage

  • Did you use AI/LLMs when working on this PR? Yes.
  • If yes, describe the extent AI was used: AI was used for debugging and investigating the existing layout configuration, reviewing the proposed change, and assisting with build and Git workflow troubleshooting.

For UI-specific PRs only

Before

The screenshot below is from the original issue report and illustrates the
reported layout problem, where the background did not cover the full available
tablet screen.

Layout issue from the original issue report

After

The updated layout was verified on the emulator. The background now fills the
available screen width while the content remains properly centered.

Updated Admin PIN tablet layout

@samarthshukla20
samarthshukla20 requested a review from a team as a code owner August 22, 2026 18:16
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5fca9fe9-3590-4ab0-a254-b7aa66fa6269

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

@samarthshukla20 this PR is being marked as draft because the PR description must contain 'Fixes #' or 'Fixes part of #' for each issue the PR is changing, and each one on its own line with no other text.

@github-actions
github-actions Bot marked this pull request as draft August 22, 2026 18:17
@samarthshukla20

Copy link
Copy Markdown
Author

UI Verification

Tablet – Portrait – After

Verified the AdminAuthActivity on a tablet emulator after changing
admin_auth_activity_layout_width from 360dp to 0dp.

The background now covers the full available tablet screen width and the
content remains correctly positioned.
Screenshot 2026-08-23 093122

@samarthshukla20
samarthshukla20 marked this pull request as ready for review August 23, 2026 04:06
@github-actions

Copy link
Copy Markdown
Contributor

@samarthshukla20 this PR is being marked as draft because the PR description must contain 'Fixes #' or 'Fixes part of #' for each issue the PR is changing, and each one on its own line with no other text.

@github-actions
github-actions Bot marked this pull request as draft August 23, 2026 04:08
@samarthshukla20
samarthshukla20 marked this pull request as ready for review August 23, 2026 06:03
@adhiamboperes

Copy link
Copy Markdown
Contributor

Hi @samarthshukla20, if the PR is ready for review, please assign @Neer-rn for a first review pass by “@username, PTAL. Always do this when you want someone to take a look at your work.

@samarthshukla20
samarthshukla20 marked this pull request as draft August 25, 2026 07:01
@samarthshukla20
samarthshukla20 marked this pull request as ready for review August 25, 2026 07:07
@samarthshukla20

Copy link
Copy Markdown
Author

@Neer-rn Hi! @adhiamboperes suggested assigning you for a first review pass on this PR. I’m unable to add you directly in the Reviewers section, so I’m mentioning you here instead. I’ve implemented and locally verified the AdminAuthActivity tablet layout fix for #6145. Could you please take a look when you get a chance? Thank you!

@oppiabot oppiabot Bot assigned adhiamboperes and unassigned samarthshukla20 Aug 25, 2026
@oppiabot

oppiabot Bot commented Aug 25, 2026

Copy link
Copy Markdown

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

@Neer-rn Neer-rn assigned Neer-rn and unassigned adhiamboperes Aug 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Results

Coverage Analysis: SKIP ⏭️

This PR did not introduce any changes to Kotlin source or test files.

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

@Sandesh282

Copy link
Copy Markdown
Collaborator

@samarthshukla20 Please sign the CLA before contributing. Also I'd recommend going through this wiki if you haven't already.

@Neer-rn Neer-rn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @samarthshukla20, thanks for working on this!

The fix might work on the screen from the issue. But this dimen is also used by admin_auth_activity.xml, and that screen is fine right now. On a tablet its content sits as a 360dp column in the middle, and after this change it might stretche to the full width with no margins, so the text and PIN box touch the screen edges. This is me just guessing looking at the code but you can verify this for me.

The screen in the issue is actually AdminPin, not AdminAuth. Both have the same toolbar title so it is easy to mix up. Please read this comment I think the solution to this issue is already mentioned here. Please try to work on it.

Also when you are done with your work you can re-assign me this by commenting '@username PTAL' and the oppia-bot will assign me for review you cannot manually assign me the issue as of now.

Comment thread app/src/main/res/values-sw600dp-port/dimens.xml
Comment thread app/src/main/res/values-sw600dp-land/dimens.xml Outdated
@oppiabot oppiabot Bot unassigned Neer-rn Aug 25, 2026
@oppiabot

oppiabot Bot commented Aug 25, 2026

Copy link
Copy Markdown

Unassigning @Neer-rn since the review is done.

@oppiabot

oppiabot Bot commented Aug 25, 2026

Copy link
Copy Markdown

Hi @samarthshukla20, it looks like some changes were requested on this pull request by @Neer-rn. PTAL. Thanks!

@samarthshukla20

Copy link
Copy Markdown
Author

@Neer-rn, PTAL

@oppiabot

oppiabot Bot commented Aug 26, 2026

Copy link
Copy Markdown

Hi @samarthshukla20, it looks like some changes were requested on this pull request by @Neer-rn. PTAL. Thanks!

@samarthshukla20

Copy link
Copy Markdown
Author

Done. I reverted the two dimens.xml changes as suggested and tested the fix again. The layout still works correctly with only the change in admin_pin_activity.xml. I also updated the PR description with before and after screenshots. @Neer-rn PTAL, thanks!

@oppiabot

oppiabot Bot commented Aug 29, 2026

Copy link
Copy Markdown

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

@Neer-rn Neer-rn self-assigned this Aug 29, 2026

@Neer-rn Neer-rn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @samarthshukla20, I see no changes here, your last commit was on Aug 25, did you push your new changes?? Please make sure you address my previous comment then only re-assign me.

@oppiabot oppiabot Bot unassigned Neer-rn Aug 29, 2026
@oppiabot

oppiabot Bot commented Aug 29, 2026

Copy link
Copy Markdown

Unassigning @Neer-rn since the review is done.

@oppiabot

oppiabot Bot commented Aug 29, 2026

Copy link
Copy Markdown

Hi @samarthshukla20, it looks like some changes were requested on this pull request by @Neer-rn. PTAL. Thanks!

@samarthshukla20

Copy link
Copy Markdown
Author

Hi @Neer-rn, I've addressed your previous feedback. The unnecessary dimens.xml changes were reverted, and the fix is now limited to admin_pin_activity.xml. I've also updated the PR description with before and after screenshots. The latest changes are in commit ca3a894. Thanks!

@Neer-rn

Neer-rn commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

@samarthshukla20 I think you reverted the files locally but didn't commit and push them. Please look at the section of files changed still I can see 3 files changed. I can only see one single commit being pushed in total on this PR. The commit you showed me ca3a894 doesn't belong to this particular branch. If you are not sure how git and github works then I recommend you taking help of LLM to figure things out.

Screenshot from 2026-08-29 22-38-51 Screenshot from 2026-08-29 22-38-58

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Results

Number of files assessed: 42
Overall Coverage: 89.20%
Coverage Analysis: PASS

Passing coverage

Files with passing code coverage
File Coverage Lines Hit Status Min Required
EdgeToEdgeHelper.ktapp/src/main/java/org/oppia/android/app/utility/edgetoedge/EdgeToEdgeHelper.kt
95.42% 229 / 240 70%
LocaleController.ktdomain/src/main/java/org/oppia/android/domain/locale/LocaleController.kt
92.49% 160 / 173 70%
TranslationController.ktdomain/src/main/java/org/oppia/android/domain/translation/TranslationController.kt
94.15% 161 / 171 70%
LiTagHandler.ktutility/src/main/java/org/oppia/android/util/parser/html/LiTagHandler.kt
89.86% 133 / 148 70%
WorkedExampleTagHandler.ktutility/src/main/java/org/oppia/android/util/parser/html/WorkedExampleTagHandler.kt
97.37% 74 / 76 70%
TestOppiaBidiFormatter.ktutility/src/main/java/org/oppia/android/util/locale/testing/TestOppiaBidiFormatter.kt
82.61% 19 / 23 70%
OppiaBidiFormatterImpl.ktutility/src/main/java/org/oppia/android/util/locale/OppiaBidiFormatterImpl.kt
100.00% 5 / 5 70%
MachineLocaleImpl.ktutility/src/main/java/org/oppia/android/util/locale/MachineLocaleImpl.kt
86.05% 37 / 43 70%
AndroidLocaleProfile.ktutility/src/main/java/org/oppia/android/util/locale/AndroidLocaleProfile.kt
100.00% 94 / 94 70%
VersionInversionChecker.ktscripts/src/java/org/oppia/android/scripts/release/VersionInversionChecker.kt
100.00% 48 / 48 70%
UploadChangelogToPlayConsole.ktscripts/src/java/org/oppia/android/scripts/release/UploadChangelogToPlayConsole.kt
86.67% 91 / 105 70%
FakePlayConsoleClient.ktscripts/src/java/org/oppia/android/scripts/release/FakePlayConsoleClient.kt
86.36% 114 / 132 70%
UpdateRolloutFraction.ktscripts/src/java/org/oppia/android/scripts/release/UpdateRolloutFraction.kt
86.30% 63 / 73 70%
UploadBinaryToPlayConsole.ktscripts/src/java/org/oppia/android/scripts/release/UploadBinaryToPlayConsole.kt
98.23% 111 / 113 70%
AndroidBuildSdkProperties.ktscripts/src/java/org/oppia/android/scripts/common/AndroidBuildSdkProperties.kt
100.00% 10 / 10 70%
LintAnalysisReporter.ktscripts/src/java/org/oppia/android/scripts/lint/LintAnalysisReporter.kt
95.05% 422 / 444 70%
AndroidLintRunner.ktscripts/src/java/org/oppia/android/scripts/lint/AndroidLintRunner.kt
71.83% 255 / 355 70%
LintModelCreator.ktscripts/src/java/org/oppia/android/scripts/lint/LintModelCreator.kt
81.82% 180 / 220 70%

Exempted coverage

Files exempted from coverage
File Exemption Reason
ProfileChooserFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/profile/ProfileChooserFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
ProfileChooserFragmentPresenterV1.ktapp/src/main/java/org/oppia/android/app/profile/ProfileChooserFragmentPresenterV1.kt
This file is exempted from having a test file; skipping coverage check.
ProfileChooserFragment.ktapp/src/main/java/org/oppia/android/app/profile/ProfileChooserFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
AudioViewModel.ktapp/src/main/java/org/oppia/android/app/player/audio/AudioViewModel.kt
This file is exempted from having a test file; 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.
StateFragment.ktapp/src/main/java/org/oppia/android/app/player/state/StateFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
NavigationDrawerFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/drawer/NavigationDrawerFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
AppLanguageResourceHandler.ktapp/src/main/java/org/oppia/android/app/translation/AppLanguageResourceHandler.kt
This file is incompatible with code coverage tooling; skipping coverage check.
ProfilePictureActivityPresenter.ktapp/src/main/java/org/oppia/android/app/profileprogress/ProfilePictureActivityPresenter.kt
This file is exempted from having a test file; skipping coverage check.
AppLanguageFragment.ktapp/src/main/java/org/oppia/android/app/options/AppLanguageFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
AudioLanguageSelectionViewModel.ktapp/src/main/java/org/oppia/android/app/options/AudioLanguageSelectionViewModel.kt
This file is exempted from having a test file; skipping coverage check.
SplashActivity.ktapp/src/main/java/org/oppia/android/app/splash/SplashActivity.kt
This file is incompatible with code coverage tooling; skipping coverage check.
WalkthroughActivityPresenter.ktapp/src/main/java/org/oppia/android/app/walkthrough/WalkthroughActivityPresenter.kt
This file is exempted from having a test file; skipping coverage check.
HomeActivity.ktapp/src/main/java/org/oppia/android/app/home/HomeActivity.kt
This file is incompatible with code coverage tooling; skipping coverage check.
OnboardingFragmentPresenterV1.ktapp/src/main/java/org/oppia/android/app/onboarding/OnboardingFragmentPresenterV1.kt
This file is exempted from having a test file; skipping coverage check.
OnboardingFragment.ktapp/src/main/java/org/oppia/android/app/onboarding/OnboardingFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
QuestionAssessmentProgressController.ktdomain/src/main/java/org/oppia/android/domain/question/QuestionAssessmentProgressController.kt
This file is incompatible with code coverage tooling; skipping coverage check.
ExplorationProgressController.ktdomain/src/main/java/org/oppia/android/domain/exploration/ExplorationProgressController.kt
This file is incompatible with code coverage tooling; skipping coverage check.
TopicController.ktdomain/src/main/java/org/oppia/android/domain/topic/TopicController.kt
This file is incompatible with code coverage tooling; skipping coverage check.
HtmlParser.ktutility/src/main/java/org/oppia/android/util/parser/html/HtmlParser.kt
This file is incompatible with code coverage tooling; skipping coverage check.
ListItemLeadingMarginSpan.ktutility/src/main/java/org/oppia/android/util/parser/html/ListItemLeadingMarginSpan.kt
This file is incompatible with code coverage tooling; skipping coverage check.
MathBitmapModelLoader.ktutility/src/main/java/org/oppia/android/util/parser/math/MathBitmapModelLoader.kt
This file is exempted from having a test file; skipping coverage check.
AccessibilityServiceImpl.ktutility/src/main/java/org/oppia/android/util/accessibility/AccessibilityServiceImpl.kt
This file is exempted from having a test file; skipping coverage check.
FrozenReleaseConfig.ktscripts/src/java/org/oppia/android/scripts/release/FrozenReleaseConfig.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

@samarthshukla20

Copy link
Copy Markdown
Author

Hi @Neer-rn, I’ve addressed your feedback. The unnecessary dimens.xml changes have been reverted and the PR now contains only the change in admin_pin_activity.xml. I also verified the updated layout on the tablet emulator and updated the PR description with before/after screenshots. PTAL, thanks!
Screenshot 2026-08-30 001814

@oppiabot

oppiabot Bot commented Aug 29, 2026

Copy link
Copy Markdown

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

@Neer-rn Neer-rn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @samarthshukla20, One small thing: your PR title and description say AdminAuthActivity, can you fix that in both places? Also the "Before" image is the same one from the issue did you just take that image from issue? Were you able to reproduce the issue or not?

@samarthshukla20

Copy link
Copy Markdown
Author

Hi @Neer-rn, thanks! I've updated the PR title and description to refer to the Admin PIN layout instead of AdminAuthActivity. The "Before" screenshot is from the original issue report; I did not capture it myself. I verified the updated layout on the emulator after applying the fix. PTAL, thanks!

@samarthshukla20 samarthshukla20 changed the title Fix #6145: Fix AdminAuthActivity tablet layout Fix #6145: Fix Admin PIN tablet layout Aug 30, 2026

@Neer-rn Neer-rn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

@adhiamboperes

Copy link
Copy Markdown
Contributor

@samarthshukla20, could you please add the full screenshots expected? app/src/main/res/layout/admin_pin_activity.xml is shared between both the mobile and tablet devices, so please attache the "after" for both. Also show dark mode.

One of the best ways for displaying multiple images is to use markdown tables. Please see #5880 for example. Please see documentation on md tables: https://www.markdownguide.org/extended-syntax/

@samarthshukla20

Copy link
Copy Markdown
Author

Hi @adhiamboperes ! I wanted to provide an update regarding testing the fix. I was able to successfully make and verify the layout change earlier in my WSL environment, and the Bazel build completed successfully there. However, while cleaning up my development environment afterward, I accidentally removed that WSL setup.

I attempted to recreate the environment on Windows to continue testing, including setting up the required Android SDK versions and Bazel dependencies, but the Oppia build requires several environment-specific dependencies and the setup started consuming a significant amount of storage. I therefore decided to stop recreating the environment.

The code change itself is limited to changing the NestedScrollView width to 0dp, allowing it to fill the available width through its existing constraints while preserving the centered content layout. I have also included the before/after screenshots demonstrating the issue and the resulting fix.

I apologize for the inconvenience caused by this situation. I hope this does not cause any issues with merging the PR, but please let me know if you would prefer any additional testing or changes from my side. Thank you for your understanding!

@Neer-rn

Neer-rn commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Hi @adhiamboperes ! I wanted to provide an update regarding testing the fix. I was able to successfully make and verify the layout change earlier in my WSL environment, and the Bazel build completed successfully there. However, while cleaning up my development environment afterward, I accidentally removed that WSL setup.

I attempted to recreate the environment on Windows to continue testing, including setting up the required Android SDK versions and Bazel dependencies, but the Oppia build requires several environment-specific dependencies and the setup started consuming a significant amount of storage. I therefore decided to stop recreating the environment.

The code change itself is limited to changing the NestedScrollView width to 0dp, allowing it to fill the available width through its existing constraints while preserving the centered content layout. I have also included the before/after screenshots demonstrating the issue and the resulting fix.

I apologize for the inconvenience caused by this situation. I hope this does not cause any issues with merging the PR, but please let me know if you would prefer any additional testing or changes from my side. Thank you for your understanding!

Thanks for the update @samarthshukla20. I understand that configuring bazel on windows can be really complex but the setup issue does not replace the UI verification required for this PR. As this PR touches part of UI so we will need screenshots to see if the cahnges are working properly. As above mentioned by @adhiamboperes you will need to add before and after of both mobile and tablet screens in light and dark mode.

However if you are having a lot of issues setting up the environment you can always file a debugging doc iincluding your OS, setup steps, exact errors/logs, and what you have tried. We will be happy to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Tablet UI issue: “Authorize to add profiles” screen misaligned and large empty space is observed on Tablet.

4 participants