{"id":300076,"date":"2020-03-13T09:00:28","date_gmt":"2020-03-13T09:00:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=300076"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=300076","title":{"rendered":"\u0412\u0438\u0434\u0436\u0435\u0442\u044b \u043d\u0430 Android. \u0420\u0435\u0434\u043a\u0430\u044f \u0444\u0438\u0447\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/492166\/\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 \u0425\u0430\u043a\u0438\u043c\u043e\u0432, \u044f android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 FINCH.<\/p>\n<p>  \u0423 \u0432\u0430\u0441 \u0431\u044b\u0432\u0430\u043b\u043e \u0442\u0430\u043a\u043e\u0435, \u0447\u0442\u043e \u0432\u0430\u0448 \u0434\u0438\u0437\u0430\u0439\u043d \u0431\u044b\u043b \u043f\u043e\u0434 iOS, \u0430 \u0432\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0434 android? \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043b\u0438 \u0432\u0430\u0448\u0438 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432\u0438\u0434\u0436\u0435\u0442\u044b? \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u0438\u0434\u0436\u0435\u0442 \u2014 \u0440\u0435\u0434\u043a\u0438\u0439 \u043a\u0435\u0439\u0441 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441 \u043d\u0438\u043c \u0440\u0435\u0434\u043a\u043e \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, <\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0438\u0434\u0436\u0435\u0442, \u043d\u0430 \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u0441\u0432\u043e\u0438\u043c \u043a\u0435\u0439\u0441\u043e\u043c.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u0430<\/h2>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c:<\/p>\n<ol>\n<li>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432\u0438\u0434\u0436\u0435\u0442\u0430.<\/li>\n<li>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0432 \u0441\u0435\u0442\u043a\u0435 \u044d\u043a\u0440\u0430\u043d\u0430.<\/li>\n<li>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u0430.<\/li>\n<\/ol>\n<p>  \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.<\/p>\n<h3>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432\u0438\u0434\u0436\u0435\u0442\u0430<\/h3>\n<p>  \u0421 \u044d\u0442\u0438\u043c \u043f\u0443\u043d\u043a\u0442\u043e\u043c \u0437\u043d\u0430\u043a\u043e\u043c \u043b\u044e\u0431\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u043e\u0442\u044c \u0440\u0430\u0437 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 RemoteViews. \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0437 \u0442\u0430\u043a\u0438\u0445, \u0441\u043c\u0435\u043b\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u0435 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043f\u0443\u043d\u043a\u0442\u0443. <\/p>\n<p>  RemoteViews \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f\u043c\u0438 Views, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u043b\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b, \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0449\u0438\u0435 View, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0447\u0430\u0441\u0442\u044c\u044e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 RemoteViews \u0432\u0445\u043e\u0434\u0438\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 android.widget. <\/p>\n<p>  View \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 (\u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u044d\u0442\u043e \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 \u044d\u043a\u0440\u0430\u043d), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f UI \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 BroadcastReceiver \u2014 AppWidgetProvider, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<h3>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0432 \u00ab\u0441\u0435\u0442\u043a\u0435\u00bb \u044d\u043a\u0440\u0430\u043d\u0430<\/h3>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u044d\u0442\u043e\u0442 \u043f\u0443\u043d\u043a\u0442 \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u0443\u0436 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0439, \u0435\u0441\u043b\u0438 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 <a href=\"https:\/\/developer.android.com\/guide\/practices\/ui_guidelines\/widget_design#anatomy_determining_size\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0433\u0430\u0439\u0434\u043b\u0430\u0439\u043d\u044b<\/a>:   <\/p>\n<blockquote><p>Each widget must define a minWidth and minHeight, indicating the minimum amount of space it should consume by default. When users add a widget to their Home screen, it will generally occupy more than the minimum width and height you specify. Android Home screens offer users a grid of available spaces into which they can place widgets and icons. This grid can vary by a device; for example, many handsets offer a 4&#215;4 grid, and tablets can offer a larger, 8&#215;7 grid.<\/p><\/blockquote>\n<p>  \u041f\u0435\u0440\u0435\u0432\u043e\u0434\u044f \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439: \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0438\u0434\u0436\u0435\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0448\u0438\u0440\u0438\u043d\u0443 \u0438 \u0432\u044b\u0441\u043e\u0442\u0443, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c \u0437\u0430\u043d\u044f\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6r\/p-\/ux\/6rp-uxyfekjzwlpantqmxkdfaio.png\" alt=\"image\"\/><br \/>  <i>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0432 Android Studio<\/i><\/p>\n<p>  \u0412\u0438\u0434\u0436\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u0430 \u043d\u0430 Home screen, \u043e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u0439\u043c\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043c\u0435\u0441\u0442\u0430 \u0447\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0448\u0438\u0440\u0438\u043d\u0430 \u0438 \u0432\u044b\u0441\u043e\u0442\u0430 \u044d\u043a\u0440\u0430\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0437\u0430\u0434\u0430\u043b\u0438. Android Home screens \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0441\u0435\u0442\u043a\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0438 \u0438\u043a\u043e\u043d\u043a\u0438. \u042d\u0442\u0430 \u0441\u0435\u0442\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430; \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043d\u043e\u0433\u0438\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0441\u0435\u0442\u043a\u0443 4\u04454, \u0430 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0441\u0435\u0442\u043a\u0438 8\u04457.<\/p>\n<p>  \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0441\u0435\u0442\u043a\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0443\u0433\u043e\u0434\u043d\u043e, \u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u044f\u0447\u0435\u0435\u043a \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0441\u0435\u0442\u043a\u0438. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u044d\u0442\u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439. <\/p>\n<p>  \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0448\u0438\u0440\u0438\u043d\u0443 \u0438 \u0432\u044b\u0441\u043e\u0442\u0443 \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0438 \u0441\u0442\u0440\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435:<\/p>\n<p>  minSideSizeDp = 70 \u00d7 n \u2212 30, \u0433\u0434\u0435 n \u2014\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0438\u043b\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432<\/p>\n<p>  \u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0441\u0435\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u044d\u0442\u043e 4\u04454. \u042d\u0442\u043e \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0432\u0430\u0448 \u0432\u0438\u0434\u0436\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u0441\u0435\u0445 \u0434\u0435\u0432\u0430\u0439\u0441\u0430\u0445.<\/p>\n<h3> \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u0430<\/h3>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a AppWidgetProvider \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c BroadcastReceiver-\u0430, \u0441 \u043d\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e \u0438 \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c BroadcastReceiver. AppWidgetProvider \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0430\u0440\u0441\u0438\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f \u0438\u0437 Intent, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0432 onReceive \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 extras.<\/p>\n<p>  \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0441 \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u2014 \u0432\u0441\u0435 \u0434\u0435\u043b\u043e \u0432 \u0440\u0430\u0437\u043d\u0438\u0446\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u043d\u0430 iOS \u0438 Android. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 iOS-\u0432\u0438\u0434\u0436\u0435\u0442\u0430\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432\u0438\u0434\u0436\u0435\u0442 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0438\u0434\u0435\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u0412 Android, \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u041c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0438\u0434\u0438\u0442 \u0432\u0438\u0434\u0436\u0435\u0442.<\/p>\n<p>  \u0414\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u043d\u0430 Android \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0443. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u0430 updatePeriodMillis. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u044d\u0442\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0432\u0438\u0434\u0436\u0435\u0442 \u0447\u0430\u0449\u0435 \u0447\u0435\u043c \u0440\u0430\u0437 \u0432 30 \u043c\u0438\u043d\u0443\u0442. \u041d\u0438\u0436\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<h2>\u041a\u0435\u0439\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u0430<\/h2>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e \u043a\u0435\u0439\u0441\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0443 \u043d\u0430\u0441 \u0432 FINCH \u0432 \u043a\u0440\u0443\u043f\u043d\u043e\u043c \u043b\u043e\u0442\u0435\u0440\u0435\u0439\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u00ab\u0421\u0442\u043e\u043b\u043e\u0442\u043e\u00bb \u0434\u043b\u044f \u0443\u0447\u0430\u0441\u0442\u0438\u044f \u0432 \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043b\u043e\u0442\u0435\u0440\u0435\u044f\u0445. <\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2013 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u043c \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u044b\u0431\u043e\u0440 \u043b\u043e\u0442\u0435\u0440\u0435\u0438 \u0438 \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u0431\u0438\u043b\u0435\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430: \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u0435 \u0438\u0433\u0440\u044b \u0434\u043b\u044f \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0438 \u043f\u043e \u0442\u0430\u043f\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439. \u0421\u043f\u0438\u0441\u043e\u043a \u0438\u0433\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f. <\/p>\n<p>  \u0412 \u043d\u0430\u0448\u0435\u043c \u043a\u0435\u0439\u0441\u0435 \u0434\u0438\u0437\u0430\u0439\u043d \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b \u0434\u0432\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f: <\/p>\n<ul>\n<li>\u0414\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/li>\n<li>\u0414\u043b\u044f \u043d\u0435\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/li>\n<\/ul>\n<p>  \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u044f: \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u043b\u0435\u0442\u043e\u0432 \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0445 \u0440\u043e\u0437\u044b\u0433\u0440\u044b\u0448\u0430 \u0438 \u0441\u0443\u043c\u043c\u0443 \u043d\u0435\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0435\u0439. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d, \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445, \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rp\/d2\/6i\/rpd26ixtdxfjopibvmgaaczfkco.png\" alt=\"image\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dk\/yy\/qx\/dkyyqxqcnopxezwhknrmqbuedgu.png\" alt=\"image\"\/><\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u00bb, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u0430, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b RemoteAdapter \u0432 \u0432\u0438\u0434\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 RemoteViewsService, \u0447\u0442\u043e\u0431\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. <\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0431\u044b\u043b \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u043c, \u0442\u043e \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u043b\u044e\u0431\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043c\u0435\u0442\u043e\u0434\u0430 onUpdate:<\/p>\n<pre><code class=\"kotlin\">override fun onUpdate(         context: Context,         appWidgetManager: AppWidgetManager,         appWidgetIds: IntArray     ) {         injector.openScope(this, *arrayOf(this))         \/\/ update each of the widgets with the remote adapter         appWidgetIds             .forEach {                 updateWidget(context, appWidgetManager, it)           }     }<\/code><\/pre>\n<p>  \u041f\u0438\u0448\u0435\u043c \u0430\u043f\u0434\u0435\u0439\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u0430.<\/p>\n<pre><code class=\"kotlin\">private fun updateWidget(         context: Context,         appWidgetManager: AppWidgetManager,         appWidgetId: Int     ) { \/\/\u0421\u043e\u0437\u0434\u0430\u0435\u043c remoteViews \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e widgetId         val remoteViews = RemoteViews(             context.packageName,             R.layout.app_widget_layout ... \/\/ \u0434\u0435\u043b\u0430\u0435\u043c \u0447\u0442\u043e \u0442\u043e \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 ... \/\/ \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0434\u043b\u044f remoteViews updateRemoteAdapter(context, remoteViews, appWidgetId)   \/\/\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0432\u0438\u0434\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c remoteViews  appWidgetManager.updateAppWidget(appWidgetId, remoteViews) \/\/\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c collection view \u044d\u0442\u043e\u0433\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u0430 appWidgetManager.notifyAppWidgetViewDataChanged(             appWidgetId,             R.id.lvWidgetItems         )     }<\/code><\/pre>\n<p>  \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0430\u0434\u0430\u043f\u0442\u0435\u0440.<\/p>\n<pre><code class=\"kotlin\">private fun updateRemoteAdapter(context: Context, remoteViews: RemoteViews, appWidgetId: Int) { \/\/\u041d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e RemoteViewsService \u043d\u0430 \u0440\u043e\u043b\u044c RemoteAdapter \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430         val adapterIntent = Intent(context, StolotoAppWidgetRemoteViewsService::class.java).apply {             putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)         }         remoteViews.setRemoteAdapter(R.id.lvWidgetItems, adapterIntent) \/\/\u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c actionIntent \u0434\u043b\u044f pendingIntent  \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u043b\u0438\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432\u0438\u0434\u0436\u0435\u0442\u0430         val actionIntent = Intent(context, StolotoAppWidgetProvider::class.java).apply {             action = WIDGET_CLICK_ACTION             putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)         }         val pendingIntent = PendingIntent.getBroadcast(             context, 0, actionIntent,             PendingIntent.FLAG_UPDATE_CURRENT         ) \/\/\u041d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c pendingIntent \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u0434\u043b\u044f \u043a\u043b\u0438\u043a\u0430 \u043f\u043e \u043d\u0430\u0448\u0438\u043c \u0430\u0439\u0442\u0435\u043c\u0430\u043c         remoteViews.setPendingIntentTemplate(R.id.lvWidgetItems, pendingIntent)     }<\/code><\/pre>\n<p>  \u041f\u0438\u0448\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u0412 \u043d\u0435\u043c \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 RemoteViewsService.RemoteViewsFactory \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043d\u0442.<\/p>\n<pre><code class=\"kotlin\">class StolotoAppWidgetRemoteViewsService : RemoteViewsService() {     override fun onGetViewFactory(intent: Intent): RemoteViewsFactory =         StolotoAppWidgetRemoteViewsFactory(             this.applicationContext,             intent         ) }<\/code><\/pre>\n<p>  \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u0442\u043e\u043d\u043a\u0438\u0439 wrapper \u043d\u0430\u0434 Adapter. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u043c\u0443, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 remote collection view. RemoteViewsFactory \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 RemoteViews \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0423 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u2014 \u0432\u0441\u0435 \u0447\u0442\u043e \u044f \u0434\u0435\u043b\u0430\u044e, \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u044e \u0432 \u043d\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442. <\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0430\u0440\u0443 \u0441\u043b\u043e\u0432 \u043e\u0431 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445:<\/p>\n<ol>\n<li>onCreate \u2013 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430.<\/li>\n<li>getLoadingView \u2013 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c View, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u0441\u043f\u0438\u0441\u043a\u0430, \u043f\u043e\u043a\u0430 \u043e\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0435 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0435 View.<\/li>\n<li>getViewAt \u2013 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u043d\u043a\u0442\u044b \u0441\u043f\u0438\u0441\u043a\u0430. \u0417\u0434\u0435\u0441\u044c \u0438\u0434\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 RemoteViews.<\/li>\n<li>onDataSetChanged \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043b \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435. \u0422.\u0435. \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430. \u041c\u0435\u0442\u043e\u0434 \u0437\u0430\u0442\u043e\u0447\u0435\u043d \u043f\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u044f\u0436\u0435\u043b\u043e\u0433\u043e, \u0434\u043e\u043b\u0433\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/li>\n<li>onDestroy \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0430\u0434\u0430\u043f\u0442\u0435\u0440 (\u043e\u0434\u0438\u043d \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438).<\/li>\n<li>RemoteViewsFactory \u0436\u0438\u0432\u0435\u0442 \u043f\u043e\u043a\u0430 \u0432\u0441\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b \u0441\u043f\u0438\u0441\u043a\u0430 \u0436\u0438\u0432\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u043d\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u0430\u0439\u0442\u0435\u043c\u043e\u0432.<\/li>\n<\/ol>\n<p>  \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"kotlin\">private val widgetItems = ArrayList&lt;WidgetItem&gt;()<\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u0417\u0434\u0435\u0441\u044c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0442\u044f\u0436\u0435\u043b\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0441\u0435\u0442\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044f \u043f\u043e\u0442\u043e\u043a.<\/p>\n<pre><code class=\"kotlin\">override fun onCreate() {         updateDataSync() } <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0430\u043a \u0436\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c updateDataSync()<\/p>\n<pre><code class=\"kotlin\">   override fun onDataSetChanged() {         updateDataSync()     }<\/code><\/pre>\n<p>  \u0412\u043d\u0443\u0442\u0440\u0438 updateDataSync \u0442\u043e\u0436\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u041e\u0447\u0438\u0449\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a item-\u043e\u0432. \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0438 \u0438\u0433\u0440\u044b.<\/p>\n<pre><code class=\"kotlin\"> private fun updateDataSync() {         widgetItems.clear()         updateProfileSync()         updateGamesSync()     }<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0443\u0436\u0435 \u043f\u043e\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435<\/p>\n<pre><code class=\"kotlin\">private fun updateProfileSync() {<\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0442\u043e \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435:<\/p>\n<pre><code class=\"kotlin\">val isUserFullAuth = isUserFullAuthInteractor             .execute()             .blockingGet()         if (isUserFullAuth) {             val profile = getWidgetProfileInteractor                 .execute()                 .onErrorReturn {                     WidgetProfile() \/\/\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0438\u043b\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0444\u0438\u043b\u044f                 }                 .blockingGet()<\/code><\/pre>\n<p>  \u041c\u043e\u0434\u0435\u043b\u044c WidgetProfile \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043b\u043e\u0433\u0438\u043a\u0430 \u0438\u0445 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0435\u0451 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0441 \u0438\u0445 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>  \u0414\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441 \u043b\u043e\u0433\u0438\u043a\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430, \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a item-\u043e\u0432.<\/p>\n<pre><code class=\"kotlin\">  if (profile.walletAmount &gt;= 0L) {                 widgetItems.add(                     WidgetItem.Profile(                         wallet = profile.walletAmount.toMoneyFormat(),                         waitingTickets = if (profile.waitingTicketsCount &gt;= 0) profile.waitingTicketsCount.toString() else &quot;&quot;,                         unpaidPrizeAmount = if (profile.unpaidPrizeAmount &gt;= 0) profile.unpaidPrizeAmoount.toMoneyFormat() else &quot;&quot;                     )                 )             }         }     }<\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 updateGamesSync() \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 getWidgetGamesInteractor \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a widgetItems \u043d\u0430\u0431\u043e\u0440 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0438\u0433\u0440. <\/p>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u0430\u0440\u0442\u043e\u0447\u0435\u043a, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0434\u0435\u043b\u044c WidgetItem. \u041e\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0447\u0435\u0440\u0435\u0437 kotlin sealed class, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u043e\u0439, \u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0435\u0439 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439.<\/p>\n<pre><code class=\"kotlin\">sealed class WidgetItem {       data class Profile(         val wallet: String,         val waitingTickets: String,         val unpaidPrizeAmount: String     ) : WidgetItem()       data class Game(         val id: String,         val iconId: Int,         val prizeValue: String,         val date: String     ) : WidgetItem() }<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c RemoteViews \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0438\u0445 \u043e\u0442\u043a\u043b\u0438\u043a \u0447\u0435\u0440\u0435\u0437 FillInIntent<\/p>\n<pre><code class=\"kotlin\">override fun getViewAt(position: Int): RemoteViews {         return when (val item = widgetItems[position]) {             is WidgetItem.Profile -&gt; {               RemoteViews(                         context.packageName,                         R.layout.item_widget_user_profile                     ).apply {                         setTextViewText(R.id.tvWidgetWalletMoney, item.wallet)                         setTextViewText(R.id.tvWidgetUnpaidCount, item.unpaidPrizeAmount)                         setTextViewText(R.id.tvWidgetWaitingCount, item.waitingTickets)                         setOnClickFillInIntent(                             R.id.llWidgetProfileWallet, Intent().putExtra(                                 StolotoAppWidgetProvider.KEY_PROFILE_OPTIONS,                                 StolotoAppWidgetProvider.VALUE_USER_WALLET                             )                         )                         setOnClickFillInIntent(                             R.id.llWidgetProfileUnpaid, Intent().putExtra(                                 StolotoAppWidgetProvider.KEY_PROFILE_OPTIONS,                                 StolotoAppWidgetProvider.VALUE_UNPAID_PRIZE                             )                         )                         setOnClickFillInIntent(                             R.id.llWidgetProfileWaiting, Intent().putExtra(                                 StolotoAppWidgetProvider.KEY_PROFILE_OPTIONS,                                 StolotoAppWidgetProvider.VALUE_WAITING_TICKETS                             )                         )                     }               is WidgetItem.Game -&gt; {                 RemoteViews(                     context.packageName,                     R.layout.item_widget_game                 ).apply {                     setImageViewResource(R.id.ivWidgetGame, item.iconId)                     setTextViewText(R.id.tvWidgetGamePrize, item.prizeValue)                     setTextViewText(R.id.tvWidgetGameDate, item.date)                     setOnClickFillInIntent(                         R.id.llWidgetGame, Intent().putExtra(                             StolotoAppWidgetProvider.KEY_GAME_CLICK, item.id                         )                     )                 }             }         }     } <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 setOnClickFillInIntent \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 viewId intent, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d \u0441 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c PendingIntent \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435 \u043d\u0430 view \u0441 \u044d\u0442\u0438\u043c viewId. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043a\u043b\u0438\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u043d\u0430\u0448\u0435\u043c WidgetProvider.<\/p>\n<h2>\u0420\u0443\u0447\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u0430<\/h2>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0431\u044b\u043b\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u043b\u0447\u0430\u0441\u0430. \u041c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u0447\u0430\u0449\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 \u0442\u0430\u043d\u0446\u044b \u0441 WorkManager, \u043d\u043e \u0437\u0430\u0447\u0435\u043c \u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0430\u0448\u0443 \u0441\u0435\u0442\u044c \u0438 \u0430\u043a\u043a\u0443\u043c\u0443\u043b\u044f\u0442\u043e\u0440? \u0422\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u043c.<\/p>\n<p>  \u0412\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u043a\u043e\u0433\u0434\u0430 \u00ab\u0431\u0438\u0437\u043d\u0435\u0441\u00bb \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u043d\u0430 \u0432\u0438\u0434\u0436\u0435\u0442, \u043d\u0430 \u043d\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u00ab\u0412\u043e\u0442 \u043d\u0430 \u043c\u043e\u0435\u043c iPhone, \u044f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e \u0432\u0438\u0434\u0436\u0435\u0442 \u0438 \u0442\u0430\u043c \u0421\u0410\u041c\u042b\u0415 \u0441\u0432\u0435\u0436\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u044f\u00bb.<\/p>\n<p>  \u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u0430: iOS \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u043e\u0432\u044b\u0435 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u043f\u0440\u0438 \u041a\u0410\u0416\u0414\u041e\u041c \u043f\u043e\u043a\u0430\u0437\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432, \u0432\u0435\u0434\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443 \u043d\u0438\u0445 \u043e\u0442\u0432\u0435\u0434\u0435\u043d \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d, \u0430 Android \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0443\u0447\u0435\u0441\u0442\u044c, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u043e\u0442\u0435\u0440\u0435\u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0440\u0430\u0437 \u0432 15 \u043c\u0438\u043d\u0443\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0438\u0434\u0436\u0435\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u0430\u0432\u0430\u0442\u044c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u2013 \u0442\u044b \u0445\u043e\u0447\u0435\u0448\u044c \u043f\u043e\u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0442\u0438\u0440\u0430\u0436\u0435, \u0430 \u043e\u043d \u0443\u0436\u0435 \u043f\u0440\u043e\u0448\u0435\u043b.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 \u044d\u0442\u043e\u0439 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0438 \u043a\u0430\u043a \u0442\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u043c\u043d\u043e\u0439 \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043e \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u00bb.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u0442\u0443 \u043a\u043d\u043e\u043f\u043a\u0443 \u0432 \u043c\u0430\u043a\u0435\u0442 layout-a \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0435\u0451 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 updateWidget <\/p>\n<pre><code class=\"kotlin\">... \/\/\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c Intent \u0441 \u0434\u0435\u0439\u0441\u0442\u0438\u0432\u0435\u043c AppWidgetManager.ACTION_APPWIDGET_UPDATE val intentUpdate = Intent(context, StolotoAppWidgetProvider::class.java) intentUpdate.action = AppWidgetManager.ACTION_APPWIDGET_UPDATE  \/\/\u041d\u0430\u0437\u043d\u0430\u0447\u0438\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u043c \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u0430 val ids = AppWidgetManager.getInstance(context)    .getAppWidgetIds(ComponentName(context, StolotoAppWidgetProvider::class.java)) intentUpdate.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, ids)  \/\/\u041d\u0430\u0437\u043d\u0430\u0447\u0438\u043c \u044d\u0442\u043e\u0442 intent \u043a\u0430\u043a PendingIntent, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f PendingIntent.getBroadcast() val pendingUpdate = PendingIntent.getBroadcast(    context,    appWidgetId,    intentUpdate,    PendingIntent.FLAG_UPDATE_CURRENT ) \/\/\u041d\u0430\u0437\u043d\u0430\u0447\u0438\u043c \u044d\u0442\u043e\u0442 pendingIntent \u043e\u0442\u043a\u043b\u0438\u043a\u043e\u043c \u043d\u0430 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0438 \u2018\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u2019 remoteViews.setOnClickPendingIntent(R.id.ivWidgetRefresh, pendingUpdate) \u2026<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0435 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0433\u0440\u0443\u0441\u0442\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443: \u043e\u0442 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u00bb \u0434\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f, \u043c\u043e\u0433\u043b\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434. \u0425\u043e\u0442\u044f \u0432\u0438\u0434\u0436\u0435\u0442 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u043e\u043d \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043e \u0432\u043b\u0430\u0441\u0442\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0447\u0435\u0440\u0435\u0437 broadcast-\u044b.<\/p>\n<p>  \u0422.\u0435. \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u00bb \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0446\u0435\u043f\u043e\u0447\u043a\u0430:<\/p>\n<ol>\n<li>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c Intent \u0432 onReceive \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 action\u2019 .<\/li>\n<li>AppWidgetManager.ACTION_APPWIDGET_UPDATE. <\/li>\n<li>\u0412\u044b\u0437\u043e\u0432 onUpdate \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 intent-e widgetIds.<\/li>\n<li>\u0417\u0430\u0439\u0442\u0438 \u0432 \u0441\u0435\u0442\u044c \u0437\u0430 \u043d\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/li>\n<li>\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u0441\u043f\u0438\u0441\u043a\u0430.<\/li>\n<\/ol>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0436\u0430\u0432 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443, \u043c\u044b \u043f\u0430\u0440\u0443 \u0441\u0435\u043a\u0443\u043d\u0434 \u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043d\u0430 \u0442\u043e\u0442 \u0436\u0435 \u0432\u0438\u0434\u0436\u0435\u0442. \u0411\u044b\u043b\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435. \u041a\u0430\u043a \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u0438\u043a\u0430?<\/p>\n<p>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0444\u043b\u0430\u0433 isWidgetLoading \u0441 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u043e\u0440. \u0420\u043e\u043b\u044c \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430 \u2014 \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u00bb, \u043f\u043e\u043a\u0430 \u0438\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0438\u0434\u0436\u0435\u0442\u0430.<\/p>\n<p>  \u0412\u043e \u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0444\u0430\u0431\u0440\u0438\u043a\u0435 \u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b \u043d\u0430 \u0442\u0440\u0438 \u044d\u0442\u0430\u043f\u0430:<\/p>\n<pre><code class=\"kotlin\">enum class LoadingStep {    START,    MIDDLE,    END }<\/code><\/pre>\n<p>  START \u2014 \u043d\u0430\u0447\u0430\u043b\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u0432\u044c\u044e\u0448\u0435\u043a \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430 \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u043b\u0430\u0433\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u00ab\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f\u00bb.<\/p>\n<p>  MIDDLE \u2014 \u044d\u0442\u0430\u043f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u0441\u043b\u0435 \u0438\u0445 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043b\u0430\u0433 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u00ab\u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e\u00bb, \u0430 \u0432 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  END \u2014 \u043a\u043e\u043d\u0435\u0446 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0410\u0434\u0430\u043f\u0442\u0435\u0440\u0443 \u043d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430. \u042d\u0442\u043e\u0442 \u0448\u0430\u0433 \u043d\u0443\u0436\u0435\u043d \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u044d\u0442\u0430\u043f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u044c\u044e\u0448\u0435\u043a \u0432 WidgetProvider.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043a\u0430\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0432 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0435:<\/p>\n<pre><code class=\"kotlin\">if (isFullAuthorized && !widgetLoadingStateInteractor.isWidgetLoading) {    remoteViews.setViewVisibility(R.id.ivWidgetRefresh, View.VISIBLE) ... \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u043d\u0435\u0435 ...    } else {    remoteViews.setViewVisibility(        R.id.ivWidgetRefresh,        if (isFullAuthorized) View.INVISIBLE else View.GONE \/\/ \u041e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434 \u043a\u043d\u043e\u043f\u043a\u0443 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.    ) }<\/code><\/pre>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0435:<\/p>\n<pre><code class=\"kotlin\">private fun updateDataSync() {    when (loadingStep) {        START -&gt; {            widgetItems.forEach { it.isLoading = true }            widgetLoadingStateInteractor.isWidgetLoading = true            loadingStep = MIDDLE            widgetManager.updateWidgets()        }        MIDDLE -&gt; {            widgetItems.clear()            updateProfileSync()            updateGamesSync()            widgetLoadingStateInteractor.isWidgetLoading = false            loadingStep = END            widgetManager.updateWidgets()        }        END -&gt; {            loadingStep = START        }    } }<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bq\/ah\/hg\/bqahhgnwugy10345-bcegnupxo8.png\" alt=\"image\"\/><\/p>\n<p>  \u041b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b: <\/p>\n<ol>\n<li>\u0412 \u043a\u043e\u043d\u0446\u0435 \u044d\u0442\u0430\u043f\u043e\u0432 START \u0438 MIDDLE \u044f \u0432\u044b\u0437\u044b\u0432\u0430\u044e \u043c\u0435\u0442\u043e\u0434 updateWidgets \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 view \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u043c.<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0448\u0430\u0433\u0430 START \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u00ab\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430\u00bb \u0432 \u044f\u0447\u0435\u0439\u043a\u0430\u0445 \u0432\u0438\u0434\u0436\u0435\u0442\u0430, \u0438 \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f \u044d\u0442\u0430\u043f MIDDLE.<\/li>\n<li>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430 \u043d\u0430 \u0448\u0430\u0433\u0435 MIDDLE, \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0441\u043a\u0440\u043e\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u00bb.<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0448\u0430\u0433\u0430 MIDDLE, \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f \u044d\u0442\u0430\u043f END. <\/li>\n<li>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430, \u043d\u0430 \u0448\u0430\u0433\u0435 END, \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0441\u043a\u0440\u043e\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u00bb. \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430 \u0448\u0430\u0433\u0435 END \u043c\u0435\u043d\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 loadingStep \u043d\u0430 START.<\/li>\n<\/ol>\n<p>  <\/p>\n<hr\/>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044f \u0434\u043e\u0441\u0442\u0438\u0433 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441 \u043c\u0435\u0436\u0434\u0443 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u00ab\u0431\u0438\u0437\u043d\u0435\u0441\u0430\u00bb \u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0430 \u0432\u0438\u0434\u0436\u0435\u0442\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u00ab\u0434\u0435\u0440\u0433\u0430\u0442\u044c\u00bb \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0447\u0430\u0441\u0442\u043e. <\/p>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0431\u044b\u043b \u043e\u043f\u044b\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u0434\u043b\u044f Android, \u0442\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. <\/p>\n<p>  \u0423\u0434\u0430\u0447\u0438!<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/492166\/\"> https:\/\/habr.com\/ru\/post\/492166\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/492166\/\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 \u0425\u0430\u043a\u0438\u043c\u043e\u0432, \u044f android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 FINCH.<\/p>\n<p>  \u0423 \u0432\u0430\u0441 \u0431\u044b\u0432\u0430\u043b\u043e \u0442\u0430\u043a\u043e\u0435, \u0447\u0442\u043e \u0432\u0430\u0448 \u0434\u0438\u0437\u0430\u0439\u043d \u0431\u044b\u043b \u043f\u043e\u0434 iOS, \u0430 \u0432\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0434 android? \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043b\u0438 \u0432\u0430\u0448\u0438 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432\u0438\u0434\u0436\u0435\u0442\u044b? \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u0438\u0434\u0436\u0435\u0442 \u2014 \u0440\u0435\u0434\u043a\u0438\u0439 \u043a\u0435\u0439\u0441 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441 \u043d\u0438\u043c \u0440\u0435\u0434\u043a\u043e \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, <\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0438\u0434\u0436\u0435\u0442, \u043d\u0430 \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u0441\u0432\u043e\u0438\u043c \u043a\u0435\u0439\u0441\u043e\u043c.  <\/p>\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-300076","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300076","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=300076"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300076\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=300076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=300076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=300076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}