Skip to content

Homework_View_@_Resources#61

Open
AnGuru-60 wants to merge 1 commit intoAndroid-Developer-Basic:masterfrom
AnGuru-60:master
Open

Homework_View_@_Resources#61
AnGuru-60 wants to merge 1 commit intoAndroid-Developer-Basic:masterfrom
AnGuru-60:master

Conversation

@AnGuru-60
Copy link

No description provided.

android:layout_marginHorizontal="10dp"
android:layout_marginEnd="12dp"
android:text="@string/login"
android:textColor="#3E5F90"

Choose a reason for hiding this comment

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

Лучше избегать хардкорных значений, хоть у нас учебные проекты

import androidx.recyclerview.widget.RecyclerView
class CartViewHolder(view: View) : RecyclerView.ViewHolder(view) {

private val title: TextView by lazy { view.findViewById(R.id.name) }

Choose a reason for hiding this comment

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

В ViewHolder это неэффективно, так как findViewById вызывается при каждом создании холдера. Лучше инициализировать напрямую в конструкторе без lazy


class MainActivity : AppCompatActivity() {

private val login_Dialog by lazy { createMaterialDialog() }

Choose a reason for hiding this comment

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

Принято использовать camelCase для имен переменных. Давайте использовать loginDialog для соответствия конвенциям языка

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