Skip to content

task/hw8 todo_list#8

Open
WentuM wants to merge 1 commit intomasterfrom
task/hw8
Open

task/hw8 todo_list#8
WentuM wants to merge 1 commit intomasterfrom
task/hw8

Conversation

@WentuM
Copy link
Copy Markdown
Owner

@WentuM WentuM commented Dec 29, 2020

No description provided.

Comment thread app/build.gradle

// Kotlin components
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.coroutines"
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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())
Copy link
Copy Markdown

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>(
Copy link
Copy Markdown

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Не оч понятен смысл этого

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