Skip to content

Conversation

@WentuM
Copy link
Owner

@WentuM WentuM commented Dec 29, 2020

No description provided.


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

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

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())

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>(

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

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.

3 participants