From ef34293d857413d3316ee417f15714fefbd0fbd8 Mon Sep 17 00:00:00 2001 From: kevingitonga Date: Wed, 23 Aug 2023 12:39:35 +0300 Subject: [PATCH] Minor updates per reviewer's comments. --- .../administratorcontrols/AdministratorControlsActivity.kt | 2 +- .../oppia/android/app/profile/AdminPinActivityPresenter.kt | 4 ++-- .../app/settings/profile/ProfileEditDeletionDialogFragment.kt | 2 +- .../app/settings/profile/ProfileEditDialogInterface.kt | 2 +- .../oppia/android/app/settings/profile/ProfileEditFragment.kt | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/oppia/android/app/administratorcontrols/AdministratorControlsActivity.kt b/app/src/main/java/org/oppia/android/app/administratorcontrols/AdministratorControlsActivity.kt index 15ba01b61ba..ebdd11f3456 100644 --- a/app/src/main/java/org/oppia/android/app/administratorcontrols/AdministratorControlsActivity.kt +++ b/app/src/main/java/org/oppia/android/app/administratorcontrols/AdministratorControlsActivity.kt @@ -82,7 +82,7 @@ class AdministratorControlsActivity : PROFILE_LIST_FRAGMENT } profileId = savedInstanceState?.extractCurrentUserProfileId() - ?: ProfileId.newBuilder().apply { internalId = -1 }.build() + ?: ProfileId.newBuilder().setInternalId(-1).build() administratorControlsActivityPresenter.handleOnCreate( extraControlsTitle, lastLoadedFragment, diff --git a/app/src/main/java/org/oppia/android/app/profile/AdminPinActivityPresenter.kt b/app/src/main/java/org/oppia/android/app/profile/AdminPinActivityPresenter.kt index 974681f69bb..d07da9b0a51 100644 --- a/app/src/main/java/org/oppia/android/app/profile/AdminPinActivityPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/profile/AdminPinActivityPresenter.kt @@ -117,7 +117,7 @@ class AdminPinActivityPresenter @Inject constructor( AdminAuthEnum.PROFILE_ADMIN_CONTROLS.value -> { activity.startActivity( AdministratorControlsActivity.createAdministratorControlsActivityIntent( - context, activity.intent.extractCurrentUserProfileId() + context, profileId ) ) activity.finish() @@ -129,7 +129,7 @@ class AdminPinActivityPresenter @Inject constructor( activity.intent.getIntExtra( ADMIN_PIN_COLOR_RGB_EXTRA_KEY, -10710042 ), - activity.intent.extractCurrentUserProfileId() + profileId ) ) activity.finish() diff --git a/app/src/main/java/org/oppia/android/app/settings/profile/ProfileEditDeletionDialogFragment.kt b/app/src/main/java/org/oppia/android/app/settings/profile/ProfileEditDeletionDialogFragment.kt index b702fdd2e1c..eef6984c090 100644 --- a/app/src/main/java/org/oppia/android/app/settings/profile/ProfileEditDeletionDialogFragment.kt +++ b/app/src/main/java/org/oppia/android/app/settings/profile/ProfileEditDeletionDialogFragment.kt @@ -53,7 +53,7 @@ class ProfileEditDeletionDialogFragment : InjectableDialogFragment() { dialog.dismiss() } .setPositiveButton(R.string.profile_edit_delete_dialog_positive) { dialog, _ -> - profileEditDialogInterface.deleteProfileByInternalProfileId(profileId) + profileEditDialogInterface.deleteProfileByProfileId(profileId) } .create() return alertDialog diff --git a/app/src/main/java/org/oppia/android/app/settings/profile/ProfileEditDialogInterface.kt b/app/src/main/java/org/oppia/android/app/settings/profile/ProfileEditDialogInterface.kt index 573bc7a84ec..a4fc69fcd8d 100644 --- a/app/src/main/java/org/oppia/android/app/settings/profile/ProfileEditDialogInterface.kt +++ b/app/src/main/java/org/oppia/android/app/settings/profile/ProfileEditDialogInterface.kt @@ -6,5 +6,5 @@ import org.oppia.android.app.model.ProfileId interface ProfileEditDialogInterface { /** Handles profile deletion in [ProfileEditFragment]. */ - fun deleteProfileByInternalProfileId(profileId: ProfileId) + fun deleteProfileByProfileId(profileId: ProfileId) } diff --git a/app/src/main/java/org/oppia/android/app/settings/profile/ProfileEditFragment.kt b/app/src/main/java/org/oppia/android/app/settings/profile/ProfileEditFragment.kt index 047725962b8..82c2987e370 100644 --- a/app/src/main/java/org/oppia/android/app/settings/profile/ProfileEditFragment.kt +++ b/app/src/main/java/org/oppia/android/app/settings/profile/ProfileEditFragment.kt @@ -61,7 +61,7 @@ class ProfileEditFragment : ) } - override fun deleteProfileByInternalProfileId(profileId: ProfileId) { + override fun deleteProfileByProfileId(profileId: ProfileId) { profileEditFragmentPresenter.deleteProfile(profileId) }