{"id":309631,"date":"2020-09-08T15:00:16","date_gmt":"2020-09-08T15:00:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=309631"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=309631","title":{"rendered":"\u041f\u043e\u043b\u0438\u0440\u0443\u0435\u043c UI \u0432 Android: StateListAnimator"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/518278\/\"><b><i>\u041f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u0431\u0440! \u0412 \u043f\u0440\u0435\u0434\u0434\u0432\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/21urn\/\">\u00abAndroid Developer. Professional\u00bb<\/a> \u043c\u044b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.<\/i><\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/j9\/4a\/9t\/j94a9t1dxswnsnusgnmpyrix9gc.png\">  <\/p>\n<hr>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430\u0448\u0435\u0433\u043e Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u0442\u0440\u0430\u0442\u0438\u043c \u043e\u0442\u043d\u044e\u0434\u044c \u043d\u0435 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u2014 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c \u0432\u044c\u044e\u0445 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434. \u042f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043d\u0430\u0441 \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0441\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435. \u0418 \u044f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u0432 \u043a\u043e\u0440\u043d\u0435 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u0438 \u043e UI\/UX. \u042f \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044e \u00ab\u0431\u0443\u0434\u044c\u0442\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043e\u043c \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c UI\u00bb, \u043d\u043e \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u044f\u0437\u044b\u043a \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0438 \u0435\u0433\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438.<\/p>\n<p>  \u0420\u0430\u043d\u0435\u0435 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u044e \u043e \u0442\u0435\u043d\u044f\u0445 \u0432 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043c\u043d\u043e\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u043e\u0442\u0437\u044b\u0432\u043e\u0432. \u042f \u0445\u043e\u0447\u0443 \u043f\u043e\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u0442\u044c \u0432\u0441\u0435\u0445 \u0432\u0430\u0441. <a href=\"https:\/\/android.jlelse.eu\/mastering-shadows-in-android-e883ad2c9d5b\">\u00ab\u041e\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u0442\u0435\u043d\u0435\u0439 \u0432 Android\u00bb<\/a> \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e \u0432\u044b\u0441\u043e\u0442\u0435 (elevation) \u0438 \u0442\u0435\u043d\u0438 (shadow) \u0432 Android. \u0422\u0430\u043c \u0436\u0435 \u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u043a\u0430\u043a \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u043b \u0438\u043c\u0438 \u0441\u0432\u043e\u044e UI \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. (<a href=\"https:\/\/github.com\/iammert\/ScalingLayout\">Scaling Layout<\/a>).<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>StateListAnimator<\/b> \u0438 \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c, \u043a\u0430\u043a \u044f \u044d\u0442\u043e \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c.<a name=\"habracut\"><\/a><\/p>\n<h3>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h3>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0442\u0435\u043c\u044b:  <\/p>\n<ul>\n<li>\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f Drawable<\/li>\n<li><a href=\"http:\/\/\">StateListDrawable<\/a><\/li>\n<li><a href=\"https:\/\/developer.android.com\/guide\/topics\/graphics\/prop-animation.html\">\u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432<\/a><\/li>\n<li><a href=\"https:\/\/developer.android.com\/reference\/android\/animation\/StateListAnimator.html\">StateListAnimator<\/a><\/li>\n<li>ScalingLayout \u0441\u043e StateListAnimator<\/li>\n<\/ul>\n<h3>\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f Drawable<\/h3>\n<p>  \u0412 Android \u0435\u0441\u0442\u044c 17 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0434\u043b\u044f Drawable.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/b5\/q3\/tm\/b5q3tmgeybt-txj_ogmyt24hofu.png\"><\/p>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u044b \u0434\u0430\u0436\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445. \u042f \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>pressed<\/code>, <code>enabled<\/code>, <code>windows focused<\/code>, <code>checked<\/code> \u0438 \u0442. \u0434. \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043b\u044f drawable, \u0442\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 Android.<\/p>\n<p>  \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u044d\u0442\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430\u0448 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 <i>StateListDrawable<\/i>.<\/p>\n<h3>StateListDrawable<\/h3>\n<p>  \u042d\u0442\u043e, \u043f\u043e \u0441\u0443\u0442\u0438, \u0441\u043f\u0438\u0441\u043e\u043a drawable \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f StateListDrawable \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c XML-\u0444\u0430\u0439\u043b \u0432 \u043f\u0430\u043f\u043a\u0435 <code>res\/drawable<\/code>.<\/p>\n<pre><code class=\"xml\">&lt;item android:drawable=&quot;@drawable\/i&quot; android:state_pressed=&quot;true&quot;\/&gt;<\/code><\/pre>\n<p>  \u042d\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 (item). \u041e\u043d \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430. <i><b>Drawable<\/b><\/i> \u0438 <i><b>State<\/b><\/i>.<\/p>\n<pre><code class=\"xml\">&lt;selector&gt;    &lt;item        android:drawable=&quot;@drawable\/p&quot;        android:state_pressed=&quot;true&quot;\/&gt;    &lt;item        android:drawable=&quot;@drawable\/default&quot;\/&gt; &lt;\/selector&gt;<\/code><\/pre>\n<p>  \u042d\u0442\u043e StateListDrawable. \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 (state) \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b \u0440\u0430\u043d\u0435\u0435, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e <b>\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/b>.<\/p>\n<h3>\u041c\u043e\u0433\u0443 \u043b\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ShapeDrawable?<\/h3>\n<p>  \u0414\u0430. \u0412\u043c\u0435\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <i><b>android:drawable<\/b><\/i> \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a \u0441\u0432\u043e\u0435\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443. \u0412\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 <i><b>ShapeDrawable<\/b><\/i>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6m\/s_\/7k\/6ms_7kmgq1qseugkkx9vonscua8.gif\"><br \/>  <i>StateListDrawable<\/i><\/p>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c StateListDrawable \u0441 \u0443\u0440\u043e\u0432\u043d\u044f API 1. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043b\u044f StateListDrawable \u043d\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0443\u0440\u043e\u0432\u043d\u044f API.<\/p>\n<pre><code class=\"xml\">&lt;View    android:layout_width=&quot;50dp&quot;    android:layout_height=&quot;50dp&quot;    android:foreground=&quot;@drawable\/state_list_drawable&quot;    android:clickable=&quot;true&quot;\/&gt;<\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u044c\u044e \u0435\u0441\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u043d\u0435\u0433\u043e, \u0435\u0433\u043e \u0446\u0432\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d. \u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0442\u043f\u0443\u0441\u0442\u0438\u0442 \u0435\u0433\u043e, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438 \u0446\u0432\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<blockquote><p>\u041d\u043e \u043f\u043e\u0433\u043e\u0434\u0438\u0442\u0435 \u0441\u0435\u043a\u0443\u043d\u0434\u043e\u0447\u043a\u0443. <b><i>Clickable<\/i><\/b>? \u0417\u0430\u0447\u0435\u043c \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442? \u041d\u0430\u043c \u0447\u0442\u043e, \u0435\u0449\u0435 \u0438 \u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0443\u0436\u043d\u043e? \u0414\u0430. \u041d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0432\u044c\u044e. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u0432\u0440\u0435\u043c\u044f. \u041a\u043d\u043e\u043f\u043a\u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0431\u0435\u0437 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f clickable, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <i><b>clickable<\/b><\/i>. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c StateListDrawable \u0434\u043b\u044f View, ImageView, Custom View \u0438 \u0442. \u0434., \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i><b>clickable<\/b><\/i>.<\/p><\/blockquote>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/73\/ra\/-e\/73ra-ebsts_wdrtmlc8d8bnu2oo.gif\"><br \/>  <i>StateListDrawable<\/i><\/p>\n<p>  \u042f \u0434\u043e\u0431\u0430\u0432\u0438\u043b StateListDrawable \u0432 \u044d\u0442\u043e\u043c <a href=\"https:\/\/github.com\/iammert\/ScalingLayout\/commit\/58ebe38db74dee7f6c7c87f1694829e09604be7c\">\u043a\u043e\u043c\u043c\u0438\u0442\u0435<\/a>. \u041e\u043d \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043f\u0440\u0438\u0432\u0435\u043b \u0432\u044b\u0448\u0435. \u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u043b\u0435\u0439\u0430\u0443\u0442, \u043e\u043d \u043e\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u043b\u0443\u0447\u0448\u0438\u043c \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e StateListAnimator.<\/p>\n<h3>StateListAnimator<\/h3>\n<p>  \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442\u0435 FloatingActionButton, \u0435\u0433\u043e Z \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437-\u0437\u0430 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438. \u042d\u0442\u043e StateListAnimator \u0442\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u0430 \u043a\u0430\u0434\u0440\u043e\u043c. \u0423 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 StateListAnimator \u0432\u043d\u0443\u0442\u0440\u0438.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u044f\u0441\u043d\u0438\u043c \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 StackOverflow.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/n4\/yz\/g8\/n4yzg87n5xrcca9omroap7s-vga.png\"><\/p>\n<p>  (\u041a\u0430\u043a \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0446\u0443\/\u0442\u0435\u043d\u044c \u0441 \u043a\u043d\u043e\u043f\u043e\u043a lollipop).<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0443 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 StateListAnimator \u0432\u043d\u0443\u0442\u0440\u0438, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u043b\u044f \u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 null, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e (\u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e, \u043e\u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a.) \u0418 \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u0442\u0432\u0435\u0442 \u0437\u0432\u0443\u0447\u0438\u0442 \u043a\u0443\u0434\u0430 \u0431\u043e\u043b\u0435\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u043e.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ka\/ae\/bl\/kaaebljtijhpkd0ghbyavb3qfa0.png\">  <\/p>\n<blockquote><p><i>(Lollipop \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0443\u044e <code>stateListAnimator<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u0442\u0443 \u043a\u043d\u043e\u043f\u043e\u043a, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f \u0442\u0435\u043d\u0438.<\/p>\n<p>  \u0423\u0434\u0430\u043b\u0438\u0442\u0435 <code>stateListAnimator<\/code>, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0442\u0435\u043d\u0435\u0439.<\/p>\n<p>  \u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e:<\/p>\n<p>  <b>\u0412 \u043a\u043e\u0434\u0435:<\/b><\/p>\n<p>  button.setStateListAnimator(null);)<\/i><\/p><\/blockquote>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.092%;\"><iframe src=\"https:\/\/giphy.com\/embed\/xUySTD7evBn33BMq3K\" style=\"border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;\" allowfullscreen scrolling=\"no\" allow=\"encrypted-media\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  \u0418\u0442\u0430\u043a, \u0430 \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0433\u043e?<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c StateListAnimator, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c <b>\u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (property animation)<\/b>. \u042f <b>\u043d\u0435<\/b> \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u041d\u043e \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u043e\u0441\u043d\u043e\u0432\u044b.<\/p>\n<h3>\u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432<\/h3>\n<p>  \u0412\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435. X \u2014 \u044d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e.<\/p>\n<pre><code class=\"java\">class MyObject{      private int x;      public int getX() {        return x;    }      public void setX(int x) {        this.x = x;    } }<\/code><\/pre>\n<p>  <i>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 <b>property animation<\/b> \u2014 \u044d\u0442\u043e \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c <b>\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435<\/b>. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441 \u0442\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 <b>\u0442\u043e\u0433\u043e<\/b><b>, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043b\u0438 \u043e\u043d \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442<\/b>. \u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 (\u043f\u043e\u043b\u044f \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435) \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/n5\/pz\/d5\/n5pzd5r401sz9z09ueocbpiplco.png\"><\/p>\n<p>  X \u2014 \u044d\u0442\u043e <b>\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e<\/b>. \u0422 \u2014 <b>\u0432\u0440\u0435\u043c\u044f<\/b>. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e X \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0412 \u0446\u0435\u043b\u043e\u043c \u0442\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432. \u0412\u043c\u0435\u0441\u0442\u043e \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044c\u044e \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<p>  <b>ValueAnimator<\/b> \u2014 \u044d\u0442\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f ValueAnimator \u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432.<\/p>\n<p>  <b>ObjectAnimator<\/b> \u2014 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u043c <code>ValueAnimator<\/code>. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ObjectAnimator, \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u0432\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:<\/p>\n<ul>\n<li>\u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c <b>\u043e\u0431\u044a\u0435\u043a\u0442<\/b> (\u043b\u044e\u0431\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043a\u0430\u043a\u0438\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c).<\/li>\n<li>\u0412\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u043c ValueAnimator.<\/li>\n<li>\u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c <b>\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430<\/b> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/li>\n<\/ul>\n<p>  \u0418\u0442\u0430\u043a, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c <b>\u0432\u044c\u044e<\/b> (\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c), \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0432\u044c\u044e (\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 x, \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 y, rotation, translation \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443 \u0432\u044c\u044e \u0435\u0441\u0442\u044c \u0433\u0435\u0442\u0442\u0435\u0440\/\u0441\u0435\u0442\u0442\u0435\u0440), \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <b>ObjectAnimator<\/b>. \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 StateListAnimator.<\/p>\n<pre><code class=\"xml\">&lt;selector&gt;      &lt;item android:state_pressed=&quot;true&quot;&gt;       &lt;objectAnimator            android:duration=&quot;200&quot;            android:propertyName=&quot;translationZ&quot;            android:valueTo=&quot;6dp&quot;            android:valueType=&quot;floatType&quot; \/&gt;    &lt;\/item&gt;      &lt;item&gt;       &lt;objectAnimator            android:duration=&quot;200&quot;            android:propertyName=&quot;translationZ&quot;            android:valueTo=&quot;0dp&quot;            android:valueType=&quot;floatType&quot;\/&gt;    &lt;\/item&gt;   &lt;\/selector&gt;<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6n\/iu\/p7\/6niup7hage1halitqhxaigpqpga.png\"><br \/>  <i>\u041a\u043d\u043e\u043f\u043a\u0430 FAB \u0430\u043d\u0438\u043c\u0438\u0440\u0443\u0435\u0442 \u0441\u0432\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u00abtranslationZ\u00bb \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u0438 \u0440\u0430\u0437\u0436\u0430\u0442\u0438\u0438.<\/i><\/p>\n<p>  \u041a\u0430\u043a \u044f \u0441\u043a\u0430\u0437\u0430\u043b \u0440\u0430\u043d\u0435\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043d\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u044f \u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0430\u043d\u0438\u043c\u0430\u0442\u043e\u0440\u0435. \u041a\u0430\u0436\u0434\u044b\u0439 View \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e translationZ. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c <b>translationZ<\/b> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ObjectAnimator.<\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <code><code>&lt;<\/code>objectAnimator&gt;<\/code>-\u043e\u0432 \u0432 <code><code>&lt;<\/code>set&gt;<\/code>. \u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e View. <i>Scale X<\/i> \u0438 <i>Scale Y<\/i>.<\/p>\n<p>  \u0412\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442! \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u0410 \u0432\u043e\u0442 <a href=\"https:\/\/github.com\/iammert\/ScalingLayout\/commit\/d1906af5fdd45a823740842dd9c25a97b18cc8c3#diff-99440eb578ffa46f57b794eb48783a8d\">\u043a\u043e\u043c\u043c\u0438\u0442<\/a>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/da\/h0\/zl\/dah0zldc-qil_-byz6ktidt6x1s.gif\"><\/p>\n<p>  \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u0441\u0432\u043e\u0435\u043c <code>animator.xml<\/code>. \u0417\u0434\u0435\u0441\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 ObjectAnimator.<\/p>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435. \u042f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0435 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043e ValueAnimator \u0438 ObjectAnimator. \u042d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 API \u0434\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>  \u0423\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u0430\u043c \u043a\u043e\u0434\u0438\u043d\u0433\u0430!<br \/>  <a href=\"https:\/\/otus.pw\/21urn\/\"> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2a\/z8\/xk\/2az8xk2so48hq9b2ejyf3sjidzg.png\"><\/a><\/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\/518278\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/518278\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/518278\/\"><b><i>\u041f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u0431\u0440! \u0412 \u043f\u0440\u0435\u0434\u0434\u0432\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/21urn\/\">\u00abAndroid Developer. Professional\u00bb<\/a> \u043c\u044b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.<\/i><\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/j9\/4a\/9t\/j94a9t1dxswnsnusgnmpyrix9gc.png\">  <\/p>\n<hr>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430\u0448\u0435\u0433\u043e Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u0442\u0440\u0430\u0442\u0438\u043c \u043e\u0442\u043d\u044e\u0434\u044c \u043d\u0435 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u2014 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c \u0432\u044c\u044e\u0445 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434. \u042f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043d\u0430\u0441 \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0441\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435. \u0418 \u044f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u0432 \u043a\u043e\u0440\u043d\u0435 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u0438 \u043e UI\/UX. \u042f \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044e \u00ab\u0431\u0443\u0434\u044c\u0442\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043e\u043c \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c UI\u00bb, \u043d\u043e \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u044f\u0437\u044b\u043a \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0438 \u0435\u0433\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438.<\/p>\n<p>  \u0420\u0430\u043d\u0435\u0435 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u044e \u043e \u0442\u0435\u043d\u044f\u0445 \u0432 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043c\u043d\u043e\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u043e\u0442\u0437\u044b\u0432\u043e\u0432. \u042f \u0445\u043e\u0447\u0443 \u043f\u043e\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u0442\u044c \u0432\u0441\u0435\u0445 \u0432\u0430\u0441. <a href=\"https:\/\/android.jlelse.eu\/mastering-shadows-in-android-e883ad2c9d5b\">\u00ab\u041e\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u0442\u0435\u043d\u0435\u0439 \u0432 Android\u00bb<\/a> \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e \u0432\u044b\u0441\u043e\u0442\u0435 (elevation) \u0438 \u0442\u0435\u043d\u0438 (shadow) \u0432 Android. \u0422\u0430\u043c \u0436\u0435 \u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u043a\u0430\u043a \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u043b \u0438\u043c\u0438 \u0441\u0432\u043e\u044e UI \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. (<a href=\"https:\/\/github.com\/iammert\/ScalingLayout\">Scaling Layout<\/a>).<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>StateListAnimator<\/b> \u0438 \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c, \u043a\u0430\u043a \u044f \u044d\u0442\u043e \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-309631","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/309631","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=309631"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/309631\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=309631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=309631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=309631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}