{"id":274833,"date":"2016-02-24T11:57:02","date_gmt":"2016-02-24T08:57:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=274833"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=274833","title":{"rendered":"\u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0451 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CoordinatorLayout Behavior"},"content":{"rendered":"<p>       <i>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 Ian Lake <a href=\"https:\/\/medium.com\/google-developers\/intercepting-everything-with-coordinatorlayout-behaviors-8c6adc140c26#.s3anmcccm\">Intercepting everything with CoordinatorLayout Behaviors<\/a>.<\/i><\/p>\n<p>  \u0412\u044b \u043d\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0435\u0442\u0435\u0441\u044c \u0434\u0430\u043b\u0435\u043a\u043e \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 <a href=\"http:\/\/android-developers.blogspot.ru\/2015\/05\/android-design-support-library.html\">Android Design Support Library<\/a>, \u043d\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0432\u0448\u0438\u0441\u044c \u0441 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.html\">CoordinatorLayout<\/a>. \u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e View \u0438\u0437 Design Library \u0442\u0440\u0435\u0431\u0443\u044e\u0442 CoordinatorLayout. \u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443? \u0421\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 CoordinatorLayout \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u043c\u043d\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441 View, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 Android \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 FrameLayout. \u0422\u0430\u043a \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0432\u0441\u044f \u0435\u0433\u043e \u043c\u0430\u0433\u0438\u044f? \u0412\u043e\u0442 \u0433\u0434\u0435 \u043d\u0430 \u0441\u0446\u0435\u043d\u0443 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html\">CoordinatorLayout.Behavior<\/a>. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432 Behavior \u043a \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0439 View \u0443 CoordinatorLayout, \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0441\u0430\u043d\u0438\u044f, \u043e\u043a\u043e\u043d\u043d\u044b\u0435 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 (window insets), \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0438 \u043c\u0430\u043a\u0435\u0442\u0430 (measurement \u0438 layout), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0443. Design Library \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Behavior \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u043b\u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/b0c\/09c\/1e7\/b0c09c1e7fbb4a33adf7648f9dd7af1b.png\"\/><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Behavior<\/h4>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0442\u044c Behavior \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e: \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u043e\u0442 Behavior:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Behavior<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public class FancyBehavior&lt;V extends View&gt;     extends CoordinatorLayout.Behavior&lt;V&gt; {    \/**    * \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 FancyBehavior \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0434.    *\/   public FancyBehavior() {   }    \/**    * \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 FancyBehavior \u0447\u0435\u0440\u0435\u0437 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443.    *    * @param context The {@link Context}.    * @param attrs The {@link AttributeSet}.    *\/   public FancyBehavior(Context context, AttributeSet attrs) {     super(context, attrs);     \/\/ \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043b\u044e\u0431\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b     \/\/ \u0432 \u0438\u0434\u0435\u0430\u043b\u0435 \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c behavior_     \/\/ \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043a Behavior   } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 generic \u0442\u0438\u043f, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c FancyBehavior \u043a \u043b\u044e\u0431\u043e\u0439 View. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432\u0430\u0448 Behavior \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 View, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">public class FancyFrameLayoutBehavior     extends CoordinatorLayout.Behavior&lt;FancyFrameLayout&gt; <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u043f\u0430\u0441\u0442\u0438 \u0432\u0430\u0441 \u043e\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0432\u0430\u043c \u043f\u043e\u0434\u0442\u0438\u043f\u0443 View \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u2013 \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u0443\u0434\u043e\u0431\u043d\u043e.<\/p>\n<p>  \u0415\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#setTag%28android.view.View,%20java.lang.Object%29\">Behavior.setTag()<\/a>\/<a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html?#getTag%28android.view.View%29\">Behavior.getTag()<\/a>, \u0442\u0430\u043a \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 Behavior \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#onSaveInstanceState%28android.support.design.widget.CoordinatorLayout,%20V%29\">onSaveInstanceState()<\/a>\/<a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#onRestoreInstanceState(android.support.design.widget.CoordinatorLayout, V, android.os.Parcelable)\">onRestoreInstanceState()<\/a>. \u042f \u043f\u0440\u0438\u0437\u044b\u0432\u0430\u044e \u0432\u0430\u0441 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c Behavior \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u201c\u043b\u0451\u0433\u043a\u0438\u043c\u0438\u201d, \u043d\u043e \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c Behavior \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f.<\/p>\n<h4>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 Behavior<\/h4>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, Behavior \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0439 View \u0443 CoordinatorLayout. \u0415\u0441\u0442\u044c \u0442\u0440\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e: \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e, \u0432 XML \u0438\u043b\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438.<\/p>\n<h5>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 Behavior<\/h5>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043e Behavior \u043a\u0430\u043a \u043e \u0447\u0451\u043c-\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u043e\u043c \u043a \u043a\u0430\u0436\u0434\u043e\u0439 View \u0432\u043d\u0443\u0442\u0440\u0438 CoordinatorLayout, \u0432\u0430\u0441 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0443\u0434\u0438\u0432\u0438\u0442\u044c (\u0435\u0441\u043b\u0438 \u0432\u044b \u0447\u0438\u0442\u0430\u043b\u0438 <a href=\"https:\/\/medium.com\/google-developers\/layouts-attributes-and-you-9e5a4b4fe32c#.bsynkhkzd\">\u043d\u0430\u0448 \u043f\u043e\u0441\u0442 \u043e \u043c\u0430\u043a\u0435\u0442\u0430\u0445<\/a>) \u0442\u043e, \u0447\u0442\u043e <b>Behavior \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 LayoutParams \u043a\u0430\u0436\u0434\u043e\u0439 View<\/b> \u2013 \u0432\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 Behavior \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u0443 View \u0432\u043d\u0443\u0442\u0440\u0438 CoordinatorLayout, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0443 \u044d\u0442\u0438\u0445 View \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043f\u043e\u0434\u0442\u0438\u043f LayoutParams, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c Behavior.<\/p>\n<pre><code class=\"java\">FancyBehavior fancyBehavior = new FancyBehavior(); CoordinatorLayout.LayoutParams params =     (CoordinatorLayout.LayoutParams) yourView.getLayoutParams(); params.setBehavior(fancyBehavior); <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043f\u0443\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435. \u041a\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u0447\u0442\u043e-\u0442\u043e \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0434 \u2013 \u043d\u0435\u0442 \u043f\u0440\u0435\u0434\u0435\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c.<\/p>\n<h5>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 Behavior \u0447\u0435\u0440\u0435\u0437 XML<\/h5>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0451 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0434 \u2013 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0431\u0435\u0441\u043f\u043e\u0440\u044f\u0434\u043e\u043a. \u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 LayoutParams, \u0435\u0441\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 layout_ \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0451 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e <b>layout_behavior<\/b> \u0430\u0442\u0440\u0438\u0431\u0443\u0442:<\/p>\n<pre><code class=\"xml\">&lt;FrameLayout   android:layout_height=\u201dwrap_content\u201d   android:layout_width=\u201dmatch_parent\u201d   app:layout_behavior=\u201d.FancyBehavior\u201d \/&gt; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430, \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0437\u0432\u0430\u043d \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 <i>FancyBehavior(Context context, AttributeSet attrs)<\/i>. \u0417\u0430\u0442\u043e, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u043e\u043d\u0443\u0441\u0430, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438\u0445 \u0438\u0437 XML AttributeSet, \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 (\u0430 \u0432\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435) \u0434\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432\u0430\u0448\u0435\u0433\u043e Behavior \u0447\u0435\u0440\u0435\u0437 XML.<\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/b>: \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f layout_ \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043c\u0435\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <b>\u043f\u0440\u0435\u0444\u0438\u043a\u0441 behavior_<\/b> \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 Behavior. <\/p>\n<h5>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 Behavior<\/h5>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0435 \u0441\u0432\u043e\u044e View, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0443\u0436\u0435\u043d \u0441\u0432\u043e\u0439 Behavior (\u043a\u0430\u043a \u0431\u044b\u043b\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432 Design Library), \u0442\u043e\u0433\u0434\u0430 \u0432\u044b \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c Behavior \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0431\u0435\u0437 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0434 \u0438\u043b\u0438 XML. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e, \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e \u0441\u0432\u0435\u0440\u0445\u0443 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u0430\u0448\u0435\u0439 View:<\/p>\n<pre><code class=\"java\">@CoordinatorLayout.DefaultBehavior(FancyFrameLayoutBehavior.class) public class FancyFrameLayout extends FrameLayout { } <\/code><\/pre>\n<p>  \u0412\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u0430\u0448 Behavior \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430, \u0434\u0435\u043b\u0430\u044f \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c Behavior. \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u043b\u044e\u0431\u043e\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>layout_behavior<\/i> \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.DefaultBehavior.html\">DefaultBehavior<\/a>.<\/p>\n<h4>\u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u043a\u0430\u0441\u0430\u043d\u0438\u0439<\/h4>\n<p>  \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 Behavior, \u0432\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c. \u041e\u0434\u043d\u043e \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439 Behavior \u2013 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u043a\u0430\u0441\u0430\u043d\u0438\u0439.<\/p>\n<p>  \u0411\u0435\u0437 <i>CoordinatorLayout<\/i>, \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u043e\u0432\u043b\u0435\u043a\u0430\u043b\u043e \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u044b \u043a\u0430\u0436\u0434\u043e\u0439 ViewGroup, \u043a\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 <a href=\"https:\/\/developer.android.com\/training\/gestures\/viewgroup.html\">Managing Touch Events training<\/a>. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 <i>CoordinatorLayout<\/i>, \u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0441\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u0430 <a href=\"https:\/\/developer.android.com\/reference\/android\/view\/ViewGroup.html#onInterceptTouchEvent%28android.view.MotionEvent%29\">onInterceptTouchEvent()<\/a> \u043c\u0435\u0442\u043e\u0434\u0443 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#onInterceptTouchEvent%28android.support.design.widget.CoordinatorLayout,%20V,%20android.view.MotionEvent%29\">onInterceptTouchEvent()<\/a> \u0432\u0430\u0448\u0435\u0433\u043e Behavior, <b>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0432\u0430\u0448\u0435\u043c\u0443 Behavior \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0441\u0430\u043d\u0438\u044f<\/b>. \u0415\u0441\u043b\u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 <i>true<\/i>, \u0442\u043e \u0432\u0430\u0448 Behavior \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0432\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u0430\u0441\u0430\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#onTouchEvent%28android.support.design.widget.CoordinatorLayout,%20V,%20android.view.MotionEvent%29\">onTouchEvent()<\/a> \u2013 \u0432\u0441\u0451 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0442\u0430\u0439\u043d\u0435 \u043e\u0442 View. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0442\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/SwipeDismissBehavior.html\">SwipeDismissBehavior<\/a> \u0441 \u043b\u044e\u0431\u043e\u0439 View.<\/p>\n<p>  \u0415\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439, \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u043a\u0430\u0441\u0430\u043d\u0438\u0439 \u2013 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u043b\u044e\u0431\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#blocksInteractionBelow(android.support.design.widget.CoordinatorLayout, V)\">blocksInteractionBelow()<\/a> <i>true<\/i>. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u043a\u0430\u043a-\u0442\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043e (\u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u043b\u0438, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u043c\u0430\u043d\u043e) \u2013 \u0432\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b <i>blocksInteractionBelow()<\/i> \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#getScrimOpacity(android.support.design.widget.CoordinatorLayout, V)\">getScrimOpacity()<\/a>. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e\u0435 \u043d\u0443\u043b\u044e, \u0440\u0430\u0437\u043e\u043c \u0440\u0438\u0441\u0443\u0435\u043c \u0446\u0432\u0435\u0442 (<a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#getScrimColor(android.support.design.widget.CoordinatorLayout, V)\">getScrimColor()<\/a>, \u0447\u0451\u0440\u043d\u044b\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u043f\u043e\u0432\u0435\u0440\u0445 View \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043a\u0430\u0441\u0430\u043d\u0438\u0435\u043c. \u0423\u0434\u043e\u0431\u043d\u043e.<\/p>\n<h4>\u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u043e\u043a\u043e\u043d\u043d\u044b\u0445 \u0432\u0441\u0442\u0430\u0432\u043e\u043a<\/h4>\n<p>  \u0421\u043a\u0430\u0436\u0435\u043c, \u0432\u044b \u0447\u0438\u0442\u0430\u043b\u0438 \u0431\u043b\u043e\u0433 <a href=\"https:\/\/medium.com\/google-developers\/why-would-i-want-to-fitssystemwindows-4e26d9ce1eec\">Why would I want to fitsSystemWindows?<\/a>. \u0422\u0430\u043c \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b\u0438 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 <i>fitsSystemWindows<\/i>, \u043d\u043e \u0432\u0441\u0451 \u0441\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043a \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043e\u043a\u043e\u043d\u043d\u044b\u0445 \u0432\u0441\u0442\u0430\u0432\u043e\u043a (window insets), \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 \u043e\u043a\u043d\u0430\u043c\u0438 (\u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a status bar \u0438 navigation bar). Behavior \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u044f\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u044f \u0438 \u0442\u0443\u0442. \u0415\u0441\u043b\u0438 \u0432\u0430\u0448\u0430 View <i>fitsSystemWindows=\u201ctrue\u201d<\/i>, \u0442\u043e \u043b\u044e\u0431\u043e\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 Behavior \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#onApplyWindowInsets(android.support.design.widget.CoordinatorLayout, V, android.support.v4.view.WindowInsetsCompat)\">onApplyWindowInsets()<\/a>, \u0432 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0435 \u043d\u0430\u0434 \u0441\u0430\u043c\u043e\u0439 View.<\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/b>: \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0435\u0441\u043b\u0438 \u0432\u0430\u0448 Behavior \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u043a\u043e\u043d\u043d\u044b\u0435 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0446\u0435\u043b\u0438\u043a\u043e\u043c, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/v4\/view\/ViewCompat.html#dispatchApplyWindowInsets(android.view.View, android.support.v4.view.WindowInsetsCompat)\">ViewCompat.dispatchApplyWindowInsets()<\/a>, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u0432\u0441\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 View \u043f\u043e\u043b\u0443\u0447\u0430\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0432\u0438\u0434\u0435\u0442\u044c WindowInsets.<\/p>\n<h4>\u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 Measurement \u0438 Layout<\/h4>\n<p>  \u042d\u0442\u043e \u0434\u0432\u0430 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0432 \u0442\u043e\u043c, \u043a\u0430\u043a <a href=\"https:\/\/developer.android.com\/guide\/topics\/ui\/how-android-draws.html\">Android \u0440\u0438\u0441\u0443\u0435\u0442 View<\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b, \u0447\u0442\u043e Behavior, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a \u0432\u0441\u0435\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0442\u0430\u043a \u0436\u0435 \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u043c\u0430\u043a\u0435\u0442\u0430 \u043f\u0443\u0442\u0451\u043c \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#onMeasureChild%28android.support.design.widget.CoordinatorLayout,%20V,%20int,%20int,%20int,%20int%29\">onMeasureChild()<\/a> \u0438 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#onLayoutChild(android.support.design.widget.CoordinatorLayout, V, int)\">onLayoutChild() <\/a>.<\/p>\n<p>  \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u043b\u044e\u0431\u043e\u0439 generic ViewGroup \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a \u043d\u0435\u043c\u0443 maxWidth. \u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 <a href=\"https:\/\/gist.github.com\/ianhanniballake\/c33de76fcb255b7d7920#file-maxwidthbehavior-java\"> MaxWidthBehavior.java<\/a>.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 generic Behavior, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 View, \u0432\u0435\u0441\u044c\u043c\u0430 \u0443\u0434\u043e\u0431\u043d\u043e. \u041d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0436\u0438\u0437\u043d\u044c, \u043e\u0431\u0434\u0443\u043c\u0430\u0432 \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 Behavior \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u043d\u0435 \u0432\u0441\u0435 Behavior \u043f\u043e\u0433\u043e\u043b\u043e\u0432\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c generic!).<\/p>\n<h4>\u041f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 View<\/h4>\n<p>  \u0412\u0441\u0451 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432\u044b\u0448\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0434\u043d\u0443 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e View. \u041d\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0441\u0438\u043b\u0430 Behavior \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 View, \u0442\u043e \u0435\u0441\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u043d\u0430 View \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0432\u0430\u0448 Behavior \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0438 \u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439.<\/p>\n<p>  Behavior \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c View \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0434\u0432\u0443\u043c\u044f \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0443\u0442\u044f\u043c\u0438: \u043a\u043e\u0433\u0434\u0430 View \u0441\u0432\u044f\u0437\u0430\u043d\u0430 (anchor) \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 View (\u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u043c\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c) \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u044f\u0432\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0435 <i>true<\/i> \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#layoutDependsOn(android.support.design.widget.CoordinatorLayout, V, android.view.View)\">layoutDependsOn()<\/a>.<\/p>\n<p>  \u0421\u0432\u044f\u0437\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u0448\u0430 View \u0432\u043d\u0443\u0442\u0440\u0438 <i>CoordinatorLayout<\/i> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.LayoutParams.html#getAnchorId()\">layout_anchor<\/a> \u0430\u0442\u0440\u0438\u0431\u0443\u0442. \u042d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u0441\u043e\u0432\u043c\u0435\u0449\u0451\u043d\u043d\u044b\u0439 \u0441 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.LayoutParams.html#anchorGravity\">layout_anchorGravity<\/a>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 View \u0432\u043c\u0435\u0441\u0442\u0435. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0432\u044f\u0437\u0430\u0442\u044c <i>FloatingActionButton<\/i> \u0441 <i>AppBarLayout<\/i>, \u0442\u043e\u0433\u0434\u0430 <i>FloatingActionButton.Behavior<\/i> \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u044f\u0432\u043d\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u043f\u0440\u044f\u0442\u0430\u0442\u044c FAB, \u0435\u0441\u043b\u0438 <i>AppBarLayout<\/i> \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0435\u043d\u0430 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u044d\u043a\u0440\u0430\u043d\u0430.<\/p>\n<p>  \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432\u0430\u0448 <i>Behavior<\/i> \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u0430 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#onDependentViewRemoved(android.support.design.widget.CoordinatorLayout, V, android.view.View)\">onDependentViewRemoved()<\/a>, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430\u044f View \u0431\u044b\u043b\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430 \u0438 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#onDependentViewChanged(android.support.design.widget.CoordinatorLayout, V, android.view.View)\">onDependentViewChanged()<\/a>, \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437 \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430\u044f View \u0431\u044b\u043b\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0430 (\u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u043b\u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u044f).<\/p>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 Design Library \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0432\u044f\u0437\u043a\u0438 View \u0432\u043c\u0435\u0441\u0442\u0435. \u0412\u043e\u0437\u044c\u043c\u0438\u0442\u0435 \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 <i>FloatingActionButton<\/i> \u0438 <i>Snackbar<\/i>. <i>Behavior<\/i> \u0443 FAB \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432 <i>CoordinatorLayout<\/i> \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 <i>Snackbar<\/i>, \u0437\u0430\u0442\u0435\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <i>onDependentViewChanged()<\/i>, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442 FAB \u0432\u044b\u0448\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0442\u0438\u0435 <i>Snackbar<\/i>.<\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/b>: \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c, View \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0430 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 View, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435.<\/p>\n<h4>\u0412\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430<\/h4>\n<p>  \u041e, \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430. \u042f \u043b\u0438\u0448\u044c \u0441\u043b\u0435\u0433\u043a\u0430 \u043a\u043e\u0441\u043d\u0443\u0441\u044c \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u044b \u0432 \u043f\u043e\u0441\u0442\u0435. \u041d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0432 \u0432\u0438\u0434\u0443 \u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432\u0435\u0449\u0430\u0445:<\/p>\n<ol>\n<li> \u0412\u044b \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 View c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u043e\u0439. \u041a\u0430\u0436\u0434\u0430\u044f View \u0432\u043d\u0443\u0442\u0440\u0438 <i>CoordinatorLayout<\/i> \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438.<\/li>\n<li>\u0412\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0443 View \u0432\u043d\u0443\u0442\u0440\u0438 <i>CoordinatorLayout<\/i>, \u043d\u043e \u0438 \u0443 <b>\u043b\u044e\u0431\u043e\u0439<\/b> \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0439 View (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u201c\u0440\u0435\u0431\u0451\u043d\u043e\u043a\u201d \u201c\u0440\u0435\u0431\u0451\u043d\u043a\u0430\u201d \u201c\u0440\u0435\u0431\u0451\u043d\u043a\u0430\u201d \u0443 <i>CoordinatorLayout<\/i>).<\/li>\n<li>\u042f \u0431\u0443\u0434\u0443 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u043e\u0439, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u043e\u0434 \u043d\u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430 \u0438 \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430 (fling).<\/li>\n<\/ol>\n<p>  \u0421\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 \u043c\u0435\u0442\u043e\u0434\u0430 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#onStartNestedScroll(android.support.design.widget.CoordinatorLayout, V, android.view.View, android.view.View, int)\">onStartNestedScroll()<\/a>. \u0412\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0441\u0438 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 (\u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u043b\u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u2013 \u043c\u043e\u0436\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0443 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438) \u0438 <b>\u0434\u043e\u043b\u0436\u043d\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c <i>true<\/i>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438<\/b>.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0432\u044b \u0432\u0435\u0440\u043d\u0451\u0442\u0435 <i>true<\/i> \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <i>onStartNestedScroll()<\/i>, \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0434\u0432\u0430 \u044d\u0442\u0430\u043f\u0430:<\/p>\n<ul>\n<li><a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#onNestedPreScroll(android.support.design.widget.CoordinatorLayout, V, android.view.View, int, int, int[])\">onNestedPreScroll()<\/a> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <b>\u043f\u0435\u0440\u0435\u0434<\/b> \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c\u0430\u044f View \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0430\u0448\u0435\u043c\u0443 <i>Behavior<\/i> \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0438\u043b\u0438 \u0432\u0441\u044e \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0443 (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 int[] \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u2013 \u044d\u0442\u043e \u201c\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u201d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u0433\u0434\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043b Behavior). <\/li>\n<li><a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#onNestedScroll(android.support.design.widget.CoordinatorLayout, V, android.view.View, int, int, int, int)\">onNestedScroll()<\/a> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c\u0430\u044f View \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0435\u043d\u0430. \u0412\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e View \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0435\u043d\u0430 \u0438 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/li>\n<\/ul>\n<p>  \u0415\u0441\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 (\u043d\u043e \u043c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 pre-fling \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043b\u0438\u0431\u043e \u0432\u0441\u044e \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0443, \u043b\u0438\u0431\u043e \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u043e\u0432\u0441\u0435).<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f (\u043b\u0438\u0431\u043e \u0431\u044b\u0441\u0442\u0440\u0430\u044f) \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f, \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html#onStopNestedScroll(android.support.design.widget.CoordinatorLayout, V, android.view.View)\">onStopNestedScroll()<\/a>. \u042d\u0442\u043e \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <i>onStartNestedScroll()<\/i> \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043d\u0430\u0447\u043d\u0451\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430.<\/p>\n<p>  \u0412\u043e\u0437\u044c\u043c\u0438\u0442\u0435 \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u043f\u0440\u044f\u0442\u0430\u0442\u044c <i>FloatingActionButton<\/i>, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u043d\u0438\u0437 \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c FAB, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0432\u0435\u0440\u0445. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b <i>onStartNestedScroll()<\/i> \u0438 <i>onNestedScroll()<\/i>, \u043a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0432 <a href=\"https:\/\/github.com\/ianhanniballake\/cheesesquare\/blob\/scroll_aware_fab\/app\/src\/main\/java\/com\/support\/android\/designlibdemo\/ScrollAwareFABBehavior.java\">ScrollAwareFABBehavior<\/a>.<\/p>\n<h4>\u0418 \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b\u043e<\/h4>\n<p>  \u0415\u0441\u043b\u0438 \u043a\u0430\u0436\u0434\u0430\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0443 <i>Behavior<\/i> \u043b\u0438\u0448\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430, \u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u0432\u0441\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u2013 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u0433\u0438\u044f. \u042f \u043e\u0447\u0435\u043d\u044c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Design Library, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Chrome <i>Android SDK Search<\/i> \u0432\u0441\u0451 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0438\u0437 \u043c\u043e\u0438\u0445 \u043b\u044e\u0431\u0438\u043c\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0434\u043b\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 AOSP (Android Open Source Project). \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043f\u043e \u043f\u0443\u0442\u0438 <i>&lt;android-sdk&gt;\/extras\/android\/m2repository<\/i>.<\/p>\n<p>  \u0414\u0430\u0439\u0442\u0435 \u043c\u043d\u0435 \u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u044b \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 Behavior \u0445\u044d\u0448\u0442\u0435\u0433\u043e\u043c #BuildBetterApps.<\/p>\n<p>  \u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043a \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044e \u043d\u0430 <a href=\"https:\/\/plus.google.com\/+AndroidDevelopers\/posts\/WojFEkDdFNe\">Google+<\/a> \u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 <a href=\"https:\/\/plus.google.com\/collection\/sLR0p\">Android Development Patterns Collection<\/a> \u0434\u043b\u044f \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438!       <\/p>\n<div class=\"clear\"><\/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:\/\/habrahabr.ru\/post\/277813\/\"> https:\/\/habrahabr.ru\/post\/277813\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <i>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 Ian Lake <a href=\"https:\/\/medium.com\/google-developers\/intercepting-everything-with-coordinatorlayout-behaviors-8c6adc140c26#.s3anmcccm\">Intercepting everything with CoordinatorLayout Behaviors<\/a>.<\/i><\/p>\n<p>  \u0412\u044b \u043d\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0435\u0442\u0435\u0441\u044c \u0434\u0430\u043b\u0435\u043a\u043e \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 <a href=\"http:\/\/android-developers.blogspot.ru\/2015\/05\/android-design-support-library.html\">Android Design Support Library<\/a>, \u043d\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0432\u0448\u0438\u0441\u044c \u0441 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.html\">CoordinatorLayout<\/a>. \u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e View \u0438\u0437 Design Library \u0442\u0440\u0435\u0431\u0443\u044e\u0442 CoordinatorLayout. \u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443? \u0421\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 CoordinatorLayout \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u043c\u043d\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441 View, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 Android \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 FrameLayout. \u0422\u0430\u043a \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0432\u0441\u044f \u0435\u0433\u043e \u043c\u0430\u0433\u0438\u044f? \u0412\u043e\u0442 \u0433\u0434\u0435 \u043d\u0430 \u0441\u0446\u0435\u043d\u0443 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 <a href=\"https:\/\/developer.android.com\/reference\/android\/support\/design\/widget\/CoordinatorLayout.Behavior.html\">CoordinatorLayout.Behavior<\/a>. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432 Behavior \u043a \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0439 View \u0443 CoordinatorLayout, \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0441\u0430\u043d\u0438\u044f, \u043e\u043a\u043e\u043d\u043d\u044b\u0435 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 (window insets), \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0438 \u043c\u0430\u043a\u0435\u0442\u0430 (measurement \u0438 layout), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0443. Design Library \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Behavior \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u043b\u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/b0c\/09c\/1e7\/b0c09c1e7fbb4a33adf7648f9dd7af1b.png\"\/>  <\/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-274833","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274833","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=274833"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274833\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=274833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=274833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=274833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}