Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #4294 'added profile deleted message' #4560

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
69bbc79
added profile deleted message
mbobiosio Sep 6, 2022
b386cdb
fixed classes in alphabetical order
mbobiosio Sep 7, 2022
f1e3428
added kdoc
mbobiosio Sep 8, 2022
5ff1077
reviewed comments
mbobiosio Sep 9, 2022
a92c3ed
outside touch for dialog
mbobiosio Sep 9, 2022
1d634af
updated tag
mbobiosio Sep 13, 2022
7882cf7
set outside cancelable to true
mbobiosio Sep 13, 2022
5daf12d
updated tag id
mbobiosio Sep 15, 2022
c0f91a2
added new tests
mbobiosio Sep 16, 2022
3492144
added new tests
mbobiosio Sep 16, 2022
4793299
added new tests
mbobiosio Sep 16, 2022
047c6e0
updated KDoc for tag
mbobiosio Sep 20, 2022
c1274d4
excluded DeleteProfileSuccessDialogFragment in test_file_exemptions.t…
mbobiosio Sep 21, 2022
96d628d
completed unit testing
mbobiosio Sep 23, 2022
2508427
updated comment for new instance
mbobiosio Sep 29, 2022
fa4b79b
removed 'check' from name
mbobiosio Sep 30, 2022
80f8b48
removed unnecessary space
mbobiosio Sep 30, 2022
df71f74
injected AppLanguageResourceHandler for dialog
mbobiosio Sep 30, 2022
af3f9f0
closing dialog and validating activity is running
mbobiosio Oct 4, 2022
d4d176e
closing dialog and validating activity is running -fixed ktlint
mbobiosio Oct 4, 2022
67eca56
added activity state check after closing dialog
mbobiosio Oct 4, 2022
dc9cdb6
removed activitytestrule
mbobiosio Oct 5, 2022
958357d
Merge branch 'develop' into delete-profile-message
mbobiosio Oct 5, 2022
4f5947e
removed unnecessary checks
mbobiosio Oct 13, 2022
1c07fef
removed the test to verify intent
mbobiosio Oct 13, 2022
0e361e6
fixed unused imports
mbobiosio Oct 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ import org.oppia.android.app.administratorcontrols.AdministratorControlsActivity
import org.oppia.android.app.fragment.FragmentComponentImpl
import org.oppia.android.app.fragment.InjectableDialogFragment

/** [DialogFragment] that notifies user after profile is successfully deleted. */
/** [DialogFragment] that notifies the user after a profile is successfully deleted. */
class DeleteProfileSuccessDialogFragment : InjectableDialogFragment() {
rt4914 marked this conversation as resolved.
Show resolved Hide resolved

companion object {
const val TAG = "DELETE_SUCCESS_DIALOG_FRAGMENT"

/**
* This function is responsible for displaying content in DialogFragment.
*
* @return [DeleteProfileSuccessDialogFragment]: DialogFragment
* This function returns a new instance of [DeleteProfileSuccessDialogFragment]
Copy link
Member

Choose a reason for hiding this comment

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

This should actually be the exact wording I suggest, i.e.:

/** Returns a new instance of [DeleteProfileSuccessDialogFragment]. */

Copy link
Author

Choose a reason for hiding this comment

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

Updated this

Copy link
Member

Choose a reason for hiding this comment

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

This doesn't seem updated in the latest version of the PR. Did you push your changes?

Copy link
Author

Choose a reason for hiding this comment

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

Updated now

Copy link
Member

Choose a reason for hiding this comment

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

This still seems unchanged--I see the old documentation wording in the latest changes of the PR.

*/
fun newInstance(): DeleteProfileSuccessDialogFragment {
fun createNewInstance(): DeleteProfileSuccessDialogFragment {
return DeleteProfileSuccessDialogFragment()
}
}
Expand All @@ -33,19 +31,24 @@ class DeleteProfileSuccessDialogFragment : InjectableDialogFragment() {
}

override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return AlertDialog.Builder(requireContext(), R.style.OppiaAlertDialogTheme)
.setMessage(R.string.profile_edit_delete_successful_message)
.setPositiveButton(R.string.log_out_dialog_okay_button) { _, _ ->
if (requireContext().resources.getBoolean(R.bool.isTablet)) {
val intent =
Intent(requireContext(), AdministratorControlsActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(intent)
} else {
val intent = Intent(requireContext(), ProfileListActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(intent)

BenHenning marked this conversation as resolved.
Show resolved Hide resolved
val alertDialog = AlertDialog
.Builder(requireContext(), R.style.OppiaAlertDialogTheme).apply {
setMessage(R.string.profile_edit_delete_successful_message)
setPositiveButton(R.string.log_out_dialog_okay_button) { _, _ ->
if (requireContext().resources.getBoolean(R.bool.isTablet)) {
val intent =
Intent(requireContext(), AdministratorControlsActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(intent)
} else {
val intent = Intent(requireContext(), ProfileListActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(intent)
}
}
}.create()
rt4914 marked this conversation as resolved.
Show resolved Hide resolved
alertDialog.setCanceledOnTouchOutside(false)
return alertDialog
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class ProfileEditFragmentPresenter @Inject constructor(
fragment,
{
if (it is AsyncResult.Success) {
DeleteProfileSuccessDialogFragment.newInstance()
DeleteProfileSuccessDialogFragment.createNewInstance()
.showNow(fragment.childFragmentManager, DeleteProfileSuccessDialogFragment.TAG)
}
}
Expand Down