Как добавить стили @style/ThemeOverlay.Achievements.LoaderWithBackground для loaderView и @style/ThemeOverlay.Achievements.NoConnectionView для noConnectionView в DummyFragment? package ru.maxi.mobile.feature.achievements

import android.os.Bundle
import android.util.Log
import android.util.TypedValue
import android.view.ContextThemeWrapper
import android.view.Gravity
import android.view.View
import android.widget.FrameLayout
import android.widget.TextView
import androidx.fragment.app.Fragment
import com.github.terrakok.cicerone.androidx.FragmentScreen
import com.google.android.material.progressindicator.CircularProgressIndicator
import ru.maxi.mobile.R
import ru.maxi.mobile.base.ui.MvvmBaseFragment
import ru.maxi.mobile.core.navigation.FragmentScreenWithArgs
import ru.maxi.mobile.feature.achievements.ui.main.AchievementsMainArgs
import ru.maxi.mobile.feature.achievements.ui.main.AchievementsMainFragment
import ru.maxi.mobile.feature.achievements.ui.intro.AchievementsIntroFragment
import ru.maxi.mobile.uikit.components.noConnectionView.NoConnectionView

/**
 * Экраны функционала достижений
 */
@Suppress("FunctionName")
object AchievementsScreens {

    /**
     * Табы экрана-контейнера функционала
     */
    enum class AchievementsTab { IN_PROGRESS_TAB, RECEIVED_TAB }

    /**
     * Контейнер экранов
     *
     * @param initialTab стартовый таб экрана
     * @param achievementId идентификатор достижения
     */
    fun MainScreen(
        initialTab: AchievementsTab = AchievementsTab.entries.first(),
        achievementId: Long? = null,
    ) = FragmentScreenWithArgs(
        args = AchievementsMainArgs(initialTab = initialTab, achievementId = achievementId),
    ) {
        AchievementsMainFragment()
    }

    /**
     * Экран "Не полученные" достижений
     */
    fun AchievementsInProgressScreen() = FragmentScreen {
        DummyFragment("AchievementsInProgress")
    }

    /**
     * Экран "Полученные" достижений
     */
    fun AchievementsReceivedScreen() = FragmentScreen {
        DummyFragment("AchievementsReceived")
    }

    class DummyFragment(val text: String) : MvvmBaseFragment(R.layout.fragment_advent_calendar_container) {

        override val analyticsName: String? = null

        override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
            super.onViewCreated(view, savedInstanceState)
            

            val noConnectionView = view.findViewById<NoConnectionView>(R.id.no_connection_view)
            val loaderView = view.findViewById<CircularProgressIndicator>(R.id.loader_view)
            loaderView.visibility = View.VISIBLE
            noConnectionView.visibility = View.VISIBLE



            val textView = TextView(requireContext()).apply {
                text = this@DummyFragment.text
                textSize = 18f
                gravity = Gravity.CENTER_HORIZONTAL
            }
            val frameLayout = view.findViewById<FrameLayout>(R.id.fragment_advent_calendar_container)
            val layoutParams = FrameLayout.LayoutParams(
                FrameLayout.LayoutParams.WRAP_CONTENT,
                FrameLayout.LayoutParams.WRAP_CONTENT
            ).apply {
                gravity = Gravity.CENTER_HORIZONTAL or Gravity.TOP
            }
            frameLayout.addView(textView, layoutParams)
        }
    }

    /**
     * Экран обучения
     */
    fun IntroScreen() = FragmentScreen {
        AchievementsIntroFragment()
    }

    /**
     * Главный экран
     */
    fun MainScreen() = FragmentScreen {
        Fragment()
    }
}