{"id":340090,"date":"2022-10-22T03:00:13","date_gmt":"2022-10-22T03:00:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=340090"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=340090","title":{"rendered":"<span>\u041f\u0438\u0448\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 ColorWheel \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f (View) \u0432 Android<\/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>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0441\u0435\u0445.<\/p>\n<p>\u041a\u0430\u043a-\u0442\u043e \u043e\u0434\u043d\u0438\u043c \u0432\u0435\u0447\u0435\u0440\u043e\u043c \u043c\u043d\u0435 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u0437\u0430\u0431\u0440\u0430\u043b\u0430\u0441\u044c \u0438\u0434\u0435\u044f \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e <code>View<\/code> \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0446\u0432\u0435\u0442\u0430 \u0432 \u043e\u0431\u0451\u0440\u0442\u043a\u0435 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0442\u0430\u043a\u043e\u0432\u044b\u0445 \u0432 \u0441\u0435\u0442\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438 \u0431\u0435\u0437 \u043c\u0435\u043d\u044f, \u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445, \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u044f \u043d\u0435 \u043d\u0430\u0448\u0451\u043b. \u041e\u043f\u044b\u0442\u0430 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 <code>View<\/code> \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435 \u0431\u044b\u043b\u043e, \u0430 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043d\u0438\u0447\u0435\u0433\u043e. \u0422\u0430\u043a \u044f \u0438 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043b \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043a\u043e\u0434\u0430. <\/p>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u043c \u043a \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0441\u0442\u043e\u0438\u0442 \u0434\u0435\u043b\u0430\u0442\u044c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041e\u0434\u043d\u0430\u043a\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0433\u0440\u0430\u0431\u043b\u0438 \u0441 \u043a\u043e\u0441\u0442\u044b\u043b\u044f\u043c\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u043b \u043f\u043e \u043c\u0435\u0440\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0435\u0439 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u0434\u0435\u0438.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, <a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/530618\/\" rel=\"noopener noreferrer nofollow\">\u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/a>, \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0443\u043c\u0435\u0435\u0442\u0435. \u041d\u0443 \u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u0448\u043a\u043e\u043b\u044c\u043d\u0443\u044e \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u044e.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u043e\u0439\u043b\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/42a\/8a1\/824\/42a8a182477f00f51a45fd6100b8ce93.png\" width=\"2117\" height=\"716\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/42a\/8a1\/824\/42a8a182477f00f51a45fd6100b8ce93.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u201c\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\u201d \u0441\u043b\u0435\u0432\u0430, \u043f\u043b\u044e\u0441 \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442 \u043c\u0435\u043d\u044f.<\/p>\n<\/div>\n<\/details>\n<p>\u0417\u0430\u043f\u0430\u0441\u0430\u0435\u043c\u0441\u044f <s>\u0433\u0440\u0435\u0447\u0435\u0439<\/s> \u0447\u0430\u0435\u043c, \u0431\u0443\u0442\u0435\u0440\u0431\u0440\u043e\u0434\u0430\u043c\u0438 \u0438 \u0442\u0435\u0440\u043f\u0435\u043d\u0438\u0435\u043c, \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439.<\/p>\n<h2>\u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u043e\u0438\u0442 \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b view \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u0442\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043a\u043e\u0434\u0438\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/009\/3a9\/1b7\/0093a91b794ee861e1fb673f8493edf4.png\" width=\"1449\" height=\"1057\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/009\/3a9\/1b7\/0093a91b794ee861e1fb673f8493edf4.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0443\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0435\u0451 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u041a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 (\u0440\u0430\u0437\u043c\u0435\u0440, \u0432\u0438\u0434\u0435\u043d\/\u043d\u0435 \u0432\u0438\u0434\u0435\u043d, \u0446\u0432\u0435\u0442, \u0440\u0430\u0434\u0438\u0443\u0441 \u0438 \u0442.\u043f.).<\/p>\n<p>\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043d\u043e\u043f\u043e\u043a \u0434\u043b\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u0415\u0441\u0442\u044c \u0440\u0435\u0436\u0438\u043c &#171;Stepper&#187;, \u043a\u043e\u0433\u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0447\u0451\u0442\u043a\u043e \u043f\u043e \u043c\u0435\u0442\u043a\u0430\u043c.<\/p>\n<p>\u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (\u043f\u043e\u0432\u0435\u0440\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0446\u0432\u0435\u0442\u0430) \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0438\u043a\u043e\u043d\u043a\u0443.<\/p>\n<p>\u0412 \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u0431\u0443\u0434\u0443\u0442 3 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f:<\/p>\n<ul>\n<li>\n<p><code>ColorChangeListener<\/code> &#8212; \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<ul>\n<li>\n<p><code>void onColorChanged(int color)<\/code> &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043f\u043e \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u043c\u0443 \u043a\u0440\u0443\u0433\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0446\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><code>void firstDraw(int color)<\/code> &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 <code>View<\/code>, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u0446\u0432\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432\u043e <code>View<\/code> \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><code>ButtonTouchListener<\/code> &#8212; \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<ul>\n<li>\n<p><code>void on_cPointerTouch()<\/code> &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0441\u0430\u043d\u0438\u0438 \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><code>void on_excPointerTouch()<\/code> &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0441\u0430\u043d\u0438\u0438 \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><code>StepperListener<\/code> &#8212; \u0438\u043c\u0435\u0435\u0442 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434:<\/p>\n<ul>\n<li>\n<p><code>void onStep()<\/code> &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u043c\u0435\u0442\u043a\u0443 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 &#171;Stepper&#187;.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/h2>\n<h4>\u041e\u0441\u043d\u043e\u0432\u044b<\/h4>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u044f \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e \u043f\u0440\u043e\u0431\u0435\u0433\u0443\u0441\u044c \u043f\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <code>View<\/code> \u0432 \u041e\u0421 Android.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e <code>View<\/code> \u0432 Android \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 (\u0410 \u0435\u0441\u043b\u0438 \u0442\u043e\u0447\u043d\u0435\u0435 &#8212; \u0442\u043e \u0438\u0445 4, \u0438 \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u0438 \u0440\u0430\u0441\u0447\u0451\u0442\u0430\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 <code>View<\/code> \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c).<\/p>\n<pre><code class=\"java\">public View(Context context) {} public View(Context context, @Nullable AttributeSet attrs) {} public View(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {} public View(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {}<\/code><\/pre>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0437 \u043a\u043e\u0434\u0430. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u00a0<code>context<\/code>\u00a0\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u044d\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u0427\u0435\u0440\u0435\u0437 <code>context<\/code>\u00a0\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0442\u0435\u043c\u0435, \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c \u0438 \u0442.\u00a0\u043f.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0448 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439\u00a0<code>View<\/code>\u00a0\u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432 \u043c\u0430\u043a\u0435\u0442\u0430 XML, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <code>View<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0442\u0438\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u0432\u0442\u043e\u0440\u043e\u043c\u0443, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u0427\u0435\u0442\u0432\u0451\u0440\u0442\u044b\u0439 \u0443\u0436\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u0442\u0440\u0435\u0442\u044c\u0435\u043c\u0443, \u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0442\u0435\u043c\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u042f, \u043a\u0430\u043a \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0438 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f, \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b \u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 (\u043a \u043d\u0435\u043c\u0443 \u043c\u044b \u0435\u0449\u0451 \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f). \u0411\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f.<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f<\/h4>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 Android Studio.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1a1\/0e0\/7dd\/1a10e07dd65e33f82b0e49499df95f8c.png\" alt=\"\" title=\"\" width=\"525\" height=\"166\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1a1\/0e0\/7dd\/1a10e07dd65e33f82b0e49499df95f8c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a, \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f SDK, \u044f\u0437\u044b\u043a \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438 \u043c\u043e\u0434\u0443\u043b\u044f<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1dc\/b98\/3ad\/1dcb983ad60190c28a328a0b928c6700.png\" width=\"687\" height=\"527\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1dc\/b98\/3ad\/1dcb983ad60190c28a328a0b928c6700.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 build.gradle \u0444\u0430\u0439\u043b\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u0442\u0440\u043e\u0447\u043a\u043e\u0439 <code>implementation project (\":RXColorWheel\")<\/code><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/959\/55c\/64e\/95955c64e86a4a344bdfb5d9f51d2829.png\" width=\"636\" height=\"288\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/959\/55c\/64e\/95955c64e86a4a344bdfb5d9f51d2829.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <code>RXColorWheel<\/code>, \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0441\u044f \u043e\u0442 <code>View<\/code>, IDE \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 \u0441\u0443\u043f\u0435\u0440\u043a\u043b\u0430\u0441\u0441\u0430 &#8212; \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435. \u0412 \u0438\u0442\u043e\u0433\u0435, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"java\">public class RXColorWheel extends View {     public RXColorWheel(Context context) {         super(context);     }      public RXColorWheel(Context context, @Nullable AttributeSet attrs) {         super(context, attrs);     }      public RXColorWheel(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {         super(context, attrs, defStyleAttr);     }      public RXColorWheel(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {         super(context, attrs, defStyleAttr, defStyleRes);     } }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0441\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0432 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435.<\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u0440\u0430\u043d\u043d\u0435\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438, \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0438\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u0441 \u0441\u0435\u0442\u0442\u0435\u0440\u0430\u043c\u0438 \u0434\u043b\u044f \u043d\u0438\u0445.<\/p>\n<pre><code class=\"java\">    public interface ColorChangeListener{          void onColorChanged(int color);          void firstDraw(int color);     }      public interface ButtonTouchListener{          void on_cPointerTouch();          void on_excPointerTouch();      }      public interface StepperListener{          void onStep();      }      private ColorChangeListener colorChangeListener;     private ButtonTouchListener buttonTouchListener;     private StepperListener     stepperListener;      public void setButtonTouchListener(@NonNull ButtonTouchListener listener){ buttonTouchListener = listener;}     public void setColorChangeListener(@NonNull ColorChangeListener listener){colorChangeListener = listener;}     public void setStepperListener(@NonNull StepperListener listener){ stepperListener = listener;}<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>View<\/code> \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u0430\u043a\u0435\u0442\u0430 android.graphics:<\/p>\n<ul>\n<li>\n<p>Paint &#8212; \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0446\u0432\u0435\u0442\u0430, \u0441\u0442\u0438\u043b\u0438 \u0438 \u043f\u0440\u043e\u0447\u0443\u044e \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u0445\u043e\u043b\u0441\u0442\u0435. \u0423 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043d, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0446\u0432\u0435\u0442, \u0441\u0442\u0438\u043b\u044c, \u0448\u0440\u0438\u0444\u0442, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>Canvas &#8212; \u044d\u0442\u0430 \u043d\u0430\u0448 \u0445\u043e\u043b\u0441\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0440\u0438\u0441\u0443\u0435\u043c.<\/p>\n<\/li>\n<li>\n<p>BitMap &#8212; \u043a\u043b\u0430\u0441\u0441, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u0440\u0430\u0441\u0442\u0440\u043e\u0432\u044b\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>Color &#8212; \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0446\u0432\u0435\u0442\u0430. \u0418\u0445 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 ARGB, \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u0430\u043d\u0430\u043b\u0430(Alpha, Red, Green, Blue).<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0441\u0435\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0445 \u0437\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0438 \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0445 \u0432 \u0441\u0435\u0431\u0435 \u043f\u0440\u043e\u0447\u0443\u044e \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u041a\u043e\u0434 \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"java\">    private ColorChangeListener colorChangeListener;     private ButtonTouchListener buttonTouchListener;     private StepperListener     stepperListener;      \/\/ANTI_ALIAS_FLAG \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0430\u043d\u0442\u0438\u0430\u043b\u0438\u0430\u0441\u0438\u043d\u0433     private final Paint     p_color = new Paint(Paint.ANTI_ALIAS_FLAG); \/\/\u0426\u0432\u0435\u0442\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u044c\u0446\u043e     private final Paint     p_pointer = new Paint(Paint.ANTI_ALIAS_FLAG); \/\/\u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c     private final Paint     p_pStroke = new Paint(Paint.ANTI_ALIAS_FLAG); \/\/\u041e\u0431\u0432\u043e\u0434\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f     private final Paint     p_background = new Paint();\/\/\u0417\u0430\u0434\u043d\u0438\u0439 \u0444\u043e\u043d     private final Paint     p_pLine = new Paint(Paint.ANTI_ALIAS_FLAG); \/\/\u041b\u0438\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f     private final Paint     p_cPointer = new Paint(); \/\/\u0426\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c     private final Paint     p_excPointer = new Paint(); \/\/\u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c     private final Paint     p_placemarks = new Paint(); \/\/\u041c\u0435\u0442\u043a\u0438      private double          py, px; \/\/\u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f      private float           cx, cy; \/\/\u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b View     private float           color_rad; \/\/\u0420\u0430\u0434\u0438\u0443\u0441 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430     private float           color_rTh; \/\/\u0422\u043e\u043b\u0449\u0438\u043d\u0430 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430     private float           placemarks_rad; \/\/\u0420\u0430\u0434\u0438\u0443\u0441 \u043c\u0435\u0442\u043e\u043a     private float           cPointer_rad; \/\/\u0420\u0430\u0434\u0438\u0443\u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0446\u0432\u0435\u0442\u0430     private float           excPointer_rad; \/\/\u0420\u0430\u0434\u0438\u0443\u0441 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0446\u0432\u0435\u0442\u0430     private float           pointer_rad; \/\/\u0420\u0430\u0434\u0438\u0443\u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f     private float           background_rad; \/\/\u0420\u0430\u0434\u0438\u0443\u0441 \u0437\u0430\u0434\u043d\u0435\u0433\u043e \u0444\u043e\u043d\u0430     private float           badge_size; \/\/\u0420\u0430\u0437\u043c\u0435\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u043a\u043e\u043d\u043a\u0438     private float[]         degrees; \/\/\u041c\u0430\u0441\u0441\u0438\u0432, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0443\u0433\u043b\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u043a     private final float[] hsv = new float[] {0, 1f, 1f};        private int[]           color_palette; \/\/\u0425\u0440\u0430\u043d\u0438\u0442 \u043f\u0430\u043b\u0438\u0442\u0440\u0443 \u0446\u0432\u0435\u0442\u043e\u0432 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430     private int             color; \/\/\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0446\u0432\u0435\u0442, \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c      private int             minVsize; \/\/\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 View (\u043f\u043e \u0432\u044b\u0441\u043e\u0442\u0435 \u0438\u043b\u0438 \u0448\u0438\u0440\u0438\u043d\u0435)     private int             pCount; \/\/\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u043e\u043a      \/** \u0411\u0443\u043b\u0435\u0432\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. *\/     private boolean         isBackground;     private boolean         isExColorPointer;     private boolean         isColorPointerCustomColor;     private boolean         isPointerLine;     private boolean         isPlacemarks;     private boolean         isPlacemarksRound;     private boolean         isColorPointer;     private boolean         isBadge;     private boolean         isRoundBadge;     private boolean         isPointerOutline;     private boolean         isColorPointerShadow;     private boolean         isPointerCustomColor;     private boolean         isPointerShadow;     private boolean         isShadow;     private boolean         stepperMode;      private boolean firstDraw = true;      private Bitmap          mainImageBitmap; \/\/Bitmap \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0437\u043d\u0430\u0447\u043a\u0430     private TypedArray      typedArray; \/\/\u0425\u0440\u0430\u043d\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0447\u0430\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0438\u0437 XML \u0447\u0435\u0440\u0435\u0437 <code>TypedArray<\/code>.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u0441 XML \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438.<\/p>\n<p>\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>res\/values\/<\/code> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b attr.xml<\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?> &lt;resources>     &lt;declare-styleable name=\"RXColorWheel\">         &lt;attr name=\"badge\" format=\"reference\" \/>         &lt;attr name=\"colorPointerRad\" format=\"float\" \/>         &lt;attr name=\"excPointerRad\" format=\"float\" \/>         &lt;attr name=\"backgroundRad\" format=\"float\" \/>         &lt;attr name=\"bgColor\" format=\"color\" \/>         &lt;attr name=\"pointerRad\" format=\"float\" \/>         &lt;attr name=\"badgeSize\" format=\"float\" \/>         &lt;attr name=\"colorRingRad\" format=\"float\" \/>         &lt;attr name=\"colorRingThickness\" format=\"float\" \/>         &lt;attr name=\"placemarksRad\" format=\"float\" \/>         &lt;attr name=\"placemarksCount\" format=\"integer\" \/>         &lt;attr name=\"colorPointerCustomColor\" format=\"color\" \/>         &lt;attr name=\"pointerCustomColor\" format=\"color\" \/>          &lt;attr name=\"isColorPointerCustomColor\" format=\"boolean\" \/>         &lt;attr name=\"isPointerCustomColor\" format=\"boolean\" \/>         &lt;attr name=\"isBackground\" format=\"boolean\" \/>         &lt;attr name=\"isExColorPointer\" format=\"boolean\" \/>         &lt;attr name=\"isPointerLine\" format=\"boolean\" \/>         &lt;attr name=\"isPlacemarks\" format=\"boolean\" \/>         &lt;attr name=\"isPlacemarksRound\" format=\"boolean\" \/>         &lt;attr name=\"isColorPointer\" format=\"boolean\" \/>         &lt;attr name=\"isColorPointerShadow\" format=\"boolean\" \/>         &lt;attr name=\"isBadge\" format=\"boolean\" \/>         &lt;attr name=\"isRoundBadge\" format=\"boolean\" \/>         &lt;attr name=\"isPointerOutline\" format=\"boolean\" \/>         &lt;attr name=\"isPointerShadow\" format=\"boolean\" \/>         &lt;attr name=\"isShadow\" format=\"boolean\" \/>         &lt;attr name=\"stepperMode\" format=\"boolean\" \/>      &lt;\/declare-styleable> &lt;\/resources><\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u0442\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c \u0438\u0437 \u043a\u043e\u0434\u0430, \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435.<\/p>\n<pre><code class=\"java\">    public RXColorWheel(Context context, AttributeSet attrs) {         this(context, attrs, 0);          this.setDrawingCacheEnabled(true);          setColorPalette(getResources().getIntArray(R.array.default_color_palette));          typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.RXColorWheel);          isBackground = typedArray.getBoolean(R.styleable.RXColorWheel_isBackground,true);          isExColorPointer = typedArray.getBoolean(R.styleable.RXColorWheel_isExColorPointer,true);          isPointerLine = typedArray.getBoolean(R.styleable.RXColorWheel_isPointerLine,true);          isPlacemarks = typedArray.getBoolean(R.styleable.RXColorWheel_isPlacemarks,true);          isPlacemarksRound = typedArray.getBoolean(R.styleable.RXColorWheel_isPlacemarksRound,true);          isColorPointer = typedArray.getBoolean(R.styleable.RXColorWheel_isColorPointer,true);          isColorPointerShadow = typedArray.getBoolean(R.styleable.RXColorWheel_isColorPointerShadow, true);          isBadge = typedArray.getBoolean(R.styleable.RXColorWheel_isBadge, true);          isRoundBadge = typedArray.getBoolean(R.styleable.RXColorWheel_isRoundBadge, false);          isPointerOutline = typedArray.getBoolean(R.styleable.RXColorWheel_isPointerOutline, true);          isPointerShadow = typedArray.getBoolean(R.styleable.RXColorWheel_isPointerShadow, false);          pCount = even(typedArray.getInt(R.styleable.RXColorWheel_placemarksCount,20));         if(stepperMode) calculate_step_angle(pCount);          p_background.setColor(typedArray.getColor(R.styleable.RXColorWheel_bgColor,                 getResources().getColor(R.color.background)));          isShadow = typedArray.getBoolean(R.styleable.RXColorWheel_isShadow, true);          setIsPointerCustomColor(typedArray.getBoolean(R.styleable.RXColorWheel_isPointerCustomColor, false));          setIsColorPointerCustomColor(typedArray.getBoolean(R.styleable.RXColorWheel_isColorPointerCustomColor, false));          if (isPlacemarks) {stepperMode = typedArray.getBoolean(R.styleable.RXColorWheel_stepperMode, false);}         else {stepperMode = false;}          int cp_color = typedArray.getColor(R.styleable.RXColorWheel_colorPointerCustomColor, 0);         if(cp_color != 0) setColorPointerCustomColor(cp_color);          int pColor = typedArray.getColor(R.styleable.RXColorWheel_pointerCustomColor, 0);         if(pColor != 0) setPointerCustomColor(pColor);          mainImageBitmap = getBitmapFromVectorDrawable(context, typedArray.getResourceId(R.styleable.RXColorWheel_badge, R.drawable.ic_baseline_add_24));      }<\/code><\/pre>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u043f\u0430\u043b\u0438\u0442\u0440\u0443 \u0446\u0432\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430, \u0438 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430 \u0432 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0435\u0442\u0442\u0435\u0440\u0430\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0435\u0449\u0451 \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e \u0442\u043e\u0439 \u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438.<\/p>\n<p>arrays.xml<\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?> &lt;resources>     &lt;array name=\"default_color_palette\">         &lt;item>#FF0000FF&lt;\/item>         &lt;item>#FF00FF00&lt;\/item>         &lt;item>#FFFFFF00&lt;\/item>         &lt;item>#FFFF0000&lt;\/item>     &lt;\/array> &lt;\/resources><\/code><\/pre>\n<p>colors.xml<\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?> &lt;resources>     &lt;color name=\"background\">#2C2A31&lt;\/color>     &lt;color name=\"color_pointer\">#FFFFFFFF&lt;\/color>     &lt;color name=\"pointer_line\">#FFFFFFFF&lt;\/color>     &lt;color name=\"pointer\">#F6F6F6&lt;\/color>     &lt;color name=\"pointer_outline\">#FFFFFFFF&lt;\/color> &lt;\/resources><\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u043c.<\/p>\n<h2>\u0418\u0437\u043c\u0435\u0440\u044f\u0435\u043c<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c \u0432\u0441\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u044b <code>View<\/code>, \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>onMeasure(int widthMeasureSpec, int heightMeasureSpec)<\/code><\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0442.\u043a. \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043a\u0440\u0443\u0433\u0430\u043c\u0438, \u043b\u043e\u0433\u0438\u0447\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0434\u0435\u043a\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u043f\u043e\u043b\u044f\u0440\u043d\u0443\u044e, \u0433\u0434\u0435 \u043c\u044b \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0442\u043e\u0436\u0435 \u0434\u0432\u0443\u043c\u044f \u0447\u0438\u0441\u043b\u0430\u043c\u0438 &#8212; \u044d\u0442\u043e \u043f\u043e\u043b\u044f\u0440\u043d\u044b\u0439 \u0443\u0433\u043e\u043b \u0438 \u043f\u043e\u043b\u044f\u0440\u043d\u044b\u0439 \u0440\u0430\u0434\u0438\u0443\u0441.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e99\/3be\/95d\/e993be95d485013d8ee128321c94c908.png\" width=\"308\" height=\"306\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e99\/3be\/95d\/e993be95d485013d8ee128321c94c908.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 Canvas \u0438\u0437 Android SDK \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0435\u0432\u044b\u0439 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0443\u0433\u043e\u043b. \u042d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u043d \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043d\u0438\u0436\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/85c\/2ec\/65a\/85c2ec65a25ff3c2bf09aa470dd07dfd.webp\" width=\"600\" height=\"600\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0441\u044c X \u0438\u0434\u0451\u0442 \u0432\u043f\u0440\u0430\u0432\u043e, \u0430 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0441\u044c Y \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u200b\u200b\u0432\u043d\u0438\u0437. \u0417\u0430\u043f\u043e\u043c\u043d\u0438\u043c \u044d\u0442\u043e, \u0442.\u043a. \u0446\u0435\u043d\u0442\u0440\u043e\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0430 <code>View<\/code> (\u043a\u0430\u043a \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u0432\u044b\u0448\u0435), \u0430 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f Y \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0432\u0435\u0440\u0445\u0443, \u0430 \u043d\u0435 \u0432\u043d\u0438\u0437\u0443.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8f3\/990\/736\/8f3990736bb55fb7b75e6900ed5335d5.png\" width=\"316\" height=\"557\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8f3\/990\/736\/8f3990736bb55fb7b75e6900ed5335d5.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043d\u0430\u0447\u0430\u043b\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 &#8212; \u044d\u0442\u043e \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 <code>View<\/code>. \u0412\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u043a\u0430\u043a \u0440\u0430\u0437 \u0432 <code>onMasure()<\/code>. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <code>MeasureSpec<\/code>, \u0438 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e. <code>measureSpec<\/code> \u0445\u0440\u0430\u043d\u0438\u0442 \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u0438 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f <code>View<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u043d\u0430\u043c \u043e\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e <code>View<\/code> (\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430). <\/p>\n<p>\u0412\u0441\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0440\u0435\u0436\u0438\u043c\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>UNSPECIFIED: \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0434\u0430\u0435\u0442 \u0435\u043c\u0443 \u043b\u044e\u0431\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d \u0445\u043e\u0447\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p>EXACTLY: \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b \u0442\u043e\u0447\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u0435\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e, \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c size. \u041e\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 match_parent \u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u0432 LayoutParams.<\/p>\n<\/li>\n<li>\n<p>AT_MOST: \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0440, \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 vew. \u042d\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 wrap_content \u0432 LayoutParams.<\/p>\n<\/li>\n<\/ul>\n<ol>\n<li>\n<\/li>\n<\/ol>\n<p>C\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>decodeMeasureSpec()<\/code>. \u041e\u043d\u0430 \u0434\u043e\u0441\u0442\u0430\u0451\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0437 <code>measureSpec<\/code> \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043d\u0435 \u0432\u044b\u0434\u0432\u0438\u043d\u0443\u043b \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u043d\u0430\u0448\u0435\u0439 <code>View<\/code> (\u0440\u0435\u0436\u0438\u043c UNSPECIFIED). \u042f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0432\u043d\u044b\u0439 350.<\/p>\n<pre><code class=\"java\">    private int decodeMeasureSpec(int measureSpec) {         int result;         int specMode = MeasureSpec.getMode(measureSpec);         int specSize = MeasureSpec.getSize(measureSpec);         if (specMode == MeasureSpec.UNSPECIFIED) result = 350;         else result = specSize;         return result;     }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u044b <code>View<\/code>, \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0446\u0435\u043d\u0442\u0440 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 <code>cx<\/code> \u0438 <code>cy<\/code>. \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0441 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d \u0432\u043d\u0438\u0437\u0443.<\/p>\n<pre><code class=\"java\">    @Override     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {                  int mWidth = decodeMeasureSpec(widthMeasureSpec); \/\/\u0414\u043e\u0441\u0442\u0430\u0451\u043c \u0440\u0430\u0437\u043c\u0435\u0440 View         int mHeight = decodeMeasureSpec(heightMeasureSpec);          minVsize = Math.min(mWidth, mHeight); \/\/\u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 (\u0431\u0443\u0434\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0443\u0433\u0438 \u043f\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u0443 View \u0432 \u0432\u044b\u0441\u043e\u0442\u0435 \u0438\u043b\u0438 \u0448\u0438\u0440\u0438\u043d\u0435)         setMeasuredDimension(mWidth, mHeight); \/\/\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044f\u0435\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043d\u0443\u044e \u0448\u0438\u0440\u0438\u043d\u0443 \u0438 \u0432\u044b\u0441\u043e\u0442\u0443 \u0434\u043b\u044f View          cx = mWidth * 0.5f; \/\/\u0414\u0435\u043b\u0438\u043c \u043f\u043e\u043f\u043e\u043b\u0430\u043c \u0432\u044b\u0441\u043e\u0442\u0443 \u0438 \u0448\u0438\u0440\u0438\u043d\u0443 View         cy = mHeight * 0.5f;      }<\/code><\/pre>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0448\u0438\u0440\u0438\u043d\u044b \u0438 \u0432\u044b\u0441\u043e\u0442\u044b \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>setMeasuredDimension()<\/code>, \u0438\u043d\u0430\u0447\u0435 \u0431\u0443\u0434\u0435\u0442 \u0431\u0440\u043e\u0448\u0435\u043d\u00a0<code>IllegalStateException<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u0432.<\/p>\n<h2>\u0421\u0447\u0438\u0442\u0430\u0435\u043c<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0446\u0435\u043d\u0442\u0440 \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0432 <code>cy<\/code> \u0438 <code>cx<\/code> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0440\u0430\u0441\u0447\u0451\u0442\u0430\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0430\u043c\u043e\u0433\u043e <code>View<\/code>.<\/p>\n<h4>\u0412\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c<\/h4>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 &#8212; <code>calculateSizes()<\/code> \u0438 <code>init()<\/code>. \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 <code>View<\/code>, \u0432\u0442\u043e\u0440\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 <code>Paint<\/code> \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 <code>View<\/code>.<\/p>\n<pre><code class=\"java\">    private void calculateSizes() {          \/\/\u0422\u0443\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 View         \/\/\u041b\u0435\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 XML \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430, \u043f\u0440\u0430\u0432\u044b\u0439 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0435\u0441\u043b\u0438 XML \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043d\u0435 \u0431\u044b\u043b \u0443\u043a\u0430\u0437\u0430\u043d         \/\/\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u043b\u0438\u0441\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043d\u0430\u0443\u0447\u043d\u043e\u0433\u043e \u0442\u044b\u043a\u0430         float color_rad_coef = typedArray.getFloat(R.styleable.RXColorWheel_colorRingRad, 0.41f);         float color_rWidth_coef = typedArray.getFloat(R.styleable.RXColorWheel_colorRingThickness, 0.04f);         float pointer_rad_coef = typedArray.getFloat(R.styleable.RXColorWheel_pointerRad, 0.12f);         float cPointer_rad_coef = typedArray.getFloat(R.styleable.RXColorWheel_colorPointerRad, 0.17f);         float badge_size_coef = typedArray.getFloat(R.styleable.RXColorWheel_badgeSize, 1);         float excPointer_rad_coef = typedArray.getFloat(R.styleable.RXColorWheel_excPointerRad, 0.6f);         float placemarks_rad_coef = typedArray.getFloat(R.styleable.RXColorWheel_placemarksRad, 0.96f);         float background_rad_coef = typedArray.getFloat(R.styleable.RXColorWheel_backgroundRad, 1);          \/\/\u0422\u0443\u0442 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432         \/\/\u0420\u0430\u0437\u043c\u0435\u0440 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0440\u0430\u0432\u0435\u043d \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0435\u0433\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 View \u043f\u043e \u0448\u0438\u0440\u0438\u043d\u0435 \u0438\u043b\u0438 \u0432\u044b\u0441\u043e\u0442\u0435         \/\/\u0420\u0430\u0437\u043c\u0435\u0440 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u0432\u0435\u043d \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0435\u0433\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430         color_rad = minVsize * color_rad_coef;         color_rTh = color_rad * color_rWidth_coef;         pointer_rad = color_rad * pointer_rad_coef;         cPointer_rad = color_rad * cPointer_rad_coef;         badge_size = cPointer_rad * badge_size_coef;         excPointer_rad = color_rad * excPointer_rad_coef;         placemarks_rad = color_rad * placemarks_rad_coef - color_rTh * 0.5f;         background_rad = color_rad * background_rad_coef;         px = cx + color_rad; \/\/\u0410 \u044d\u0442\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, x \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 + \u0440\u0430\u0434\u0438\u0443\u0441 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430         py = cy; \/\/y \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0440\u0430\u0432\u043d\u0430 \u0446\u0435\u043d\u0442\u0440\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442         \/\/\u0422\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430      }<\/code><\/pre>\n<pre><code class=\"java\">    private void init(){          Shader s_color = new SweepGradient(cx, cy, color_palette, null); \/\/\u0428\u0435\u0439\u0434\u0435\u0440 \u0434\u043b\u044f \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430, \u0434\u0430\u044e\u0449\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442 \u043f\u043e \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438          p_color.setStyle(Paint.Style.STROKE); \/\/\u0421\u0442\u0438\u043b\u044c \u0434\u043b\u044f \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430         p_color.setStrokeWidth(color_rTh);         p_color.setShader(s_color);          p_pointer.setStyle(Paint.Style.FILL); \/\/\u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c         if(isPointerShadow) {             p_pointer.setShadowLayer(15.0f, 0.0f, 0.0f, Color.argb(110, 0, 0, 0));         }          p_pStroke.setStyle(Paint.Style.STROKE); \/\/\u041e\u0431\u0432\u043e\u0434\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f         p_pStroke.setColor(getResources().getColor(R.color.pointer_outline));         p_pStroke.setStrokeWidth(pointer_rad * 0.08f);          if(isShadow) {             p_background.setShadowLayer(50.0f, 0.0f, 0.0f, 0xFF000000);         }          p_pLine.setStyle(Paint.Style.STROKE); \/\/\u041b\u0438\u043d\u0438\u044f, \u0438\u0434\u0443\u0449\u0430\u044f \u043e\u0442 \u0446\u0435\u043d\u0442\u0440\u0430 \u043a \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e         p_pLine.setColor(getResources().getColor(R.color.pointer_line));          p_cPointer.setStyle(Paint.Style.FILL); \/\/\u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430         if(isColorPointerShadow) {             p_cPointer.setShadowLayer(90.0f, 0.0f, 0.0f, Color.argb(130, 0, 0, 0));         }          p_excPointer.setStyle(Paint.Style.FILL); \/\/\u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430          p_placemarks.setStyle(Paint.Style.STROKE); \/\/\u041c\u0435\u0442\u043a\u0438         p_placemarks.setARGB(255, 124,122,129);          if(mainImageBitmap != null) {             mainImageBitmap = Bitmap.createScaledBitmap(mainImageBitmap, (int) badge_size,                     (int) badge_size, false); \/\/\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 Bitmap         }      }<\/code><\/pre>\n<p>\u0422.\u043a. \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043f\u043e\u043b\u044f\u0440\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442. \u0412 \u0446\u0435\u043b\u043e\u043c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b \u043f\u043e \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 (\u043f\u043e \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u043c\u0443 \u043a\u0440\u0443\u0433\u0443) \u0437\u0430 \u043f\u0430\u043b\u044c\u0446\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0432\u043e\u0434\u044f\u0449\u0438\u043c \u0438\u043c \u043f\u043e \u044d\u043a\u0440\u0430\u043d\u0443.<\/p>\n<h4>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0443\u0433\u043e\u043b \u0438 \u043f\u043e\u043b\u044f\u0440\u043d\u044b\u0439 \u0440\u0430\u0434\u0438\u0443\u0441<\/h4>\n<p>\u0414\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0446\u0435\u043b\u0438 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0443\u0433\u043e\u043b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c. \u0414\u043b\u044f \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>boolean onTouchEvent(MotionEvent event)<\/code> \u0438 \u0434\u043e\u0441\u0442\u0430\u0451\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043a\u0430\u0441\u0430\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 <code>event.getX()<\/code> \u0438 <code>event.getY()<\/code>.<\/p>\n<pre><code class=\"java\">float x = event.getX() - cx; \/\/\u0418\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c \u0446\u0435\u043d\u0442\u0440 View, float y = cy - event.getY(); \/\/\u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0438\u0437-\u0437\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u043e\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 atan2.<\/code><\/pre>\n<p><strong>\u041f\u043e\u0447\u0435\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u044b\u0447\u0438\u0442\u0430\u0442\u044c \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442?<\/strong> \u041f\u043e\u044f\u0441\u043d\u044e \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e. \u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0443\u0433\u043b\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>atan2()<\/code>. \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0430\u0440\u043a\u0442\u0430\u043d\u0433\u0435\u043d\u0441\u0430 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442. \u0422.\u043a. \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 X \u0438 Y, \u043a\u0430\u043a \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445, \u0442\u0430\u043a \u0438 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043a\u0430\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u044b\u0447\u0435\u0441\u0442\u044c \u0446\u0435\u043d\u0442\u0440 <code>View<\/code>, \u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u0442.\u043a. \u0432 Android \u043d\u0430 <code>Canvas<\/code> \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0443\u0445\u043e\u0434\u044f\u0442 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u044d\u043a\u0440\u0430\u043d\u0430. \u041d\u0430\u043c \u0436\u0435 \u043d\u0443\u0436\u043d\u0430 \u0432\u0441\u044f &#171;\u043f\u0430\u043b\u0438\u0442\u0440\u0430&#187; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0426\u0435\u043d\u0442\u0440 <code>View<\/code> \u0440\u0430\u0432\u0435\u043d \u0446\u0435\u043d\u0442\u0440\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 &#8212; <code>View<\/code> \u0448\u0438\u0440\u0438\u043d\u043e\u0439 \u0432 250 \u0435\u0434\u0438\u043d\u0438\u0446 \u043f\u043e \u043e\u0441\u0438 X, \u0435\u0451 \u0446\u0435\u043d\u0442\u0440 125-\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 \u043f\u043e X &#8212; \u044d\u0442\u043e \u043d\u0430\u0448 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u043d\u043e\u043b\u044c, \u0432\u0441\u0451 \u0447\u0442\u043e \u043c\u0435\u043d\u044c\u0448\u0435 125, \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b. \u0422\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u0438 \u0434\u043b\u044f Y \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b. \u041f\u0443\u0442\u0451\u043c \u0442\u0430\u043a\u0438\u0445 \u043d\u0435\u0445\u0438\u0442\u0440\u044b\u0445 \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ae6\/8db\/48f\/ae68db48f1619030092d25c3532de84b.png\" width=\"594\" height=\"596\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ae6\/8db\/48f\/ae68db48f1619030092d25c3532de84b.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u043a\u0430\u0440\u0442\u043e\u0432\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432 \u043f\u043e\u043b\u044f\u0440\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 <code>Math.atan2()<\/code> \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 java.lang. \u0414\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0434\u0432\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 &#8212; y \u0438 x \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u043b\u044f\u0440\u043d\u044b\u0439 \u0443\u0433\u043e\u043b \u03b8 &#8212; &#171;\u0442\u0435\u0442\u0430&#187; \u0432 \u0440\u0430\u0434\u0438\u0430\u043d\u0430\u0445, \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d. \u0412\u0441\u0435 \u0443\u0433\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0434\u0438\u0430\u043d\u0430\u0445. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0439\u0442\u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0446\u0435\u043d\u0442\u0440\u0430 <code>View<\/code> \u0434\u043e \u0442\u043e\u0447\u043a\u0438 \u043a\u0430\u0441\u0430\u043d\u0438\u044f (\u043f\u043e\u043b\u044f\u0440\u043d\u044b\u0439 \u0440\u0430\u0434\u0438\u0443\u0441), \u0442\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u043e \u043a\u0430\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0441\u043d\u0443\u043b\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">float angle = (float) Math.atan2(y,x); \/\/\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0443\u0433\u043e\u043b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0446\u0435\u043d\u0442\u0440\u0430 (\u043a\u043e\u043e\u0440\u0434\u0438\u0442\u043d\u0430\u0442\u0430 x \u0432\u043f\u0440\u0430\u0432\u043e \u043e\u0442 \u0446\u0435\u043d\u0442\u0440\u0430) \u0438 \u0442\u043e\u0447\u043a\u0438 \u043a\u0430\u0441\u0430\u043d\u0438\u044f double d = Math.sqrt(x*x + y*y); \/\/\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0446\u0435\u043d\u0442\u0440\u0430 View \u0434\u043e \u0442\u043e\u0447\u043a\u0438 \u043a\u0430\u0441\u0430\u043d\u0438\u044f, \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043c \u044d\u0442\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 \u0434\u043e \u0442\u043e\u0447\u043a\u0438, \u043d\u0443\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439:<\/p>\n<p>AB = \u221a(x<sub>b<\/sub>\u00a0&#8212; x<sub>a<\/sub>)<sup>2<\/sup>\u00a0+ (y<sub>b<\/sub>\u00a0&#8212; y<sub>a<\/sub>)<sup>2<\/sup>  <\/p>\n<p>\u0422.\u043a. \u0432\u0442\u043e\u0440\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0446\u0435\u043d\u0442\u0440 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 &#8212; 0, \u0435\u0433\u043e \u043c\u043e\u0436\u0435\u043c \u0434\u0430\u0436\u0435 \u043d\u0435 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0443\u043b\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435: <code>Math.sqrt(x*x + y*y);<\/code><\/p>\n<h4>\u041a\u0440\u0443\u0442\u0438\u043c-\u0432\u0435\u0440\u0442\u0438\u043c<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438 \u0443\u0433\u043e\u043b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043d\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c (<s>\u0445\u0430-\u0445\u0430, \u0442\u0430\u0432\u0442\u043e\u043b\u043e\u0433\u0438\u044f)<\/s>. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430, \u0432\u0435\u0441\u044c\u043c\u0430 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430 \u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0432 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435). \u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0442\u043e\u0447\u043a\u0443 \u0432\u043e\u043a\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0438\u043b\u0438 \u0432\u043e\u043a\u0440\u0443\u0433 \u0446\u0435\u043d\u0442\u0440\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0443\u0433\u043e\u043b.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a26\/d59\/2f6\/a26d592f62ac292f1fd8a964d206fba0.png\" width=\"209\" height=\"48\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a26\/d59\/2f6\/a26d592f62ac292f1fd8a964d206fba0.png\"\/><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/477\/9a0\/086\/4779a0086492f05512875a9d045f10d5.png\" width=\"640\" height=\"480\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/477\/9a0\/086\/4779a0086492f05512875a9d045f10d5.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0442\u043e\u0447\u043a\u0438 \u0432\u043e\u043a\u0440\u0443\u0433 \u0446\u0435\u043d\u0442\u0440\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b X \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043a\u043e\u0441\u0438\u043d\u0443\u0441, \u043f\u043e\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0439 \u0440\u0430\u0434\u0438\u0443\u0441 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0434\u0438\u0443\u0441 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430, \u0442.\u043a. \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u043d\u0451\u043c) \u0438 \u043f\u0440\u0438\u0431\u0430\u0432\u0438\u0442\u044c cx. \u0414\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b Y \u0432\u0441\u0451 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0441\u0438\u043d\u0443\u0441 \u0438 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c cy:<\/p>\n<pre><code class=\"java\">px = color_rad * Math.cos(angle) + cx; \/\/\u041f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e cx \u0438 cy \u044d\u0442\u043e \u0446\u0435\u043d\u0442\u0440 \u043d\u0430\u0448\u0435\u0439 View py = color_rad * Math.sin(angle) + cy; \/\/px \u0438 py \u044d\u0442\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0442\u044c <code>cx<\/code> \u0438 <code>cy<\/code>, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u043b\u0435\u0432\u043e\u0433\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0433\u043b\u0430 <code>View<\/code>, \u0442\u043e \u0431\u0438\u0448\u044c \u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043d\u0430 <code>Canvas<\/code>. <\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0435 \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/foxford.ru\/wiki\/informatika\/povorot-tochki\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h4>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0434\u043e \u0447\u0435\u0433\u043e \u043a\u043e\u0441\u043d\u0443\u043b\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c<\/h4>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c <code>enum<\/code>  \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u043e \u043a\u0430\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c:<\/p>\n<pre><code class=\"java\">    private enum Unit{         VOID, \/\/\u041d\u0438\u0447\u0435\u0433\u043e         EX_CP, \/\/\u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430         CP, \/\/\u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430         P \/\/\u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c     }<\/code><\/pre>\n<p>\u0423 <code>MotionEvent<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 <code>onTouchEvent()<\/code> \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u0430\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0438:<\/p>\n<ul>\n<li>\n<p><code>ACTION_DOWN<\/code><em> &#8212; \u043a\u043e\u0441\u043d\u0443\u043b\u0438\u0441\u044c \u043f\u0430\u043b\u044c\u0446\u0435\u043c \u044d\u043a\u0440\u0430\u043d\u0430.<\/em><\/p>\n<\/li>\n<li>\n<p><code>ACTION_UP<\/code><em> &#8212; \u0443\u0431\u0440\u0430\u043b\u0438 \u043f\u0430\u043b\u0435\u0446 \u0441 \u044d\u043a\u0440\u0430\u043d\u0430.<\/em><\/p>\n<\/li>\n<li>\n<p><code>ACTION_MOVE<\/code><em> &#8212; \u0434\u0432\u0438\u0433\u0430\u0435\u043c \u043f\u0430\u043b\u0435\u0446 \u043f\u043e \u044d\u043a\u0440\u0430\u043d\u0443.<\/em><\/p>\n<\/li>\n<\/ul>\n<p>\u041b\u043e\u0433\u0438\u0447\u043d\u043e, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 <code>ACTION_DOWN<\/code><em>, \u0432 \u043d\u0451\u043c \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043a\u0430\u0441\u0430\u043d\u0438\u044f \u0434\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c <\/em><code>switch<\/code><em>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0451 \u043b\u043e\u0433\u0438\u043a\u0443.<\/em><\/p>\n<pre><code class=\"java\">switch (event.getAction()) {                  case MotionEvent.ACTION_UP:                 break;                  case MotionEvent.ACTION_DOWN:                 break;                  case MotionEvent.ACTION_MOVE:                 break;              }<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u044d\u0442\u043e\u0442 <code>switch<\/code>, \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>onTouchEvent()<\/code> \u0441 \u043f\u043e\u043b\u043d\u044b\u043c\u0438 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043d\u0438\u0436\u0435: <\/p>\n<pre><code class=\"java\">    @SuppressLint(\"ClickableViewAccessibility\")     @Override     public boolean onTouchEvent(@NonNull MotionEvent event) {          float x = event.getX() - cx;         float y = event.getY() - cy;          float nearest;          float angle = (float) Math.atan2(y, x); \/\/\u0422\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0443\u0433\u043e\u043b \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c         double d = Math.sqrt(x*x + y*y); \/\/\u0422\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u043b\u044f\u0440\u043d\u044b\u0439 \u0440\u0430\u0434\u0438\u0443\u0441          nearest = stepperMode ? nearest(angle, degrees) : 0; \/\/\u0415\u0441\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0440\u0435\u0436\u0438\u043c \"stepper\", \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0443\u0433\u043b\u043e\u0432 \u043c\u0435\u0442\u043e\u043a \u0438         \/\/\u0443\u0433\u043b\u043e\u043c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0438\u0436\u0435.              switch (event.getAction()) {                  case MotionEvent.ACTION_UP:                      \/\/\u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0442\u0435\u043c, \u043d\u0430 \u0447\u0442\u043e \u043d\u0430\u0436\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c                     switch (unit){                         case EX_CP:                             if(buttonTouchListener != null) buttonTouchListener.on_excPointerTouch();                             break;                         case CP:                             if(buttonTouchListener != null) buttonTouchListener.on_cPointerTouch();                             break;                     }                      unit = Unit.VOID;                  break;                  case MotionEvent.ACTION_DOWN:                      \/\/d - \u042d\u0442\u043e \u043f\u043e\u043b\u044f\u0440\u043d\u044b\u0439 \u0440\u0430\u0434\u0438\u0443\u0441, \u0435\u0441\u043b\u0438 \u043e\u043d \u043c\u0435\u043d\u044c\u0448\u0435 \u0440\u0430\u0434\u0438\u0443\u0441\u0430 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0446\u0432\u0435\u0442\u0430 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0446\u0432\u0435\u0442\u0430,                     \/\/\u043f\u0440\u0438 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432\u043e View, \u0437\u043d\u0430\u0447\u0438\u0442 \u043c\u044b \u043a\u043b\u0438\u043a\u043d\u0443\u043b\u0438 \u043d\u0430 \u043d\u0435\u0433\u043e                     if(d &lt; excPointer_rad &amp;&amp; d > cPointer_rad &amp;&amp; isExColorPointer){ unit = Unit.EX_CP; }                                          \/\/\u0442\u0443\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d, \u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430                     else if(d &lt; excPointer_rad &amp;&amp; !isColorPointer &amp;&amp; isExColorPointer){ unit = Unit.EX_CP; }                                          \/\/\u0422\u0443\u0442 \u043f\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c \u0446\u0432\u0435\u0442\u0430                     else if(d &lt; cPointer_rad &amp;&amp; isColorPointer){ unit = Unit.CP; }                      float t = color_rTh * 0.5f + 48;\/\/\u0422\u0443\u0442\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043a\u0430\u0441\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430                                          \/\/\u0422\u0430\u043a \u043a\u0430\u043a, \u0435\u0441\u043b\u0438 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u043a\u0440\u0443\u0433 \u0442\u043e\u043d\u043a\u0438\u0439, \u0442\u043e \u043f\u043e \u043d\u0435\u043c\u0443 \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043f\u0430\u043b\u044c\u0446\u0435\u043c                     if(d &lt; color_rad + t  &amp;&amp; d > color_rad - t) {                         unit = Unit.P; \/\/\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0432\u0438\u0433\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c                         if(stepperMode) { \/\/\u0415\u0441\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0440\u0435\u0436\u0438\u043c \"stepper\"                             angle = nearest; \/\/\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u0443\u0433\u043e\u043b \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0435 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435                             if(Math.abs(nearest_old) != Math.abs(nearest)) {                                 nearest_old = nearest; \/\/                                                                \/\/\u0414\u0451\u0440\u0433\u0430\u0435\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c                                 if (stepperListener != null) stepperListener.onStep();                             }                         }                         \/\/\u0410 \u0442\u0443\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0439 \u0443\u0433\u043e\u043b                         px = color_rad * Math.cos(angle) + cx;                         py = color_rad * Math.sin(angle) + cy;                                                \/\/\u041f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0446\u0432\u0435\u0442 \u0432 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u043e\u0437\u0436\u0435                         if(colorChangeListener != null) colorChangeListener.onColorChanged(color);                      }                  break;                  case MotionEvent.ACTION_MOVE:                      if (unit.equals(Unit.P)) { \/\/\u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430 \u043c\u043e\u0436\u0435\u043c \u0434\u0432\u0438\u0433\u0430\u0442\u044c                         if(stepperMode){ \/\/\u0415\u0441\u043b\u0438 \u0440\u0435\u0436\u0438\u043c \"stepper\"                             angle = nearest; \/\/\u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u0443\u0433\u043e\u043b \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435                             if(Math.abs(nearest_old) != Math.abs(nearest)) {                                 nearest_old = nearest;                                                                  \/\/\u0414\u0451\u0440\u0433\u0430\u0435\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c                                 if (stepperListener != null) stepperListener.onStep();                             }                         }                          \/\/\u0418 \u0442\u0443\u0442 \u043f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0439 \u0443\u0433\u043e\u043b                         px = color_rad * Math.cos(angle) + cx;                         py = color_rad * Math.sin(angle) + cy;                          \/\/\u041f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0446\u0432\u0435\u0442 \u0432 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u043e\u0437\u0436\u0435                         if(colorChangeListener != null) colorChangeListener.onColorChanged(color);                      }                  break;              }          \/\/\u0415\u0441\u043b\u0438 \u043c\u044b \u0434\u0432\u0438\u0433\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u043c View \u043c\u0435\u0442\u043e\u0434\u043e\u043c invalidate() \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439         if(angle_old != angle) {             angle_old = angle;             invalidate();         }          return true;     }<\/code><\/pre>\n<p>\u041f\u043e\u0440\u0430 \u0431\u044b \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>nearest()<\/code> \u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 degrees. \u0422\u0443\u0442 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e, \u043c\u0435\u0442\u043e\u0434 <code>nearest()<\/code> \u0438\u0449\u0435\u0442 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043a \u0447\u0438\u0441\u043b\u0443, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0431\u0435\u0440\u0451\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <code>degrees<\/code> &#8212; \u044d\u0442\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0445\u0440\u0430\u043d\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0443\u0433\u043b\u043e\u0432 \u0432\u0441\u0435\u0445 \u043c\u0435\u0442\u043e\u043a (\u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0442\u0430\u0442\u044c\u0438 \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0432\u0441\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432). \u041c\u0435\u0442\u043e\u0434 <code>nearest()<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0435\u0436\u0438\u043c\u0430 &#171;stepper&#187;, \u0434\u043b\u044f \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043a \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0439 \u043c\u0435\u0442\u043a\u0435.<\/p>\n<pre><code class=\"java\">\/\/\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0431\u044b\u043b \u0432\u0437\u044f\u0442 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 static float nearest(float n, float...args) {         float nearest = 0;         float value = 2*Float.MAX_VALUE;         if(args != null){             for(float arg : args){                 if (value > Math.abs(n - arg)){                     value = Math.abs(n-arg);                     nearest = arg;}}         }         return nearest;     }<\/code><\/pre>\n<p>\u041c\u0430\u0441\u0441\u0438\u0432 <code>degrees<\/code> \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>calculateStepAngle()<\/code>. \u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u0433\u043b\u0430 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u0435\u0442\u043a\u043e\u0439.<\/p>\n<pre><code class=\"java\">    private void calculateStepAngle(int line_count){          float angle = 0;         float degree = (float) Math.toRadians(360f \/ line_count);          degrees = new float[line_count + 1];          int half = line_count\/2;         degrees[0] = 0;          float[] array = new float[half];          for(int i = 1; i &lt; half+1; i++) {                 angle = angle + degree;                 degrees[i] = angle;                 array[i-1] = degrees[i];         }          for(int i = half+1; i &lt; line_count+1; i++){             degrees[i] = array[i-half-1] * -1;         }      }<\/code><\/pre>\n<h2>\u0420\u0438\u0441\u0443\u0435\u043c<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u0441\u0435 \u0440\u0430\u0441\u0447\u0451\u0442\u044b \u0431\u044b\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u043d\u044b, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u043e\u0434 <code>onDraw()<\/code>, \u0438 \u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043d\u043e\u0432\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u043c. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0446\u0432\u0435\u0442, \u043d\u0430\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c <code>Bitmap<\/code> \u043e\u0442 <code>View<\/code> \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0446\u0432\u0435\u0442 \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f.<\/p>\n<pre><code class=\"java\">@Override     protected void onDraw(Canvas c) {         super.onDraw(c);          if(isBackground) c.drawCircle(cx, cy, background_rad, p_background); \/\/\u0420\u0438\u0441\u0443\u0435\u043c \u0444\u043e\u043d         c.drawCircle(cx, cy, color_rad, p_color); \/\/\u0420\u0438\u0441\u0443\u0435\u043c \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u044c\u0446\u043e          color = getDrawingCache().getPixel((int) px,(int) py); \/\/\u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0446\u0432\u0435\u0442 \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f          \/\/\u041d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c \u0446\u0432\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f, \u0435\u0441\u043b\u0438 \u0438\u043c \u043d\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0441\u0432\u043e\u0439 \u0446\u0432\u0435\u0442 \u0438\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a         if(!isColorPointerCustomColor) p_cPointer.setColor(color);          if(!isPointerCustomColor) p_pointer.setColor(color);          Color.colorToHSV(color, hsv); \/\/\u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0446\u0432\u0435\u0442 \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f hsv          hsv[2] = hsv[2] * 0.90f; \/\/\u0417\u0430\u0442\u0435\u043c\u043d\u044f\u0435\u043c \u0446\u0432\u0435\u0442          p_excPointer.setColor(Color.HSVToColor(hsv)); \/\/\u041d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0437\u0430\u0442\u0435\u043c\u043d\u0451\u043d\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0435\u043c\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e \u0446\u0432\u0435\u0442\u0430          if(isExColorPointer) c.drawCircle(cx, cy, excPointer_rad, p_excPointer); \/\/\u0420\u0438\u0441\u0443\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430          if(firstDraw) { \/\/\u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0435\u043c \u043e\u0431 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c \u0438 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0443\u0433\u043b\u044b \u043c\u0435\u0442\u043e\u043a             firstDraw = false;             if(stepperMode) calculateStepAngle(pCount);             if(colorChangeListener != null) colorChangeListener.firstDraw(color);         }         else {             if(isPointerLine) {c.drawLine(cx,cy,(float) px,(float) py, p_pLine);} \/\/\u0420\u0438\u0441\u0443\u0435\u043c \u043b\u0438\u043d\u0438\u044e \u043e\u0442 \u0446\u0435\u043d\u0442\u0440\u0430 \u0434\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f             if(isColorPointer) { \/\/\u0420\u0438\u0441\u0443\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430                 c.drawCircle(cx, cy, cPointer_rad, p_cPointer);                 if(isBadge){ \/\/\u0420\u0438\u0441\u0443\u0435\u043c \u0437\u043d\u0430\u0447\u043e\u043a \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435 \u0446\u0432\u0435\u0442\u0430, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0438\u043c\u0435\u0435\u0442\u0441\u044f                     c.drawBitmap(                             isRoundBadge ? getCircledBitmap(mainImageBitmap) : mainImageBitmap, \/\/\u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u043e\u043a \u043a\u0440\u0443\u0433\u043b\u044b\u0439, \u043e\u0442\u0440\u0438\u0441\u043e\u044b\u0432\u0430\u0435\u043c \u043a\u0440\u0443\u0433\u043b\u044b\u0439 Bitmap                             cx - mainImageBitmap.getWidth() * 0.5f, \/\/\u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u043a\u0430 \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0446\u0432\u0435\u0442\u0430, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u0438\u043c \u0440\u0430\u0441\u0447\u0451\u0442\u0430\u043c \u0446\u0435\u043d\u0442\u0440 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 - \u044d\u0442\u043e \u0446\u0435\u043d\u0442\u0440 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438,                             cy - mainImageBitmap.getHeight() * 0.5f, \/\/\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 - \u043b\u0435\u0432\u044b\u0439 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0443\u0433\u043e\u043b                             p_cPointer \/\/\u0420\u0438\u0441\u0443\u0435\u043c Bitmap \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438, \u0447\u0442\u043e \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430                     );                 }             }              if(isPlacemarks){                 drawRadialLines(c, placemarks_rad - 20, 20, pCount); \/\/\u041c\u0435\u0442\u043a\u0438                 if(isPlacemarksRound) c.drawCircle(cx, cy, placemarks_rad, p_placemarks);             }              c.drawCircle((float) px, (float) py, pointer_rad, p_pointer); \/\/\u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c             if (isPointerOutline) { \/\/\u041e\u0431\u0432\u043e\u0434\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f                 c.drawCircle((float) px, (float) py, pointer_rad, p_pStroke);             }         }      }<\/code><\/pre>\n<p>\u041d\u0438\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f <code>Bitmap<\/code> \u0438\u0437 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u0440\u0443\u0433\u043b\u043e\u0433\u043e Bitmap (\u0438\u0445 \u044f \u0442\u043e\u0436\u0435 \u0432\u0437\u044f\u043b \u0441 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430).<\/p>\n<pre><code class=\"java\">    \/** \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 Bitmap \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 *\/     private static Bitmap getBitmapFromVectorDrawable(Context context, int drawableId) {         Drawable drawable = ContextCompat.getDrawable(context, drawableId);         if (Build.VERSION.SDK_INT &lt; Build.VERSION_CODES.LOLLIPOP) {             drawable = (DrawableCompat.wrap(drawable)).mutate();         }          Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(),                 drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);         Canvas canvas = new Canvas(bitmap);         drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());         drawable.draw(canvas);          return bitmap;     }      \/** \u0421\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u0442 Bitmap *\/     private static Bitmap getCircledBitmap(Bitmap bitmap) {         Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);         Canvas canvas = new Canvas(output);         final Paint paint = new Paint();         final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());          paint.setAntiAlias(true);         canvas.drawARGB(0, 0, 0, 0);         canvas.drawCircle(bitmap.getWidth() * 0.5f, bitmap.getHeight() * 0.5f, bitmap.getWidth() * 0.5f, paint);         paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));         canvas.drawBitmap(bitmap, rect, rect, paint);          return output;     }<\/code><\/pre>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0442\u0442\u0435\u0440\u044b \u0438 \u0433\u0435\u0442\u0442\u0435\u0440\u044b, \u0441 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043a \u043d\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438.<\/p>\n<pre><code class=\"java\">    \/\/\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u0430\u043b\u0438\u0442\u0440\u0443 \u0446\u0432\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430     \/\/\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u043a\u043c \u0442\u043e\u0442 \u0436\u0435 \u0446\u0432\u0435\u0442, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c, \u0438\u043d\u0430\u0447\u0435     \/\/\u0411\u0443\u0434\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u0430\u0441\u0442 \u043c\u0435\u0436\u0434\u0443 \u0446\u0432\u0435\u0442\u0430\u043c\u0438 \u0432 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u043c \u043a\u0440\u0443\u0433\u0435     public void setColorPalette(@NonNull int[] colors){         if(colors[0] != colors[colors.length - 1]){             colors = Arrays.copyOf(colors, colors.length + 1); \/\/\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0441 \u0435\u0449\u0451 \u043e\u0434\u043d\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c             colors[colors.length - 1] = colors[0];             color_palette = colors;         }         else {             color_palette = colors;         }     }      public void setIsColorPointer(boolean isColorPointer){this.isColorPointer = isColorPointer;}      public void setColorPointerCustomColor(int color){this.isColorPointerCustomColor = true; p_cPointer.setColor(color);}      public void setColorPointerCustomColor(String color){this.isColorPointerCustomColor = true; p_cPointer.setColor(Color.parseColor(color));}      public void setIsColorPointerCustomColor(boolean isColorPointerCustomColor){         this.isColorPointerCustomColor = isColorPointerCustomColor;         if(isColorPointerCustomColor){p_cPointer.setColor(getResources().getColor(R.color.color_pointer));}     }      public void setPointerCustomColor(int color){this.isPointerCustomColor = true; p_pointer.setColor(color);}      public void setPointerCustomColor(String color){this.isPointerCustomColor = true; p_pointer.setColor(Color.parseColor(color));}      public void setIsPointerCustomColor(boolean isPointerCustomColor){         this.isPointerCustomColor = isPointerCustomColor;         if(isPointerCustomColor) p_pointer.setColor(getResources().getColor(R.color.pointer));     }      public void setColorPointerRadius(float colorPointerRadius){cPointer_rad = color_rad * colorPointerRadius;}      public void setIsBadge(boolean isBadge){this.isBadge = isBadge;}      public void setIsRoundBadge(boolean isRoundBadge){this.isRoundBadge = isRoundBadge;}      public void setBadgeSize(float badge_size){this.badge_size = cPointer_rad * badge_size;}      public void setImageBitmap(Bitmap bitmap){         mainImageBitmap = bitmap;         mainImageBitmap = Bitmap.createScaledBitmap(mainImageBitmap, (int)cPointer_rad,                 (int)cPointer_rad, false); \/\/\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 Bitmap     }      public void setImageById(Context context, int drawableId){         mainImageBitmap = getBitmapFromVectorDrawable(context, drawableId);         mainImageBitmap = Bitmap.createScaledBitmap(mainImageBitmap, (int)cPointer_rad,                 (int)cPointer_rad, false); \/\/\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 Bitmap     }      public void setIsExColorPointer(boolean isExColorPointer){this.isExColorPointer = isExColorPointer;}      public void setExColorPointerRadius(float ExColorPointerRadius){this.excPointer_rad = color_rad * ExColorPointerRadius;}      public void setBackgroundColor(int color){this.p_background.setColor(color);}      public void setIsBackground(boolean background){this.isBackground = background;}      public void setIsPointerLine(boolean isPointerLine){this.isPointerLine = isPointerLine;}      public void setIsPointerShadow(boolean isPointerShadow){this.isPointerShadow = isPointerShadow;}      public void setIsPlacemarks(boolean isPlacemarks){this.isPlacemarks = isPlacemarks;}      public void setIsPlacemarksRound(boolean isPlacemarksRound){this.isPlacemarksRound = isPlacemarksRound;}      public void setPlacemarksCount(int count){this.pCount = even(count); calculateStepAngle(pCount);}      public void setColorRingRadius(float colorRingRadius){this.color_rad = minVsize * colorRingRadius;}      public void setColorRingThickness(float colorRingThickness){this.color_rTh = color_rad * colorRingThickness;}      public void setIsColorPointerShadow(boolean isColorPointerShadow){this.isColorPointerShadow = isColorPointerShadow;}      public void setPointerRadius(float pointerRadius){this.pointer_rad = color_rad * pointerRadius;}      public void setIsPointerOutline(boolean isPointerOutline){this.isPointerOutline = isPointerOutline;}      public void setStepperMode(boolean stepperMode){if(isPlacemarks) this.stepperMode = stepperMode; if(this.stepperMode) calculateStepAngle(pCount);}      \/** --------- \u0413\u0435\u0442\u0442\u0435\u0440\u044b --------- *\/      public int[] getColor_palette() {return this.color_palette;}      public boolean getIsColorPointer(){return this.isColorPointer;}      public boolean getIsColorPointerCustomColor(){return this.isColorPointerCustomColor;}      public int getColorPointerCustomColor(){return this.p_cPointer.getColor();}      public boolean getIsPointerCustomColor(){return this.isPointerCustomColor;}      public int getPointerCustomColor(){return this.p_pointer.getColor();}      public float getColorPointerRadius(){return this.cPointer_rad;}      public boolean getIsBadge(){return this.isBadge;}      public boolean getIsRoundBadge(){return this.isRoundBadge;}      public float getBadgeSize(){return this.badge_size;}      public Bitmap getImageBitmap(){ return this.mainImageBitmap;}      public boolean getIsExColorPointer(){return this.isExColorPointer;}      public float getExColoPointerRadius(){return this.excPointer_rad;}      public int getBackgroundColor(){return this.p_background.getColor();}      public boolean getIsBackground(){return this.isBackground;}      public boolean getIsPointerLine(){return this.isPointerLine;}      public boolean getIsPointerShadow(){return this.isPointerShadow;}      public boolean getIsPlacemarks(){return this.isPlacemarks;}      public boolean getIsPlacemarksRound(){return this.isPlacemarksRound;}      public int getPlacemarksCount(){return this.pCount;}      public float getColorRingRadius(){return this.color_rad;}      public float getColorRingThickness(){return this.color_rTh;}      public boolean getIsColorPointerShadow(){return this.isColorPointerShadow;}      public float getPointerRadius(){return this.pointer_rad;}      public boolean getIsPointerOutline(){return this.isPointerOutline;}      public boolean getStepperMode() {return this.stepperMode;}<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>setColorPalette()<\/code>, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4bb\/43a\/cdf\/4bb43acdf71179a46214e19200022188.png\" alt=\"\" title=\"\" width=\"368\" height=\"358\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4bb\/43a\/cdf\/4bb43acdf71179a46214e19200022188.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430\u0447\u0430\u043b\u0441\u044f \u0441 \u0441\u0438\u043d\u0435\u0433\u043e \u0446\u0432\u0435\u0442\u0430, \u0442\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f \u043e\u043d \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0438\u043d\u0438\u043c \u0446\u0432\u0435\u0442\u043e\u043c, \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c  \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0435\u0437\u043a\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0446\u0432\u0435\u0442\u043e\u0432.<\/p>\n<p>\u0412 \u0441\u0435\u0442\u0442\u0435\u0440\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f even() \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0451\u0442\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043c\u0435\u0442\u043e\u043a. \u0422\u0430\u043a \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e. \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043e\u0441\u0442\u0430\u0442\u043a\u0430 \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 2, \u0435\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0435\u0441\u0442\u044c, \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0449\u0451 \u0435\u0434\u0438\u043d\u0438\u0446\u0443.<\/p>\n<pre><code class=\"java\">    private int even(int c){         int cc;         if(c % 2 == 0) { cc = c; }         else{ cc = c + 1; }         return cc;     }<\/code><\/pre>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u042f \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u0438 \u043e\u0447\u0435\u043d\u044c \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u043c\u043e\u0433 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c\u0438 \u043a\u0430\u043a \u044f.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0430\u0445:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f6f\/e97\/538\/f6fe9753851a38ef7240714e3dbdff75.gif\" width=\"348\" height=\"772\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f6f\/e97\/538\/f6fe9753851a38ef7240714e3dbdff75.gif\"\/><figcaption><\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0415\u0449\u0451 \u0441\u043f\u043e\u0439\u043b\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043e\u0431\u043e\u0448\u043b\u043e\u0441\u044c \u043d\u0435 \u0431\u0435\u0437 \u043a\u043e\u0441\u044f\u043a\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0411\u044b\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/92f\/ae3\/d99\/92fae3d993d684a0cf32dd6585ebb54e.gif\" width=\"348\" height=\"772\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/92f\/ae3\/d99\/92fae3d993d684a0cf32dd6585ebb54e.gif\"\/><figcaption><\/figcaption><\/figure>\n<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/261\/749\/ced\/261749ced6885bd8cc46b8dee17c1f1a.gif\" width=\"348\" height=\"772\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/261\/749\/ced\/261749ced6885bd8cc46b8dee17c1f1a.gif\"\/><figcaption><\/figcaption><\/figure>\n<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7fa\/803\/343\/7fa803343d6df7b25768eeb2df3f370e.gif\" width=\"348\" height=\"772\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7fa\/803\/343\/7fa803343d6df7b25768eeb2df3f370e.gif\"\/><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0441 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0439 <a href=\"https:\/\/github.com\/AlekSt7\/RXColorWheel\/wiki\/Attributes-and-methods\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 <\/a>\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 <a href=\"https:\/\/github.com\/AlekSt7\/RXColorWheel\" rel=\"noopener noreferrer nofollow\">Github <\/a>\u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/694852\/\"> https:\/\/habr.com\/ru\/post\/694852\/<\/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>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0441\u0435\u0445.<\/p>\n<p>\u041a\u0430\u043a-\u0442\u043e \u043e\u0434\u043d\u0438\u043c \u0432\u0435\u0447\u0435\u0440\u043e\u043c \u043c\u043d\u0435 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u0437\u0430\u0431\u0440\u0430\u043b\u0430\u0441\u044c \u0438\u0434\u0435\u044f \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e <code>View<\/code> \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0446\u0432\u0435\u0442\u0430 \u0432 \u043e\u0431\u0451\u0440\u0442\u043a\u0435 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0442\u0430\u043a\u043e\u0432\u044b\u0445 \u0432 \u0441\u0435\u0442\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438 \u0431\u0435\u0437 \u043c\u0435\u043d\u044f, \u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445, \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u044f \u043d\u0435 \u043d\u0430\u0448\u0451\u043b. \u041e\u043f\u044b\u0442\u0430 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 <code>View<\/code> \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435 \u0431\u044b\u043b\u043e, \u0430 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043d\u0438\u0447\u0435\u0433\u043e. \u0422\u0430\u043a \u044f \u0438 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043b \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043a\u043e\u0434\u0430. <\/p>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u043c \u043a \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0441\u0442\u043e\u0438\u0442 \u0434\u0435\u043b\u0430\u0442\u044c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041e\u0434\u043d\u0430\u043a\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0433\u0440\u0430\u0431\u043b\u0438 \u0441 \u043a\u043e\u0441\u0442\u044b\u043b\u044f\u043c\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u043b \u043f\u043e \u043c\u0435\u0440\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0435\u0439 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u0434\u0435\u0438.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, <a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/530618\/\" rel=\"noopener noreferrer nofollow\">\u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/a>, \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0443\u043c\u0435\u0435\u0442\u0435. \u041d\u0443 \u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u0448\u043a\u043e\u043b\u044c\u043d\u0443\u044e \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u044e.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u043e\u0439\u043b\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u201c\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\u201d \u0441\u043b\u0435\u0432\u0430, \u043f\u043b\u044e\u0441 \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442 \u043c\u0435\u043d\u044f.<\/p>\n<\/div>\n<\/details>\n<p>\u0417\u0430\u043f\u0430\u0441\u0430\u0435\u043c\u0441\u044f <s>\u0433\u0440\u0435\u0447\u0435\u0439<\/s> \u0447\u0430\u0435\u043c, \u0431\u0443\u0442\u0435\u0440\u0431\u0440\u043e\u0434\u0430\u043c\u0438 \u0438 \u0442\u0435\u0440\u043f\u0435\u043d\u0438\u0435\u043c, \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439.<\/p>\n<h2>\u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u043e\u0438\u0442 \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b view \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u0442\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043a\u043e\u0434\u0438\u043c:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0443\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0435\u0451 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u041a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 (\u0440\u0430\u0437\u043c\u0435\u0440, \u0432\u0438\u0434\u0435\u043d\/\u043d\u0435 \u0432\u0438\u0434\u0435\u043d, \u0446\u0432\u0435\u0442, \u0440\u0430\u0434\u0438\u0443\u0441 \u0438 \u0442.\u043f.).<\/p>\n<p>\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043d\u043e\u043f\u043e\u043a \u0434\u043b\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u0415\u0441\u0442\u044c \u0440\u0435\u0436\u0438\u043c &#171;Stepper&#187;, \u043a\u043e\u0433\u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0447\u0451\u0442\u043a\u043e \u043f\u043e \u043c\u0435\u0442\u043a\u0430\u043c.<\/p>\n<p>\u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (\u043f\u043e\u0432\u0435\u0440\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0446\u0432\u0435\u0442\u0430) \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0438\u043a\u043e\u043d\u043a\u0443.<\/p>\n<p>\u0412 \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u0431\u0443\u0434\u0443\u0442 3 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f:<\/p>\n<ul>\n<li>\n<p><code>ColorChangeListener<\/code> &#8212; \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<ul>\n<li>\n<p><code>void onColorChanged(int color)<\/code> &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043f\u043e \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u043c\u0443 \u043a\u0440\u0443\u0433\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0446\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><code>void firstDraw(int color)<\/code> &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 <code>View<\/code>, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u0446\u0432\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432\u043e <code>View<\/code> \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><code>ButtonTouchListener<\/code> &#8212; \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<ul>\n<li>\n<p><code>void on_cPointerTouch()<\/code> &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0441\u0430\u043d\u0438\u0438 \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><code>void on_excPointerTouch()<\/code> &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0441\u0430\u043d\u0438\u0438 \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0446\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><code>StepperListener<\/code> &#8212; \u0438\u043c\u0435\u0435\u0442 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434:<\/p>\n<ul>\n<li>\n<p><code>void onStep()<\/code> &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u043c\u0435\u0442\u043a\u0443 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 &#171;Stepper&#187;.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/h2>\n<h4>\u041e\u0441\u043d\u043e\u0432\u044b<\/h4>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u044f \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e \u043f\u0440\u043e\u0431\u0435\u0433\u0443\u0441\u044c \u043f\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <code>View<\/code> \u0432 \u041e\u0421 Android.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e <code>View<\/code> \u0432 Android \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 (\u0410 \u0435\u0441\u043b\u0438 \u0442\u043e\u0447\u043d\u0435\u0435 &#8212; \u0442\u043e \u0438\u0445 4, \u0438 \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u0438 \u0440\u0430\u0441\u0447\u0451\u0442\u0430\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 <code>View<\/code> \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c).<\/p>\n<pre><code class=\"java\">public View(Context context) {} public View(Context context, @Nullable AttributeSet attrs) {} public View(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {} public View(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {}<\/code><\/pre>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0437 \u043a\u043e\u0434\u0430. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u00a0<code>context<\/code>\u00a0\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u044d\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u0427\u0435\u0440\u0435\u0437 <code>context<\/code>\u00a0\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0442\u0435\u043c\u0435, \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c \u0438 \u0442.\u00a0\u043f.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0448 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439\u00a0<code>View<\/code>\u00a0\u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432 \u043c\u0430\u043a\u0435\u0442\u0430 XML, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <code>View<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0442\u0438\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u0432\u0442\u043e\u0440\u043e\u043c\u0443, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u0427\u0435\u0442\u0432\u0451\u0440\u0442\u044b\u0439 \u0443\u0436\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u0442\u0440\u0435\u0442\u044c\u0435\u043c\u0443, \u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0442\u0435\u043c\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u042f, \u043a\u0430\u043a \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0438 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f, \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b \u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 (\u043a \u043d\u0435\u043c\u0443 \u043c\u044b \u0435\u0449\u0451 \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f). \u0411\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f.<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f<\/h4>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 Android Studio.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a, \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f SDK, \u044f\u0437\u044b\u043a \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438 \u043c\u043e\u0434\u0443\u043b\u044f<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 build.gradle \u0444\u0430\u0439\u043b\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u0442\u0440\u043e\u0447\u043a\u043e\u0439 <code>implementation project (\":RXColorWheel\")<\/code><\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <code>RXColorWheel<\/code>, \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0441\u044f \u043e\u0442 <code>View<\/code>, IDE \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 \u0441\u0443\u043f\u0435\u0440\u043a\u043b\u0430\u0441\u0441\u0430 &#8212; \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435. \u0412 \u0438\u0442\u043e\u0433\u0435, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"java\">public class RXColorWheel extends View {     public RXColorWheel(Context context) {         super(context);     }      public RXColorWheel(Context context, @Nullable AttributeSet attrs) {         super(context, attrs);     }      public RXColorWheel(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {         super(context, attrs, defStyleAttr);     }      public RXColorWheel(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {         super(context, attrs, defStyleAttr, defStyleRes);     } }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0441\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0432 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435.<\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u0440\u0430\u043d\u043d\u0435\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438, \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0438\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u0441 \u0441\u0435\u0442\u0442\u0435\u0440\u0430\u043c\u0438 \u0434\u043b\u044f \u043d\u0438\u0445.<\/p>\n<pre><code class=\"java\">    public interface ColorChangeListener{          void onColorChanged(int color);          void firstDraw(int color);     }      public interface ButtonTouchListener{          void on_cPointerTouch();          void on_excPointerTouch();      }      public interface StepperListener{          void onStep();      }      private ColorChangeListener colorChangeListener;     private ButtonTouchListener buttonTouchListener;     private StepperListener     stepperListener;      public void setButtonTouchListener(@NonNull ButtonTouchListener listener){ buttonTouchListener = listener;}     public void setColorChangeListener(@NonNull ColorChangeListener listener){colorChangeListener = listener;}     public void setStepperListener(@NonNull StepperListener listener){ stepperListener = listener;}<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>View<\/code> \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u0430\u043a\u0435\u0442\u0430 android.graphics:<\/p>\n<ul>\n<li>\n<p>Paint &#8212; \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0446\u0432\u0435\u0442\u0430, \u0441\u0442\u0438\u043b\u0438 \u0438 \u043f\u0440\u043e\u0447\u0443\u044e \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u0445\u043e\u043b\u0441\u0442\u0435. \u0423 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043d, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0446\u0432\u0435\u0442, \u0441\u0442\u0438\u043b\u044c, \u0448\u0440\u0438\u0444\u0442, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>Canvas &#8212; \u044d\u0442\u0430 \u043d\u0430\u0448 \u0445\u043e\u043b\u0441\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0440\u0438\u0441\u0443\u0435\u043c.<\/p>\n<\/li>\n<li>\n<p>BitMap &#8212; \u043a\u043b\u0430\u0441\u0441, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u0440\u0430\u0441\u0442\u0440\u043e\u0432\u044b\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>Color &#8212; \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0446\u0432\u0435\u0442\u0430. \u0418\u0445 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 ARGB, \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u0430\u043d\u0430\u043b\u0430(Alpha, Red, Green, Blue).<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0441\u0435\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0445 \u0437\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0438 \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0445 \u0432 \u0441\u0435\u0431\u0435 \u043f\u0440\u043e\u0447\u0443\u044e \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u041a\u043e\u0434 \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"java\">    private ColorChangeListener colorChangeListener;     private ButtonTouchListener buttonTouchListener;     private StepperListener     stepperListener;      \/\/ANTI_ALIAS_FLAG \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0430\u043d\u0442\u0438\u0430\u043b\u0438\u0430\u0441\u0438\u043d\u0433     private final Paint     p_color = new Paint(Paint.ANTI_ALIAS_FLAG); \/\/\u0426\u0432\u0435\u0442\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u044c\u0446\u043e     private final Paint     p_pointer = new Paint(Paint.ANTI_ALIAS_FLAG); \/\/\u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c     private final Paint     p_pStroke = new Paint(Paint.ANTI_ALIAS_FLAG); \/\/\u041e\u0431\u0432\u043e\u0434\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f     private final Paint     p_background = new Paint();\/\/\u0417\u0430\u0434\u043d\u0438\u0439 \u0444\u043e\u043d     private final Paint     p_pLine = new Paint(Paint.ANTI_ALIAS_FLAG); \/\/\u041b\u0438\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f     private final Paint     p_cPointer = new Paint(); \/\/\u0426\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c     private final Paint     p_excPointer = new Paint(); \/\/\u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c     private final Paint     p_placemarks = new Paint(); \/\/\u041c\u0435\u0442\u043a\u0438      private double          py, px; \/\/\u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f      private float           cx, cy; \/\/\u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b View     private float           color_rad; \/\/\u0420\u0430\u0434\u0438\u0443\u0441 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430     private float           color_rTh; \/\/\u0422\u043e\u043b\u0449\u0438\u043d\u0430 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430     private float           placemarks_rad; \/\/\u0420\u0430\u0434\u0438\u0443\u0441 \u043c\u0435\u0442\u043e\u043a     private float           cPointer_rad; \/\/\u0420\u0430\u0434\u0438\u0443\u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0446\u0432\u0435\u0442\u0430     private float           excPointer_rad; \/\/\u0420\u0430\u0434\u0438\u0443\u0441 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0446\u0432\u0435\u0442\u0430     private float           pointer_rad; \/\/\u0420\u0430\u0434\u0438\u0443\u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f     private float           background_rad; \/\/\u0420\u0430\u0434\u0438\u0443\u0441 \u0437\u0430\u0434\u043d\u0435\u0433\u043e \u0444\u043e\u043d\u0430     private float           badge_size; \/\/\u0420\u0430\u0437\u043c\u0435\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u043a\u043e\u043d\u043a\u0438     private float[]         degrees; \/\/\u041c\u0430\u0441\u0441\u0438\u0432, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0443\u0433\u043b\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u043a     private final float[] hsv = new float[] {0, 1f, 1f};        private int[]           color_palette; \/\/\u0425\u0440\u0430\u043d\u0438\u0442 \u043f\u0430\u043b\u0438\u0442\u0440\u0443 \u0446\u0432\u0435\u0442\u043e\u0432 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430     private int             color; \/\/\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0446\u0432\u0435\u0442, \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c      private int             minVsize; \/\/\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 View (\u043f\u043e \u0432\u044b\u0441\u043e\u0442\u0435 \u0438\u043b\u0438 \u0448\u0438\u0440\u0438\u043d\u0435)     private int             pCount; \/\/\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u043e\u043a      \/** \u0411\u0443\u043b\u0435\u0432\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. *\/     private boolean         isBackground;     private boolean         isExColorPointer;     private boolean         isColorPointerCustomColor;     private boolean         isPointerLine;     private boolean         isPlacemarks;     private boolean         isPlacemarksRound;     private boolean         isColorPointer;     private boolean         isBadge;     private boolean         isRoundBadge;     private boolean         isPointerOutline;     private boolean         isColorPointerShadow;     private boolean         isPointerCustomColor;     private boolean         isPointerShadow;     private boolean         isShadow;     private boolean         stepperMode;      private boolean firstDraw = true;      private Bitmap          mainImageBitmap; \/\/Bitmap \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0437\u043d\u0430\u0447\u043a\u0430     private TypedArray      typedArray; \/\/\u0425\u0440\u0430\u043d\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0447\u0430\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0438\u0437 XML \u0447\u0435\u0440\u0435\u0437 <code>TypedArray<\/code>.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u0441 XML \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438.<\/p>\n<p>\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>res\/values\/<\/code> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b attr.xml<\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?> &lt;resources>     &lt;declare-styleable name=\"RXColorWheel\">         &lt;attr name=\"badge\" format=\"reference\" \/>         &lt;attr name=\"colorPointerRad\" format=\"float\" \/>         &lt;attr name=\"excPointerRad\" format=\"float\" \/>         &lt;attr name=\"backgroundRad\" format=\"float\" \/>         &lt;attr name=\"bgColor\" format=\"color\" \/>         &lt;attr name=\"pointerRad\" format=\"float\" \/>         &lt;attr name=\"badgeSize\" format=\"float\" \/>         &lt;attr name=\"colorRingRad\" format=\"float\" \/>         &lt;attr name=\"colorRingThickness\" format=\"float\" \/>         &lt;attr name=\"placemarksRad\" format=\"float\" \/>         &lt;attr<\/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-340090","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340090","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=340090"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340090\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=340090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=340090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=340090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}