{"id":320874,"date":"2021-04-05T15:00:18","date_gmt":"2021-04-05T15:00:18","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=320874"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=320874","title":{"rendered":"MotionLayout + RecyclerView = \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u0438\u0441\u043a\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0438 \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u0438\u0441\u043a\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 RecyclerView \u0438 MotionLayout. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<blockquote>\n<p>\u041e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430: \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0430\u0432\u0442\u043e\u0440\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 &#8212; <a href=\"https:\/\/github.com\/mjmanaog\/foodbuddy\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/mjmanaog\/foodbuddy<\/a>.<br \/>\u042f \u0435\u0433\u043e <a href=\"https:\/\/github.com\/StepanMe\/foodbuddy\" rel=\"noopener noreferrer nofollow\">\u0444\u043e\u0440\u043a\u043d\u0443\u043b<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043c\u0443-\u0442\u043e &#171;\u0440\u0443\u0441\u0441\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f&#187; \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0431\u043e\u043b\u044c\u0448\u0435.<\/p>\n<\/blockquote>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 MotionLayout?<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e MotionLayout \u2014 \u044d\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441 ConstraintLayout, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e XML \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u043d\u0451\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u2014 <a href=\"https:\/\/developer.android.com\/training\/constraint-layout\/motionlayout\" rel=\"noopener noreferrer nofollow\">\u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u0438 <a href=\"https:\/\/medium.com\/google-developers\/introduction-to-motionlayout-part-i-29208674b10d%D1%8D\" rel=\"noopener noreferrer nofollow\">\u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c<\/a> \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0451\u043c.<\/p>\n<h3>\u0428\u0430\u0433 1: \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442<\/h3>\n<p>\u041d\u0430\u0437\u043e\u0432\u0451\u043c \u0435\u0433\u043e, \u043a\u0430\u043a \u0434\u0443\u0448\u0435 \u0443\u0433\u043e\u0434\u043d\u043e. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0432\u044b\u0431\u0435\u0440\u0435\u043c Empty Activity. <\/p>\n<h3>\u0428\u0430\u0433 2: \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/h3>\n<p>\u0412 gradle-\u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043c:<\/p>\n<pre><code>implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'<\/code><\/pre>\n<p>\u0418 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e (Sync Now \u0432 \u043f\u0440\u0430\u0432\u043e\u043c \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0443\u0433\u043b\u0443).<\/p>\n<h3>\u0428\u0430\u0433 3: \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043b\u044d\u0439\u0430\u0443\u0442<\/h3>\n<p>\u041d\u0430\u0448 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/245\/be5\/a67\/245be5a67e16de1e5e9ffb9fbcef18b5.png\" alt=\"\u042d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 RecyclerView\" title=\"\u042d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 RecyclerView\" width=\"971\" height=\"430\"><figcaption>\u042d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 RecyclerView<\/figcaption><\/figure>\n<p>\u0412 \u043f\u0430\u043f\u043a\u0435 <em>res\/layout<\/em> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <em>item_food.<\/em><\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u043d\u0443\u0442\u0440\u0438 \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     xmlns:tools=\"http:\/\/schemas.android.com\/tools\"     android:id=\"@+id\/clMain\"     android:layout_width=\"match_parent\"     android:layout_height=\"wrap_content\"     app:layoutDescription=\"@xml\/item_food_scene\"&gt;      &lt;ImageView         android:id=\"@+id\/ivFood\"         android:layout_width=\"150dp\"         android:layout_height=\"150dp\"         android:layout_marginTop=\"8dp\"         android:elevation=\"10dp\"         android:scaleType=\"fitXY\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\"         app:srcCompat=\"@drawable\/img_salmon_salad\" \/&gt;      &lt;androidx.cardview.widget.CardView         android:id=\"@+id\/cardView\"         android:layout_width=\"match_parent\"         android:layout_height=\"150dp\"         android:layout_marginStart=\"100dp\"         android:layout_marginLeft=\"100dp\"         android:layout_marginTop=\"16dp\"         android:layout_marginEnd=\"16dp\"         android:layout_marginRight=\"16dp\"         android:layout_marginBottom=\"16dp\"         app:cardCornerRadius=\"20dp\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\"&gt;          &lt;androidx.constraintlayout.widget.ConstraintLayout             android:layout_width=\"match_parent\"             android:layout_height=\"match_parent\"&gt;              &lt;TextView                 android:id=\"@+id\/tvTitle\"                 android:layout_width=\"0dp\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"60dp\"                 android:layout_marginLeft=\"60dp\"                 android:layout_marginTop=\"24dp\"                 android:layout_marginEnd=\"8dp\"                 android:layout_marginRight=\"8dp\"                 android:textSize=\"18sp\"                 android:textStyle=\"bold\"                 app:layout_constraintEnd_toEndOf=\"parent\"                 app:layout_constraintStart_toStartOf=\"parent\"                 app:layout_constraintTop_toTopOf=\"parent\"                 tools:text=\"\u0421\u0430\u043b\u0430\u0442 \u0441 \u043b\u043e\u0441\u043e\u0441\u0435\u043c\" \/&gt;              &lt;TextView                 android:id=\"@+id\/tvDescription\"                 android:layout_width=\"0dp\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"60dp\"                 android:layout_marginLeft=\"60dp\"                 android:layout_marginEnd=\"16dp\"                 android:layout_marginRight=\"8dp\"                 android:ellipsize=\"end\"                 android:maxLines=\"3\"                 app:layout_constraintEnd_toEndOf=\"parent\"                 app:layout_constraintStart_toStartOf=\"parent\"                 app:layout_constraintTop_toBottomOf=\"@+id\/tvTitle\"                 tools:text=\"\u041b\u043e\u0441\u043e\u0441\u044c \u0441 \u043e\u0432\u043e\u0449\u0430\u043c\u0438 \u2014 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0438\u0442\u0430\u043d\u0438\u044f. \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0446\u0435\u043f\u0442 \u0431\u043b\u044e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0431\u043e\u0433\u0430\u0442\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0438\u0442\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0441\u0442\u0432: \u0431\u0435\u043b\u043a\u0438, \u0436\u0438\u0440\u044b \u0438 \u043a\u043b\u0435\u0442\u0447\u0430\u0442\u043a\u0443.\" \/&gt;              &lt;TextView                 android:id=\"@+id\/tvCalories\"                 android:layout_width=\"wrap_content\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"8dp\"                 android:layout_marginLeft=\"8dp\"                 android:layout_marginBottom=\"16dp\"                 android:textStyle=\"bold\"                 app:layout_constraintBottom_toBottomOf=\"parent\"                 app:layout_constraintStart_toEndOf=\"@+id\/imageView6\"                 tools:text=\"80 \u043a\u043a\u0430\u043b\" \/&gt;              &lt;ImageView                 android:id=\"@+id\/imageView6\"                 android:layout_width=\"24dp\"                 android:layout_height=\"24dp\"                 android:layout_marginStart=\"60dp\"                 android:layout_marginLeft=\"60dp\"                 android:layout_marginBottom=\"16dp\"                 app:layout_constraintBottom_toBottomOf=\"parent\"                 app:layout_constraintStart_toStartOf=\"parent\"                 app:srcCompat=\"@drawable\/ic_calories\" \/&gt;              &lt;ImageView                 android:id=\"@+id\/imageView7\"                 android:layout_width=\"24dp\"                 android:layout_height=\"24dp\"                 android:layout_marginStart=\"24dp\"                 android:layout_marginLeft=\"24dp\"                 android:layout_marginBottom=\"16dp\"                 app:layout_constraintBottom_toBottomOf=\"parent\"                 app:layout_constraintStart_toEndOf=\"@+id\/tvCalories\"                 app:srcCompat=\"@drawable\/ic_star\" \/&gt;              &lt;TextView                 android:id=\"@+id\/tvRate\"                 android:layout_width=\"wrap_content\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"8dp\"                 android:layout_marginLeft=\"8dp\"                 android:layout_marginBottom=\"16dp\"                 app:layout_constraintBottom_toBottomOf=\"parent\"                 app:layout_constraintStart_toEndOf=\"@+id\/imageView7\"                 tools:text=\"4.5\" \/&gt;         &lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;     &lt;\/androidx.cardview.widget.CardView&gt;  &lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;<\/code><\/pre>\n<\/div>\n<\/details>\n<h3>\u0428\u0430\u0433 4: \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c ConstraintLayout \u0432 MotionLayout<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c ConstraintLayout \u0432 MotionLayout:<\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u0441\u044c \u0432 \u0440\u0435\u0436\u0438\u043c Split \u0438\u043b\u0438 Design;<\/p>\n<\/li>\n<li>\n<p>\u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 (Component Tree) \u0449\u0451\u043b\u043a\u043d\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438 \u043d\u0430 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 clMain);<\/p>\n<\/li>\n<li>\n<p>\u0432 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0435\u043c\u0441\u044f \u043c\u0435\u043d\u044e \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <em>Convert to MotionLayout<\/em>.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fb2\/e90\/eac\/fb2e90eac3b4f0514674b83752262f62.png\" alt=\"\u041a\u0430\u043a \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c ConstraintLayout \u0432 MotionLayout\" title=\"\u041a\u0430\u043a \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c ConstraintLayout \u0432 MotionLayout\" width=\"1641\" height=\"1074\"><figcaption>\u041a\u0430\u043a \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c ConstraintLayout \u0432 MotionLayout<\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 MotionLayout.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 item_food \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;androidx.constraintlayout.motion.widget.MotionLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     xmlns:tools=\"http:\/\/schemas.android.com\/tools\"     android:id=\"@+id\/clMain\"     android:layout_width=\"match_parent\"     android:layout_height=\"wrap_content\"     app:layoutDescription=\"@xml\/item_food_scene\"&gt;      &lt;ImageView         android:id=\"@+id\/ivFood\"         android:layout_width=\"150dp\"         android:layout_height=\"150dp\"         android:layout_marginTop=\"8dp\"         android:elevation=\"10dp\"         android:scaleType=\"fitXY\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\"         app:srcCompat=\"@drawable\/img_salmon_salad\" \/&gt;      &lt;androidx.cardview.widget.CardView         android:id=\"@+id\/cardView\"         android:layout_width=\"match_parent\"         android:layout_height=\"150dp\"         android:layout_marginStart=\"100dp\"         android:layout_marginLeft=\"100dp\"         android:layout_marginTop=\"16dp\"         android:layout_marginEnd=\"16dp\"         android:layout_marginRight=\"16dp\"         android:layout_marginBottom=\"16dp\"         app:cardCornerRadius=\"20dp\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\"&gt;          &lt;androidx.constraintlayout.widget.ConstraintLayout             android:layout_width=\"match_parent\"             android:layout_height=\"match_parent\"&gt;              &lt;TextView                 android:id=\"@+id\/tvTitle\"                 android:layout_width=\"0dp\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"60dp\"                 android:layout_marginLeft=\"60dp\"                 android:layout_marginTop=\"24dp\"                 android:layout_marginEnd=\"8dp\"                 android:layout_marginRight=\"8dp\"                 android:textSize=\"18sp\"                 android:textStyle=\"bold\"                 app:layout_constraintEnd_toEndOf=\"parent\"                 app:layout_constraintStart_toStartOf=\"parent\"                 app:layout_constraintTop_toTopOf=\"parent\"                 tools:text=\"\u0421\u0430\u043b\u0430\u0442 \u0441 \u043b\u043e\u0441\u043e\u0441\u0435\u043c\" \/&gt;              &lt;TextView                 android:id=\"@+id\/tvDescription\"                 android:layout_width=\"0dp\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"60dp\"                 android:layout_marginLeft=\"60dp\"                 android:layout_marginEnd=\"16dp\"                 android:layout_marginRight=\"8dp\"                 android:ellipsize=\"end\"                 android:maxLines=\"3\"                 app:layout_constraintEnd_toEndOf=\"parent\"                 app:layout_constraintStart_toStartOf=\"parent\"                 app:layout_constraintTop_toBottomOf=\"@+id\/tvTitle\"                 tools:text=\"\u041b\u043e\u0441\u043e\u0441\u044c \u0441 \u043e\u0432\u043e\u0449\u0430\u043c\u0438 \u2014 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0438\u0442\u0430\u043d\u0438\u044f. \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0446\u0435\u043f\u0442 \u0431\u043b\u044e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0431\u043e\u0433\u0430\u0442\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0438\u0442\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0441\u0442\u0432: \u0431\u0435\u043b\u043a\u0438, \u0436\u0438\u0440\u044b \u0438 \u043a\u043b\u0435\u0442\u0447\u0430\u0442\u043a\u0443.\" \/&gt;              &lt;TextView                 android:id=\"@+id\/tvCalories\"                 android:layout_width=\"wrap_content\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"8dp\"                 android:layout_marginLeft=\"8dp\"                 android:layout_marginBottom=\"16dp\"                 android:textStyle=\"bold\"                 app:layout_constraintBottom_toBottomOf=\"parent\"                 app:layout_constraintStart_toEndOf=\"@+id\/imageView6\"                 tools:text=\"80 \u043a\u043a\u0430\u043b\" \/&gt;              &lt;ImageView                 android:id=\"@+id\/imageView6\"                 android:layout_width=\"24dp\"                 android:layout_height=\"24dp\"                 android:layout_marginStart=\"60dp\"                 android:layout_marginLeft=\"60dp\"                 android:layout_marginBottom=\"16dp\"                 app:layout_constraintBottom_toBottomOf=\"parent\"                 app:layout_constraintStart_toStartOf=\"parent\"                 app:srcCompat=\"@drawable\/ic_calories\" \/&gt;              &lt;ImageView                 android:id=\"@+id\/imageView7\"                 android:layout_width=\"24dp\"                 android:layout_height=\"24dp\"                 android:layout_marginStart=\"24dp\"                 android:layout_marginLeft=\"24dp\"                 android:layout_marginBottom=\"16dp\"                 app:layout_constraintBottom_toBottomOf=\"parent\"                 app:layout_constraintStart_toEndOf=\"@+id\/tvCalories\"                 app:srcCompat=\"@drawable\/ic_star\" \/&gt;              &lt;TextView                 android:id=\"@+id\/tvRate\"                 android:layout_width=\"wrap_content\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"8dp\"                 android:layout_marginLeft=\"8dp\"                 android:layout_marginBottom=\"16dp\"                 app:layout_constraintBottom_toBottomOf=\"parent\"                 app:layout_constraintStart_toEndOf=\"@+id\/imageView7\"                 tools:text=\"4.5\" \/&gt;         &lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;     &lt;\/androidx.cardview.widget.CardView&gt;  &lt;\/androidx.constraintlayout.motion.widget.MotionLayout&gt;<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0412 \u043f\u0430\u043f\u043a\u0435 <em>res<\/em> \u0421\u0442\u0443\u0434\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u043b\u0430 \u043f\u0430\u043f\u043a\u0443 <em>xml<\/em> \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0430 \u0432 \u043d\u0435\u0451 \u0444\u0430\u0439\u043b <em>item_food_scene.xml<\/em>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b33\/f6d\/471\/b33f6d471f36df2d79253de77bff6a97.png\" width=\"1940\" height=\"928\"><figcaption><\/figcaption><\/figure>\n<blockquote>\n<p>\u0421\u0442\u0443\u0434\u0438\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 (Warnings \u0432 \u043d\u0438\u0436\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u043a\u0440\u0430\u043d\u0430), \u0447\u0442\u043e \u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 ImageView \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d \u0442\u0435\u0433 <em>contentDescription<\/em>. \u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 XML-\u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0442\u0435\u0433\u0438 (\u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b, \u0447\u0438\u0442\u0430\u0439\u0442\u0435 <a href=\"https:\/\/developer.android.com\/guide\/topics\/ui\/accessibility\/apps#describe-ui-element\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>).<\/p>\n<\/blockquote>\n<h3>\u0428\u0430\u0433 5: \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u043d\u0430 ImageView<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6b1\/895\/52b\/6b189552b883c1ec916b1fe329bc48c1.gif\" width=\"600\" height=\"356\"><figcaption><\/figcaption><\/figure>\n<ol>\n<li>\n<p>\u0412 \u0434\u0435\u0440\u0435\u0432\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 ivFood (ImageView \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439);<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 MotionLayout \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 end;<\/p>\n<\/li>\n<li>\n<p>\u0423 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 ivFood \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u0443\u044e (End) \u043e\u043f\u043e\u0440\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0438 \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0435\u0451 \u0437\u0430 \u043f\u0440\u0430\u0432\u0443\u044e (End) \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u0441\u0442\u0430\u0442\u044c \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 layout_height \u0438 layout_width \u043d\u0430 300dp.<\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p>\u041e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430: \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 ImageView (\u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0448\u0438\u0440\u0438\u043d\u0430 \u0438 \u0432\u044b\u0441\u043e\u0442\u0430) \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0430 \u0435\u0433\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c: \u043e\u043d \u0432\u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 (\u0441 150dp \u0434\u043e 300dp).<\/p>\n<\/blockquote>\n<h3>\u0428\u0430\u0433 6: \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8ed\/2b3\/6f0\/8ed2b36f01e4b178f3f8cf94a09f5b7c.gif\" width=\"600\" height=\"356\"><figcaption><\/figcaption><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438:<\/p>\n<ol>\n<li>\n<p>\u0412 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 MotionLayout \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u0435 \u0442\u043e\u043b\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0435\u043b\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438 \u0441 \u043d\u0430\u0434\u043f\u0438\u0441\u044f\u043c\u0438 <em>start<\/em> \u0438 <em>end<\/em>;<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u043d\u0438\u0436\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0431\u043b\u043e\u043a Transition;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 Play, \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e.<\/p>\n<\/li>\n<\/ol>\n<h3>\u0428\u0430\u0433 7: \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u043d\u0430 CardView<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/678\/758\/b57\/678758b57c5462602cc9c5522d4c9419.gif\" width=\"600\" height=\"355\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441\u0445\u043e\u0436:<\/p>\n<ol>\n<li>\n<p>\u0412 \u0434\u0435\u0440\u0435\u0432\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u0435 cardView (constraintView \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c, \u043a\u0430\u043b\u043e\u0440\u0438\u0439\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u043e\u0446\u0435\u043d\u043a\u043e\u0439);<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 MotionLayout \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 end;<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0434\u0435\u043b\u0438\u0442\u0435 cardView \u0432 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0435\u043c\u0441\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435 ConstraintSet;<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043a \u0433\u0440\u0443\u043f\u043f\u0435 Transforms;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 alpha \u043d\u0430 0.<\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p>\u041e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430: \u0443 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0431\u043b\u044e\u0434\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 (end) \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e (start) \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 alpha. \u0412 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0440\u044b\u0442\u0430 (\u0438 \u0441\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043b\u0430\u0432\u043d\u043e).<\/p>\n<\/blockquote>\n<h3>\u0428\u0430\u0433 8: \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430\u0436\u0430\u0442\u0438\u0439<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c, \u043d\u0430\u0434\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430\u0436\u0430\u0442\u0438\u0439:<\/p>\n<ol>\n<li>\n<p>\u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043f\u043e\u0434 OnClick \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 (\u043a\u043d\u043e\u043f\u043a\u0430 \u00ab+\u00bb);<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 targetId \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 ivFood;<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u043f\u043e\u043b\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 ClickAction \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 toggle.<\/p>\n<\/li>\n<\/ol>\n<details class=\"spoiler\">\n<summary>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u0430\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f:<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/411\/2c6\/702\/4112c670254e258d2ab13e8d4b7c4f07.gif\" width=\"602\" height=\"471\"><figcaption><\/figcaption><\/figure>\n<\/div>\n<\/details>\n<h3>\u0428\u0430\u0433 9: \u0434\u043e\u0431\u0430\u0432\u0438\u043c RecyclerView \u0432 activity_main.xml<\/h3>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     android:layout_width=\"match_parent\"     android:layout_height=\"match_parent\"&gt;      &lt;androidx.recyclerview.widget.RecyclerView         android:id=\"@+id\/rvMain\"         android:layout_width=\"match_parent\"         android:layout_height=\"match_parent\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\" \/&gt; &lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;<\/code><\/pre>\n<h3>\u0428\u0430\u0433 10: \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 \u0438 \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/h3>\n<pre><code class=\"kotlin\">package com.mjmanaog.foodbuddy.data.model  import com.mjmanaog.foodbuddy.R  data class FoodModel(         val title: String,         val description: String,         val calories: String,         val rate: String,         val imgId: Int )  val foodDummyData: ArrayList&lt;FoodModel&gt; = arrayListOf(         FoodModel(                 \"\u0421\u0430\u043b\u0430\u0442 \u0441 \u043b\u043e\u0441\u043e\u0441\u0435\u043c\",                 \"\u041b\u043e\u0441\u043e\u0441\u044c \u0441 \u043e\u0432\u043e\u0449\u0430\u043c\u0438 \u2014 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0438\u0442\u0430\u043d\u0438\u044f. \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0446\u0435\u043f\u0442 \u0431\u043b\u044e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0431\u043e\u0433\u0430\u0442\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0438\u0442\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0441\u0442\u0432: \u0431\u0435\u043b\u043a\u0438, \u0436\u0438\u0440\u044b \u0438 \u043a\u043b\u0435\u0442\u0447\u0430\u0442\u043a\u0443.\",                 \"80 \u043a\u043a\u0430\u043b\",                 \"4.5\",                 R.drawable.img_salmon_salad         ),         FoodModel(                 \"\u041a\u0443\u0440\u0438\u043d\u0430\u044f \u0433\u0440\u0443\u0434\u043a\u0430-\u0431\u0430\u0440\u0431\u0435\u043a\u044e\",                 \"\u041e\u0442 \u043a\u0443\u0440\u043e\u0447\u043a\u0438, \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u0433\u0440\u0438\u043b\u0435 \u0438\u043b\u0438 \u0437\u0430\u043f\u0435\u0447\u0451\u043d\u043d\u043e\u0439 \u0432 \u0434\u0443\u0445\u043e\u0432\u043a\u0435 \u0432\u0441\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432 \u0432\u043e\u0441\u0442\u043e\u0440\u0433\u0435, \u0435\u0441\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u0430 \u043d\u0435 \u0441\u0443\u0445\u0430\u044f \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0436\u0430\u0440\u0435\u043d\u043d\u0430\u044f.\",                 \"80 \u043a\u043a\u0430\u043b\",                 \"4.5\",                 R.drawable.img_chicken         ),         FoodModel(                 \"\u041a\u0443\u0440\u0438\u0446\u0430 \u0441 \u0440\u0438\u0441\u043e\u043c \u043d\u0430 \u043f\u0430\u0440\u0443\",                 \"\u041f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0430\u0440\u0443 \u2014 \u0437\u0434\u043e\u0440\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0438\u0449\u0438. \u041e\u043d \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0435\u0451 \u0430\u0440\u043e\u043c\u0430\u0442, \u043d\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0430. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u043b\u044e\u0434 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u043b\u043e.\",                 \"80 \u043a\u043a\u0430\u043b\",                 \"4.5\",                 R.drawable.img_chicken_rice         ),         FoodModel(                 \"\u0421\u0430\u043b\u0430\u0442 \u0426\u0435\u0437\u0430\u0440\u044c\",                 \"\u0417\u0435\u043b\u0451\u043d\u044b\u0439 \u0441\u0430\u043b\u0430\u0442 \u0438\u0437 \u043b\u0438\u0441\u0442\u044c\u0435\u0432 \u0441\u0430\u043b\u0430\u0442\u0430 \u0440\u043e\u043c\u044d\u043d \u0438 \u0433\u0440\u0435\u043d\u043e\u043a, \u0437\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043b\u0438\u043c\u043e\u043d\u043d\u044b\u043c \u0441\u043e\u043a\u043e\u043c (\u0438\u043b\u0438 \u0441\u043e\u043a\u043e\u043c \u043b\u0430\u0439\u043c\u0430), \u043e\u043b\u0438\u0432\u043a\u043e\u0432\u044b\u043c \u043c\u0430\u0441\u043b\u043e\u043c, \u044f\u0439\u0446\u043e\u043c, \u0412\u0443\u0441\u0442\u0435\u0440\u0448\u0438\u0440\u0441\u043a\u0438\u043c \u0441\u043e\u0443\u0441\u043e\u043c, \u0430\u043d\u0447\u043e\u0443\u0441\u0430\u043c\u0438, \u0447\u0435\u0441\u043d\u043e\u043a\u043e\u043c, \u0434\u0438\u0436\u043e\u043d\u0441\u043a\u043e\u0439 \u0433\u043e\u0440\u0447\u0438\u0446\u0435\u0439, \u0441\u044b\u0440\u043e\u043c \u041f\u0430\u0440\u043c\u0435\u0437\u0430\u043d \u0438 \u0447\u0451\u0440\u043d\u044b\u043c \u043f\u0435\u0440\u0446\u0435\u043c.\",                 \"80 \u043a\u043a\u0430\u043b\",                 \"4.5\",                 R.drawable.img_salad         ),         FoodModel(                 \"\u041f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0435\u0434\u0430\",                 \"\u041b\u043e\u0441\u043e\u0441\u044c \u0441 \u043e\u0432\u043e\u0449\u0430\u043c\u0438 \u2014 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0438\u0442\u0430\u043d\u0438\u044f. \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0446\u0435\u043f\u0442 \u0431\u043b\u044e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0431\u043e\u0433\u0430\u0442\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0438\u0442\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0441\u0442\u0432: \u0431\u0435\u043b\u043a\u0438, \u0436\u0438\u0440\u044b \u0438 \u043a\u043b\u0435\u0442\u0447\u0430\u0442\u043a\u0443.\",                 \"80 \u043a\u043a\u0430\u043b\",                 \"4.5\",                 R.drawable.img_healthy         ) )<\/code><\/pre>\n<h3>\u0428\u0430\u0433 11: \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0438 ViewHolder<\/h3>\n<p>\u0422\u0443\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043d\u0435\u0442. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0430\u0448\u0443 FoodModel<\/p>\n<h3>\u0428\u0430\u0433 12: \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c RecyclerView \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438<\/h3>\n<pre><code class=\"kotlin\">class MainActivity : AppCompatActivity() {     private var foodAdapter: FoodAdapter = FoodAdapter()     override fun onCreate(savedInstanceState: Bundle?) {         super.onCreate(savedInstanceState)         setContentView(R.layout.activity_main)          rvMain.layoutManager = LinearLayoutManager(this, RecyclerView.VERTICAL, false)         rvMain.adapter = foodAdapter         foodAdapter.addAll(foodDummyData)     } }<\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u0442\u0438\u0445 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0442\u0430\u043a\u0430\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f:<\/p>\n<p><iframe id=\"606b1c74d07205866cff5c71\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/606b1c74d07205866cff5c71\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<details class=\"spoiler\">\n<summary>GIF \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0435 \u0441\u0442\u0430\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041e\u043d\u0430 \u0432\u0435\u0441\u0442\u0438 11 \u041c\u0431.<\/p>\n<\/div>\n<\/details>\n<h3>\u0415\u0449\u0451 \u043a\u043e\u0435-\u0447\u0442\u043e<\/h3>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <em>item_food_scene.xml<\/em> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438. \u041d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u0441\u0446\u0435\u043d\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043a\u043e\u043c\u0443-\u0442\u043e \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c. \u0411\u0443\u0434\u0435\u0442 \u043a\u0440\u0443\u0442\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435 \u0438\u0437 \u043d\u0435\u0451 \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/550846\/\"> https:\/\/habr.com\/ru\/post\/550846\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0438 \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u0438\u0441\u043a\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 RecyclerView \u0438 MotionLayout. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<blockquote>\n<p>\u041e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430: \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0430\u0432\u0442\u043e\u0440\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 &#8212; <a href=\"https:\/\/github.com\/mjmanaog\/foodbuddy\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/mjmanaog\/foodbuddy<\/a>.<br \/>\u042f \u0435\u0433\u043e <a href=\"https:\/\/github.com\/StepanMe\/foodbuddy\" rel=\"noopener noreferrer nofollow\">\u0444\u043e\u0440\u043a\u043d\u0443\u043b<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043c\u0443-\u0442\u043e &#171;\u0440\u0443\u0441\u0441\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f&#187; \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0431\u043e\u043b\u044c\u0448\u0435.<\/p>\n<\/blockquote>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 MotionLayout?<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e MotionLayout \u2014 \u044d\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441 ConstraintLayout, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e XML \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u043d\u0451\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u2014 <a href=\"https:\/\/developer.android.com\/training\/constraint-layout\/motionlayout\" rel=\"noopener noreferrer nofollow\">\u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u0438 <a href=\"https:\/\/medium.com\/google-developers\/introduction-to-motionlayout-part-i-29208674b10d%D1%8D\" rel=\"noopener noreferrer nofollow\">\u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c<\/a> \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0451\u043c.<\/p>\n<h3>\u0428\u0430\u0433 1: \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442<\/h3>\n<p>\u041d\u0430\u0437\u043e\u0432\u0451\u043c \u0435\u0433\u043e, \u043a\u0430\u043a \u0434\u0443\u0448\u0435 \u0443\u0433\u043e\u0434\u043d\u043e. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0432\u044b\u0431\u0435\u0440\u0435\u043c Empty Activity. <\/p>\n<h3>\u0428\u0430\u0433 2: \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/h3>\n<p>\u0412 gradle-\u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043c:<\/p>\n<pre><code>implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'<\/code><\/pre>\n<p>\u0418 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e (Sync Now \u0432 \u043f\u0440\u0430\u0432\u043e\u043c \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0443\u0433\u043b\u0443).<\/p>\n<h3>\u0428\u0430\u0433 3: \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043b\u044d\u0439\u0430\u0443\u0442<\/h3>\n<p>\u041d\u0430\u0448 \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><figcaption>\u042d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 RecyclerView<\/figcaption><\/figure>\n<p>\u0412 \u043f\u0430\u043f\u043a\u0435 <em>res\/layout<\/em> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <em>item_food.<\/em><\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u043d\u0443\u0442\u0440\u0438 \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     xmlns:tools=\"http:\/\/schemas.android.com\/tools\"     android:id=\"@+id\/clMain\"     android:layout_width=\"match_parent\"     android:layout_height=\"wrap_content\"     app:layoutDescription=\"@xml\/item_food_scene\"&gt;      &lt;ImageView         android:id=\"@+id\/ivFood\"         android:layout_width=\"150dp\"         android:layout_height=\"150dp\"         android:layout_marginTop=\"8dp\"         android:elevation=\"10dp\"         android:scaleType=\"fitXY\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\"         app:srcCompat=\"@drawable\/img_salmon_salad\" \/&gt;      &lt;androidx.cardview.widget.CardView         android:id=\"@+id\/cardView\"         android:layout_width=\"match_parent\"         android:layout_height=\"150dp\"         android:layout_marginStart=\"100dp\"         android:layout_marginLeft=\"100dp\"         android:layout_marginTop=\"16dp\"         android:layout_marginEnd=\"16dp\"         android:layout_marginRight=\"16dp\"         android:layout_marginBottom=\"16dp\"         app:cardCornerRadius=\"20dp\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\"&gt;          &lt;androidx.constraintlayout.widget.ConstraintLayout             android:layout_width=\"match_parent\"             android:layout_height=\"match_parent\"&gt;              &lt;TextView                 android:id=\"@+id\/tvTitle\"                 android:layout_width=\"0dp\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"60dp\"                 android:layout_marginLeft=\"60dp\"                 android:layout_marginTop=\"24dp\"                 android:layout_marginEnd=\"8dp\"                 android:layout_marginRight=\"8dp\"                 android:textSize=\"18sp\"                 android:textStyle=\"bold\"                 app:layout_constraintEnd_toEndOf=\"parent\"                 app:layout_constraintStart_toStartOf=\"parent\"                 app:layout_constraintTop_toTopOf=\"parent\"                 tools:text=\"\u0421\u0430\u043b\u0430\u0442 \u0441 \u043b\u043e\u0441\u043e\u0441\u0435\u043c\" \/&gt;              &lt;TextView                 android:id=\"@+id\/tvDescription\"                 android:layout_width=\"0dp\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"60dp\"                 android:layout_marginLeft=\"60dp\"                 android:layout_marginEnd=\"16dp\"                 android:layout_marginRight=\"8dp\"                 android:ellipsize=\"end\"                 android:maxLines=\"3\"                 app:layout_constraintEnd_toEndOf=\"parent\"                 app:layout_constraintStart_toStartOf=\"parent\"                 app:layout_constraintTop_toBottomOf=\"@+id\/tvTitle\"                 tools:text=\"\u041b\u043e\u0441\u043e\u0441\u044c \u0441 \u043e\u0432\u043e\u0449\u0430\u043c\u0438 \u2014 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0438\u0442\u0430\u043d\u0438\u044f. \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0446\u0435\u043f\u0442 \u0431\u043b\u044e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0431\u043e\u0433\u0430\u0442\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0438\u0442\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0441\u0442\u0432: \u0431\u0435\u043b\u043a\u0438, \u0436\u0438\u0440\u044b \u0438 \u043a\u043b\u0435\u0442\u0447\u0430\u0442\u043a\u0443.\" \/&gt;              &lt;TextView                 android:id=\"@+id\/tvCalories\"                 android:layout_width=\"wrap_content\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"8dp\"                 android:layout_marginLeft=\"8dp\"                 android:layout_marginBottom=\"16dp\"                 android:textStyle=\"bold\"                 app:layout_constraintBottom_toBottomOf=\"parent\"                 app:layout_constraintStart_toEndOf=\"@+id\/imageView6\"                 tools:text=\"80 \u043a\u043a\u0430\u043b\" \/&gt;              &lt;ImageView                 android:id=\"@+id\/imageView6\"                 android:layout_width=\"24dp\"                 android:layout_height=\"24dp\"                 android:layout_marginStart=\"60dp\"                 android:layout_marginLeft=\"60dp\"                 android:layout_marginBottom=\"16dp\"                 app:layout_constraintBottom_toBottomOf=\"parent\"                 app:layout_constraintStart_toStartOf=\"parent\"                 app:srcCompat=\"@drawable\/ic_calories\" \/&gt;              &lt;ImageView                 android:id=\"@+id\/imageView7\"                 android:layout_width=\"24dp\"                 android:layout_height=\"24dp\"                 android:layout_marginStart=\"24dp\"                 android:layout_marginLeft=\"24dp\"                 android:layout_marginBottom=\"16dp\"                 app:layout_constraintBottom_toBottomOf=\"parent\"                 app:layout_constraintStart_toEndOf=\"@+id\/tvCalories\"                 app:srcCompat=\"@drawable\/ic_star\" \/&gt;              &lt;TextView                 android:id=\"@+id\/tvRate\"                 android:layout_width=\"wrap_content\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"8dp\"                 android:layout_marginLeft=\"8dp\"                 android:layout_marginBottom=\"16dp\"                 app:layout_constraintBottom_toBottomOf=\"parent\"                 app:layout_constraintStart_toEndOf=\"@+id\/imageView7\"                 tools:text=\"4.5\" \/&gt;         &lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;     &lt;\/androidx.cardview.widget.CardView&gt;  &lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;<\/code><\/pre>\n<\/div>\n<\/details>\n<h3>\u0428\u0430\u0433 4: \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c ConstraintLayout \u0432 MotionLayout<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c ConstraintLayout \u0432 MotionLayout:<\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u0441\u044c \u0432 \u0440\u0435\u0436\u0438\u043c Split \u0438\u043b\u0438 Design;<\/p>\n<\/li>\n<li>\n<p>\u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 (Component Tree) \u0449\u0451\u043b\u043a\u043d\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438 \u043d\u0430 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 clMain);<\/p>\n<\/li>\n<li>\n<p>\u0432 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0435\u043c\u0441\u044f \u043c\u0435\u043d\u044e \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <em>Convert to MotionLayout<\/em>.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption>\u041a\u0430\u043a \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c ConstraintLayout \u0432 MotionLayout<\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 MotionLayout.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 item_food \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;androidx.constraintlayout.motion.widget.MotionLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     xmlns:tools=\"http:\/\/schemas.android.com\/tools\"     android:id=\"@+id\/clMain\"     android:layout_width=\"match_parent\"     android:layout_height=\"wrap_content\"     app:layoutDescription=\"@xml\/item_food_scene\"&gt;      &lt;ImageView         android:id=\"@+id\/ivFood\"         android:layout_width=\"150dp\"         android:layout_height=\"150dp\"         android:layout_marginTop=\"8dp\"         android:elevation=\"10dp\"         android:scaleType=\"fitXY\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\"         app:srcCompat=\"@drawable\/img_salmon_salad\" \/&gt;      &lt;androidx.cardview.widget.CardView         android:id=\"@+id\/cardView\"         android:layout_width=\"match_parent\"         android:layout_height=\"150dp\"         android:layout_marginStart=\"100dp\"         android:layout_marginLeft=\"100dp\"         android:layout_marginTop=\"16dp\"         android:layout_marginEnd=\"16dp\"         android:layout_marginRight=\"16dp\"         android:layout_marginBottom=\"16dp\"         app:cardCornerRadius=\"20dp\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\"&gt;          &lt;androidx.constraintlayout.widget.ConstraintLayout             android:layout_width=\"match_parent\"             android:layout_height=\"match_parent\"&gt;              &lt;TextView                 android:id=\"@+id\/tvTitle\"                 android:layout_width=\"0dp\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"60dp\"                 android:layout_marginLeft=\"60dp\"                 android:layout_marginTop=\"24dp\"                 android:layout_marginEnd=\"8dp\"                 android:layout_marginRight=\"8dp\"                 android:textSize=\"18sp\"                 android:textStyle=\"bold\"                 app:layout_constraintEnd_toEndOf=\"parent\"                 app:layout_constraintStart_toStartOf=\"parent\"                 app:layout_constraintTop_toTopOf=\"parent\"                 tools:text=\"\u0421\u0430\u043b\u0430\u0442 \u0441 \u043b\u043e\u0441\u043e\u0441\u0435\u043c\" \/&gt;              &lt;TextView                 android:id=\"@+id\/tvDescription\"                 android:layout_width=\"0dp\"                 android:layout_height=\"wrap_content\"                 android:layout_marginStart=\"60dp\"                 android:layout_marginLeft=\"60dp\"                 android:layout_marginEnd=\"16dp\"                 android:layout_marginRight=\"8dp\"                 android:ellipsize=\"end\"                 android:maxLines=\"3\"                 app:layout_constraintEnd_toEndOf=\"parent\"                 app:layout_constraintStart_toStartOf=\"parent\"                 app:layout_constraintTop_toBottomOf=\"@+id\/tvTitle\"                 tools:text=\"\u041b\u043e\u0441\u043e\u0441\u044c \u0441 \u043e\u0432\u043e\u0449\u0430\u043c\u0438 \u2014 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0434\u043b\u044f<\/code><\/pre>\n<\/div>\n<\/details>\n<\/blockquote>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-320874","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=320874"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320874\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}