{"id":349831,"date":"2023-07-05T21:01:07","date_gmt":"2023-07-05T21:01:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=349831"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=349831","title":{"rendered":"<span>\u0420\u0430\u0437\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044e Android Developer<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a \u0432\u0441\u0435\u043c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c \u0425\u0430\u0431\u0440. <\/p>\n<p>\u041f\u043e\u0438\u0441\u043a \u0440\u0430\u0431\u043e\u0442\u044b \u0432 it \u0441\u0444\u0435\u0440\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0439 \u0438 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0432 it\u00a0\u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0439. \u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u043f\u0440\u0438 \u043e\u0442\u043a\u043b\u0438\u043a\u0435 \u043d\u0430 \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u044e \u043f\u0440\u043e\u0441\u044f\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435, \u044d\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c, \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0434\u0438\u043b\u0435\u043c\u043c\u0430, \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u043b\u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c, \u0432\u0435\u0434\u044c \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0432\u043f\u0443\u0441\u0442\u0443\u044e \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0438 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044e Android\u00a0developer \u0438 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 \u0422\u0417 \u0437\u0430\u0434\u0430\u043d\u0438\u044f<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/755\/aa3\/e04\/755aa3e0453f60623f7f042ea4991053.PNG\" alt=\"\u0421\u043a\u0440\u0438\u043d \u0422\u0417\" title=\"\u0421\u043a\u0440\u0438\u043d \u0422\u0417\" width=\"544\" height=\"767\"\/><\/p>\n<div><figcaption>\u0421\u043a\u0440\u0438\u043d \u0422\u0417<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0422\u0417 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0438\u0437 \u0447\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0447\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0422\u0417 \u043a\u0440\u043e\u043c\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u044f\u0437\u044b\u043a\u0443 (\u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 Kotlin), \u0435\u0441\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (MVVM \u0438\u043b\u0438 MVP), \u0442\u0430\u043a \u0436\u0435 \u0441\u0440\u0430\u0437\u0443 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a (\u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0443\u0436\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0434\u0430\u0442\u0435, \u043e\u0431 \u044d\u0442\u043e\u043c \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u0434\u0430\u043b\u0435\u0435) \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c GET \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u043e API. \u0427\u0442\u043e \u0436\u0435, \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0422\u0417 \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u043c, \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u044d\u0442\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0434\u0430\u0442\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e!\u00a0<\/p>\n<h3>\u0428\u0430\u0433 1. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043e\u0431 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f<\/p>\n<p>ui \u2013 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432\u0441\u0435 \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 ui \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c: MainFragment \u2013 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a, MainViewModelFactory \u2013 \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 ViewModelTraining. ViewModelTraining \u2013 \u0432\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 MainFragment.<\/p>\n<p>adapter \u2013 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 TrainingAdapter, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u0432\u044f\u0437\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 ui<\/p>\n<p>api \u2013 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 BASE_URL,\u00a0 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 ApiService \u0441 GET \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u0430 \u0442\u0430\u043a \u0436\u0435 ApiResult \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API.<\/p>\n<p>data &#8212;\u00a0 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043a\u0435 \u0431\u0443\u0434\u0443\u0442 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GET \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>di &#8212;\u00a0 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<h3>\u0428\u0430\u0433 2. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443, \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f:<\/p>\n<\/li>\n<\/ol>\n<p>viewBinding &#8212; \u0434\u043b\u044f \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.  <\/p>\n<pre><code> buildFeatures {         viewBinding true     }<\/code><\/pre>\n<p>Lifecycle &#8212;  \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u043c \u0446\u0438\u043a\u043b\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<\/p>\n<pre><code>    \/\/ Lifecycle     def lifecycleVersion = \"2.4.1\"     implementation \"androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion\"     implementation \"androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion\"     implementation \"androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion\"<\/code><\/pre>\n<p>Coroutines &#8212;\u00a0 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<pre><code>    \/\/ Coroutines     def coroutinesVersion = \"1.6.4\"     implementation \"org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion\"     implementation \"org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion\"<\/code><\/pre>\n<p>Retrofit &#8212; \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API.<\/p>\n<pre><code>    \/\/ Retrofit     def retrofitVersion = \"2.9.0\"     implementation \"com.squareup.retrofit2:retrofit:$retrofitVersion\"     implementation \"com.squareup.retrofit2:converter-gson:$retrofitVersion\"<\/code><\/pre>\n<p>Navigation Components &#8212; \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0438\u043c\u0435\u043d\u043d\u043e Navigation Components \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 fragments.<\/p>\n<pre><code>    \/\/ Navigation Components     def navVersion = \"2.5.3\"     implementation \"androidx.navigation:navigation-fragment-ktx:$navVersion\"     implementation \"androidx.navigation:navigation-ui-ktx:$navVersion\"<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0412\u0435\u0440\u0441\u0442\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 single activity, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 activity_main \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c FragmentContainerView.<\/p>\n<p>\u0421 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c navigation, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f <\/p>\n<pre><code> &lt;androidx.fragment.app.FragmentContainerView         android:id=\"@+id\/nav_host_fragment\"         android:layout_width=\"match_parent\"         android:layout_height=\"match_parent\"         android:name=\"androidx.navigation.fragment.NavHostFragment\"         app:defaultNavHost = \"true\"         app:navGraph=\"@navigation\/nav_graph\"         app:layout_constraintBottom_toTopOf=\"@id\/bottom_nav_menu\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         \/><\/code><\/pre>\n<p>\u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 BottomNavigationView \u0431\u0435\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 Fragments, \u0442\u0430\u043a \u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0435\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c activity_main.<\/p>\n<pre><code>    &lt;com.google.android.material.bottomnavigation.BottomNavigationView         android:id=\"@+id\/bottom_nav_menu\"         android:layout_width=\"match_parent\"         android:layout_height=\"50dp\"         app:menu=\"@menu\/bottom_nav_menu\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\" \/><\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 fragment_main \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a, \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c recyclerview.<\/p>\n<pre><code>    &lt;androidx.recyclerview.widget.RecyclerView         android:id=\"@+id\/training_adapter\"         app:layoutManager=\"androidx.recyclerview.widget.LinearLayoutManager\"         android:orientation=\"vertical\"         android:layout_width=\"match_parent\"         android:layout_height=\"wrap_content\"         android:layout_marginTop=\"12dp\"         android:clipToPadding=\"false\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintHorizontal_bias=\"0.5\"         app:layout_constraintStart_toStartOf=\"parent\"         tools:ignore=\"MissingConstraints\" \/><\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 listitem, \u0432 \u043d\u0435\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0442\u043e \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435.<\/p>\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?> &lt;androidx.cardview.widget.CardView xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     android:layout_width=\"match_parent\"     android:layout_height=\"wrap_content\"     app:cardCornerRadius=\"10dp\"     android:layout_margin=\"8dp\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\">  &lt;androidx.constraintlayout.widget.ConstraintLayout     android:layout_width=\"match_parent\"     android:layout_height=\"match_parent\"     android:background=\"@drawable\/frame\">      &lt;TextView         android:id=\"@+id\/startTime\"         android:layout_width=\"50dp\"         android:layout_height=\"20dp\"         android:layout_marginStart=\"16dp\"         android:layout_marginTop=\"32dp\"         android:text=\"10:00\"         app:layout_constraintStart_toEndOf=\"@+id\/color\"         app:layout_constraintTop_toTopOf=\"parent\" \/>      &lt;TextView         android:id=\"@+id\/lastTime\"         android:layout_width=\"50dp\"         android:layout_height=\"20dp\"         android:layout_marginStart=\"16dp\"         android:layout_marginTop=\"16dp\"         android:text=\"11:00\"         app:layout_constraintStart_toEndOf=\"@+id\/color\"         app:layout_constraintTop_toBottomOf=\"@+id\/startTime\" \/>      &lt;TextView         android:id=\"@+id\/trening\"         android:layout_width=\"wrap_content\"         android:layout_height=\"wrap_content\"         android:layout_marginStart=\"8dp\"         android:layout_marginTop=\"32dp\"         android:text=\"\u0421\u0438\u043b\u043e\u0432\u0430\u044f \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0430\"         app:layout_constraintStart_toEndOf=\"@+id\/startTime\"         app:layout_constraintTop_toTopOf=\"parent\" \/>      &lt;TextView         android:id=\"@+id\/trainingTime\"         android:layout_width=\"100dp\"         android:layout_height=\"20dp\"         android:layout_marginTop=\"32dp\"         android:layout_marginEnd=\"32dp\"         android:text=\"1\u0447. 15\u043c\u0438\u043d.\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\" \/>      &lt;TextView         android:id=\"@+id\/name\"         android:layout_width=\"150dp\"         android:layout_height=\"20dp\"         android:layout_marginTop=\"16dp\"         android:text=\"\u0413\u0440\u0438\u0433\u043e\u0440\u044c\u0435\u0432 \u042f\u0440\u043e\u0441\u043b\u0430\u0432\"         app:layout_constraintStart_toEndOf=\"@+id\/profile\"         app:layout_constraintTop_toBottomOf=\"@+id\/trening\" \/>      &lt;TextView         android:id=\"@+id\/hall\"         android:layout_width=\"100dp\"         android:layout_height=\"20dp\"         android:layout_marginStart=\"8dp\"         android:layout_marginTop=\"16dp\"         android:layout_marginEnd=\"16dp\"         android:text=\"\u0421\u0442\u0443\u0434\u0438\u044f 2\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintStart_toEndOf=\"@+id\/geo\"         app:layout_constraintTop_toBottomOf=\"@+id\/trainingTime\" \/>      &lt;ImageView         android:id=\"@+id\/profile\"         android:layout_width=\"20dp\"         android:layout_height=\"20dp\"         android:layout_marginStart=\"8dp\"         android:layout_marginTop=\"16dp\"         android:background=\"@drawable\/ic_person\"         app:layout_constraintStart_toEndOf=\"@+id\/lastTime\"         app:layout_constraintTop_toBottomOf=\"@+id\/trening\" \/>      &lt;ImageView         android:id=\"@+id\/geo\"         android:layout_width=\"20dp\"         android:layout_height=\"20dp\"         android:layout_marginStart=\"4dp\"         android:layout_marginTop=\"16dp\"         android:layout_marginEnd=\"7dp\"         android:background=\"@drawable\/ic_location\"         app:layout_constraintEnd_toStartOf=\"@+id\/hall\"         app:layout_constraintStart_toEndOf=\"@+id\/name\"         app:layout_constraintTop_toBottomOf=\"@+id\/trainingTime\" \/>      &lt;TextView         android:id=\"@+id\/color\"         android:layout_width=\"5dp\"         android:layout_height=\"100dp\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\" \/>  &lt;\/androidx.constraintlayout.widget.ConstraintLayout>   &lt;\/androidx.cardview.widget.CardView><\/code><\/pre>\n<p>\u041d\u0430 \u043c\u0430\u043a\u0435\u0442\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f87\/dac\/f13\/f87dacf1344d79d560149402e5db3f73.PNG\" width=\"440\" height=\"760\"\/><\/figure>\n<p>\u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u0435\u043d header_item \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u0430\u0442\u044b<\/p>\n<pre><code>&lt;FrameLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     android:layout_width=\"wrap_content\"     android:layout_height=\"wrap_content\">      &lt;TextView         android:id=\"@+id\/date\"         android:layout_width=\"wrap_content\"         android:layout_height=\"wrap_content\"         android:textSize=\"20dp\"         android:layout_gravity=\"center_vertical\"         android:textColor=\"@color\/gray\"\/>  &lt;\/FrameLayout><\/code><\/pre>\n<p> MainActivity \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code>class MainActivity : AppCompatActivity() {      private var _binding: ActivityMainBinding? = null     private val mBinding get() = _binding!!      override fun onCreate(savedInstanceState: Bundle?) {         super.onCreate(savedInstanceState)         _binding = ActivityMainBinding.inflate(layoutInflater)         setContentView(mBinding.root)         val navHostFragment =             supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment         val navController = navHostFragment.navController         mBinding.bottomNavMenu.setupWithNavController(navController)     }      override fun onDestroy() {         super.onDestroy()         _binding = null     } }<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 <code>MainActivity<\/code>, \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0435\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0438\u0436\u043d\u0435\u0435 \u043c\u0435\u043d\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438.  <\/p>\n<ol start=\"3\">\n<li>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f Kotlin data class File from JSON \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0430\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<\/li>\n<\/ol>\n<pre><code><\/code><\/pre>\n<pre><code>data class Training(     @SerializedName(\"lessons\")     val lessons: List&lt;Lesson>,     @SerializedName(\"option\")     val option: Option,     @SerializedName(\"tabs\")     val tabs: List&lt;Tab>,     @SerializedName(\"trainers\")     val trainers: List&lt;Trainer> )<\/code><\/pre>\n<pre><code>data class Trainer(     @SerializedName(\"description\")     val description: String,     @SerializedName(\"full_name\")     val fullName: String,     @SerializedName(\"id\")     val id: String,     @SerializedName(\"image_url\")     val imageUrl: String,     @SerializedName(\"image_url_medium\")     val imageUrlMedium: String,     @SerializedName(\"image_url_small\")     val imageUrlSmall: String,     @SerializedName(\"last_name\")     val lastName: String,     @SerializedName(\"name\")     val name: String,     @SerializedName(\"position\")     val position: String )<\/code><\/pre>\n<pre><code>data class Tab(     @SerializedName(\"id\")     val id: Int,     @SerializedName(\"name\")     val name: String )<\/code><\/pre>\n<pre><code>data class Option(     @SerializedName(\"club_name\")     val clubName: String,     @SerializedName(\"link_android\")     val linkAndroid: String,     @SerializedName(\"link_ios\")     val linkIos: String,     @SerializedName(\"primary_color\")     val primaryColor: String,     @SerializedName(\"secondary_color\")     val secondaryColor: String )<\/code><\/pre>\n<pre><code>data class Lesson(     @SerializedName(\"appointment_id\")     val appointmentId: String,     @SerializedName(\"available_slots\")     val availableSlots: Int,     @SerializedName(\"client_recorded\")     val clientRecorded: Boolean,     @SerializedName(\"coach_id\")     val coachId: String,     @SerializedName(\"color\")     val color: String,     @SerializedName(\"commercial\")     val commercial: Boolean,     @SerializedName(\"date\")     val date: String,     @SerializedName(\"description\")     val description: String,     @SerializedName(\"endTime\")     val endTime: String,     @SerializedName(\"is_cancelled\")     val isCancelled: Boolean,     @SerializedName(\"name\")     val name: String,     @SerializedName(\"place\")     val place: String,     @SerializedName(\"service_id\")     val serviceId: String,     @SerializedName(\"startTime\")     val startTime: String,     @SerializedName(\"tab\")     val tab: String,     @SerializedName(\"tab_id\")     val tabId: Int )<\/code><\/pre>\n<p>enum class TrainingType \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0435.<\/p>\n<p>\u00a04. \u0412\u043d\u0435\u0434\u0440\u044f\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435, \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Hilt.<\/p>\n<pre><code>class App : Application() {      private lateinit var viewModelFactory: MainViewModelFactory     private lateinit var retrofit: ApiService      override fun onCreate() {         super.onCreate()         retrofit = Retrofit.Builder()             .baseUrl(RetrofitClient.BASE_URL)             .addConverterFactory(GsonConverterFactory.create())             .build().create(ApiService::class.java)         viewModelFactory = MainViewModelFactory(retrofit)     }      fun &lt;T : ViewModel> provideViewModel(clazz: Class&lt;T>, owner: ViewModelStoreOwner) =         ViewModelProvider(owner, viewModelFactory)[clazz] }<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b <code>retrofit<\/code> \u0438 <code>viewModelFactory<\/code> \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>onCreate()<\/code>, \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b ViewModel \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>provideViewModel()<\/code>.   <\/p>\n<p>\u0412 \u043a\u043b\u0430\u0441\u0441\u0435 App \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c ApiService \u0438 MainViewModelFactor, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438\u0445 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u0436\u0435<\/p>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u044c App\u00a0\u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435.  <\/p>\n<pre><code>      android:name=\".di.App\"<\/code><\/pre>\n<p>\u00a05. \u041f\u0438\u0448\u0435\u043c \u0440\u0435\u0442\u0440\u043e\u0444\u0438\u0442.<\/p>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0438 BASE_URL, \u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u0431\u0438\u043b\u0434\u0435\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 App. \u0422\u0430\u043a \u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0441\u0435\u0442\u044c\u044e \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435.  <\/p>\n<pre><code>class RetrofitClient {     companion object {         val BASE_URL = \"https:\/\/olimpia.fitnesskit-admin.ru\/\"     } }<\/code><\/pre>\n<p>\u0412 \u043a\u043b\u0430\u0441\u0441\u0435 RetrofitClient \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c BASE_URL<\/p>\n<pre><code>interface ApiService {      @GET(\"schedule\/get_v3\/?club_id=2\")     suspend fun getTrainingList(): Response&lt;Training> }<\/code><\/pre>\n<p>\u0412 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 ApiService \u043f\u0438\u0448\u0435\u043c GET \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c Response&lt;Training><\/p>\n<pre><code>sealed class ApiResult&lt;out T>(     val data: T?,     val errorMessage: String? ) {      class Success&lt;out T>(_data: T?) : ApiResult&lt;T>(         data = _data,         errorMessage = null     )      class Error&lt;out T>(         val exception: String     ) : ApiResult&lt;T>(         data = null,         errorMessage = exception     ) } <\/code><\/pre>\n<p>\u041a\u043b\u0430\u0441\u0441 <code>ApiResult<\/code> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u0449\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 API. \u041f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u044b <code>Success<\/code> \u0438 <code>Error<\/code> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. <\/p>\n<pre><code>    &lt;uses-permission android:name=\"android.permission.INTERNET\"\/><\/code><\/pre>\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0441\u0435\u0442\u044c\u044e.<\/p>\n<ol start=\"6\">\n<li>\n<p>\u00a0\u041f\u0438\u0448\u0435\u043c \u0430\u0434\u0430\u043f\u0442\u0435\u0440<\/p>\n<\/li>\n<\/ol>\n<p>\u0410\u0434\u0430\u043f\u0442\u0435\u0440 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0432 \u0430\u043d\u0434\u0440\u043e\u0438\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043e\u043d \u0435\u0441\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0430 \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043d\u0435 \u043e\u0434\u0438\u043d listitem, \u0430 \u0435\u0449\u0435 \u0438 header_item (\u043e\u0431\u044b\u0447\u043d\u043e \u043c\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u0434\u0438\u043d \u0441\u043f\u0438\u0441\u043e\u043a).<\/p>\n<pre><code>class TrainingAdapter(private val getTrainerById: (String) -> String) :     RecyclerView.Adapter&lt;TrainingAdapter.TrainingViewHolder>() {      class TrainingViewHolder(view: View) : RecyclerView.ViewHolder(view)      private var training: List&lt;LessonEntity> = emptyList()      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TrainingViewHolder {         val layoutInflater = LayoutInflater.from(parent.context)         val viewToInflate = when (viewType) {             TrainingType.TRAIN.ordinal -> R.layout.listitem             else -> R.layout.header_item         }         return TrainingViewHolder(layoutInflater.inflate(viewToInflate, parent, false))     }      override fun getItemViewType(position: Int): Int {         return training[position].type.ordinal     }      override fun onBindViewHolder(holder: TrainingViewHolder, position: Int) {         val item = training[position]         if (item.type == TrainingType.TRAIN) {             with(holder.itemView) {                 findViewById&lt;TextView>(R.id.startTime).text = item.lesson?.startTime                 findViewById&lt;TextView>(R.id.lastTime).text = item.lesson?.endTime                 findViewById&lt;TextView>(R.id.trening).text = item.lesson?.name                 findViewById&lt;TextView>(R.id.color).setBackgroundColor(Color.parseColor(item.lesson?.color))                 item.lesson?.coachId?.let {                     findViewById&lt;TextView>(R.id.name).text = getTrainerById(it)                 }             }         } else {             holder.itemView.findViewById&lt;TextView>(R.id.date).text = item.header         }     }      override fun getItemCount() = training.size      @SuppressLint(\"NotifyDataSetChanged\")     fun setData(data: List&lt;LessonEntity>) {         training = data         notifyDataSetChanged()     } }<\/code><\/pre>\n<p>\u0412 TrainingViewHolder \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 (val binding: ListitemBinding), \u0430 \u0431\u0443\u0434\u0435\u0442 (view: View), \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0438 \u043a \u0441\u043f\u0438\u0441\u043a\u0443 \u0438 \u043a \u0434\u0430\u0442\u0435.<\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>onCreateViewHolder<\/code> \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 <code>TrainingViewHolder<\/code> \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432 <code>viewType<\/code>. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 <code>TrainingViewHolder<\/code>, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 inflate.  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>getItemViewType<\/code> \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u0435\u0433\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>ordinal<\/code> \u0442\u0438\u043f\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>TrainingType<\/code>.  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>onBindViewHolder<\/code> \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043f\u0438\u0441\u043a\u0430. \u0415\u0441\u043b\u0438 \u0442\u0438\u043f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>TrainingType.TRAIN<\/code>, \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 (TextView) \u0432\u043d\u0443\u0442\u0440\u0438 <code>TrainingViewHolder.itemView<\/code>. \u0415\u0441\u043b\u0438 \u0442\u0438\u043f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 <code>TrainingType.TRAIN<\/code>, \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 TextView \u0432\u043d\u0443\u0442\u0440\u0438 <code>TrainingViewHolder.itemView<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>getItemCount<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <code>training<\/code>.  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>setData<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0438 \u0432\u044b\u0437\u043e\u0432\u0430 <code>notifyDataSetChanged()<\/code>, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a.  <\/p>\n<ol start=\"7\">\n<li>\n<p>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u0432\u0441\u0435 \u0432 MainFragment \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a  .<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 MainViewModelFactory.<\/p>\n<pre><code>class MainViewModelFactory constructor(     private val retrofit: ApiService ) : ViewModelProvider.Factory {      override fun &lt;T : ViewModel> create(modelClass: Class&lt;T>): T {         if (modelClass.isAssignableFrom(ViewModelTraining::class.java)) {             return ViewModelTraining(retrofit) as T         }         throw java.lang.IllegalArgumentException(\"Unknown class name\")     } }<\/code><\/pre>\n<p><code>MainViewModelFactory<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 <code>ViewModelTraining<\/code> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <code>ApiService<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c ViewModelTraining.<\/p>\n<pre><code>class ViewModelTraining(private val retrofit: ApiService) : ViewModel() {      var liveData = MutableLiveData&lt;ApiResult&lt;Training>>()      init {         loadListTraining()     }      fun loadListTraining() {         viewModelScope.launch(Dispatchers.IO) {             val result = retrofit.getTrainingList()             if (result.isSuccessful) {                 liveData.postValue(ApiResult.Success(result.body()))             } else liveData.postValue(ApiResult.Error(\"Not Loading\"))         }     }      fun getTrainerById(id: String): String {         val trainer = liveData.value?.data?.trainers?.find {             it.id == id         }         return trainer?.name ?: \" \"     } }<\/code><\/pre>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 <code>ViewModelTraining<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>liveData<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c <code>MutableLiveData<\/code> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c <code>ApiResult&lt;Training><\/code>. <code>MutableLiveData<\/code> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u0438 \u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438.   <\/p>\n<p>\u0412 \u0431\u043b\u043e\u043a\u0435 <code>init<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0431\u043b\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <code>loadListTraining()<\/code>. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u043a \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>liveData<\/code>.  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>loadListTraining()<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>viewModelScope.launch<\/code> \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 <code>Dispatchers.IO<\/code>. \u0412\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u043c\u0435\u0442\u043e\u0434\u0443 <code>getTrainingList()<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>retrofit<\/code>. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u0443\u0441\u043f\u0435\u0448\u0435\u043d, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 <code>liveData<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>liveData.postValue(ApiResult.Success(result.body()))<\/code>, \u0438\u043d\u0430\u0447\u0435 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>liveData.postValue(ApiResult.Error(\"Not Loading\"))<\/code>.  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>getTrainerById<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <code>id<\/code> \u0442\u0438\u043f\u0430 <code>String<\/code> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438 \u0442\u0440\u0435\u043d\u0435\u0440\u0430 \u043f\u043e \u0435\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443. \u0412\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>find<\/code> \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0442\u0440\u0435\u043d\u0435\u0440\u0430 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 <code>liveData<\/code>. \u0415\u0441\u043b\u0438 \u0442\u0440\u0435\u043d\u0435\u0440 \u043d\u0430\u0439\u0434\u0435\u043d, \u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u0438\u043c\u044f, \u0438\u043d\u0430\u0447\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430.  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c MainFragment<\/p>\n<pre><code>class MainFragment : Fragment() {      private var _binding: FragmentMainBinding? = null     private val mBinding get() = _binding!!     private lateinit var viewModel: ViewModelTraining      override fun onCreateView(         inflater: LayoutInflater, container: ViewGroup?,         savedInstanceState: Bundle?     ): View? {         _binding = FragmentMainBinding.inflate(layoutInflater, container, false)         return mBinding.root     }      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {         super.onViewCreated(view, savedInstanceState)          viewModel =             (activity?.application as App).provideViewModel(ViewModelTraining::class.java, this)          val trainingAdapter = TrainingAdapter { viewModel.getTrainerById(it) }         mBinding.trainingAdapter.adapter = trainingAdapter         viewModel.liveData.observe(requireActivity()) {             if (it is ApiResult.Success &amp;&amp; it.data != null) {                 trainingAdapter.setData(sortLessons(it.data))             } else {                 Toast.makeText(requireContext(), it.errorMessage, Toast.LENGTH_SHORT).show()             }         }     }      fun sortLessons(body: Training): ArrayList&lt;LessonEntity> {         val list = body.lessons.sortedByDescending {             it.formatedDate         }         val map = emptyMap&lt;String, ArrayList&lt;Lesson>>().toMutableMap()         list.forEach {             if (map[it.dateWithDay] == null)                 map[it.dateWithDay] = ArrayList()             map[it.dateWithDay]?.add(it)         }          val newList = ArrayList&lt;LessonEntity>()         map.forEach() { entry ->             newList.add(LessonEntity(type = TrainingType.HEADER, null, entry.key))             entry.value.mapTo(newList) {                 LessonEntity(type = TrainingType.TRAIN, it, null)             }         }         return newList     }      override fun onDestroy() {         super.onDestroy()         _binding = null     } }<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>_binding<\/code> \u0442\u0438\u043f\u0430 <code>FragmentMainBinding?<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430.  \u0421\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>mBinding<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>_binding!!<\/code>, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430.  <\/p>\n<p> \u0421\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>viewModel<\/code> \u0442\u0438\u043f\u0430 <code>ViewModelTraining<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438.  <\/p>\n<p>  \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 <code>onCreateView<\/code> \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <code>_binding<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>FragmentMainBinding.inflate(layoutInflater, container, false)<\/code>. \u0417\u0430\u0442\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0432\u0438\u0434  \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438.    <\/p>\n<p> \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 <code>onViewCreated<\/code> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <code>viewModel<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>provideViewModel<\/code> \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0430 <code>App<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 <code>ViewModelTraining<\/code> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <code>activity?.application<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 <code>this<\/code>. \u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 <code>TrainingAdapter<\/code>, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u043b\u044f\u043c\u0431\u0434\u0430-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>viewModel.getTrainerById(it)<\/code> \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440. \u0414\u0430\u043b\u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0434\u043b\u044f <code>mBinding.trainingAdapter.adapter<\/code>. \u041d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u0435\u043b\u044c <code>liveData<\/code> \u0432 <code>viewModel<\/code> \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 UI \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>ApiResult.Success<\/code> \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u0440\u0430\u0432\u043d\u044b <code>null<\/code>, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>setData<\/code> \u0434\u043b\u044f <code>trainingAdapter<\/code> \u0441 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>Toast<\/code> \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435.  <\/p>\n<p>\u0412 \u043a\u043b\u0430\u0441\u0441\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u043c\u0435\u0442\u043e\u0434 <code>sortLessons<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 <code>Training<\/code> \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a <code>LessonEntity<\/code>. \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 <code>lessons<\/code> \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e \u0434\u0430\u0442\u044b. \u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u043e\u0439 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c <code>map<\/code>, \u043a\u0443\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 <code>lessons<\/code> \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u043e \u0434\u0430\u0442\u0435. \u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a <code>newList<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0438 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0438 \u0438\u0437 \u0441\u043b\u043e\u0432\u0430\u0440\u044f <code>map<\/code>. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a <code>newList<\/code>.  <\/p>\n<p>\u0412 \u043c\u0435\u0442\u043e\u0434\u0435 <code>onDestroy<\/code> <code>_binding<\/code> \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 <code>null<\/code>, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438. <\/p>\n<p>\u0412\u0441\u0435, \u0437\u0430\u0434\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e! \u041d\u0430 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e3c\/76b\/e97\/e3c76be97fa8cbf373a4e98c60cb1014.PNG\" width=\"573\" height=\"924\"\/><\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b6\/9f2\/286\/8b69f2286fb99d47d49e1e663e88cca8.PNG\" width=\"502\" height=\"933\"\/><\/figure>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0445\u043e\u0447\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435, \u0433\u0434\u0435 \u0432\u0430\u0441 \u043f\u0440\u043e\u0441\u044f\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u043e. \u0414\u0443\u043c\u0430\u044e, \u043c\u043e\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e\u0442 \u0441\u0442\u0430\u0442\u044c \u0410\u043d\u0434\u0440\u043e\u0438\u0434 \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0438 \u043f\u0440\u043e\u0431\u0443\u044e\u0442 \u043e\u0442\u043a\u043b\u0438\u043a\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u0438. \u0414\u0435\u043b\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442, \u0432\u0430\u0448 \u0432\u044b\u0431\u043e\u0440, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u0430\u043c \u043f\u043e\u0432\u0435\u0437\u0435\u0442 \u0438 \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0432\u0430\u0441 \u043f\u043e\u0437\u043e\u0432\u0443\u0442 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p><a href=\"https:\/\/github.com\/Andrey9595\/FitnessKit\" rel=\"noopener noreferrer nofollow\">\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0441 \u043a\u043e\u0434\u043e\u043c \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0442\u0443\u0442<\/a><\/p>\n<p>\u0422\u0413 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438: <a class=\"mention\" href=\"\/users\/AndrewNB\">@AndrewNB<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \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\/articles\/746146\/\"> https:\/\/habr.com\/ru\/articles\/746146\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a \u0432\u0441\u0435\u043c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c \u0425\u0430\u0431\u0440. <\/p>\n<p>\u041f\u043e\u0438\u0441\u043a \u0440\u0430\u0431\u043e\u0442\u044b \u0432 it \u0441\u0444\u0435\u0440\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0439 \u0438 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0432 it\u00a0\u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0439. \u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u043f\u0440\u0438 \u043e\u0442\u043a\u043b\u0438\u043a\u0435 \u043d\u0430 \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u044e \u043f\u0440\u043e\u0441\u044f\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435, \u044d\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c, \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0434\u0438\u043b\u0435\u043c\u043c\u0430, \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u043b\u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c, \u0432\u0435\u0434\u044c \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0432\u043f\u0443\u0441\u0442\u0443\u044e \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0438 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044e Android\u00a0developer \u0438 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 \u0422\u0417 \u0437\u0430\u0434\u0430\u043d\u0438\u044f<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u043a\u0440\u0438\u043d \u0422\u0417<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0422\u0417 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0438\u0437 \u0447\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0447\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0422\u0417 \u043a\u0440\u043e\u043c\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u044f\u0437\u044b\u043a\u0443 (\u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 Kotlin), \u0435\u0441\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (MVVM \u0438\u043b\u0438 MVP), \u0442\u0430\u043a \u0436\u0435 \u0441\u0440\u0430\u0437\u0443 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a (\u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0443\u0436\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0434\u0430\u0442\u0435, \u043e\u0431 \u044d\u0442\u043e\u043c \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u0434\u0430\u043b\u0435\u0435) \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c GET \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u043e API. \u0427\u0442\u043e \u0436\u0435, \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0422\u0417 \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u043c, \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u044d\u0442\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0434\u0430\u0442\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e!\u00a0<\/p>\n<h3>\u0428\u0430\u0433 1. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043e\u0431 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f<\/p>\n<p>ui \u2013 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432\u0441\u0435 \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 ui \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c: MainFragment \u2013 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a, MainViewModelFactory \u2013 \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 ViewModelTraining. ViewModelTraining \u2013 \u0432\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 MainFragment.<\/p>\n<p>adapter \u2013 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 TrainingAdapter, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u0432\u044f\u0437\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 ui<\/p>\n<p>api \u2013 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 BASE_URL,\u00a0 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 ApiService \u0441 GET \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u0430 \u0442\u0430\u043a \u0436\u0435 ApiResult \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API.<\/p>\n<p>data &#8212;\u00a0 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043a\u0435 \u0431\u0443\u0434\u0443\u0442 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GET \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>di &#8212;\u00a0 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<h3>\u0428\u0430\u0433 2. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443, \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f:<\/p>\n<\/li>\n<\/ol>\n<p>viewBinding &#8212; \u0434\u043b\u044f \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.  <\/p>\n<pre><code> buildFeatures {         viewBinding true     }<\/code><\/pre>\n<p>Lifecycle &#8212;  \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u043c \u0446\u0438\u043a\u043b\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<\/p>\n<pre><code>    \/\/ Lifecycle     def lifecycleVersion = \"2.4.1\"     implementation \"androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion\"     implementation \"androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion\"     implementation \"androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion\"<\/code><\/pre>\n<p>Coroutines &#8212;\u00a0 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<pre><code>    \/\/ Coroutines     def coroutinesVersion = \"1.6.4\"     implementation \"org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion\"     implementation \"org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion\"<\/code><\/pre>\n<p>Retrofit &#8212; \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API.<\/p>\n<pre><code>    \/\/ Retrofit     def retrofitVersion = \"2.9.0\"     implementation \"com.squareup.retrofit2:retrofit:$retrofitVersion\"     implementation \"com.squareup.retrofit2:converter-gson:$retrofitVersion\"<\/code><\/pre>\n<p>Navigation Components &#8212; \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0438\u043c\u0435\u043d\u043d\u043e Navigation Components \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 fragments.<\/p>\n<pre><code>    \/\/ Navigation Components     def navVersion = \"2.5.3\"     implementation \"androidx.navigation:navigation-fragment-ktx:$navVersion\"     implementation \"androidx.navigation:navigation-ui-ktx:$navVersion\"<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0412\u0435\u0440\u0441\u0442\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 single activity, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 activity_main \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c FragmentContainerView.<\/p>\n<p>\u0421 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c navigation, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f <\/p>\n<pre><code> &lt;androidx.fragment.app.FragmentContainerView         android:id=\"@+id\/nav_host_fragment\"         android:layout_width=\"match_parent\"         android:layout_height=\"match_parent\"         android:name=\"androidx.navigation.fragment.NavHostFragment\"         app:defaultNavHost = \"true\"         app:navGraph=\"@navigation\/nav_graph\"         app:layout_constraintBottom_toTopOf=\"@id\/bottom_nav_menu\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         \/><\/code><\/pre>\n<p>\u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 BottomNavigationView \u0431\u0435\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 Fragments, \u0442\u0430\u043a \u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0435\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c activity_main.<\/p>\n<pre><code>    &lt;com.google.android.material.bottomnavigation.BottomNavigationView         android:id=\"@+id\/bottom_nav_menu\"         android:layout_width=\"match_parent\"         android:layout_height=\"50dp\"         app:menu=\"@menu\/bottom_nav_menu\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\" \/><\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 fragment_main \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a, \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c recyclerview.<\/p>\n<pre><code>    &lt;androidx.recyclerview.widget.RecyclerView         android:id=\"@+id\/training_adapter\"         app:layoutManager=\"androidx.recyclerview.widget.LinearLayoutManager\"         android:orientation=\"vertical\"         android:layout_width=\"match_parent\"         android:layout_height=\"wrap_content\"         android:layout_marginTop=\"12dp\"         android:clipToPadding=\"false\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintHorizontal_bias=\"0.5\"         app:layout_constraintStart_toStartOf=\"parent\"         tools:ignore=\"MissingConstraints\" \/><\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 listitem, \u0432 \u043d\u0435\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0442\u043e \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435.<\/p>\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?> &lt;androidx.cardview.widget.CardView xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     android:layout_width=\"match_parent\"     android:layout_height=\"wrap_content\"     app:cardCornerRadius=\"10dp\"     android:layout_margin=\"8dp\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\">  &lt;androidx.constraintlayout.widget.ConstraintLayout     android:layout_width=\"match_parent\"     android:layout_height=\"match_parent\"     android:background=\"@drawable\/frame\">      &lt;TextView         android:id=\"@+id\/startTime\"         android:layout_width=\"50dp\"         android:layout_height=\"20dp\"         android:layout_marginStart=\"16dp\"         android:layout_marginTop=\"32dp\"         android:text=\"10:00\"         app:layout_constraintStart_toEndOf=\"@+id\/color\"         app:layout_constraintTop_toTopOf=\"parent\" \/>      &lt;TextView         android:id=\"@+id\/lastTime\"         android:layout_width=\"50dp\"         android:layout_height=\"20dp\"         android:layout_marginStart=\"16dp\"         android:layout_marginTop=\"16dp\"         android:text=\"11:00\"         app:layout_constraintStart_toEndOf=\"@+id\/color\"         app:layout_constraintTop_toBottomOf=\"@+id\/startTime\" \/>      &lt;TextView         android:id=\"@+id\/trening\"         android:layout_width=\"wrap_content\"         android:layout_height=\"wrap_content\"         android:layout_marginStart=\"8dp\"         android:layout_marginTop=\"32dp\"         android:text=\"\u0421\u0438\u043b\u043e\u0432\u0430\u044f \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0430\"         app:layout_constraintStart_toEndOf=\"@+id\/startTime\"         app:layout_constraintTop_toTopOf=\"parent\" \/>      &lt;TextView         android:id=\"@+id\/trainingTime\"         android:layout_width=\"100dp\"         android:layout_height=\"20dp\"         android:layout_marginTop=\"32dp\"         android:layout_marginEnd=\"32dp\"         android:text=\"1\u0447. 15\u043c\u0438\u043d.\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\" \/>      &lt;TextView         android:id=\"@+id\/name\"         android:layout_width=\"150dp\"         android:layout_height=\"20dp\"         android:layout_marginTop=\"16dp\"         android:text=\"\u0413\u0440\u0438\u0433\u043e\u0440\u044c\u0435\u0432 \u042f\u0440\u043e\u0441\u043b\u0430\u0432\"         app:layout_constraintStart_toEndOf=\"@+id\/profile\"         app:layout_constraintTop_toBottomOf=\"@+id\/trening\" \/>      &lt;TextView         android:id=\"@+id\/hall\"         android:layout_width=\"100dp\"         android:layout_height=\"20dp\"         android:layout_marginStart=\"8dp\"         android:layout_marginTop=\"16dp\"         android:layout_marginEnd=\"16dp\"         android:text=\"\u0421\u0442\u0443\u0434\u0438\u044f 2\"         app:layout_constraintEnd_toEndOf=\"parent\"         app:layout_constraintStart_toEndOf=\"@+id\/geo\"         app:layout_constraintTop_toBottomOf=\"@+id\/trainingTime\" \/>      &lt;ImageView         android:id=\"@+id\/profile\"         android:layout_width=\"20dp\"         android:layout_height=\"20dp\"         android:layout_marginStart=\"8dp\"         android:layout_marginTop=\"16dp\"         android:background=\"@drawable\/ic_person\"         app:layout_constraintStart_toEndOf=\"@+id\/lastTime\"         app:layout_constraintTop_toBottomOf=\"@+id\/trening\" \/>      &lt;ImageView         android:id=\"@+id\/geo\"         android:layout_width=\"20dp\"         android:layout_height=\"20dp\"         android:layout_marginStart=\"4dp\"         android:layout_marginTop=\"16dp\"         android:layout_marginEnd=\"7dp\"         android:background=\"@drawable\/ic_location\"         app:layout_constraintEnd_toStartOf=\"@+id\/hall\"         app:layout_constraintStart_toEndOf=\"@+id\/name\"         app:layout_constraintTop_toBottomOf=\"@+id\/trainingTime\" \/>      &lt;TextView         android:id=\"@+id\/color\"         android:layout_width=\"5dp\"         android:layout_height=\"100dp\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintStart_toStartOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\" \/>  &lt;\/androidx.constraintlayout.widget.ConstraintLayout>   &lt;\/androidx.cardview.widget.CardView><\/code><\/pre>\n<p>\u041d\u0430 \u043c\u0430\u043a\u0435\u0442\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u0435\u043d header_item \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u0430\u0442\u044b<\/p>\n<pre><code>&lt;FrameLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     android:layout_width=\"wrap_content\"     android:layout_height=\"wrap_content\">      &lt;TextView         android:id=\"@+id\/date\"         android:layout_width=\"wrap_content\"         android:layout_height=\"wrap_content\"         android:textSize=\"20dp\"         android:layout_gravity=\"center_vertical\"         android:textColor=\"@color\/gray\"\/>  &lt;\/FrameLayout><\/code><\/pre>\n<p> MainActivity \u043a\u043e\u0434<\/p>\n<\/div>\n<\/div>\n<\/div>\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-349831","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349831","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=349831"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349831\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=349831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=349831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=349831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}