{"id":325265,"date":"2021-06-21T21:00:22","date_gmt":"2021-06-21T21:00:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=325265"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=325265","title":{"rendered":"\u041e\u0441\u043d\u043e\u0432\u044b \u0442\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 Android"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cb4\/e66\/5f6\/cb4e665f604e6e32e52fc72b9db5bf67.png\" width=\"780\" height=\"439\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 Android. \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0435 \u0442\u0440\u0443\u0434\u043d\u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 \u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u0438\u0437\u0430\u0439\u043d\u0430, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0432\u043e\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0438 \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0446\u0432\u0435\u0442\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0425\u043e\u0440\u043e\u0448\u0435\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0442\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u043e \u0432\u0441\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 Compose, \u043f\u043b\u043e\u0445\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0442\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u0438 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u0442\u0438\u043b\u0435\u0439 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041d\u043e \u043a\u0430\u043a \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0442\u0438\u043b\u0435\u0439 \u0438 \u0442\u0435\u043c?<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0435\u0442 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 5 \u0447\u0430\u0441\u0442\u0435\u0439.<\/p>\n<ul>\n<li>\n<p>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0438\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0438\u043b\u044c \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u0442\u0435\u043c\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p>TextAppearance<\/p>\n<\/li>\n<\/ul>\n<p><strong>. &nbsp; &nbsp; &nbsp; . &nbsp; &nbsp; &nbsp; .<\/strong><\/p>\n<p><strong>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/strong><\/p>\n<p>\u0412\u0441\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430. \u0411\u0435\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0432 XML \u043d\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c. <em>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b <\/em>&#8212; \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>attrs.xml<\/code>. \u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u043a\u0430\u043a \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0442\u0435\u043c\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>android:layout_width<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0430 <code>colorPrimary<\/code> &#8212; \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c \u0442\u0435\u043c\u044b.<\/p>\n<p>\u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 XML \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u0438\u0431\u043e \u043f\u0443\u0442\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0442\u0435\u0433\u0435, \u043b\u0438\u0431\u043e \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>style<\/code> (\u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e \u043f\u043e\u0437\u0436\u0435).. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0444\u043e\u043d \u043a\u043d\u043e\u043f\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f <code>android:backgroundTint<\/code>.<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0444\u0438\u043a\u0441 android.<\/em><\/p>\n<pre><code class=\"kotlin\">&lt;Button     android:layout_width=\"wrap_content\"     android:layout_height=\"wrap_content\"     android:backgroundTint=\"@color\/red\" \/&gt;<\/code><\/pre>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0444\u043e\u043d \u043d\u0430 \u0431\u0435\u043b\u044b\u0439. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>android:backgroundTint<\/code> \u043d\u0430 \u0431\u0435\u043b\u044b\u0439.<\/p>\n<p>\u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u043a\u043d\u043e\u043f\u043a\u0443. \u041d\u043e \u043a\u0430\u043a \u0431\u044b\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u043d\u0430 \u0431\u0435\u043b\u044b\u0435? \u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f:<\/p>\n<ul>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0442\u0435\u043c\u044b \u0434\u043b\u044f <code>android:backgroundTint<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u044f \u043a\u043e \u0432\u0441\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0430\u043c<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p><strong><em>\u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u0442\u0435\u043c\u044b<\/em><\/strong><em> \u2014 \u044d\u0442\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0442\u0435\u043c\u044b.<\/em><\/p>\n<\/blockquote>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0442\u0435\u043c\u044b \u0434\u043b\u044f <code>android:backgroundTint<\/code>, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0442\u0435\u043c\u044b \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>myButtonBackground<\/code> \u0432 <code>attrs.xml<\/code>.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0442\u0435\u043c\u044b:<\/p>\n<pre><code>&lt;resources&gt;     &lt;attr name=\"myButtonBackground\" format=\"color\" \/&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u0422\u0438\u043f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u043b\u044f <code>format<\/code>. \u0424\u043e\u0440\u043c\u0430\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0434\u0430\u043d \u043a\u0430\u043a \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u0439 \u0438\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0442\u0438\u043f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,&nbsp;<\/p>\n<p><code>android:background format=\"reference|color\"<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0430\u043a \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 drawable-\u0440\u0435\u0441\u0443\u0440\u0441 (&#171;reference&#187;), \u0442\u0430\u043a \u0438 \u0446\u0432\u0435\u0442 (&#171;color&#187;).<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>myButtonBackground<\/code> \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0444\u043e\u043d\u0430 \u0432\u0430\u0448\u0435\u0439 \u043a\u043d\u043e\u043f\u043a\u0438. \u041d\u043e \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>myButtonBackground<\/code>. \u041e\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u043b\u0438\u0431\u043e \u0432 \u0442\u0435\u043c\u0435, \u043b\u0438\u0431\u043e \u0432 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0442\u0435\u043c\u044b:<\/p>\n<pre><code class=\"kotlin\">&lt;style name=\"Theme.MyApp\" parent=\"...\"&gt;     &lt;item name=\"myButtonBackground\"&gt;@color\/red&lt;\/item&gt; &lt;\/style&gt;<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0444\u043e\u043d\u0430 \u0432\u0430\u0448\u0438\u0445 \u043a\u043d\u043e\u043f\u043e\u043a.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0444\u043e\u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430:<\/p>\n<pre><code class=\"kotlin\">&lt;Button     android:layout_width=\"wrap_content\"     android:layout_height=\"wrap_content\"     android:backgroundTint=\"?attr\/myButtonBackground\" \/&gt;<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430, \u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0444\u043e\u043d \u0432\u0441\u0435\u0445 \u043a\u043d\u043e\u043f\u043e\u043a, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>?attr\/myButtonBackground<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u043e\u043d\u0430. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>?myButtonBackground<\/code> \u043a\u0430\u043a \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0432\u043c\u0435\u0441\u0442\u043e <code>?attr\/myButtonBackground<\/code>.<\/p>\n<p>\u041d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 <code>android:backgroundTint<\/code> \u043d\u0430 <code>myButtonBackground<\/code> \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0438\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0438\u043b\u044c \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0435\u0433\u043e \u043a\u043e \u0432\u0441\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0430\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0442\u0438\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<h3>\u0421\u0442\u0438\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/h3>\n<p>\u0417\u0430\u043c\u0435\u0447\u0430\u043b\u0438 \u043b\u0438 \u0432\u044b, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0435 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0444\u043e\u043d\u0430, \u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0444\u043e\u043d\u043e\u0432\u044b\u0439 drawable (\u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0439 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442)? \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Button (\u043a\u043d\u043e\u043f\u043a\u0430) \u0438\u043c\u0435\u0435\u0442 \u0441\u0442\u0438\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u0430\u043a \u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0438\u0434. <em>\u0421\u0442\u0438\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441\u0442\u0438\u043b\u044c \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<pre><code class=\"kotlin\">\/\/ Source code:  \/\/ https:\/\/android.googlesource.com\/platform\/frameworks\/base\/+\/master\/core\/java\/android\/widget\/Button.java public class Button extends TextView {   ...      public Button(Context context, AttributeSet attrs) {     this(context, attrs, com.android.internal.R.attr.buttonStyle);   }      public Button(Context context, AttributeSet attrs, int defStyleAttr) {     this(context, attrs, defStyleAttr, 0);   } }<\/code><\/pre>\n<p>\u0421\u0442\u0438\u043b\u044c \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0442\u0435\u043c\u044b <code>R.attr.buttonStyle<\/code>. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0438\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u0441\u0435\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u0432 \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0441\u0442\u0438\u043b\u044c \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043d\u0430\u0448\u0435\u0439 \u0442\u0435\u043c\u0435 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0444\u043e\u043d \u0431\u044b\u043b \u043a\u0440\u0430\u0441\u043d\u044b\u043c.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0442\u0438\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <code>buttonStyle<\/code>:<\/p>\n<pre><code class=\"kotlin\">&lt;resources xmlns:tools=\"http:\/\/schemas.android.com\/tools\"&gt;     &lt;!-- Base application theme. --&gt;     &lt;style name=\"Theme.StylesNThemes\" parent=\"Theme.AppCompat.DayNight.DarkActionBar\"&gt;       ...       &lt;item name=\"android:buttonStyle\"&gt;@style\/MyButton&lt;\/item&gt;     &lt;\/style&gt;      &lt;style name=\"MyButton\"&gt;       &lt;item name=\"android:background\"&gt;@color\/red&lt;\/item&gt;     &lt;\/style&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/582\/e3d\/920\/582e3d920e24e96fa244c11bc5a64fe4.png\" alt=\"\u041a\u043d\u043e\u043f\u043a\u0430 \u0441 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c\" title=\"\u041a\u043d\u043e\u043f\u043a\u0430 \u0441 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c\" width=\"238\" height=\"76\"><figcaption>\u041a\u043d\u043e\u043f\u043a\u0430 \u0441 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c<\/figcaption><\/figure>\n<p>\u0420\u0430\u0437\u0432\u0435 \u044d\u0442\u043e \u043d\u0435 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0441 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c? \u0422\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0441\u0442\u0438\u043b\u044c <code>MyButton<\/code> \u043d\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043d\u0438 \u043e\u0442 \u043a\u0430\u043a\u0438\u0445 \u0441\u0442\u0438\u043b\u0435\u0439. \u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0432\u0441\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0444\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0432\u043e\u0435\u043c \u0441\u0442\u0438\u043b\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043a\u0430\u043a \u0441\u0442\u0438\u043b\u044c \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 <code>AppCompat<\/code>.<\/p>\n<p>\u0421\u0442\u0438\u043b\u044c \u043a\u043d\u043e\u043f\u043e\u043a \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 <code>AppCompat<\/code>:<\/p>\n<pre><code class=\"kotlin\">&lt;style name=\"Widget.AppCompat.Button\" parent=\"Base.Widget.AppCompat.Button\"\/&gt;  &lt;style name=\"Base.Widget.AppCompat.Button\" parent=\"android:Widget\"&gt;     &lt;item name=\"android:background\"&gt;@drawable\/abc_btn_default_mtrl_shape&lt;\/item&gt;     &lt;item name=\"android:textAppearance\"&gt;?android:attr\/textAppearanceButton&lt;\/item&gt;     &lt;item name=\"android:minHeight\"&gt;48dip&lt;\/item&gt;     &lt;item name=\"android:minWidth\"&gt;88dip&lt;\/item&gt;     &lt;item name=\"android:focusable\"&gt;true&lt;\/item&gt;     &lt;item name=\"android:clickable\"&gt;true&lt;\/item&gt;     &lt;item name=\"android:gravity\"&gt;center_vertical|center_horizontal&lt;\/item&gt; &lt;\/style&gt;<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435, \u044d\u0442\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u0441\u0442\u0438\u043b\u0435\u043c \u0434\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u043a\u0430\u0436\u0435\u043c <code>Widget.AppCompat.Button<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u0441\u0442\u0438\u043b\u044f <code>MyButton<\/code> \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>background<\/code> \u043d\u0430 <code>backgroundTint<\/code>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0446\u0432\u0435\u0442, \u0430 \u043d\u0435 drawable-\u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438 <code>MyButton<\/code>:<\/p>\n<pre><code class=\"kotlin\">&lt;resources xmlns:tools=\"http:\/\/schemas.android.com\/tools\"&gt;     &lt;!-- Base application theme. --&gt;     &lt;style name=\"Theme.StylesNThemes\" parent=\"Theme.AppCompat.DayNight.DarkActionBar\"&gt;       ...       &lt;item name=\"android:buttonStyle\"&gt;@style\/MyButton&lt;\/item&gt;     &lt;\/style&gt;      &lt;style name=\"MyButton\" parent=\"Widget.AppCompat.Button\"&gt;       &lt;item name=\"android:backgroundTint\"&gt;@color\/red&lt;\/item&gt;     &lt;\/style&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u0441 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/37c\/3a1\/82f\/37c3a182fc6107bfe94f5289944c3ac0.png\" alt=\"\u041a\u043d\u043e\u043f\u043a\u0430 \u0441 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c\" title=\"\u041a\u043d\u043e\u043f\u043a\u0430 \u0441 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c\" width=\"323\" height=\"132\"><figcaption>\u041a\u043d\u043e\u043f\u043a\u0430 \u0441 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c<\/figcaption><\/figure>\n<h3>\u0421\u0442\u0438\u043b\u044c \u0438 \u0442\u0435\u043c\u0430<\/h3>\n<p>\u041c\u044b \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0438 \u043e \u0441\u0442\u0438\u043b\u0435 \u0438 \u0442\u0435\u043c\u0435, \u043d\u043e \u0432 \u0447\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438? <a href=\"https:\/\/developer.android.com\/guide\/topics\/ui\/look-and-feel\/themes\"><u>\u0418 \u0441\u0442\u0438\u043b\u044c, \u0438 \u0442\u0435\u043c\u0430 &#8212; \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432<\/u><\/a>, \u043d\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0432 \u043a\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f. \u0421\u0442\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c, \u0430 \u0442\u0435\u043c\u044b \u2014 \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c \u0438\u043b\u0438 \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0441\u0442\u0438\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0430 \u0442\u0435\u043c\u0430 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0442\u0435\u043c\u044b.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0438\u043b\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043a\u0435\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f <code>style<\/code> \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043a\u0435\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u043d \u043a\u043d\u043e\u043f\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043a\u0435\u0442\u0430.<\/p>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u043e\u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043a\u0435\u0442\u0430:<\/p>\n<pre><code class=\"kotlin\">&lt;Button     android:layout_width=\"wrap_content\"     android:layout_height=\"wrap_content\"     android:background=\"@drawable\/button_background\" \/&gt;<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u044c \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043a \u044d\u0442\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0435.<\/p>\n<p>\u0421\u0442\u0438\u043b\u044c \u043a\u043d\u043e\u043f\u043a\u0438 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0444\u043e\u043d\u043e\u0432\u044b\u043c drawable:<\/p>\n<pre><code class=\"kotlin\">&lt;resources&gt;    &lt;style name=\"MyButton\" parent=\"Widget.AppCompat.Button\"&gt;       &lt;item name=\"android:background\"&gt;@drawable\/button_background&lt;\/item&gt;     &lt;\/style&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u0434\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438:<\/p>\n<pre><code>&lt;Button     style=\"@style\/MyButton\"     android:layout_width=\"wrap_content\"     android:layout_height=\"wrap_content\" \/&gt;<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u0442\u0438\u043b\u044f \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e <em>\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/em>. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 <em>\u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0442\u0435\u043c\u044b<\/em> \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0438\u043b\u044f <code>MyButton<\/code>, \u044d\u0442\u043e \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0442\u0435\u043c\u044b <code>colorPrimary<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 drawable \u0444\u043e\u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>colorPrimary<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0438\u043b\u044f <code>MyButton<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0424\u043e\u043d\u043e\u0432\u044b\u0439 drawable, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>colorPrimary<\/code>:<\/p>\n<pre><code class=\"kotlin\">&lt;shape xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     android:shape=\"rectangle\"&gt;     &lt;corners android:radius=\"2dp\" \/&gt;     &lt;solid android:color=\"?colorPrimary\" \/&gt;     &lt;padding         android:bottom=\"4dp\"         android:left=\"8dp\"         android:right=\"8dp\"         android:top=\"4dp\" \/&gt; &lt;\/shape&gt;<\/code><\/pre>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0442\u0435\u043c\u044b <code>colorPrimary<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0438\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438:<\/p>\n<pre><code class=\"kotlin\">&lt;resources&gt;     &lt;style name=\"Theme.StylesNThemes\" parent=\"Theme.AppCompat.DayNight.DarkActionBar\"&gt;       &lt;item name=\"colorPrimary\"&gt;@color\/purple_500&lt;\/item&gt;     &lt;\/style&gt;      &lt;style name=\"MyButton\" parent=\"Widget.AppCompat.Button\"&gt;         &lt;item name=\"android:background\"&gt;@drawable\/button_background&lt;\/item&gt;         &lt;item name=\"android:textColor\"&gt;@color\/white&lt;\/item&gt;         &lt;!-- Setting a theme attribute inside the MyButton style --&gt;         &lt;item name=\"colorPrimary\"&gt;@color\/red&lt;\/item&gt;     &lt;\/style&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0446\u0432\u0435\u0442 \u043a\u0430\u043a \u043a\u0440\u0430\u0441\u043d\u044b\u0439, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u0441 \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u043c \u0444\u043e\u043d\u043e\u043c.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3b0\/fd0\/9df\/3b0fd09df8246b391d5647a8a4afd6c7.png\" alt=\"\u041a\u043d\u043e\u043f\u043a\u0430 \u0441 \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u043c \u0444\u043e\u043d\u043e\u043c\" title=\"\u041a\u043d\u043e\u043f\u043a\u0430 \u0441 \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u043c \u0444\u043e\u043d\u043e\u043c\" width=\"337\" height=\"159\"><figcaption>\u041a\u043d\u043e\u043f\u043a\u0430 \u0441 \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u043c \u0444\u043e\u043d\u043e\u043c<\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u0441\u0432\u043e\u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445; \u041a\u043d\u043e\u043f\u043a\u0430 (Button) \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e\u0431 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 colorPrimary, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u0432\u043e\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u043c\u0430\u043a\u0435\u0442\u0430 \u0438\u043b\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0441\u0442\u0438\u043b\u044f. \u0415\u0441\u043b\u0438 \u0441\u0442\u0438\u043b\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0442\u0435\u043c\u044b, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d.<\/p>\n<p>\u041a\u0430\u043a \u0436\u0435 \u0442\u043e\u0433\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0442\u0435\u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f? \u0417\u0434\u0435\u0441\u044c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 <em>\u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043c<\/em>.<\/p>\n<h4>\u041d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043c<\/h4>\n<p><em>\u041d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043c<\/em> \u2014 \u044d\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u043a\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0442\u0435\u043c\u044b \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439. \u041d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0435 \u0442\u0435\u043c\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041f\u0440\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u044b \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0432\u0430 \u0448\u0430\u0433\u0430:<\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u0442\u0438\u043b\u044c, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u0441\u0442\u0438\u043b\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u043c\u0430\u043a\u0435\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>android:theme<\/code> \u0438\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>ContextThemeWrapper<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0446\u0432\u0435\u0442 \u0444\u043e\u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0442\u0435\u043c\u044b <code>colorPrimary<\/code>. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u044c \u0434\u043b\u044f \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0437\u0430\u0434\u0430\u0434\u0438\u043c <code>colorPrimary<\/code>.<\/p>\n<p>\u041d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u044b \u0434\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438:<\/p>\n<pre><code class=\"xml\">&lt;!-- res\/values\/theme_overlays.xml --&gt; &lt;resources&gt;     &lt;style name=\"ThemeOverlay.StylesNThemes.Button.Red\" parent=\"\"&gt;       &lt;item name=\"colorPrimary\"&gt;@color\/red&lt;\/item&gt;     &lt;\/style&gt; &lt;\/resources&gt;<\/code><\/pre>\n<blockquote>\n<p><em>\u0423 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u044b \u043d\u0435\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/em><\/p>\n<\/blockquote>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043b\u0443\u0447\u0448\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u044c \u0441 <code>ThemeOverlay<\/code>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0430\u043a \u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0433\u0447\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0442\u0438\u043b\u0435\u0439. \u042d\u0442\u0430 \u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u0432 <a href=\"https:\/\/github.com\/material-components\/material-components-android\/blob\/master\/lib\/java\/com\/google\/android\/material\/theme\/res\/values\/themes_overlay.xml\"><u>Material Components<\/u><\/a> \u0438 <a href=\"https:\/\/github.com\/hjanetzek\/android-support-v7-appcompat\/blob\/master\/res\/values\/themes.xml#L64\"><u>AppCompat<\/u><\/a>.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u044d\u0442\u043e \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a \u043a\u043d\u043e\u043f\u043a\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043a\u0435\u0442\u0430.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <code>android:theme<\/code>:<\/p>\n<pre><code class=\"xml\">&lt;Button     android:theme=\"@style\/ThemeOverlay.StylesNThemes.Button.Red\"     android:layout_width=\"wrap_content\"     android:layout_height=\"wrap_content\" \/&gt;<\/code><\/pre>\n<p>\u0418\u043c\u0435\u0439\u0442\u0435 \u0432 \u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a \u0433\u0440\u0443\u043f\u043f\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, <a href=\"https:\/\/ataulm.com\/2019\/11\/09\/visualising-theme-overlays.html\"><u>\u043e\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043a\u043e \u0432\u0441\u0435\u043c \u0435\u0435 \u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c<\/u><\/a>. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0442\u0435\u043c\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043c\u043a\u0430 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a \u0433\u0440\u0443\u043f\u043f\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u044b \u043a \u0433\u0440\u0443\u043f\u043f\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439:<\/p>\n<pre><code class=\"xml\">&lt;!-- Every child of this LinearLayout will be using colorPrimary as red --&gt; &lt;LinearLayout     android:theme=\"@style\/ThemeOverlay.StylesNThemes.Button.Red\"     android:layout_width=\"wrap_content\"     android:layout_height=\"wrap_content\"&gt;     &lt;Button         android:layout_width=\"wrap_content\"         android:layout_height=\"wrap_content\"         android:text=\"I am red!\" \/&gt;     &lt;Button         android:layout_width=\"wrap_content\"         android:layout_height=\"wrap_content\"         android:text=\"I am red too!\" \/&gt; &lt;\/LinearLayout&gt;<\/code><\/pre>\n<p>\u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e, \u043e\u0431\u0435\u0440\u043d\u0443\u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>ContextThemeWrapper<\/code>.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>ContextThemeWrapper<\/code> \u0434\u043b\u044f \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u044b:<\/p>\n<pre><code class=\"kotlin\">class MyButton : MaterialButton {     constructor(         context: Context,         attrs: AttributeSet     ) : super(         \/\/ It will override the contexts theme with the values inside theme overlay.         ContextThemeWrapper(context, R.style.ThemeOverlay_StylesNThemes_Button_Red),         attrs     ) }<\/code><\/pre>\n<blockquote>\n<p><code>ContextThemeWrapper<\/code><em> \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 (\u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439)&nbsp; \u0441\u0432\u043e\u0435\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u043e\u0439.&nbsp;<\/em><\/p>\n<\/blockquote>\n<h4>TextAppearance<\/h4>\n<p><code>TextAppearance<\/code> &#8212; \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 <code>TextView<\/code>, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>textColor<\/code>, <code>textSize<\/code>, \u043d\u043e <strong>\u043d\u0435<\/strong> \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0432\u0438\u0434\u043e\u043c, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <code>maxLines<\/code> \u0438\u043b\u0438 <code>drawableTop<\/code> \u0438 \u0442.\u0434.).<\/p>\n<p><code>TextAppearance<\/code> \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <code>android:textAppearance<\/code> \u043d\u0430 <code>TextView<\/code>. \u0410\u0442\u0440\u0438\u0431\u0443\u0442 <code>android:textAppearance<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>style<\/code>. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438. <code>style<\/code> \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043d\u0430\u0434 <code>android:textAppearance<\/code>, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e <code>style<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0432\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0434 \u043e\u0431\u0449\u0438\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c, \u0437\u0430\u0447\u0435\u043c \u043e\u043d \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d, \u0432\u0435\u0434\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u0441\u0435 \u0432 <code>style<\/code>? \u041e\u0442\u0432\u0435\u0442 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 <code>TextViews<\/code>, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>style<\/code> \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 \u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043b\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u044f <code>TextAppearance.StylesNThemes.Header<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0432\u0438\u0434\u0430 \u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; &lt;resources&gt;     &lt;!-- You can also use TextAppearance as a parent but then you have to customize everything      to look like header. Since there is already a style for header in both Material and AppCompat      we just use one of them depending on the our applications base theme.--&gt;     &lt;style name=\"TextAppearance.StylesNThemes.Header\" parent=\"TextAppearance.MaterialComponents.Headline1\"&gt;         &lt;!-- If any attribute which is not supported by TextAppearance is set here,          it will not be picked by TextView (Assuming this style is set with android:textAppearance). --&gt;         &lt;item name=\"android:textSize\"&gt;120sp&lt;\/item&gt;     &lt;\/style&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>style<\/code> \u0434\u043b\u044f <code>TextView<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c \u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <code>android:textAppearance<\/code>, \u0441\u043e\u0437\u0434\u0430\u0432 \u0441\u0442\u0438\u043b\u044c.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0438\u043b\u044c \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430. <\/p>\n<p>\u041e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430:<\/p>\n<pre><code class=\"xml\">&lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"     android:layout_width=\"match_parent\"     android:layout_height=\"match_parent\"&gt;      &lt;TextView         android:layout_width=\"wrap_content\"         android:layout_height=\"wrap_content\"         android:text=\"Hello World!\"         android:textAppearance=\"@style\/TextAppearance.StylesNThemes.Header\"         app:layout_constraintBottom_toBottomOf=\"parent\"         app:layout_constraintLeft_toLeftOf=\"parent\"         app:layout_constraintRight_toRightOf=\"parent\"         app:layout_constraintTop_toTopOf=\"parent\" \/&gt;  &lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u0442\u0438\u043b\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 style \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u043a \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e:<\/p>\n<pre><code class=\"xml\">&lt;resources&gt;     &lt;style name=\"Widget.StylesNThemes.TextView.Header.SingleLine\" parent=\"Widget.MaterialComponents.TextView\"&gt;         &lt;item name=\"android:singleLine\"&gt;true&lt;\/item&gt;         &lt;!-- If we were not using text appearance then we had to set all attributes inside           TextAppearance.StylesNThemes.Header here --&gt;         &lt;item name=\"android:textAppearance\"&gt;@style\/TextAppearance.StylesNThemes.Header&lt;\/item&gt;     &lt;\/style&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u044b \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0432\u0438\u0434\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0441\u0442\u0438\u043b\u0435\u0439, \u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u0430\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/medium.com\/androiddevelopers\/whats-your-text-s-appearance-f3a1729192d\"><u>\u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e<\/u><\/a>.<\/p>\n<p><strong>. &nbsp; &nbsp; &nbsp; . &nbsp; &nbsp; &nbsp; .<\/strong><\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u043f\u043e\u043d\u044f\u0442\u0438\u0435\u043c \u0432 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0442\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0438\u0445 \u0441\u0442\u0438\u043b\u044f \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0442\u0435\u043c\u044b \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0410\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0438\u043b\u044c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0441\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0432\u0430\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442 \u0441\u0442\u0438\u043b\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0442\u0435\u043c\u044b, \u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438. \u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 \u0442\u0435\u043a\u0441\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0432\u0430\u043c \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <code>TextViews<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>android: textAppearance<\/code>, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>style<\/code> \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c.<\/p>\n<hr>\n<blockquote>\n<p>\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/tMcn\/\">&#171;Android Developer. Professional&#187;.<\/a> <\/p>\n<p>Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441 \u043e\u043f\u044b\u0442\u043e\u043c \u043e\u0442 3 \u043b\u0435\u0442 \u0438 \u0432\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 \u043e\u043d\u043b\u0430\u0439\u043d-\u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432 <a href=\"https:\/\/otus.pw\/xiKU\/\">\u00ab\u041f\u043e\u043b\u043d\u044b\u0439 coverage. \u041f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u043c Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u044e\u043d\u0438\u0442\/\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438\/UI \u0442\u0435\u0441\u0442\u0430\u043c\u0438\u00bb<\/a>. <br \/>\u041d\u0430 \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u0435 \u043c\u044b:<br \/>&#8212; \u041d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0442\u044c android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u044e\u043d\u0438\u0442\/\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438\/UI \u0442\u0435\u0441\u0442\u0430\u043c\u0438.<br \/>&#8212; \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u0435\u0439\u0441\u044b: \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 suspend \u0444\u0443\u043d\u043a\u0446\u0438\u0439, RX \u0446\u0435\u043f\u043e\u0447\u0435\u043a.<br \/>&#8212; \u0418\u0437\u0443\u0447\u0438\u043c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432.<br \/>&#8212; \u041e\u0431\u0441\u0443\u0434\u0438\u043c best practices \u043f\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044e \u0442\u0435\u0441\u0442\u0430\u043c\u0438.  <\/p>\n<\/blockquote>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/563910\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/563910\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 Android. \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0435 \u0442\u0440\u0443\u0434\u043d\u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 \u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u0438\u0437\u0430\u0439\u043d\u0430, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0432\u043e\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0438 \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0446\u0432\u0435\u0442\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0425\u043e\u0440\u043e\u0448\u0435\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0442\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u043e \u0432\u0441\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 Compose, \u043f\u043b\u043e\u0445\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0442\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u0438 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u0442\u0438\u043b\u0435\u0439 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041d\u043e \u043a\u0430\u043a \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0442\u0438\u043b\u0435\u0439 \u0438 \u0442\u0435\u043c?<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0435\u0442 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 5 \u0447\u0430\u0441\u0442\u0435\u0439.<\/p>\n<ul>\n<li>\n<p>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0438\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0438\u043b\u044c \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u0442\u0435\u043c\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p>TextAppearance<\/p>\n<\/li>\n<\/ul>\n<p><strong>. &nbsp; &nbsp; &nbsp; . &nbsp; &nbsp; &nbsp; .<\/strong><\/p>\n<p><strong>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/strong><\/p>\n<p>\u0412\u0441\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430. \u0411\u0435\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0432 XML \u043d\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c. <em>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b <\/em>&#8212; \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>attrs.xml<\/code>. \u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u043a\u0430\u043a \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0442\u0435\u043c\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>android:layout_width<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0430 <code>colorPrimary<\/code> &#8212; \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c \u0442\u0435\u043c\u044b.<\/p>\n<p>\u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 XML \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u0438\u0431\u043e \u043f\u0443\u0442\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0442\u0435\u0433\u0435, \u043b\u0438\u0431\u043e \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>style<\/code> (\u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e \u043f\u043e\u0437\u0436\u0435).. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0444\u043e\u043d \u043a\u043d\u043e\u043f\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f <code>android:backgroundTint<\/code>.<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0444\u0438\u043a\u0441 android.<\/em><\/p>\n<pre><code class=\"kotlin\">&lt;Button     android:layout_width=\"wrap_content\"     android:layout_height=\"wrap_content\"     android:backgroundTint=\"@color\/red\" \/&gt;<\/code><\/pre>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0444\u043e\u043d \u043d\u0430 \u0431\u0435\u043b\u044b\u0439. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>android:backgroundTint<\/code> \u043d\u0430 \u0431\u0435\u043b\u044b\u0439.<\/p>\n<p>\u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u043a\u043d\u043e\u043f\u043a\u0443. \u041d\u043e \u043a\u0430\u043a \u0431\u044b\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u043d\u0430 \u0431\u0435\u043b\u044b\u0435? \u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f:<\/p>\n<ul>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0442\u0435\u043c\u044b \u0434\u043b\u044f <code>android:backgroundTint<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u044f \u043a\u043e \u0432\u0441\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0430\u043c<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p><strong><em>\u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u0442\u0435\u043c\u044b<\/em><\/strong><em> \u2014 \u044d\u0442\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0442\u0435\u043c\u044b.<\/em><\/p>\n<\/blockquote>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0442\u0435\u043c\u044b \u0434\u043b\u044f <code>android:backgroundTint<\/code>, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0442\u0435\u043c\u044b \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>myButtonBackground<\/code> \u0432 <code>attrs.xml<\/code>.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0442\u0435\u043c\u044b:<\/p>\n<pre><code>&lt;resources&gt;     &lt;attr name=\"myButtonBackground\" format=\"color\" \/&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u0422\u0438\u043f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u043b\u044f <code>format<\/code>. \u0424\u043e\u0440\u043c\u0430\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0434\u0430\u043d \u043a\u0430\u043a \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u0439 \u0438\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0442\u0438\u043f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,&nbsp;<\/p>\n<p><code>android:background format=\"reference|color\"<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0430\u043a \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 drawable-\u0440\u0435\u0441\u0443\u0440\u0441 (&#171;reference&#187;), \u0442\u0430\u043a \u0438 \u0446\u0432\u0435\u0442 (&#171;color&#187;).<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>myButtonBackground<\/code> \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0444\u043e\u043d\u0430 \u0432\u0430\u0448\u0435\u0439 \u043a\u043d\u043e\u043f\u043a\u0438. \u041d\u043e \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>myButtonBackground<\/code>. \u041e\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u043b\u0438\u0431\u043e \u0432 \u0442\u0435\u043c\u0435, \u043b\u0438\u0431\u043e \u0432 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0442\u0435\u043c\u044b:<\/p>\n<pre><code class=\"kotlin\">&lt;style name=\"Theme.MyApp\" parent=\"...\"&gt;     &lt;item name=\"myButtonBackground\"&gt;@color\/red&lt;\/item&gt; &lt;\/style&gt;<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0444\u043e\u043d\u0430 \u0432\u0430\u0448\u0438\u0445 \u043a\u043d\u043e\u043f\u043e\u043a.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0444\u043e\u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430:<\/p>\n<pre><code class=\"kotlin\">&lt;Button     android:layout_width=\"wrap_content\"     android:layout_height=\"wrap_content\"     android:backgroundTint=\"?attr\/myButtonBackground\" \/&gt;<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430, \u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0444\u043e\u043d \u0432\u0441\u0435\u0445 \u043a\u043d\u043e\u043f\u043e\u043a, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>?attr\/myButtonBackground<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u043e\u043d\u0430. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>?myButtonBackground<\/code> \u043a\u0430\u043a \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0432\u043c\u0435\u0441\u0442\u043e <code>?attr\/myButtonBackground<\/code>.<\/p>\n<p>\u041d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 <code>android:backgroundTint<\/code> \u043d\u0430 <code>myButtonBackground<\/code> \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0438\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0438\u043b\u044c \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0435\u0433\u043e \u043a\u043e \u0432\u0441\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0430\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0442\u0438\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<h3>\u0421\u0442\u0438\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/h3>\n<p>\u0417\u0430\u043c\u0435\u0447\u0430\u043b\u0438 \u043b\u0438 \u0432\u044b, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0435 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0444\u043e\u043d\u0430, \u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0444\u043e\u043d\u043e\u0432\u044b\u0439 drawable (\u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0439 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442)? \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Button (\u043a\u043d\u043e\u043f\u043a\u0430) \u0438\u043c\u0435\u0435\u0442 \u0441\u0442\u0438\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u0430\u043a \u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0438\u0434. <em>\u0421\u0442\u0438\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441\u0442\u0438\u043b\u044c \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<pre><code class=\"kotlin\">\/\/ Source code:  \/\/ https:\/\/android.googlesource.com\/platform\/frameworks\/base\/+\/master\/core\/java\/android\/widget\/Button.java public class Button extends TextView {   ...      public Button(Context context, AttributeSet attrs) {     this(context, attrs, com.android.internal.R.attr.buttonStyle);   }      public Button(Context context, AttributeSet attrs, int defStyleAttr) {     this(context, attrs, defStyleAttr, 0);   } }<\/code><\/pre>\n<p>\u0421\u0442\u0438\u043b\u044c \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0442\u0435\u043c\u044b <code>R.attr.buttonStyle<\/code>. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0438\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u0441\u0435\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u0432 \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0441\u0442\u0438\u043b\u044c \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043d\u0430\u0448\u0435\u0439 \u0442\u0435\u043c\u0435 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0444\u043e\u043d \u0431\u044b\u043b \u043a\u0440\u0430\u0441\u043d\u044b\u043c.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0442\u0438\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <code>buttonStyle<\/code>:<\/p>\n<pre><code class=\"kotlin\">&lt;resources xmlns:tools=\"http:\/\/schemas.android.com\/tools\"&gt;     &lt;!-- Base application theme. --&gt;     &lt;style name=\"Theme.StylesNThemes\" parent=\"Theme.AppCompat.DayNight.DarkActionBar\"&gt;       ...       &lt;item name=\"android:buttonStyle\"&gt;@style\/MyButton&lt;\/item&gt;     &lt;\/style&gt;      &lt;style name=\"MyButton\"&gt;       &lt;item name=\"android:background\"&gt;@color\/red&lt;\/item&gt;     &lt;\/style&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435.<\/p>\n<figure class=\"\"><figcaption>\u041a\u043d\u043e\u043f\u043a\u0430 \u0441 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c<\/figcaption><\/figure>\n<p>\u0420\u0430\u0437\u0432\u0435 \u044d\u0442\u043e \u043d\u0435 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0441 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c? \u0422\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0441\u0442\u0438\u043b\u044c <code>MyButton<\/code> \u043d\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043d\u0438 \u043e\u0442 \u043a\u0430\u043a\u0438\u0445 \u0441\u0442\u0438\u043b\u0435\u0439. \u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0432\u0441\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0444\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0432\u043e\u0435\u043c \u0441\u0442\u0438\u043b\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043a\u0430\u043a \u0441\u0442\u0438\u043b\u044c \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 <code>AppCompat<\/code>.<\/p>\n<p>\u0421\u0442\u0438\u043b\u044c \u043a\u043d\u043e\u043f\u043e\u043a \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 <code>AppCompat<\/code>:<\/p>\n<pre><code class=\"kotlin\">&lt;style name=\"Widget.AppCompat.Button\" parent=\"Base.Widget.AppCompat.Button\"\/&gt;  &lt;style name=\"Base.Widget.AppCompat.Button\" parent=\"android:Widget\"&gt;     &lt;item name=\"android:background\"&gt;@drawable\/abc_btn_default_mtrl_shape&lt;\/item&gt;     &lt;item name=\"android:textAppearance\"&gt;?android:attr\/textAppearanceButton&lt;\/item&gt;     &lt;item name=\"android:minHeight\"&gt;48dip&lt;\/item&gt;     &lt;item name=\"android:minWidth\"&gt;88dip&lt;\/item&gt;     &lt;item name=\"android:focusable\"&gt;true&lt;\/item&gt;     &lt;item name=\"android:clickable\"&gt;true&lt;\/item&gt;     &lt;item name=\"android:gravity\"&gt;center_vertical|center_horizontal&lt;\/item&gt; &lt;\/style&gt;<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435, \u044d\u0442\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u0441\u0442\u0438\u043b\u0435\u043c \u0434\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u043a\u0430\u0436\u0435\u043c <code>Widget.AppCompat.Button<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u0441\u0442\u0438\u043b\u044f <code>MyButton<\/code> \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>background<\/code> \u043d\u0430 <code>backgroundTint<\/code>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0446\u0432\u0435\u0442, \u0430 \u043d\u0435 drawable-\u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438 <code>MyButton<\/code>:<\/p>\n<pre><code class=\"kotlin\">&lt;resources xmlns:tools=\"http:\/\/schemas.android.com\/tools\"&gt;     &lt;!-- Base application theme. --&gt;     &lt;style name=\"Theme.StylesNThemes\" parent=\"Theme.AppCompat.DayNight.DarkActionBar\"&gt;       ...       &lt;item name=\"android:buttonStyle\"&gt;@style\/MyButton&lt;\/item&gt;     &lt;\/style&gt;      &lt;style name=\"MyButton\" parent=\"Widget.AppCompat.Button\"&gt;       &lt;item name=\"android:backgroundTint\"&gt;@color\/red&lt;\/item&gt;     &lt;\/style&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u0441 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c.<\/p>\n<figure class=\"\"><figcaption>\u041a\u043d\u043e\u043f\u043a\u0430 \u0441 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c<\/figcaption><\/figure>\n<h3>\u0421\u0442\u0438\u043b\u044c \u0438 \u0442\u0435\u043c\u0430<\/h3>\n<p>\u041c\u044b \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0438 \u043e \u0441\u0442\u0438\u043b\u0435 \u0438 \u0442\u0435\u043c\u0435, \u043d\u043e \u0432 \u0447\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438? <a href=\"https:\/\/developer.android.com\/guide\/topics\/ui\/look-and-feel\/themes\"><u>\u0418 \u0441\u0442\u0438\u043b\u044c, \u0438 \u0442\u0435\u043c\u0430 &#8212; \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432<\/u><\/a>, \u043d\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0432 \u043a\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f. \u0421\u0442\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c, \u0430 \u0442\u0435\u043c\u044b \u2014 \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c \u0438\u043b\u0438 \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0441\u0442\u0438\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0430 \u0442\u0435\u043c\u0430 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0442\u0435\u043c\u044b.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0438\u043b\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043a\u0435\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f <code>style<\/code> \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043a\u0435\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u043d \u043a\u043d\u043e\u043f\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043a\u0435\u0442\u0430.<\/p>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u043e\u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043a\u0435\u0442\u0430:<\/p>\n<pre><code class=\"kotlin\">&lt;Button     android:layout_width=\"wrap_content\"     android:layout_height=\"wrap_content\"     android:background=\"@drawable\/button_background\" \/&gt;<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u044c \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043a \u044d\u0442\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0435.<\/p>\n<p>\u0421\u0442\u0438\u043b\u044c \u043a\u043d\u043e\u043f\u043a\u0438 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0444\u043e\u043d\u043e\u0432\u044b\u043c drawable:<\/p>\n<pre><code class=\"kotlin\">&lt;resources&gt;    &lt;style name=\"MyButton\" parent=\"Widget.AppCompat.Button\"&gt;       &lt;item name=\"android:background\"&gt;@drawable\/button_background&lt;\/item&gt;     &lt;\/style&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u0434\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438:<\/p>\n<pre><code>&lt;Button     style=\"@style\/MyButton\"     android:layout_width=\"wrap_content\"     android:layout_height=\"wrap_content\" \/&gt;<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u0442\u0438\u043b\u044f \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e <em>\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/em>. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 <em>\u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0442\u0435\u043c\u044b<\/em> \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0438\u043b\u044f <code>MyButton<\/code>, \u044d\u0442\u043e \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0442\u0435\u043c\u044b <code>colorPrimary<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 drawable \u0444\u043e\u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>colorPrimary<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0438\u043b\u044f <code>MyButton<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0424\u043e\u043d\u043e\u0432\u044b\u0439 drawable, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>colorPrimary<\/code>:<\/p>\n<pre><code class=\"kotlin\">&lt;shape xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     android:shape=\"rectangle\"&gt;     &lt;corners android:radius=\"2dp\" \/&gt;     &lt;solid android:color=\"?colorPrimary\" \/&gt;     &lt;padding         android:bottom=\"4dp\"         android:left=\"8dp\"         android:right=\"8dp\"         android:top=\"4dp\" \/&gt; &lt;\/shape&gt;<\/code><\/pre>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0442\u0435\u043c\u044b <code>colorPrimary<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0438\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438:<\/p>\n<pre><code class=\"kotlin\">&lt;resources&gt;     &lt;style name=\"Theme.StylesNThemes\" parent=\"Theme.AppCompat.DayNight.DarkActionBar\"&gt;       &lt;item name=\"colorPrimary\"&gt;@color\/purple_500&lt;\/item&gt;     &lt;\/style&gt;      &lt;style name=\"MyButton\" parent=\"Widget.AppCompat.Button\"&gt;         &lt;item name=\"android:background\"&gt;@drawable\/button_background&lt;\/item&gt;         &lt;item name=\"android:textColor\"&gt;@color\/white&lt;\/item&gt;         &lt;!-- Setting a theme attribute inside the MyButton style --&gt;         &lt;item name=\"colorPrimary\"&gt;@color\/red&lt;\/item&gt;     &lt;\/style&gt; &lt;\/resources&gt;<\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0446\u0432\u0435\u0442 \u043a\u0430\u043a \u043a\u0440\u0430\u0441\u043d\u044b\u0439, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u0441 \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u043c \u0444\u043e\u043d\u043e\u043c.<\/p>\n<figure class=\"\"><figcaption>\u041a\u043d\u043e\u043f\u043a\u0430 \u0441 \u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u043c \u0444\u043e\u043d\u043e\u043c<\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e<\/p>\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-325265","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325265","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=325265"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325265\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=325265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=325265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=325265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}