From b278b5e607544d2bdb4ce8645d61647ff5164e46 Mon Sep 17 00:00:00 2001 From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:17:58 +0300 Subject: [PATCH] Fix Part of #4938: Introduce Onboarding profile type screen (#5378) ## Explanation Fixes Part of #4938: Introduce Onboarding profile type screen Adds the profile type selection screen. The new "I am a student" flow is not implemented, and tests have been set up to fail when the flow has been implemented. The "I am a parent/teacher" flow has been set up to route to the existing profile screen. ## 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)). All tests pass on Espresso ![Screenshot 2024-05-23 at 18 06 46](https://github.com/oppia/oppia-android/assets/59600948/6d2414c9-6ddf-4340-a408-52a7a5c8acdc) ## For UI-specific PRs only |||| | --- | --- | --- | || Portrait | Landscape | | Mobile Light Mode |![Screenshot_1719762068](https://github.com/oppia/oppia-android/assets/59600948/6adbff2d-6cc7-4884-bd31-8ddbc4f0d359)|![Screenshot_1719762228](https://github.com/oppia/oppia-android/assets/59600948/e9dcb7bc-9d1b-44e7-86ea-2f4d669fe5c6)| | Mobile Dark Mode |![Screenshot_1719761957](https://github.com/oppia/oppia-android/assets/59600948/c1248dda-d377-4586-9613-803517fd7d24)|![Screenshot_1719762205](https://github.com/oppia/oppia-android/assets/59600948/9cf78a42-8d7d-442b-9b4e-8db02d3c5bdf)| | Tablet Light Mode |![Screenshot_1719762364](https://github.com/oppia/oppia-android/assets/59600948/ee8d2de4-90e6-478c-b9e2-cfbba5b7b012)|![Screenshot_1719762334](https://github.com/oppia/oppia-android/assets/59600948/6e5d6f81-b7e1-4ac4-ab99-05832bb7a7a8)| | Tablet Dark Mode |![Screenshot_1719762388](https://github.com/oppia/oppia-android/assets/59600948/1e74ded0-4110-4995-a8f8-68feba04e769)|![Screenshot_1719762309](https://github.com/oppia/oppia-android/assets/59600948/8edef377-64aa-4828-aba4-42804a7fb029)| --- app/src/main/AndroidManifest.xml | 4 + .../app/activity/ActivityComponentImpl.kt | 2 + .../app/fragment/FragmentComponentImpl.kt | 2 + .../onboarding/OnboardingFragmentPresenter.kt | 8 + .../OnboardingProfileTypeActivity.kt | 32 ++ .../OnboardingProfileTypeActivityPresenter.kt | 41 ++ .../OnboardingProfileTypeFragment.kt | 29 + .../OnboardingProfileTypeFragmentPresenter.kt | 41 ++ app/src/main/res/drawable/learner_otter.xml | 542 ++++++++++++++++++ ...nboarding_back_button_white_background.xml | 5 + .../res/drawable/parent_teacher_otter.xml | 414 +++++++++++++ .../onboarding_profile_type_fragment.xml | 124 ++++ .../onboarding_profile_type_fragment.xml | 138 +++++ .../onboarding_profile_type_fragment.xml | 138 +++++ .../onboarding_profile_type_activity.xml | 10 + .../onboarding_profile_type_fragment.xml | 137 +++++ .../main/res/values-night/color_palette.xml | 1 + app/src/main/res/values/color_defs.xml | 5 +- app/src/main/res/values/color_palette.xml | 5 +- app/src/main/res/values/component_colors.xml | 4 + app/src/main/res/values/dimens.xml | 2 + app/src/main/res/values/strings.xml | 11 + app/src/main/res/values/styles.xml | 43 ++ .../OnboardingProfileTypeActivityTest.kt | 215 +++++++ .../OnboardingProfileTypeFragmentTest.kt | 398 +++++++++++++ model/src/main/proto/screens.proto | 3 + .../file_content_validation_checks.textproto | 2 + scripts/assets/test_file_exemptions.textproto | 8 + .../util/logging/EventBundleCreator.kt | 1 + 29 files changed, 2363 insertions(+), 2 deletions(-) create mode 100644 app/src/main/java/org/oppia/android/app/onboarding/OnboardingProfileTypeActivity.kt create mode 100644 app/src/main/java/org/oppia/android/app/onboarding/OnboardingProfileTypeActivityPresenter.kt create mode 100644 app/src/main/java/org/oppia/android/app/onboarding/OnboardingProfileTypeFragment.kt create mode 100644 app/src/main/java/org/oppia/android/app/onboarding/OnboardingProfileTypeFragmentPresenter.kt create mode 100644 app/src/main/res/drawable/learner_otter.xml create mode 100644 app/src/main/res/drawable/onboarding_back_button_white_background.xml create mode 100644 app/src/main/res/drawable/parent_teacher_otter.xml create mode 100644 app/src/main/res/layout-land/onboarding_profile_type_fragment.xml create mode 100644 app/src/main/res/layout-sw600dp-land/onboarding_profile_type_fragment.xml create mode 100644 app/src/main/res/layout-sw600dp-port/onboarding_profile_type_fragment.xml create mode 100644 app/src/main/res/layout/onboarding_profile_type_activity.xml create mode 100644 app/src/main/res/layout/onboarding_profile_type_fragment.xml create mode 100644 app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingProfileTypeActivityTest.kt create mode 100644 app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingProfileTypeFragmentTest.kt diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 235bb4a479f..b25b8ccfc86 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -336,6 +336,10 @@ android:name=".app.classroom.ClassroomListActivity" android:label="@string/classroom_list_activity_title" android:theme="@style/OppiaThemeWithoutActionBar" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/onboarding_back_button_white_background.xml b/app/src/main/res/drawable/onboarding_back_button_white_background.xml new file mode 100644 index 00000000000..47b0bf7daa1 --- /dev/null +++ b/app/src/main/res/drawable/onboarding_back_button_white_background.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/drawable/parent_teacher_otter.xml b/app/src/main/res/drawable/parent_teacher_otter.xml new file mode 100644 index 00000000000..abeec4882c4 --- /dev/null +++ b/app/src/main/res/drawable/parent_teacher_otter.xml @@ -0,0 +1,414 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout-land/onboarding_profile_type_fragment.xml b/app/src/main/res/layout-land/onboarding_profile_type_fragment.xml new file mode 100644 index 00000000000..40df0c99b39 --- /dev/null +++ b/app/src/main/res/layout-land/onboarding_profile_type_fragment.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +