Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -48,6 +48,7 @@ import org.wordpress.android.ui.accounts.HelpActivity.Origin.ME_SCREEN_HELP
import org.wordpress.android.ui.main.MeViewModel.RecommendAppUiState
import org.wordpress.android.ui.main.WPMainActivity.OnScrollToTopListener
import org.wordpress.android.ui.main.utils.MeGravatarLoader
import org.wordpress.android.ui.notifications.utils.NotificationsUtils
import org.wordpress.android.ui.photopicker.MediaPickerConstants
import org.wordpress.android.ui.photopicker.MediaPickerLauncher
import org.wordpress.android.ui.photopicker.PhotoPickerActivity.PhotoPickerMediaSource
Expand Down Expand Up @@ -393,7 +394,10 @@ class MeFragment : Fragment(R.layout.me_fragment), OnScrollToTopListener {
.setMessage(message)
.setPositiveButton(
R.string.signout
) { _, _ -> signOutWordPressCom() }
) { _, _ ->
clearNotifications()
signOutWordPressCom()
}
.setNegativeButton(R.string.cancel, null)
.setCancelable(true)
.create().show()
Expand All @@ -403,6 +407,10 @@ class MeFragment : Fragment(R.layout.me_fragment), OnScrollToTopListener {
viewModel.signOutWordPress(requireActivity().application as WordPress)
}

private fun clearNotifications() {
NotificationsUtils.cancelAllNotifications(requireActivity())
}

private fun showDisconnectDialog() {
disconnectProgressDialog = ProgressDialog.show(
requireContext(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ static FormattableContent mapJsonToFormattableContent(FormattableContentMapper m
return mapper.mapToFormattableContent(blockObject.toString());
}

public static void cancelAllNotifications(Context context) {
NotificationManagerCompat.from(context).cancelAll();
}

static SpannableStringBuilder getSpannableContentForRanges(
FormattableContentMapper formattableContentMapper,
JSONObject blockObject, TextView textView,
Expand Down