Skip to content

Conversation

@BelRom
Copy link

@BelRom BelRom commented May 2, 2022

Dagger2 homework Белянин Роман

@ApplicationContext
fun provideApplicationContext(): Context

fun provideColorGenerator(): ColorGenerator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ColorGenerator не нужен на уровне всего Application, по хорошему он должен быть в модуле у ProducerFragmentComponent

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
frame = view.findViewById(R.id.frame)
GlobalScope.launch {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GlobalScope лучше не использовать, можно взять lifecycleScope


fun provideColorGenerator(): ColorGenerator

fun provideState(): MutableStateFlow<Int>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Стэйт нужен в модуле активити компонента, которая создает фрагменты с цветом

@BelRom
Copy link
Author

BelRom commented May 8, 2022

Исправил

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants