{"id":289771,"date":"2018-09-23T14:55:02","date_gmt":"2018-09-23T10:55:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=289771"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=289771","title":{"rendered":"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u043e\u0434 Android. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041c\u043e\u0438 \u043f\u043e\u0441\u0442\u044b \u2014 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u043c\u043e\u0447\u044c \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043a\u0430\u043a\u0438\u043c\u0438-\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 Android. \u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0449\u0435 \u043d\u0435 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u2014 \u0432\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044f \u0432 \u0445\u043e\u0434\u0435 \u043f\u043e\u0432\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043c\u044b\u0441\u043b\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f <s>\u0434\u043e \u043d\u0438\u0445 \u0434\u043e\u043a\u0430\u0442\u0438\u043b\u0441\u044f<\/s> \u043a \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u0435\u043b.<\/p>\n<p>  <b>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435: <\/b><\/p>\n<ul>\n<li>\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 RecyclerView \u0438 RecyclerView.Adapter<\/li>\n<li>\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043e\u0434\u043d\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438\u0437 Android Jetpack (\u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u0435\u0437 \u043d\u0435\u0435)<\/li>\n<li>\u0434\u043b\u044f \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u2014 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \ud83d\ude09<\/li>\n<\/ul>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h4><b>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/b><\/h4>\n<p>  \u041d\u0443 \u0447\u0442\u043e \u0436! \u0412\u0441\u0435 \u0443\u0436\u0435 \u0437\u0430\u0431\u044b\u043b\u0438 \u043f\u0440\u043e ListView \u0438 \u0431\u043b\u0430\u0433\u043e\u043f\u043e\u043b\u0443\u0447\u043d\u043e \u043f\u0438\u0448\u0443\u0442 \u043d\u0430 RecyclerView(<i><b>Rv<\/b><\/i>). \u0422\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b\u0438 \u0441\u0430\u043c\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d <i>ViewHolder<\/i>, \u043a\u0430\u043d\u0443\u043b\u0438 \u0432 \u043d\u0435\u0431\u044b\u0442\u0438\u0435. <i>Rv<\/i> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043d\u0430\u0431\u043e\u0440 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 <i>LayoutManager&#8217;\u043e\u0432<\/i> \u0434\u043b\u044f \u0438\u0445 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041f\u043e \u0441\u0443\u0442\u0438, \u0433\u043b\u044f\u0434\u044f \u043d\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044d\u043a\u0440\u0430\u043d\u043e\u0432, \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043d\u0438\u0445 \u2014 \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 <i>ViewHolder<\/i>. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f <a href=\"https:\/\/youtu.be\/IrMw7MEgADk?t=23m4s\">\u043d\u0430\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u043d\u0430 Google I\/O<\/a>.<\/p>\n<p>  \u041d\u043e, \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0430 \u00ab\u043d\u043e\u00bb!.. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 Stackoverflow \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043e\u0431\u0449\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0435, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043c\u0435\u0441\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Adapter&#8217;a.<\/p>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, <i>Rv<\/i> \u0443\u0436\u0435 \u0442\u0440\u0438 \u0433\u043e\u0434\u0430. \u0418\u043d\u0444\u044b \u043f\u043e \u043d\u0435\u043c\u0443 \u0442\u0443\u0447\u0430, \u0438 \u043c\u043d\u043e\u0433\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0441 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0432\u0435\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b, \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u043b\u0430\u0437\u0438\u0442\u0435 \u043f\u043e\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0430 \u0447\u0443\u0436\u043e\u0439 \u043a\u043e\u0434 \u2014 \u0438 \u0432\u0438\u0434\u0438\u0442\u0435 \u0442\u0430\u043c <s>\u0414\u0440\u0435\u0432\u043d\u0438\u0439 \u0423\u0436\u0430\u0441<\/s> \u043d\u0435 \u0442\u043e, \u0447\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u0432\u0438\u0434\u0435\u0442\u044c, \u0438\u043b\u0438 \u043d\u0435 \u0442\u043e \u0447\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0441\u0435\u0431\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0438? \u0417\u0430 \u044d\u0442\u0438 \u0442\u0440\u0438 \u0433\u043e\u0434\u0430 Android \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u0430\u043a\u0438 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u043d\u044f\u043b \u043a \u0441\u0435\u0431\u0435 Kotlin = \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u0430\u0441\u044c \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430, \u043f\u043e <i>Rv<\/i> \u0432\u044b\u0448\u043b\u043e \u043d\u0435\u043c\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043f\u043e\u043b\u043d\u043e\u0439 \u043c\u0435\u0440\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u0426\u0435\u043b\u044c \u044d\u0442\u043e\u0439 \u2014 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043b\u0443\u0447\u0448\u0438\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u043a <s>\u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434<\/s> \u043e\u0441\u043d\u043e\u0432\u0443, \u043a\u0430\u0440\u043a\u0430\u0441 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u0434\u043b\u044f \u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u042d\u0442\u043e\u0442 \u043a\u0430\u0440\u043a\u0430\u0441 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0438 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044f \u043b\u0438\u0448\u043d\u0435\u0435. \u042f \u0441\u0447\u0438\u0442\u0430\u044e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u0447\u0443\u0436\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u2014 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u0432\u044b \u0438\u043c\u0435\u0435\u0442\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0438 \u043f\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0435\u0439\u0441\u044b \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0435\u0441\u044c, \u043d\u0435 \u0437\u0430\u0432\u044f\u0437\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u0447\u0443\u0436\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0438.<\/p>\n<h4><b>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043c\u044b\u0441\u043b\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438 \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430<\/b><\/h4>\n<p>  \u0420\u0435\u0448\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0431\u0443\u0434\u0435\u0442 <a href=\"https:\/\/habr.com\/post\/30444\/\">\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0430 \u043d\u0435 \u043a\u043b\u0430\u0441\u0441<\/a>, \u043d\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0437\u0430\u043c\u043a\u043d\u0435\u043c \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u044d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c. \u041d\u043e, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0442\u0430\u043a, \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0430 \u2014 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043f\u0440\u044f\u0442\u0430\u0442\u044c \u0435\u0435 \u0437\u0430 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u0430 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0433\u043e \u2014 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e. \u042f \u043f\u043e\u043a\u0430\u0436\u0443 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u043d\u043e \u043c\u043e\u044f \u0446\u0435\u043b\u044c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0434\u0443\u043c\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438. \u0415\u0449\u0435 \u0440\u0430\u0437 \u2014 \u043f\u043b\u0430\u043d \u0442\u0430\u043a\u043e\u0439: <i>\u041d\u0430\u0431\u043e\u0440 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 -&gt; <i>\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441<\/i>, \u0437\u0430\u0431\u0438\u0440\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0443 (\u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e) -&gt; \u0438 \u0443\u0436\u0435 <i>\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441<\/i> \u0441 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c<\/i>. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443.<\/p>\n<p>  \u0427\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0430\u0434\u0430\u043f\u0442\u0435\u0440? \u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043b\u0435\u0433\u0447\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u0448\u044c \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440. \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 RecyclerView.Adapter, \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043f\u0430\u0440\u0443 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">IBaseListAdapter<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>interface IBaseListAdapter&lt;T&gt; {     fun add(newItem: T)     fun add(newItems: ArrayList&lt;T&gt;?)     fun addAtPosition(pos : Int, newItem : T)     fun remove(position: Int)     fun clearAll() } <\/code><\/pre>\n<p>  <i>* \u041f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u044f \u043d\u0430\u0448\u0435\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0434\u0435\u0441\u044c \u043e\u043f\u0443\u0449\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440<\/i><b> getItemByPos(position: Int),<\/b> <i>\u0438\u043b\u0438 \u0434\u0430\u0436\u0435<\/i> <b> subList(startIndex: Int, endIndex: Int).<\/b> <i>\u041f\u043e\u0432\u0442\u043e\u0440\u044e\u0441\u044c: \u0432\u044b \u0441\u0430\u043c\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u042d\u0442\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0435\u0448\u044c \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435. \u0410\u0441\u043a\u0435\u0442\u0438\u0437\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043b\u0438\u0448\u043d\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0445\u0443\u0434\u0448\u0430\u0435\u0442 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u0442\u0440\u043e\u043a.<\/i>   <\/div>\n<\/div>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a <b>T<\/b>. \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043b\u044e\u0431\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0430 (item), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442 \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f \u2014 \u043c\u044b \u0435\u0449\u0435 \u043d\u0435 \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u043d\u0430\u0448 \u043f\u043e\u0434\u0445\u043e\u0434. \u0410 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0432\u0430, \u043f\u0435\u0440\u0432\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>interface IBaseListItem {     fun getLayoutId(): Int } <\/code><\/pre>\n<p>  \u041d\u0443 \u0434\u0430, \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u2014 \u043c\u044b \u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0431 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u0441\u043f\u0438\u0441\u043a\u0430, \u0437\u043d\u0430\u0447\u0438\u0442 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043b\u0435\u0439\u0430\u0443\u0442, \u0430 \u0441\u043e\u0441\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e layoutId. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043d\u0435 \u0431\u0440\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 <a href=\"https:\/\/youtu.be\/TS_J0Qw4zl0?t=11m49s\">\u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b<\/a>. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0443 \u0432\u0430\u0441 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043e\u043f\u044b\u0442\u0430 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0435\u043b\u0435\u0433\u0430\u0442 \u0438\u043b\u0438 \u043e\u0431\u0435\u0440\u0442\u043a\u0443, \u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u043e\u043d\u043e \u0442\u043e\u0433\u043e \u043f\u0440\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u2014 \u0438 \u0435\u0449\u0435 \u043c\u0435\u043d\u044c\u0448\u0435\u043c \u043e\u043f\u044b\u0442\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438? \u0412\u0441\u0435 \u043c\u043e\u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043a\u0443\u0434\u0430 \u0442\u043e \u0432 \u044e\u0442\u0443\u0431 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u0438\u0445 \u0438 \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0434\u0430\u043b\u044c\u0448\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u043f\u0440\u043e\u0449\u0435 \u2014 \u044f \u0441\u0447\u0438\u0442\u0430\u044e \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 <i>Rv<\/i>, <a href=\"https:\/\/developer.android.com\/guide\/topics\/ui\/layout\/recyclerview#Adapter\">\u0441\u0443\u0434\u044f \u043f\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>, \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0448\u0435 \u2014 \u043d\u0435 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u041f\u043e\u0440\u0430 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043d\u0430\u0448 <i> IBaseListAdapter <\/i> \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438, \u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0431\u0443\u0434\u0435\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u043c:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">SimpleListAdapter<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>abstract class SimpleListAdapter : RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt;(), IBaseListAdapter&lt;IBaseListItem&gt; {      protected val items: ArrayList&lt;IBaseListItem&gt; = ArrayList()      override fun getItemCount() = items.size     override fun getItemViewType(position: Int) = items[position].layoutId      protected fun inflateByViewType(context: Context?, viewType: Int, parent: ViewGroup) =             LayoutInflater.from(context).inflate(viewType, parent, false)      override fun add(newItem: IBaseListItem) {         items.add(newItem)         notifyDataSetChanged()     }      override fun add(newItems: ArrayList&lt;IBaseListItem&gt;?) {          for (newItem in newItems ?: return) {             items.add(newItem)             notifyDataSetChanged()         }     }      override fun addAtPosition(pos: Int, newItem: IBaseListItem) {         items.add(pos, newItem)         notifyDataSetChanged()     }      override fun clearAll() {         items.clear()         notifyDataSetChanged()     }      override fun remove(position: Int) {         items.removeAt(position)         notifyDataSetChanged()     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <b>*\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <b>getItemViewType(position: Int)<\/b>. \u041d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043d\u0435\u043a\u0438\u0439 \u0438\u043d\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u044e\u0447, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 Rv \u043f\u043e\u0439\u043c\u0435\u0442, \u043a\u0430\u043a\u043e\u0439 ViewHolder \u043d\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f <i>val layoutId<\/i> \u0443 \u043d\u0430\u0448\u0435\u0439 <b>item<\/b>, \u0442.\u043a. \u0410\u043d\u0434\u0440\u043e\u0438\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0443\u0441\u043b\u0443\u0436\u0438\u0432\u043e \u0434\u0435\u043b\u0430\u0435\u0442 id \u043b\u0435\u0439\u0430\u0443\u0442\u043e\u0432 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438, \u0438 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0443\u043b\u044f \u2014 \u044d\u0442\u0438\u043c \u043c\u044b \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u0430\u043b\u0435\u0435, \u00ab\u043d\u0430\u0434\u0443\u0432\u0430\u044f\u00bb <i>itemView<\/i> \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0432\u044c\u044e\u0445\u043e\u043b\u0434\u0435\u0440\u043e\u0432 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <b>inflateByViewType()<\/b> (\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430).<\/p>\n<h4><b>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a<\/b><\/h4>\n<p>  \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044d\u043a\u0440\u0430\u043d \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a. \u0410\u043d\u0434\u0440\u043e\u0438\u0434 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0430\u043c <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/v7\/preference\/PreferenceFragmentCompat\">\u0441\u0432\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442,<\/a> \u043d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043f\u043e \u0434\u0438\u0437\u0430\u0439\u043d\u0443 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0438\u0437\u043e\u0449\u0440\u0435\u043d\u043d\u043e\u0435? \u042f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u044d\u043a\u0440\u0430\u043d \u043a\u0430\u043a \u0441\u043f\u0438\u0441\u043e\u043a. \u0422\u0443\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0442\u0430\u043a\u043e\u0439 \u043a\u0435\u0439\u0441:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ln\/ta\/yo\/lntayo2a50jwpio4x07noizqh14.png\"\/><\/p>\n<p>  \u041c\u044b \u0432\u0438\u0434\u0438\u043c \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0438\u0441\u043a\u0430, \u0437\u043d\u0430\u0447\u0438\u0442 <b> SimpleListAdapter <\/b> \u0438 <i>Rv<\/i> \u0442\u0443\u0442 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442!<\/p>\n<p>  \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c! \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u0432\u0435\u0440\u0441\u0442\u043a\u0438 \u043b\u0435\u0439\u0430\u0443\u0442\u043e\u0432 \u0434\u043b\u044f item&#8217;\u043e\u0432:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">item_info.xml; item_switch.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;FrameLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     xmlns:tools=&quot;http:\/\/schemas.android.com\/tools&quot;     android:layout_width=&quot;match_parent&quot;     android:layout_height=&quot;56dp&quot;&gt;      &lt;TextView         android:id=&quot;@+id\/tv_info_title&quot;         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;         android:layout_gravity=&quot;center_vertical&quot;         android:layout_marginStart=&quot;28dp&quot;         android:textColor=&quot;@color\/black&quot;         android:textSize=&quot;20sp&quot;         tools:text=&quot;Balance&quot; \/&gt;      &lt;TextView         android:id=&quot;@+id\/tv_info_value&quot;         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;         android:layout_gravity=&quot;center_vertical|end&quot;         android:layout_marginEnd=&quot;48dp&quot;         tools:text=&quot;1000 $&quot; \/&gt;  &lt;\/FrameLayout&gt;  &lt;!----&gt;  &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;FrameLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     xmlns:tools=&quot;http:\/\/schemas.android.com\/tools&quot;     android:layout_width=&quot;match_parent&quot;     android:layout_height=&quot;56dp&quot;&gt;      &lt;TextView         android:id=&quot;@+id\/tv_switch_title&quot;         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;         android:layout_gravity=&quot;center_vertical&quot;         android:layout_marginStart=&quot;28dp&quot;         android:textColor=&quot;@color\/black&quot;         android:textSize=&quot;20sp&quot;         tools:text=&quot;Send notifications&quot; \/&gt;      &lt;Switch         android:id=&quot;@+id\/tv_switch_value&quot;         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;         android:layout_gravity=&quot;center_vertical|end&quot;         android:layout_marginEnd=&quot;48dp&quot;         tools:checked=&quot;true&quot; \/&gt;  &lt;\/FrameLayout&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0417\u0430\u0442\u0435\u043c, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0441\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u044b, \u0432\u043d\u0443\u0442\u0440\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c: \u043f\u0435\u0440\u0432\u044b\u0439 \u2014 \u044d\u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0438 \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0435\u0435 \u0438\u0437\u0432\u043d\u0435 (\u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0430, \u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437), \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u044d\u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0438 boolean \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0442\u044c Switch \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442 id \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0435\u0441\u043b\u0438 \u0436\u0435 \u0438\u0445 \u043d\u0435\u0442 \u2014 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0445 \u0441\u0430\u043c\u0438 \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">InfoItem.kt, SwitchItem.kt<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>class InfoItem(val title: String, val value: String): IBaseListItem {     override val layoutId = R.layout.item_info }  class SwitchItem(         val id: Int,         val title: String,         val actionOnReceive: (itemId: Int, userChoice: Boolean) -&gt; Unit ) : IBaseListItem {      override val layoutId = R.layout.item_switch } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f ViewHolder:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">InfoViewHolder.kt, SwitchViewHolder.kt<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>class InfoViewHolder.kt(view: View) : RecyclerView.ViewHolder(view) {     val tvTitle = view.tv_info_title     val tvValue = view.tv_info_value }  class SwitchViewHolder.kt(view: View) : RecyclerView.ViewHolder(view) {     val tvTitle = view.tv_switch_title     val tvValue = view.tv_switch_value } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041d\u0443 \u0438 \u0441\u0430\u043c\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u2014 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f SimpleListAdapter&#8217;a:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">SettingsListAdapter.kt<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>class SettingsListAdapter : SimpleListAdapter() {      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {          val context = parent.context          return when (viewType) {              R.layout.item_info -&gt; InfoHolder(inflateByViewType(context, viewType, parent))             R.layout.item_switch -&gt; SwitchHolder(inflateByViewType(context, viewType, parent))              else -&gt; throw IllegalStateException(&quot;There is no match with current layoutId&quot;)         }     }      override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {          when (holder) {              is InfoHolder -&gt; {                 val infoItem = items[position] as InfoItem                  holder.tvTitle.text = infoItem.title                 holder.tvValue.text = infoItem.value             }              is SwitchHolder -&gt; {                 val switchItem = items[position] as SwitchItem                  holder.tvTitle.text = switchItem.title                 holder.tvValue.setOnCheckedChangeListener { _, isChecked -&gt;                     switchItem.actionOnReceive.invoke(switchItem.id, isChecked)                 }             }              else -&gt; throw IllegalStateException(&quot;There is no match with current holder instance&quot;)         }     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <b>*\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0430 <i>inflateByViewType(context, viewType, parent):<\/i> <b>viewType = layoutId. <\/b><\/p>\n<p>  \u0412\u0441\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u044b! \u0422\u0435\u043f\u0435\u0440\u044c, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u0410\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">activity_settings.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;FrameLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     android:layout_width=&quot;match_parent&quot;     android:layout_height=&quot;match_parent&quot;&gt;      &lt;android.support.v7.widget.RecyclerView         android:id=&quot;@+id\/rView&quot;         android:layout_width=&quot;match_parent&quot;         android:layout_height=&quot;match_parent&quot; \/&gt; &lt;\/FrameLayout&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">SettingsActivity.kt<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>class SettingsActivity : AppCompatActivity() {      override fun onCreate(savedInstanceState: Bundle?) {         super.onCreate(savedInstanceState)         setContentView(R.layout.activity_settings)          val adapter = SettingsListAdapter()          rView.layoutManager = LinearLayoutManager(this)         rView.adapter = adapter          adapter.add(InfoItem(&quot;User Name&quot;, &quot;Leo Allford&quot;))         adapter.add(InfoItem(&quot;Balance&quot;, &quot;350 $&quot;))         adapter.add(InfoItem(&quot;Tariff&quot;, &quot;Business&quot;))         adapter.add(SwitchItem(1, &quot;Send Notifications&quot;) { itemId, userChoice -&gt; onCheck(itemId, userChoice) })         adapter.add(SwitchItem(2, &quot;Send News on Email&quot;) { itemId, userChoice -&gt; onCheck(itemId, userChoice) })     }      private fun onCheck(itemId: Int, userChoice: Boolean) {         when (itemId) {             1 -&gt; Toast.makeText(this, &quot;Notification now set as $userChoice&quot;, Toast.LENGTH_SHORT).show()             2 -&gt; Toast.makeText(this, &quot;Send news now set as $userChoice&quot;, Toast.LENGTH_SHORT).show()         }     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435, \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0441\u043f\u0438\u0441\u043a\u0430, \u0432\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443:<\/p>\n<p>  1. \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 <i>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430<\/i> \u0440\u0430\u0437\u043d\u044b\u0445 \u043b\u0435\u0439\u0430\u0443\u0442\u043e\u0432 \u0434\u043b\u044f \u0438\u0442\u0435\u043c\u043e\u0432<\/p>\n<p>  2. \u041f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u043c <i>\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f<\/i>. \u042f \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e\u043c: <b>Something<\/b>Item.kt, item_<b>something<\/b>.xml, <b>Something<\/b>ViewHolder.kt<\/p>\n<p>  3. \u041f\u0438\u0448\u0435\u043c \u043a \u044d\u0442\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u0430\u043c <b>\u0430\u0434\u0430\u043f\u0442\u0435\u0440<\/b>. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442\u0435 \u043d\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e, \u0442\u043e \u0445\u0432\u0430\u0442\u0438\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u0433\u043e \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430. \u041d\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u044f \u0431\u044b \u0432\u0441\u0435 \u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u043f\u043e \u044d\u043a\u0440\u0430\u043d\u0430\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <i>onBindViewHolder()<\/i> (\u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430) \u0432 \u0432\u0430\u0448\u0435\u043c \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0435 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e <b>SettingsListAdapter<\/b>) + \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0442\u0435\u043c\u0430, \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 + \u043f\u043e \u043c\u0435\u0442\u043e\u0434\u0443 <i>onCreateViewHolder()<\/i><\/p>\n<p>  4. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u0434 \u0438 \u0440\u0430\u0434\u0443\u0435\u043c\u0441\u044f!<\/p>\n<h4><b>JetPack<\/b><\/h4>\n<p>  \u0414\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 <i>Item.kt<\/i> \u2014 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 <i>item_layout.xml<\/i>. \u041d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <b>onBindViewHolder()<\/b>, \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c, \u0430 \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432 Item \u0438 \u043b\u0435\u0439\u0430\u0443\u0442.<\/p>\n<p>  \u0417\u0430\u0439\u0434\u0435\u043c \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 Android JetPack: <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/no\/gf\/1a\/nogf1awa7pwxahbwyfupwgvntm0.png\"\/><\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Architecture. <b>Android Databinding<\/b> \u2014 \u043e\u0447\u0435\u043d\u044c \u043e\u0431\u0448\u0438\u0440\u043d\u0430\u044f \u0442\u0435\u043c\u0430, \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e\u0431 \u043d\u0435\u0439 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u2014 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0430\u0448\u0443 <i>Item.kt<\/i> \u2014 <b>variable<\/b> \u0434\u043b\u044f <i>item.xml<\/i> (\u0438\u043b\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0435\u0435 \u0432\u044c\u044e\u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0434\u043b\u044f \u043b\u0435\u0439\u0430\u0443\u0442\u0430).<\/p>\n<p>  \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438, <i>Databinding<\/i> \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">android {     compileSdkVersion 27     defaultConfig {...}     buildTypes {...}      dataBinding {         enabled = true     }      dependencies {         kapt &quot;com.android.databinding:compiler:3.1.3&quot;         \/\/...      }   } <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e \u043f\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u0430\u043c. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0438\u0442\u0435\u043c\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439:<\/p>\n<pre><code>interface IBaseItemVm: IBaseListItem {     val brVariableId: Int } <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435, \u043c\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043c \u043d\u0430\u0448 ViewHolder, \u043f\u043e\u0442\u043e\u043c\u0443 \u0441\u0432\u044f\u0437\u0430\u043b\u0438\u0441\u044c \u0441 \u0434\u0430\u0442\u0430\u0431\u0430\u0439\u0434\u0438\u043d\u0433\u043e\u043c. \u0411\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u043d\u0435\u0433\u043e <i>ViewDataBinding<\/i>, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0431\u043b\u0430\u0433\u043e\u043f\u043e\u043b\u0443\u0447\u043d\u043e \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043b\u0435\u0439\u0430\u0443\u0442\u0430 \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<pre><code>class VmViewHolder(val binding: ViewDataBinding) : RecyclerView.ViewHolder(binding.root) <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u043e\u0439 \u0436\u0435 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"https:\/\/www.youtube.com\/watch?v=TS_J0Qw4zl0?t=15m18s\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u043d\u043e \u043d\u0430 \u043a\u043e\u0442\u043b\u0438\u043d\u0435 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0440\u043e\u0447\u0435, \u043d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438? =)<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">VmListAdapter<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>class VmListAdapter : RecyclerView.Adapter&lt;VmViewHolder&gt;(), IBaseListAdapter&lt;IBaseItemVm&gt; {      private var mItems = ArrayList&lt;IBaseItemVm&gt;()      override fun getItemCount() = mItems.size     override fun getItemViewType(position: Int) = mItems[position].layoutId      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VmViewHolder {          val inflater = LayoutInflater.from(parent.context)         val viewDataBinding = DataBindingUtil.inflate&lt;ViewDataBinding&gt;(inflater!!, viewType, parent, false)          return VmViewHolder(viewDataBinding)     }      override fun onBindViewHolder(holder: VmViewHolder, position: Int) {          holder.binding.setVariable(mItems[position].brVariableId, mItems[position])         holder.binding.executePendingBindings()     }      override fun add(newItem: IBaseItemVm) {          mItems.add(newItem)         notifyItemInserted(mItems.lastIndex)     }      override fun add(newItems: ArrayList&lt;IBaseItemVm&gt;?) {          val oldSize = mItems.size         mItems.addAll(newItems!!)         notifyItemRangeInserted(oldSize, newItems.size)     }      override fun clearAll() {         mItems.clear()         notifyDataSetChanged()     }      override fun getItemId(position: Int): Long {          val pos = mItems.size - position         return super.getItemId(pos)     }      override fun addAtPosition(pos: Int, newItem: IBaseItemVm) {          mItems.add(pos, newItem)         notifyItemInserted(pos)     }      override fun remove(position: Int) {          mItems.removeAt(position)         notifyItemRemoved(position)     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432 \u0446\u0435\u043b\u043e\u043c \u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u044b <i>onCreateViewHolder()<\/i>, <i>onBindViewHolder()<\/i>. \u0417\u0430\u0434\u0443\u043c\u043a\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u043b\u0438\u0441\u044c. \u0418\u0442\u043e\u0433\u043e, \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043e\u0434\u0438\u043d \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430, \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<p>  \u041d\u0430\u0448\u0438 items:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">InfoItem.kt , SwitchItem.kt<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>class InfoItem(val title: String, val value: String) : IBaseItemVm {      override val brVariableId = BR.vmInfo     override val layoutId = R.layout.item_info }  \/\/ class SwitchItem(         val id: Int,         val title: String,         private val actionOnReceive: (itemId: Int, userChoice: Boolean) -&gt; Unit ) : IBaseItemVm {      override val brVariableId = BR.vmSwitch     override val layoutId = R.layout.item_switch      val listener = CompoundButton.OnCheckedChangeListener { _, isChecked -&gt;         actionOnReceive.invoke(id, isChecked) } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0438\u0434\u043d\u043e, \u043a\u0443\u0434\u0430 \u0434\u0435\u043b\u0430\u0441\u044c \u043b\u043e\u0433\u0438\u043a\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <i>onBindViewHolder()<\/i>. \u0415\u0435 \u0432\u0437\u044f\u043b \u043d\u0430 \u0441\u0435\u0431\u044f Android Databinding \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u043b\u044e\u0431\u043e\u0439 \u043d\u0430\u0448 \u043b\u0435\u0439\u0430\u0443\u0442 \u043f\u043e\u0434\u043a\u0440\u0435\u043f\u043b\u0435\u043d \u0441\u0432\u043e\u0435\u0439 \u0432\u044c\u044e\u043c\u043e\u0434\u0435\u043b\u044c\u044e, \u0438 \u043e\u043d\u0430 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0430\u0436\u0430\u0442\u0438\u0439, \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439, \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u0440\u043e\u0447\u0435\u0433\u043e. \u0427\u0442\u043e \u0432\u044b \u0441\u0430\u043c\u0438 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0435\u0442\u0435. \u0412 \u044d\u0442\u043e\u043c \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u043c\u043e\u0433\u0443\u0442 <a href=\"https:\/\/developer.android.com\/topic\/libraries\/data-binding\/binding-adapters\">Binding Adapters<\/a> \u2014 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0432 \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0432\u044c\u044e \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043b\u044e\u0431\u043e\u0433\u043e \u0440\u043e\u0434\u0430. \u0442\u0430\u043a\u0436\u0435, \u0441\u0432\u044f\u0437\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <a href=\"https:\/\/medium.com\/google-developers\/android-data-binding-2-way-your-way-ccac20f6313\">\u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u043c\u0443 \u0434\u0430\u0442\u0430\u0431\u0430\u0439\u0434\u0438\u043d\u0433\u0443<\/a>. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043e\u043d \u043f\u0440\u043e\u043c\u0435\u043b\u044c\u043a\u043d\u0435\u0442 \u0432 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0449\u0435. \u041d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0431\u0430\u0439\u043d\u0434\u0438\u043d\u0433 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430:<\/p>\n<pre><code>@BindingAdapter(&quot;switchListener&quot;) fun setSwitchListener(sw: Switch, listener: CompoundButton.OnCheckedChangeListener) {     sw.setOnCheckedChangeListener(listener) }<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441 \u043d\u0430\u0448\u0438\u043c\u0438 <i>Item<\/i> \u0432\u043d\u0443\u0442\u0440\u0438 xml:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">item_info.xml; item_switch.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;layout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     xmlns:tools=&quot;http:\/\/schemas.android.com\/tools&quot;&gt;      &lt;data&gt;          &lt;import type=&quot;com.lfkekpoint.adapters.adapters.presentation.modules.bindableItemsSettings.InfoItem&quot; \/&gt;          &lt;variable             name=&quot;vmInfo&quot;             type=&quot;InfoItem&quot; \/&gt;     &lt;\/data&gt;      &lt;FrameLayout         android:layout_width=&quot;match_parent&quot;         android:layout_height=&quot;56dp&quot;&gt;          &lt;TextView             android:layout_width=&quot;wrap_content&quot;             android:layout_height=&quot;wrap_content&quot;             android:layout_gravity=&quot;center_vertical&quot;             android:layout_marginStart=&quot;28dp&quot;             android:text=&quot;@{vmInfo.title}&quot;             android:textColor=&quot;@color\/black&quot;             android:textSize=&quot;20sp&quot;             tools:text=&quot;Balance&quot; \/&gt;          &lt;TextView             android:layout_width=&quot;wrap_content&quot;             android:layout_height=&quot;wrap_content&quot;             android:layout_gravity=&quot;center_vertical|end&quot;             android:layout_marginEnd=&quot;48dp&quot;             android:text=&quot;@{vmInfo.value}&quot;             tools:text=&quot;1000 $&quot; \/&gt;      &lt;\/FrameLayout&gt; &lt;\/layout&gt;  &lt;!----&gt;  &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;layout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     xmlns:app=&quot;http:\/\/schemas.android.com\/apk\/res-auto&quot;     xmlns:tools=&quot;http:\/\/schemas.android.com\/tools&quot;&gt;      &lt;data&gt;          &lt;import type=&quot;com.lfkekpoint.adapters.adapters.presentation.modules.bindableItemsSettings.SwitchItem&quot; \/&gt;          &lt;variable             name=&quot;vmSwitch&quot;             type=&quot;SwitchItem&quot; \/&gt;     &lt;\/data&gt;      &lt;FrameLayout         android:layout_width=&quot;match_parent&quot;         android:layout_height=&quot;56dp&quot;&gt;          &lt;TextView             android:layout_width=&quot;wrap_content&quot;             android:layout_height=&quot;wrap_content&quot;             android:layout_gravity=&quot;center_vertical&quot;             android:layout_marginStart=&quot;28dp&quot;             android:text=&quot;@{vmSwitch.title}&quot;             android:textColor=&quot;@color\/black&quot;             android:textSize=&quot;20sp&quot;             tools:text=&quot;Send notifications&quot; \/&gt;          &lt;Switch             android:layout_width=&quot;wrap_content&quot;             android:layout_height=&quot;wrap_content&quot;             android:layout_gravity=&quot;center_vertical|end&quot;             android:layout_marginEnd=&quot;48dp&quot;             app:switchListener=&quot;@{vmSwitch.listener}&quot;             tools:checked=&quot;true&quot; \/&gt;      &lt;\/FrameLayout&gt; &lt;\/layout&gt; <\/code><\/pre>\n<p>   <b>app:switchListener=&quot;@{vmSwitch.listener}&quot;<\/b> \u2014 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u0448\u0438\u043c <i>BindingAdapter&#8217;\u043e\u043c<\/i><\/div>\n<\/div>\n<p>  <b>*\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u0412\u043f\u043e\u043b\u043d\u0435 \u043f\u043e \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c, \u043a\u043e\u0435-\u043a\u043e\u043c\u0443 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430 \u0432 xml \u2014 \u043d\u043e \u044d\u0442\u043e \u0432\u043e\u043f\u0440\u043e\u0441 \u0437\u043d\u0430\u043d\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Android Databinding. \u041e\u043d\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043b\u0435\u0439\u0430\u0443\u0442, \u0431\u044b\u0441\u0442\u0440\u043e \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0438 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0443\u0431\u0438\u0440\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442. \u042f \u0434\u0443\u043c\u0430\u044e, Google \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u0440\u0430\u0437 \u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Architecture, \u0432 Android Jetpack. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432 \u043f\u0430\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441\u043c\u0435\u043d\u0438\u0442\u044c MVP \u043d\u0430 MVVM \u2014 \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u044b.<\/p>\n<p>  \u041d\u0443 \u0447\u0442\u043e \u0436!.. \u0410, \u043a\u043e\u0434 \u0432 SettingsActivity:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">SettingsActivity.kt<\/b><\/p>\n<div class=\"spoiler_text\">\u2026 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f, \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0441\u044f \u0430\u0434\u0430\u043f\u0442\u0435\u0440! =) \u041d\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0440\u044b\u0433\u0430\u0442\u044c \u043f\u043e \u0441\u0442\u0430\u0442\u044c\u0435:<\/p>\n<pre><code>class SettingsActivity : AppCompatActivity() {      override fun onCreate(savedInstanceState: Bundle?) {         super.onCreate(savedInstanceState)         setContentView(R.layout.activity_settings)           val adapter = BaseVmListAdapter()          rView.layoutManager = LinearLayoutManager(this)         rView.adapter = adapter          adapter.add(InfoItem(&quot;User Name&quot;, &quot;Leo Allford&quot;))         adapter.add(InfoItem(&quot;Balance&quot;, &quot;350 $&quot;))         adapter.add(InfoItem(&quot;Tariff&quot;, &quot;Business&quot;))         adapter.add(SwitchItem(1, &quot;Send Notifications&quot;) { itemId, userChoice -&gt; onCheck(itemId, userChoice) })         adapter.add(SwitchItem(2, &quot;Send News on Email&quot;) { itemId, userChoice -&gt; onCheck(itemId, userChoice) })     }      private fun onCheck(itemId: Int, userChoice: Boolean) {         when (itemId) {             1 -&gt; Toast.makeText(this, &quot;Notification now set as $userChoice&quot;, Toast.LENGTH_SHORT).show()             2 -&gt; Toast.makeText(this, &quot;Send news now set as $userChoice&quot;, Toast.LENGTH_SHORT).show()         }     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h4><b>\u0418\u0442\u043e\u0433<\/b><\/h4>\n<p>  \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 (\u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <i>Databinding<\/i>) \u0432\u0441\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043f\u043e \u043f\u0430\u043f\u043a\u0430\u043c, \u0432\u0435\u0440\u0441\u0442\u043a\u0435 \u0438\u0442\u0435\u043c\u043e\u0432 \u0432 .xml \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0435 \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0432 .kt. <\/p>\n<p>  <b>\u0423\u0441\u043a\u043e\u0440\u044f\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443<\/b><br \/>  \u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f <a href=\"https:\/\/freemarker.apache.org\">\u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438<\/a> \u043e\u0442 Apache \u0434\u043b\u044f Android Studio \u2014 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b <a href=\"https:\/\/github.com\/Lfkekpoint\/Templates\">\u0441\u0432\u043e\u0438 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u044b<\/a> \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 <a href=\"https:\/\/www.youtube.com\/watch?v=_Nr4O1poyi0\">\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439<\/a>, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041e\u0447\u0435\u043d\u044c \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442 \u043d\u0443\u0436\u043d\u043e \u0438\u0437 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u2014 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <i>applicationId<\/i> \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u043d\u0430\u0432\u0440\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438 \u0435\u0433\u043e \u0432 Gradle. \u0410 \u0432\u043e\u0442 <i>packageName<\/i> \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u0448\u044c, \u0447\u0435\u043c \u044f \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u043f\u0440\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0430\u043c \u043d\u0438\u0436\u0435<\/p>\n<h4><b>\u0421\u043f\u0438\u0441\u043e\u043a \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b\/\u043c\u0435\u0434\u0438\u0430<\/b><\/h4>\n<p>  1. <a href=\"https:\/\/www.youtube.com\/watch?v=IrMw7MEgADk\">Modern Android development: Android Jetpack, Kotlin, and more (Google I\/O 2018, 40 m.)<\/a> \u2014 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u0433\u0430\u0439\u0434 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432 \u043c\u043e\u0434\u0435, \u043e\u0442\u0441\u044e\u0434\u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043e\u0431\u0449\u0438\u0445 \u0447\u0435\u0440\u0442\u0430\u0445 \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0441\u044f RecyclerView;<\/p>\n<p>  2. <a href=\"https:\/\/www.youtube.com\/watch?v=TS_J0Qw4zl0\">Droidcon NYC 2016 \u2014 Radical RecyclerView, 36 m.<\/a> \u2014 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0434\u043e\u043a\u043b\u0430\u0434 \u043e RecyclerView \u043e\u0442 <b>Lisa Wray<\/b>;<\/p>\n<p>  3. <a href=\"https:\/\/developer.android.com\/guide\/topics\/ui\/layout\/recyclerview\">Create a List with RecyclerView<\/a> \u2014 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/p>\n<p>  4. <a href=\"https:\/\/habr.com\/post\/30444\/\">\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b vs. \u043a\u043b\u0430\u0441\u0441\u044b<\/a><\/p>\n<p>  5. <a href=\"https:\/\/habr.com\/post\/274959\/\">Android IDE Template Format<\/a>, <a href=\"https:\/\/habr.com\/company\/redmadrobot\/blog\/274897\/\">\u0422\u043e\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f<\/a>, <a href=\"https:\/\/freemarker.apache.org\/docs\/ref_builtins_string.html\">\u043c\u0430\u043d\u0443\u0430\u043b FreeMarker<\/a> \u2014 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438<\/p>\n<p>  6. <a href=\"https:\/\/github.com\/Lfkekpoint\/ListAdapters\">\u041a\u043e\u0434 \u043a \u0441\u0442\u0430\u0442\u044c\u0435<\/a>(\u0442\u0430\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u0438\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0431\u0443\u0434\u044c\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b), <a href=\"https:\/\/github.com\/Lfkekpoint\/Templates\">\u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b<\/a> \u0438 <a href=\"https:\/\/www.youtube.com\/watch?v=_Nr4O1poyi0\">\u0432\u0438\u0434\u0435\u043e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0430\u043c\u0438<\/a><\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/post\/424129\/\"> https:\/\/habr.com\/post\/424129\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041c\u043e\u0438 \u043f\u043e\u0441\u0442\u044b \u2014 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u043c\u043e\u0447\u044c \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043a\u0430\u043a\u0438\u043c\u0438-\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 Android. \u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0449\u0435 \u043d\u0435 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u2014 \u0432\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044f \u0432 \u0445\u043e\u0434\u0435 \u043f\u043e\u0432\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043c\u044b\u0441\u043b\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f <s>\u0434\u043e \u043d\u0438\u0445 \u0434\u043e\u043a\u0430\u0442\u0438\u043b\u0441\u044f<\/s> \u043a \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u0435\u043b.<\/p>\n<p>  <b>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435: <\/b><\/p>\n<ul>\n<li>\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 RecyclerView \u0438 RecyclerView.Adapter<\/li>\n<li>\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043e\u0434\u043d\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438\u0437 Android Jetpack (\u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u0435\u0437 \u043d\u0435\u0435)<\/li>\n<li>\u0434\u043b\u044f \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u2014 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \ud83d\ude09<\/li>\n<\/ul>\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-289771","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/289771","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=289771"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/289771\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=289771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=289771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=289771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}