Skip to content

Commit

Permalink
fix: [ANDROAPP-6210] Manually instantiate resourceManager on BreakThe…
Browse files Browse the repository at this point in the history
…GlassBottomDialog (#3671)

Signed-off-by: andresmr <[email protected]>
  • Loading branch information
andresmr authored Jun 10, 2024
1 parent ae24399 commit 9cdf91c
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.dhis2.utils.customviews

import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
Expand All @@ -15,13 +16,11 @@ import org.dhis2.commons.resources.ColorType
import org.dhis2.commons.resources.ColorUtils
import org.dhis2.commons.resources.ResourceManager
import org.dhis2.databinding.BreakTheGlassBottomDialogBindingImpl
import javax.inject.Inject

class BreakTheGlassBottomDialog : BottomSheetDialogFragment() {

private lateinit var programUid: String

@Inject
lateinit var resourceManager: ResourceManager

val colorUtils: ColorUtils = ColorUtils()
Expand All @@ -42,11 +41,19 @@ class BreakTheGlassBottomDialog : BottomSheetDialogFragment() {
isCancelable = false
}

override fun onAttach(context: Context) {
super.onAttach(context)
resourceManager = ResourceManager(
context,
colorUtils,
)
}

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View? {
): View {
return BreakTheGlassBottomDialogBindingImpl.inflate(inflater, container, false).apply {
message.text = resourceManager.formatWithEnrollmentLabel(
programUid,
Expand Down

0 comments on commit 9cdf91c

Please sign in to comment.