• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5  * in compliance with the License. You may obtain a copy of the License at
6  *
7  * ```
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  * ```
10  *
11  * Unless required by applicable law or agreed to in writing, software distributed under the License
12  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
13  * or implied. See the License for the specific language governing permissions and limitations under
14  * the License.
15  */
16 package com.android.healthconnect.controller.deletion
17 
18 import android.app.Dialog
19 import android.os.Bundle
20 import androidx.fragment.app.DialogFragment
21 import com.android.healthconnect.controller.R
22 import com.android.healthconnect.controller.shared.dialog.AlertDialogBuilder
23 import com.android.healthconnect.controller.utils.logging.SuccessDialogElement
24 import dagger.hilt.android.AndroidEntryPoint
25 
26 /** A deletion {@link DialogFragment} notifying user about a successful deletion. */
27 @AndroidEntryPoint(DialogFragment::class)
28 class SuccessDialogFragment : Hilt_SuccessDialogFragment() {
29 
onCreateDialognull30     override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
31         return AlertDialogBuilder(this)
32             .setLogName(SuccessDialogElement.DELETION_DIALOG_SUCCESS_CONTAINER)
33             .setIcon(R.attr.successIcon)
34             .setTitle(R.string.delete_dialog_success_title)
35             .setMessage(R.string.delete_dialog_success_message)
36             .setNegativeButton(
37                 R.string.delete_dialog_success_got_it_button,
38                 SuccessDialogElement.DELETION_DIALOG_SUCCESS_DONE_BUTTON)
39             .create()
40     }
41 
42     companion object {
43         const val TAG = "SuccessDialogFragment"
44     }
45 }
46