-
Notifications
You must be signed in to change notification settings - Fork 0
task/hw8 todo_list #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| // Kotlin components | ||
| implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
| api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.coroutines" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а тебе точно эт надо?
| val allNotes: Flow<List<Note>> = noteDao.getListNotes() | ||
|
|
||
| @Suppress("RedundantSuspendModifier") | ||
| @WorkerThread |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А смысл?, у тебя дао само его уже на ио запустит, нет смысла указывать тред на верхние уровни
|
|
||
| class NotesApplication : Application() { | ||
|
|
||
| val applicationScope = CoroutineScope(SupervisorJob()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не оч понятно зачем это. Наверное, чтоб при первом запуске что-то было в бд, но выглядит как-то мега костыльно. Смысл скоупа в том что он зависит от жц элементов, а ты создаешь applicationScope на все приложение. Тогда мог бы и глобалскоуп использовать. Вообщем очень сомнительное решение, которое в принципе рушит идею самих скоупов
| import com.example.androidpractice2020.interfacecell.CellClickListener | ||
| import com.example.androidpractice2020.notes.Note | ||
|
|
||
| class NoteListAdapter(private val cellClickListener: CellClickListener) : androidx.recyclerview.widget.ListAdapter<Note, NoteListAdapter.NoteViewHolder>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем создавать интерфейс, если можно использовать лямбду. В этом был бы еще смысл, если б ты листенер инжектил в адаптер, а так намного же проще, быстрее, читабельнее использовать лямбду
| NoteListFragment.OnSelectedButtonListener, | ||
| CellClickListener { | ||
|
|
||
| private val manager = supportFragmentManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не оч понятен смысл этого
No description provided.