1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  *
17  */
18 
19 package com.android.healthconnect.controller.dataentries.formatters
20 
21 import android.content.Context
22 import android.health.connect.datatypes.IntermenstrualBleedingRecord
23 import com.android.healthconnect.controller.R
24 import com.android.healthconnect.controller.dataentries.formatters.shared.EntryFormatter
25 import com.android.healthconnect.controller.dataentries.units.UnitPreferences
26 import dagger.hilt.android.qualifiers.ApplicationContext
27 import javax.inject.Inject
28 
29 /** Formatter for printing IntermenstrualBleedingRecord data. */
30 class IntermenstrualBleedingFormatter
31 @Inject
32 constructor(@ApplicationContext private val context: Context) :
33     EntryFormatter<IntermenstrualBleedingRecord>(context) {
34 
formatValuenull35     override suspend fun formatValue(
36         record: IntermenstrualBleedingRecord,
37         unitPreferences: UnitPreferences
38     ): String {
39         return context.getString(R.string.spotting)
40     }
41 
formatA11yValuenull42     override suspend fun formatA11yValue(
43         record: IntermenstrualBleedingRecord,
44         unitPreferences: UnitPreferences
45     ): String {
46         return formatValue(record, unitPreferences)
47     }
48 }
49