{"id":375262,"date":"2024-05-21T06:20:24","date_gmt":"2024-05-21T06:20:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=375262"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=375262","title":{"rendered":"<span>\u041a\u0430\u043a \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0443 \u0441\u043e \u0441\u0432\u0430\u0439\u043f\u043e\u043c \u043d\u0430 Jetpack Compose<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f \u0416\u0435\u043d\u044f \u041c\u0435\u043b\u044c\u0446\u0430\u0439\u043a\u0438\u043d, <a href=\"https:\/\/tech.kontur.ru\/mobile\">\u0430\u043d\u0434\u0440\u043e\u0438\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a> \u0432 \u041a\u043e\u043d\u0442\u0443\u0440\u0435. <\/p>\n<p>\u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u043c\u044b \u0442\u0435\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u042d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0430\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u2014 \u044d\u0442\u043e \u044e\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u043d\u0430\u0447\u0438\u043c\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043d\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u043d\u0430\u0448\u0438 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u044b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0435 \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e, \u0430 \u043f\u043e \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0436\u0435\u0441\u0442\u0430 \u0441\u0432\u0430\u0439\u043f\u043e\u043c. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Jetpack Compose.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u043a\u0430\u0441\u0442 \u0438 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c: \u043a\u0430\u043a\u0430\u044f \u043a\u043d\u043e\u043f\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0435?<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/320\/fe4\/63f\/320fe463f368691483d1dfcfbd8cbc36.gif\" width=\"1075\" height=\"424\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/320\/fe4\/63f\/320fe463f368691483d1dfcfbd8cbc36.gif\"\/><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u0442\u0435 \u0442\u0443\u0442 \u0440\u0430\u0437\u043d\u0438\u0446\u044b, \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e. \u0417\u043d\u0430\u0447\u0438\u0442, Compose \u0443\u0436\u0435 \u0432\u0441\u0451 \u0441\u0434\u0435\u043b\u0430\u043b \u0437\u0430 \u043d\u0430\u0441, \u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u043e \u043d\u0435 \u0437\u0440\u044f \u0443 \u043d\u0430\u0441 \u0434\u0432\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u2014 \u0437\u043d\u0430\u0447\u0438\u0442, \u0432 \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0451 \u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0430.<\/p>\n<h2>\u0422\u0435\u043e\u0440\u0438\u044f<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438,\u00a0\u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c <strong>\u0444\u0430\u0437\u044b Compose \u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 Layout.<\/strong><\/p>\n<p><strong>\u0424\u0430\u0437\u044b Compose<\/strong><\/p>\n<p>Compose \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u0434\u0440 \u0437\u0430 \u0442\u0440\u0438 \u0444\u0430\u0437\u044b:<\/p>\n<ol>\n<li>\n<p>Composition \u2014 Compose \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 composable-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0441\u0442\u0440\u043e\u0438\u0442 \u0434\u0435\u0440\u0435\u0432\u043e \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>Layout \u2014 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432\u043d\u0443\u0442\u0440\u0438 composable-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437\u043c\u0435\u0440\u044f\u044e\u0442 \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442 \u0441\u0435\u0431\u044f \u0438 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435.<\/p>\n<\/li>\n<li>\n<p>Drawing \u2014 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u044e\u0442 \u0441\u0435\u0431\u044f \u043d\u0430 Canvas.<\/p>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u0438 \u0444\u0430\u0437\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0430\u0434\u0440, \u043d\u043e Compose \u0434\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0430\u0437\u044b, \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0438\u0445 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, Compose \u043f\u043e\u0434\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u0447\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0422\u0430\u043a\u0436\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0434\u0438\u043d \u043a\u0430\u0434\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u0430 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0445\u043e\u0434 \u0432\u0441\u0435\u0445 \u0444\u0430\u0437.<\/p>\n<p><strong>Layout<\/strong><\/p>\n<p>\u0423 \u043c\u043d\u043e\u0433\u0438\u0445 \u0435\u0449\u0451 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0444\u043b\u0435\u0448\u0431\u0435\u043a\u0438 \u0441 Custom View \u043d\u0430 Android View, \u043d\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 Layout \u0432 Compose \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 Layout \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 Compose. \u0422\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c, \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 Compose \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438. \u041d\u0435\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438\u043b\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0438\u0437-\u0437\u0430 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 onGloballyPositioned(), onSizeChanged() \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0438\u0437\u043b\u0438\u0448\u043d\u0435\u043c\u0443 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c\u0443 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0443. \u0415\u0441\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043c\u0430\u043a\u0435\u0442, \u043b\u0438\u0431\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439.<\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0435 \u0442\u0435\u043e\u0440\u0438\u0438 \u043f\u043e Compose \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u044d\u0442\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445: <strong>\u041e\u0441\u043e\u0437\u043d\u0430\u043d\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f Compose:<\/strong><a href=\"https:\/\/habr.com\/ru\/companies\/ozontech\/articles\/742854\/\"> \u0447\u0430\u0441\u0442\u044c 1<\/a>,<a href=\"https:\/\/habr.com\/ru\/articles\/796437\/\"> \u0447\u0430\u0441\u0442\u044c 2<\/a>; <a href=\"https:\/\/habr.com\/ru\/articles\/701422\/\">\u041f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f Jetpack Compose<\/a><\/p>\n<h2>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h2>\n<p>\u0414\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432, \u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u044f \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435.<\/p>\n<p><strong>\u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u2014<\/strong> \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u043a\u0430\u043a\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043a\u043d\u043e\u043f\u043a\u0430.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/df9\/3d0\/531\/df93d053139e1cef8139676a5251288c.png\" width=\"490\" height=\"191\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/df9\/3d0\/531\/df93d053139e1cef8139676a5251288c.png\"\/><\/figure>\n<ol>\n<li>\n<p>\u0417\u0430\u0434\u043d\u0438\u0439 \u0444\u043e\u043d<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0441\u0432\u0430\u0439\u043f\u0430<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u0430\u0439\u0434-\u044f\u043a\u043e\u0440\u044c<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0442\u0435\u043d\u0442 \u043f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u043f\u0440\u0430\u0432\u0430<\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0437\u0430 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0445\u043e\u0434 compose \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u044d\u0442\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0438\u0445. \u041a\u0430\u043a \u0440\u0430\u0437 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 Layout.<\/p>\n<p><strong>\u0412\u0442\u043e\u0440\u043e\u0439 \u0448\u0430\u0433<\/strong> \u2014 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u0435 compose-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 content \u0443 Layout.<\/p>\n<pre><code class=\"kotlin\">Layout( \u00a0\u00a0\u00a0\u00a0content = { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0441\u043b\u0430\u0439\u0434-\u044f\u043a\u043e\u0440\u044c \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Box( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0modifier = Modifier \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.layoutId(SwipeableButtonLayout.ThumbLayout) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.clip(shape) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.background(colors.thumbBackgroundColor(), shape) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.anchoredDraggable( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state = state.anchoredDraggableState, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0orientation = Orientation.Horizontal, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0enabled = enabled, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0startDragImmediately = false \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0), \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0contentAlignment = Alignment.Center \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0thumbContent(progressState, targetAnchorState) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0441\u0432\u0430\u0439\u043f\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Box( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0modifier = Modifier \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.layoutId(SwipeableButtonLayout.ProcessLayout) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.drawWithCache { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0onDrawBehind { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0drawRect( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0color = colors.progressColor(), \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0size = Size(width = this.size.width, height = this.size.height), \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u043f\u0440\u0430\u0432\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Box( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0modifier = Modifier.layoutId(SwipeableButtonLayout.EndLayout) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0endContent(progressState) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Box( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0modifier = Modifier.layoutId(SwipeableButtonLayout.CenterLayout) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0centerContent(progressState, currentAnchorState) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0}, ... )<\/code><\/pre>\n<p><strong>\u0422\u0440\u0435\u0442\u0438\u0439 \u0448\u0430\u0433<\/strong> \u2014 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430\u0448\u0438 compose-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b.<\/p>\n<ol>\n<li>\n<p>\u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u0441\u043b\u0430\u0439\u0434-\u044f\u043a\u043e\u0440\u044c.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"kotlin\">private fun swipeableMeasure( \u00a0\u00a0\u00a0\u00a0size: SwipeableButtonSize, \u00a0\u00a0\u00a0\u00a0draggableOffsetProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0maxAnchorProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0endOfTrackState: MutableIntState, \u00a0\u00a0\u00a0\u00a0progressState: MutableFloatState, ): MeasureScope.(measurables: List&lt;Measurable>, constraints: Constraints) -> MeasureResult { \u00a0\u00a0\u00a0\u00a0return { measurables, constraints -> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u0441\u043b\u0430\u0439\u0434-\u044f\u043a\u043e\u0440\u044c \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.ThumbLayout }.measure( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0constraints.copy( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minHeight = constraints.minHeight.coerceAtLeast(size.minHeight.roundToPx()), \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minWidth = constraints.minWidth.coerceAtLeast(size.minWidth.roundToPx()) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0...  \u00a0 } }<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3e4\/f0e\/9a3\/3e4f0e9a31cf1091d3cdae0617ff0b9b.png\" alt=\"Untitled\" title=\"\" width=\"492\" height=\"94\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3e4\/f0e\/9a3\/3e4f0e9a31cf1091d3cdae0617ff0b9b.png\"\/><\/figure>\n<ol start=\"2\">\n<li>\n<p>\u0420\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0434\u043b\u0438\u043d\u0443 \u0441\u0432\u0430\u0439\u043f\u0430.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"kotlin\">private fun swipeableMeasure( \u00a0\u00a0\u00a0\u00a0size: SwipeableButtonSize, \u00a0\u00a0\u00a0\u00a0draggableOffsetProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0maxAnchorProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0endOfTrackState: MutableIntState, \u00a0\u00a0\u00a0\u00a0progressState: MutableFloatState, ): MeasureScope.(measurables: List&lt;Measurable>, constraints: Constraints) -> MeasureResult { \u00a0\u00a0\u00a0\u00a0return { measurables, constraints -> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u0441\u043b\u0430\u0439\u0434-\u044f\u043a\u043e\u0440\u044c \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.ThumbLayout }.measure( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0constraints.copy( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minHeight = constraints.minHeight.coerceAtLeast(size.minHeight.roundToPx()), \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minWidth = constraints.minWidth.coerceAtLeast(size.minWidth.roundToPx()) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0412\u044b\u0441\u043e\u0442\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val height = thumbPlaceable.height \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0428\u0438\u0440\u0438\u043d\u0430 \u044f\u043a\u043e\u0440\u044f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbWidth = thumbPlaceable.width \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u043b\u0438\u043d\u0443 \u0441\u0432\u0430\u0439\u043f\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val endOfTrackWidth = constraints.maxWidth - thumbWidth \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0...  \u00a0 } }<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/efa\/cb5\/d02\/efacb5d022c6232c32de6eed3b8c8743.png\" width=\"491\" height=\"155\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/efa\/cb5\/d02\/efacb5d022c6232c32de6eed3b8c8743.png\"\/><\/figure>\n<ol start=\"3\">\n<li>\n<p>\u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043e\u0442\u0441\u0442\u0443\u043f \u043f\u043e \u0438\u043a\u0441 \u0438 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"kotlin\">private fun swipeableMeasure( \u00a0\u00a0\u00a0\u00a0size: SwipeableButtonSize, \u00a0\u00a0\u00a0\u00a0draggableOffsetProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0maxAnchorProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0endOfTrackState: MutableIntState, \u00a0\u00a0\u00a0\u00a0progressState: MutableFloatState, ): MeasureScope.(measurables: List&lt;Measurable>, constraints: Constraints) -> MeasureResult { \u00a0\u00a0\u00a0\u00a0return { measurables, constraints -> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0412\u044b\u0441\u043e\u0442\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val height = thumbPlaceable.height \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0428\u0438\u0440\u0438\u043d\u0430 \u044f\u043a\u043e\u0440\u044f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbWidth = thumbPlaceable.width \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u043b\u0438\u043d\u0443 \u0441\u0432\u0430\u0439\u043f\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val endOfTrackWidth = constraints.maxWidth - thumbWidth \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u0441\u0442\u0443\u043f \u043f\u043e \u0438\u043a\u0441 \u0434\u043b\u044f \u044f\u043a\u043e\u0440\u044f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbX = draggableOffsetProvider().coerceAtLeast(0).coerceAtMost(endOfTrackWidth) \/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0448\u0438\u0440\u0438\u043d\u0443 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 val progressWidth = thumbX + thumbWidth \/ 2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val progressPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.ProcessLayout }.measure( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0constraints.copy( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minWidth = progressWidth, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minHeight = height \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... \u00a0 } }<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/38a\/731\/813\/38a7318132c7366c923734887fa34434.png\" width=\"491\" height=\"153\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/38a\/731\/813\/38a7318132c7366c923734887fa34434.png\"\/><\/figure>\n<ol start=\"4\">\n<li>\n<p>\u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u043f\u0440\u0430\u0432\u0430 \u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"kotlin\">private fun swipeableMeasure( \u00a0\u00a0\u00a0\u00a0size: SwipeableButtonSize, \u00a0\u00a0\u00a0\u00a0draggableOffsetProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0maxAnchorProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0endOfTrackState: MutableIntState, \u00a0\u00a0\u00a0\u00a0progressState: MutableFloatState, ): MeasureScope.(measurables: List&lt;Measurable>, constraints: Constraints) -> MeasureResult { \u00a0\u00a0\u00a0\u00a0return { measurables, constraints -> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0...\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u0441\u0442\u0443\u043f \u043f\u043e \u0438\u043a\u0441 \u0434\u043b\u044f \u044f\u043a\u043e\u0440\u044f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbX = draggableOffsetProvider().coerceAtLeast(0).coerceAtMost(endOfTrackWidth) \/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0448\u0438\u0440\u0438\u043d\u0443 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 val progressWidth = thumbX + thumbWidth \/ 2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val progressPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.ProcessLayout }.measure( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0constraints.copy( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minWidth = progressWidth, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minHeight = height \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val endContentPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.EndLayout }.measure(constraints) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val centerContentPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.CenterLayout }.measure(constraints) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... \u00a0 } }<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/90e\/b4b\/3e1\/90eb4b3e1ff8e553aee7a54c074975d7.png\" width=\"491\" height=\"147\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/90e\/b4b\/3e1\/90eb4b3e1ff8e553aee7a54c074975d7.png\"\/><\/figure>\n<ol start=\"5\">\n<li>\n<p>\u0420\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"kotlin\">private fun swipeableMeasure( \u00a0\u00a0\u00a0\u00a0size: SwipeableButtonSize, \u00a0\u00a0\u00a0\u00a0draggableOffsetProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0maxAnchorProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0endOfTrackState: MutableIntState, \u00a0\u00a0\u00a0\u00a0progressState: MutableFloatState, ): MeasureScope.(measurables: List&lt;Measurable>, constraints: Constraints) -> MeasureResult { \u00a0\u00a0\u00a0\u00a0return { measurables, constraints -> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0...\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0412\u044b\u0441\u043e\u0442\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val height = thumbPlaceable.height \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u0441\u0442\u0443\u043f \u043f\u043e \u0438\u043a\u0441 \u0434\u043b\u044f \u044f\u043a\u043e\u0440\u044f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbX = draggableOffsetProvider().coerceAtLeast(0).coerceAtMost(endOfTrackWidth) \/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0448\u0438\u0440\u0438\u043d\u0443 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430         val progressWidth = thumbX + thumbWidth \/ 2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val progressPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.ProcessLayout }.measure( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0constraints.copy( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minWidth = progressWidth, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minHeight = height \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val endContentPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.EndLayout }.measure(constraints) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val centerContentPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.CenterLayout }.measure(constraints) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0layout(constraints.maxWidth, height) { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0progressPlaceable.placeRelative(x = 0, y = 0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0centerContentPlaceable.placeRelative( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0x = constraints.maxWidth \/ 2 - centerContentPlaceable.width \/ 2, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0y = height \/ 2 - centerContentPlaceable.height \/ 2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442-\u044f\u043a\u043e\u0440\u044c \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0thumbPlaceable.placeRelative( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0x = thumbX, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0y = height \/ 2 - thumbPlaceable.height \/ 2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0endContentPlaceable.placeRelative( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0x = constraints.maxWidth - endContentPlaceable.width, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0y = height \/ 2 - endContentPlaceable.height \/ 2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0 } }<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0448\u0430 \u043a\u043d\u043e\u043f\u043a\u0430 \u0433\u043e\u0442\u043e\u0432\u0430!<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043a\u043d\u043e\u043f\u043a\u0430 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0430 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0440\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0439, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\n<p>Layout inspector \u0432\u043d\u0443\u0442\u0440\u0438 Android studio<\/p>\n<\/li>\n<li>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d \u043e\u0442 \u0412\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u0435<a href=\"https:\/\/github.com\/VKCOM\/vkompose\"> <strong>vkcompose<\/strong><\/a><\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442. \u0415\u0433\u043e \u0441\u0443\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0432\u043e\u0434\u043a\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0438\u0445. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f50\/ace\/25b\/f50ace25bb13f06a70ee2142165a5575.gif\" width=\"1076\" height=\"418\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f50\/ace\/25b\/f50ace25bb13f06a70ee2142165a5575.gif\"\/><\/figure>\n<p>\u041f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0435\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u0435\u0440\u0445\u043d\u044f\u044f \u043a\u043d\u043e\u043f\u043a\u0430 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0437\u0430 \u0432\u0441\u0451 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441\u0432\u0430\u0439\u043f\u0430, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0430 \u043c\u0435\u043d\u044f\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u0438 \u0441\u043b\u0430\u0439\u0434\u0435 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0440\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u041d\u0438\u0436\u043d\u044f\u044f \u043a\u043d\u043e\u043f\u043a\u0430 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0432\u0430\u0439\u043f\u0430, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/EvgenyMeltsaykin\/SwipeButton\">\u0442\u0443\u0442<\/a>. \u041f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0431\u044b\u043b\u0438 \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u044b \u0432 \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0451 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c.<\/p>\n<p>\u041d\u0435 \u0431\u043e\u0439\u0442\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 Layout \u0438 \u043f\u0438\u0448\u0438\u0442\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 compose-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/811877\/\"> https:\/\/habr.com\/ru\/articles\/811877\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f \u0416\u0435\u043d\u044f \u041c\u0435\u043b\u044c\u0446\u0430\u0439\u043a\u0438\u043d, <a href=\"https:\/\/tech.kontur.ru\/mobile\">\u0430\u043d\u0434\u0440\u043e\u0438\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a> \u0432 \u041a\u043e\u043d\u0442\u0443\u0440\u0435. <\/p>\n<p>\u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u043c\u044b \u0442\u0435\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u042d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0430\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u2014 \u044d\u0442\u043e \u044e\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u043d\u0430\u0447\u0438\u043c\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043d\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u043d\u0430\u0448\u0438 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u044b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0435 \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e, \u0430 \u043f\u043e \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0436\u0435\u0441\u0442\u0430 \u0441\u0432\u0430\u0439\u043f\u043e\u043c. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Jetpack Compose.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u043a\u0430\u0441\u0442 \u0438 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c: \u043a\u0430\u043a\u0430\u044f \u043a\u043d\u043e\u043f\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0435?<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u0442\u0435 \u0442\u0443\u0442 \u0440\u0430\u0437\u043d\u0438\u0446\u044b, \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e. \u0417\u043d\u0430\u0447\u0438\u0442, Compose \u0443\u0436\u0435 \u0432\u0441\u0451 \u0441\u0434\u0435\u043b\u0430\u043b \u0437\u0430 \u043d\u0430\u0441, \u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u043e \u043d\u0435 \u0437\u0440\u044f \u0443 \u043d\u0430\u0441 \u0434\u0432\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u2014 \u0437\u043d\u0430\u0447\u0438\u0442, \u0432 \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0451 \u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0430.<\/p>\n<h2>\u0422\u0435\u043e\u0440\u0438\u044f<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438,\u00a0\u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c <strong>\u0444\u0430\u0437\u044b Compose \u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 Layout.<\/strong><\/p>\n<p><strong>\u0424\u0430\u0437\u044b Compose<\/strong><\/p>\n<p>Compose \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u0434\u0440 \u0437\u0430 \u0442\u0440\u0438 \u0444\u0430\u0437\u044b:<\/p>\n<ol>\n<li>\n<p>Composition \u2014 Compose \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 composable-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0441\u0442\u0440\u043e\u0438\u0442 \u0434\u0435\u0440\u0435\u0432\u043e \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>Layout \u2014 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432\u043d\u0443\u0442\u0440\u0438 composable-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437\u043c\u0435\u0440\u044f\u044e\u0442 \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442 \u0441\u0435\u0431\u044f \u0438 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435.<\/p>\n<\/li>\n<li>\n<p>Drawing \u2014 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u044e\u0442 \u0441\u0435\u0431\u044f \u043d\u0430 Canvas.<\/p>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u0438 \u0444\u0430\u0437\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0430\u0434\u0440, \u043d\u043e Compose \u0434\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0430\u0437\u044b, \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0438\u0445 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, Compose \u043f\u043e\u0434\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u0447\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0422\u0430\u043a\u0436\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0434\u0438\u043d \u043a\u0430\u0434\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u0430 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0445\u043e\u0434 \u0432\u0441\u0435\u0445 \u0444\u0430\u0437.<\/p>\n<p><strong>Layout<\/strong><\/p>\n<p>\u0423 \u043c\u043d\u043e\u0433\u0438\u0445 \u0435\u0449\u0451 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0444\u043b\u0435\u0448\u0431\u0435\u043a\u0438 \u0441 Custom View \u043d\u0430 Android View, \u043d\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 Layout \u0432 Compose \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 Layout \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 Compose. \u0422\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c, \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 Compose \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438. \u041d\u0435\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438\u043b\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0438\u0437-\u0437\u0430 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 onGloballyPositioned(), onSizeChanged() \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0438\u0437\u043b\u0438\u0448\u043d\u0435\u043c\u0443 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c\u0443 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0443. \u0415\u0441\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043c\u0430\u043a\u0435\u0442, \u043b\u0438\u0431\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439.<\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0435 \u0442\u0435\u043e\u0440\u0438\u0438 \u043f\u043e Compose \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u044d\u0442\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445: <strong>\u041e\u0441\u043e\u0437\u043d\u0430\u043d\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f Compose:<\/strong><a href=\"https:\/\/habr.com\/ru\/companies\/ozontech\/articles\/742854\/\"> \u0447\u0430\u0441\u0442\u044c 1<\/a>,<a href=\"https:\/\/habr.com\/ru\/articles\/796437\/\"> \u0447\u0430\u0441\u0442\u044c 2<\/a>; <a href=\"https:\/\/habr.com\/ru\/articles\/701422\/\">\u041f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f Jetpack Compose<\/a><\/p>\n<h2>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h2>\n<p>\u0414\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432, \u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u044f \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435.<\/p>\n<p><strong>\u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u2014<\/strong> \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u043a\u0430\u043a\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043a\u043d\u043e\u043f\u043a\u0430.<\/p>\n<figure class=\"\"><\/figure>\n<ol>\n<li>\n<p>\u0417\u0430\u0434\u043d\u0438\u0439 \u0444\u043e\u043d<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0441\u0432\u0430\u0439\u043f\u0430<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u0430\u0439\u0434-\u044f\u043a\u043e\u0440\u044c<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0442\u0435\u043d\u0442 \u043f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u043f\u0440\u0430\u0432\u0430<\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0437\u0430 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0445\u043e\u0434 compose \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u044d\u0442\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0438\u0445. \u041a\u0430\u043a \u0440\u0430\u0437 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 Layout.<\/p>\n<p><strong>\u0412\u0442\u043e\u0440\u043e\u0439 \u0448\u0430\u0433<\/strong> \u2014 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u0435 compose-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 content \u0443 Layout.<\/p>\n<pre><code class=\"kotlin\">Layout( \u00a0\u00a0\u00a0\u00a0content = { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0441\u043b\u0430\u0439\u0434-\u044f\u043a\u043e\u0440\u044c \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Box( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0modifier = Modifier \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.layoutId(SwipeableButtonLayout.ThumbLayout) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.clip(shape) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.background(colors.thumbBackgroundColor(), shape) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.anchoredDraggable( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state = state.anchoredDraggableState, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0orientation = Orientation.Horizontal, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0enabled = enabled, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0startDragImmediately = false \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0), \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0contentAlignment = Alignment.Center \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0thumbContent(progressState, targetAnchorState) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0441\u0432\u0430\u0439\u043f\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Box( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0modifier = Modifier \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.layoutId(SwipeableButtonLayout.ProcessLayout) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.drawWithCache { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0onDrawBehind { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0drawRect( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0color = colors.progressColor(), \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0size = Size(width = this.size.width, height = this.size.height), \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u043f\u0440\u0430\u0432\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Box( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0modifier = Modifier.layoutId(SwipeableButtonLayout.EndLayout) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0endContent(progressState) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Box( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0modifier = Modifier.layoutId(SwipeableButtonLayout.CenterLayout) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0centerContent(progressState, currentAnchorState) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0}, ... )<\/code><\/pre>\n<p><strong>\u0422\u0440\u0435\u0442\u0438\u0439 \u0448\u0430\u0433<\/strong> \u2014 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430\u0448\u0438 compose-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b.<\/p>\n<ol>\n<li>\n<p>\u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u0441\u043b\u0430\u0439\u0434-\u044f\u043a\u043e\u0440\u044c.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"kotlin\">private fun swipeableMeasure( \u00a0\u00a0\u00a0\u00a0size: SwipeableButtonSize, \u00a0\u00a0\u00a0\u00a0draggableOffsetProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0maxAnchorProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0endOfTrackState: MutableIntState, \u00a0\u00a0\u00a0\u00a0progressState: MutableFloatState, ): MeasureScope.(measurables: List&lt;Measurable>, constraints: Constraints) -> MeasureResult { \u00a0\u00a0\u00a0\u00a0return { measurables, constraints -> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u0441\u043b\u0430\u0439\u0434-\u044f\u043a\u043e\u0440\u044c \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.ThumbLayout }.measure( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0constraints.copy( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minHeight = constraints.minHeight.coerceAtLeast(size.minHeight.roundToPx()), \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minWidth = constraints.minWidth.coerceAtLeast(size.minWidth.roundToPx()) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0...  \u00a0 } }<\/code><\/pre>\n<figure class=\"\"><\/figure>\n<ol start=\"2\">\n<li>\n<p>\u0420\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0434\u043b\u0438\u043d\u0443 \u0441\u0432\u0430\u0439\u043f\u0430.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"kotlin\">private fun swipeableMeasure( \u00a0\u00a0\u00a0\u00a0size: SwipeableButtonSize, \u00a0\u00a0\u00a0\u00a0draggableOffsetProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0maxAnchorProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0endOfTrackState: MutableIntState, \u00a0\u00a0\u00a0\u00a0progressState: MutableFloatState, ): MeasureScope.(measurables: List&lt;Measurable>, constraints: Constraints) -> MeasureResult { \u00a0\u00a0\u00a0\u00a0return { measurables, constraints -> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u0441\u043b\u0430\u0439\u0434-\u044f\u043a\u043e\u0440\u044c \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.ThumbLayout }.measure( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0constraints.copy( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minHeight = constraints.minHeight.coerceAtLeast(size.minHeight.roundToPx()), \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minWidth = constraints.minWidth.coerceAtLeast(size.minWidth.roundToPx()) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0412\u044b\u0441\u043e\u0442\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val height = thumbPlaceable.height \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0428\u0438\u0440\u0438\u043d\u0430 \u044f\u043a\u043e\u0440\u044f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbWidth = thumbPlaceable.width \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u043b\u0438\u043d\u0443 \u0441\u0432\u0430\u0439\u043f\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val endOfTrackWidth = constraints.maxWidth - thumbWidth \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0...  \u00a0 } }<\/code><\/pre>\n<figure class=\"\"><\/figure>\n<ol start=\"3\">\n<li>\n<p>\u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043e\u0442\u0441\u0442\u0443\u043f \u043f\u043e \u0438\u043a\u0441 \u0438 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"kotlin\">private fun swipeableMeasure( \u00a0\u00a0\u00a0\u00a0size: SwipeableButtonSize, \u00a0\u00a0\u00a0\u00a0draggableOffsetProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0maxAnchorProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0endOfTrackState: MutableIntState, \u00a0\u00a0\u00a0\u00a0progressState: MutableFloatState, ): MeasureScope.(measurables: List&lt;Measurable>, constraints: Constraints) -> MeasureResult { \u00a0\u00a0\u00a0\u00a0return { measurables, constraints -> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0412\u044b\u0441\u043e\u0442\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val height = thumbPlaceable.height \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0428\u0438\u0440\u0438\u043d\u0430 \u044f\u043a\u043e\u0440\u044f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbWidth = thumbPlaceable.width \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u043b\u0438\u043d\u0443 \u0441\u0432\u0430\u0439\u043f\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val endOfTrackWidth = constraints.maxWidth - thumbWidth \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u0441\u0442\u0443\u043f \u043f\u043e \u0438\u043a\u0441 \u0434\u043b\u044f \u044f\u043a\u043e\u0440\u044f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbX = draggableOffsetProvider().coerceAtLeast(0).coerceAtMost(endOfTrackWidth) \/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0448\u0438\u0440\u0438\u043d\u0443 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 val progressWidth = thumbX + thumbWidth \/ 2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val progressPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.ProcessLayout }.measure( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0constraints.copy( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minWidth = progressWidth, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minHeight = height \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... \u00a0 } }<\/code><\/pre>\n<figure class=\"\"><\/figure>\n<ol start=\"4\">\n<li>\n<p>\u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u043f\u0440\u0430\u0432\u0430 \u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"kotlin\">private fun swipeableMeasure( \u00a0\u00a0\u00a0\u00a0size: SwipeableButtonSize, \u00a0\u00a0\u00a0\u00a0draggableOffsetProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0maxAnchorProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0endOfTrackState: MutableIntState, \u00a0\u00a0\u00a0\u00a0progressState: MutableFloatState, ): MeasureScope.(measurables: List&lt;Measurable>, constraints: Constraints) -> MeasureResult { \u00a0\u00a0\u00a0\u00a0return { measurables, constraints -> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0...\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u0441\u0442\u0443\u043f \u043f\u043e \u0438\u043a\u0441 \u0434\u043b\u044f \u044f\u043a\u043e\u0440\u044f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbX = draggableOffsetProvider().coerceAtLeast(0).coerceAtMost(endOfTrackWidth) \/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0448\u0438\u0440\u0438\u043d\u0443 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 val progressWidth = thumbX + thumbWidth \/ 2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val progressPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.ProcessLayout }.measure( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0constraints.copy( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minWidth = progressWidth, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minHeight = height \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val endContentPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.EndLayout }.measure(constraints) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val centerContentPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.CenterLayout }.measure(constraints) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... \u00a0 } }<\/code><\/pre>\n<figure class=\"\"><\/figure>\n<ol start=\"5\">\n<li>\n<p>\u0420\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"kotlin\">private fun swipeableMeasure( \u00a0\u00a0\u00a0\u00a0size: SwipeableButtonSize, \u00a0\u00a0\u00a0\u00a0draggableOffsetProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0maxAnchorProvider: () -> Int, \u00a0\u00a0\u00a0\u00a0endOfTrackState: MutableIntState, \u00a0\u00a0\u00a0\u00a0progressState: MutableFloatState, ): MeasureScope.(measurables: List&lt;Measurable>, constraints: Constraints) -> MeasureResult { \u00a0\u00a0\u00a0\u00a0return { measurables, constraints -> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0...\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0412\u044b\u0441\u043e\u0442\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val height = thumbPlaceable.height \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u0441\u0442\u0443\u043f \u043f\u043e \u0438\u043a\u0441 \u0434\u043b\u044f \u044f\u043a\u043e\u0440\u044f \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val thumbX = draggableOffsetProvider().coerceAtLeast(0).coerceAtMost(endOfTrackWidth) \/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0448\u0438\u0440\u0438\u043d\u0443 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430         val progressWidth = thumbX + thumbWidth \/ 2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0val progressPlaceable = measurables.first { it.layoutId == SwipeableButtonLayout.ProcessLayout }.measure( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0constraints.copy( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minWidth = progressWidth, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0minHeight = height \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ \u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-375262","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/375262","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=375262"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/375262\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=375262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=375262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=375262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}