From 7668bf08235faca71c07858293158766487aa0bf Mon Sep 17 00:00:00 2001 From: Vishwajith Shettigar <76042077+Vishwajith-Shettigar@users.noreply.github.com> Date: Wed, 6 Sep 2023 02:25:41 +0530 Subject: [PATCH] Fix #4735 Text unit is set in dp instead of sp (#5134) ## Explanation Fix #4735 , Added toolbar in admin_pin_activity xml file inorder to control the title size using sp. ## 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](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [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](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only Before fix Admin pin activity | Light mode| |--------| |![before light](https://github.com/oppia/oppia-android/assets/76042077/e80cd747-b04c-43c5-96b9-848dc5db3400) | After fix |Light mode| Dark mode| |-----------|--------------| | ![afterlightmode](https://github.com/oppia/oppia-android/assets/76042077/4445ebd1-3fde-40f4-a4cb-cb3716aad43e) | ![afterdarkmode](https://github.com/oppia/oppia-android/assets/76042077/98bd0994-5f4d-464f-b170-d21e167a9eaa) | Co-authored-by: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com> --- app/src/main/AndroidManifest.xml | 1 + .../android/app/profile/AdminPinActivity.kt | 5 ++++ .../app/profile/AdminPinActivityPresenter.kt | 10 ++++--- .../main/res/layout/admin_pin_activity.xml | 26 ++++++++++++++++--- app/src/main/res/values/styles.xml | 4 +++ 5 files changed, 39 insertions(+), 7 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a27551a2005..897fc034879 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -138,6 +138,7 @@ (activity, R.layout.admin_pin_activity) + activity.setSupportActionBar(binding.adminPinToolbar) + activity.supportActionBar?.setDisplayHomeAsUpEnabled(true) + activity.supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_close_white_24dp) + activity.supportActionBar?.setHomeActionContentDescription(R.string.admin_auth_close) + binding.apply { lifecycleOwner = activity viewModel = adminViewModel } + binding.adminPinToolbar.title = resourceHandler + .getStringInLocale(R.string.admin_auth_activity_add_profiles_title) // [onTextChanged] is a extension function defined at [TextInputEditTextHelper] binding.adminPinInputPinEditText.onTextChanged { pin -> pin?.let { diff --git a/app/src/main/res/layout/admin_pin_activity.xml b/app/src/main/res/layout/admin_pin_activity.xml index e40ed050b9d..f22760b80dd 100644 --- a/app/src/main/res/layout/admin_pin_activity.xml +++ b/app/src/main/res/layout/admin_pin_activity.xml @@ -13,14 +13,32 @@ android:layout_width="match_parent" android:layout_height="match_parent"> + + + + android:scrollbars="none" + android:background="@color/component_color_shared_screen_secondary_background_color" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/admin_pin_toolbar" + > @anim/slide_up @anim/slide_down + +