{"id":267480,"date":"2015-11-04T16:24:02","date_gmt":"2015-11-04T13:24:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=267480"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=267480","title":{"rendered":"\u041e\u0432\u043b\u0430\u0434\u0435\u043d\u0438\u0435 Coordinator Layout"},"content":{"rendered":"<p>       \u041d\u0430 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/www.youtube.com\/watch?v=7V-fIGMDsmE\">Google I\/O 15<\/a>, \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Google \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430 <a href=\"http:\/\/android-developers.blogspot.com.es\/2015\/05\/android-design-support-library.html\">\u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438<\/a> \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u043e <a href=\"https:\/\/www.google.com\/design\/spec\/material-design\/introduction.html\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u043c\u0438 Material Design<\/a>, \u0441\u0440\u0435\u0434\u0438 \u044d\u0442\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043d\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b ViewGroup \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>AppbarLayout<\/code>, <code>CollapsingToolbarLayout<\/code> \u0438 <code>CoordinatorLayout<\/code>.<\/p>\n<p>  \u041f\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 Viewgroup \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0438 \u0441\u043e\u0432\u0435\u0442\u0430\u043c\u0438.<a name=\"habracut\"><\/a><\/p>\n<h1>CoordinatorLayout<\/h1>\n<p>  \u041a\u0430\u043a \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0435\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0446\u0435\u043b\u044c \u0438 \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044f \u044d\u0442\u043e\u0439 <code>ViewGroup<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <b>\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0446\u0438\u044f<\/b> view \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/6b2\/949\/7e7\/6b29497e7884c4bebc757a19cb187564.gif\" alt=\"image\"\/><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0436\u0435\u043c \u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u043a view \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b \u0434\u0440\u0443\u0433 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433\u0430, \u043d\u0435 \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u044f \u043a \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0443, \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043a\u0430\u043a \u043e\u0434\u043d\u0438 <code>View<\/code> <b>\u0437\u0430\u0432\u0438\u0441\u044f\u0442<\/b> \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445. (\u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435).<\/p>\n<p>  \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <code>CoordinatorLayout<\/code>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;  &lt;android.support.design.widget.CoordinatorLayout     xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     xmlns:app=&quot;http:\/\/schemas.android.com\/apk\/res-auto&quot;     android:layout_width=&quot;match_parent&quot;     android:layout_height=&quot;match_parent&quot;     android:background=&quot;@android:color\/background_light&quot;     android:fitsSystemWindows=&quot;true&quot;     &gt;      &lt;android.support.design.widget.AppBarLayout         android:id=&quot;@+id\/main.appbar&quot;         android:layout_width=&quot;match_parent&quot;         android:layout_height=&quot;300dp&quot;         android:theme=&quot;@style\/ThemeOverlay.AppCompat.Dark.ActionBar&quot;         android:fitsSystemWindows=&quot;true&quot;         &gt;          &lt;android.support.design.widget.CollapsingToolbarLayout             android:id=&quot;@+id\/main.collapsing&quot;             android:layout_width=&quot;match_parent&quot;             android:layout_height=&quot;match_parent&quot;             app:layout_scrollFlags=&quot;scroll|exitUntilCollapsed&quot;             android:fitsSystemWindows=&quot;true&quot;             app:contentScrim=&quot;?attr\/colorPrimary&quot;             app:expandedTitleMarginStart=&quot;48dp&quot;             app:expandedTitleMarginEnd=&quot;64dp&quot;             &gt;              &lt;ImageView                 android:id=&quot;@+id\/main.backdrop&quot;                 android:layout_width=&quot;match_parent&quot;                 android:layout_height=&quot;match_parent&quot;                 android:scaleType=&quot;centerCrop&quot;                 android:fitsSystemWindows=&quot;true&quot;                 android:src=&quot;@drawable\/material_flat&quot;                 app:layout_collapseMode=&quot;parallax&quot;                 \/&gt;              &lt;android.support.v7.widget.Toolbar                 android:id=&quot;@+id\/main.toolbar&quot;                 android:layout_width=&quot;match_parent&quot;                 android:layout_height=&quot;?attr\/actionBarSize&quot;                 app:popupTheme=&quot;@style\/ThemeOverlay.AppCompat.Light&quot;                 app:layout_collapseMode=&quot;pin&quot;                 \/&gt;         &lt;\/android.support.design.widget.CollapsingToolbarLayout&gt;     &lt;\/android.support.design.widget.AppBarLayout&gt;      &lt;android.support.v4.widget.NestedScrollView         android:layout_width=&quot;match_parent&quot;         android:layout_height=&quot;match_parent&quot;         app:layout_behavior=&quot;@string\/appbar_scrolling_view_behavior&quot;         &gt;          &lt;TextView             android:layout_width=&quot;match_parent&quot;             android:layout_height=&quot;wrap_content&quot;             android:textSize=&quot;20sp&quot;             android:lineSpacingExtra=&quot;8dp&quot;             android:text=&quot;@string\/lorem&quot;             android:padding=&quot;@dimen\/activity_horizontal_margin&quot;             \/&gt;     &lt;\/android.support.v4.widget.NestedScrollView&gt;      &lt;android.support.design.widget.FloatingActionButton         android:layout_height=&quot;wrap_content&quot;         android:layout_width=&quot;wrap_content&quot;         android:layout_margin=&quot;@dimen\/activity_horizontal_margin&quot;         android:src=&quot;@drawable\/ic_comment_24dp&quot;         app:layout_anchor=&quot;@id\/main.appbar&quot;         app:layout_anchorGravity=&quot;bottom|right|end&quot;         \/&gt; &lt;\/android.support.design.widget.CoordinatorLayout&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043a\u0435\u043b\u0435\u0442 \u0434\u0430\u043d\u043d\u043e\u0433\u043e layout. \u0423 \u044d\u0442\u043e\u0433\u043e <code>CoordinatorLayout<\/code> \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0438 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430: <code>AppbarLayout<\/code>, \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c\u044b\u0439 <code>view<\/code> \u0438 \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u043d\u044b\u0439 <code>FloatingActionBar<\/code>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;CoordinatorLayout&gt;     &lt;AppbarLayout\/&gt;     &lt;scrollableView\/&gt;     &lt;FloatingActionButton\/&gt; &lt;\/CoordinatorLayout&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h1>AppBarLayout<\/h1>\n<p>  \u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, <code>AppBarLayout<\/code> \u044d\u0442\u043e <code>LinearLayout<\/code> \u043d\u0430 \u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430\u0445, \u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e, \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0437\u0432\u0443\u0447\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430, \u043d\u043e \u043a\u0430\u043a, \u2014 \u00ab\u041b\u0443\u0447\u0448\u0435 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0435\u043c \u0441\u0442\u043e \u0440\u0430\u0437 \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c\u00bb, \u043a \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e .gif-\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/676\/37a\/4d7\/67637a4d747e458479b357c2d4684dc2.gif\" alt=\"image\"\/><\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>AppBarLayout<\/code> \u044d\u0442\u043e \u0441\u0438\u043d\u044f\u044f view, \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u0434 \u0438\u0441\u0447\u0435\u0437\u0430\u044e\u0449\u0438\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c, \u043e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <code>Toolbar<\/code>, <code>LinearLayout<\/code> \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u0438 \u043f\u043e\u0434\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u0438 <code>TabLayout<\/code> \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0432\u043a\u043b\u0430\u0434\u043a\u0430\u043c\u0438.<\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 <code>AppbarLayout<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432: <code>layout_scrollFlags<\/code>. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435: <code>scroll<\/code> \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0445 view, \u0435\u0441\u043b\u0438 \u0431\u044b \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0435 \u0431\u044b\u043b \u0443\u043a\u0430\u0437\u0430\u043d \u043d\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 <i>AppbarLayout<\/i>, \u043e\u043d \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0431\u044b \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u043c, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f <i>\u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u043c\u0443<\/i> \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0443 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0437\u0430\u0434\u0438 \u043d\u0435\u0433\u043e.<\/p>\n<p>  \u0421\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c: <code>snap<\/code>, \u043c\u044b \u0438\u0437\u0431\u0435\u0433\u0430\u0435\u043c \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 <i>\u043f\u043e\u043b\u0443-\u0430\u043d\u0438\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e-\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/i>, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0438\u043b\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 view.<\/p>\n<p>  <code>LinearLayout<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0438 \u043f\u043e\u0434\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d \u043f\u0440\u0438 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u0432\u0432\u0435\u0440\u0445, (<code>enterAlways<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435), \u0438 <code>TabLayout<\/code> \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u0438\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u043d\u0435\u0433\u043e \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0438 \u043e\u0434\u0438\u043d \u0444\u043b\u0430\u0433.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u043c\u043e\u0449\u044c <code>AppbarLayout<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043b\u0436\u043d\u044b\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0435\u0433\u043e \u0444\u043b\u0430\u0433\u0430\u043c\u0438 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 view.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;AppBarLayout&gt;     &lt;CollapsingToolbarLayout         app:layout_scrollFlags=&quot;scroll|snap&quot;         \/&gt;      &lt;Toolbar         app:layout_scrollFlags=&quot;scroll|snap&quot;         \/&gt;      &lt;LinearLayout         android:id=&quot;+id\/title_container&quot;         app:layout_scrollFlags=&quot;scroll|enterAlways&quot;         \/&gt;      &lt;TabLayout \/&gt; &lt;!-- no flags --&gt; &lt;\/AppBarLayout&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412\u0441\u0435 \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 <a href=\"https:\/\/developer.android.com\/intl\/es\/reference\/android\/support\/design\/widget\/AppBarLayout.LayoutParams.html#CONSTANTS\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Google Developers<\/a>. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Github \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<h1>\u0424\u043b\u0430\u0433\u0438 AppbarLayout<\/h1>\n<p>  <code>SCROLL_FLAG_ENTER_ALWAYS<\/code>: \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0444\u043b\u0430\u0433\u0430, view \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043d\u0438\u0437 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c\u044b\u0445 view.<br \/>  <code>SCROLL_FLAG_ENTER_ALWAYS_COLLAPSED<\/code>: \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u043b\u0430\u0433 \u0434\u043b\u044f &#8216;enterAlways&#8217;, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 view \u043a \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u043c\u0443, \u043f\u0440\u0438 \u0438\u0441\u0447\u0435\u0437\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u0432\u044b\u0441\u043e\u0442\u044b.<br \/>  <code>SCROLL_FLAG_EXIT_UNTIL_COLLAPSED<\/code>: \u041f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435, view \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0435\u043d \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0438\u0441\u0447\u0435\u0437\u043d\u0435\u0442.<br \/>  <code>SCROLL_FLAG_SCROLL<\/code>: \u042d\u043b\u0435\u043c\u0435\u043d\u0442 view \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438.<br \/>  <code>SCROLL_FLAG_SNAP<\/code>: \u0412 \u043a\u043e\u043d\u0446\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438, \u0435\u0441\u043b\u0438 view \u0432\u0438\u0434\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043a\u0440\u0443\u0447\u0435\u043d \u0434\u043e \u0435\u0433\u043e \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u043a\u0440\u0430\u044f.<\/p>\n<h1>CoordinatorLayout Behaviors<\/h1>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c Android Studio (&gt;= 1.4) \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u0430: <i>Scrolling Activity<\/i>, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u044f, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0438\u0435\u043c \u0438 \u0432\u043e\u0442 \u0447\u0442\u043e \u043c\u044b \u0432\u0438\u0434\u0438\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f1d\/b02\/4e2\/f1db024e294060fdbe1eb951d899146f.gif\" alt=\"image\"\/><\/p>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u0438 \u043c\u0430\u043a\u0435\u0442\u044b layout \u043d\u0438 java \u043a\u043b\u0430\u0441\u0441\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0435\u0433\u043e\u0441\u044f \u043a <i>\u043c\u0430\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e<\/i> \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u0440\u0438 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0435. \u041f\u043e\u0447\u0435\u043c\u0443?<\/p>\n<p>  \u041e\u0442\u0432\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 <code>FloatingActionButton<\/code>, \u0441 \u0442\u0435\u0445 \u043f\u043e\u0440 \u043a\u0430\u043a Android Studio v1.2 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 java \u0434\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>ctrl\/cmd + click<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">\/*  * Copyright (C) 2015 The Android Open Source Project  *  *  Floating action buttons are used for a  *  special type of promoted action.   *  They are distinguished by a circled icon   *  floating above the UI and have special motion behaviors   *  related to morphing, launching, and the transferring anchor point.  *   *  blah.. blah..   *\/ @CoordinatorLayout.DefaultBehavior(     FloatingActionButton.Behavior.class) public class FloatingActionButton extends ImageButton {     ...      public static class Behavior          extends CoordinatorLayout.Behavior&lt;FloatingActionButton&gt; {          private boolean updateFabVisibility(            CoordinatorLayout parent, AppBarLayout appBarLayout,             FloatingActionButton child {             if (a long condition) {                 \/\/ If the anchor's bottom is below the seam,                  \/\/ we'll animate our FAB out                 child.hide();             } else {                 \/\/ Else, we'll animate our FAB back in                 child.show();             }         }     }      ... } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0417\u0430 \u043c\u0430\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b\u0439 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 design library, \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>Behavior<\/code>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>CoordinatorLayout.Behavior&lt;FloatingAcctionButton&gt;<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0443, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c FAB \u0438\u043b\u0438 \u043d\u0435\u0442, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438?<\/p>\n<h1>SwipeDismissBehavior<\/h1>\n<p>  \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u0434, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432\u043d\u0443\u0442\u0440\u044c \u043f\u0430\u043a\u0435\u0442\u0430 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 <b>design support library<\/b>, \u0442\u043e \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u0439 \u043a\u043b\u0430\u0441 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c: <code>SwipeDismissBehavior<\/code>. \u0421 \u044d\u0442\u0438\u043c \u043d\u043e\u0432\u044b\u043c <code>Behavior<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>\u0441\u0432\u0430\u0439\u043f \u0434\u043b\u044f \u043e\u0442\u043c\u0435\u043d\u044b<\/i> \u0432 \u043d\u0430\u0448\u0438\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u0441 <code>CoordinatorLayout<\/code>:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/89b\/967\/6b8\/89b9676b88258c21bef1e48d430a247e.gif\" alt=\"image\"\/><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">@Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_swipe_behavior);     mCardView = (CardView) findViewById(R.id.swype_card);      final SwipeDismissBehavior&lt;CardView&gt; swipe          = new SwipeDismissBehavior();          swipe.setSwipeDirection(             SwipeDismissBehavior.SWIPE_DIRECTION_ANY);          swipe.setListener(             new SwipeDismissBehavior.OnDismissListener() {             @Override public void onDismiss(View view) {                 Toast.makeText(SwipeBehaviorExampleActivity.this,                     &quot;Card swiped !!&quot;, Toast.LENGTH_SHORT).show();             }              @Override              public void onDragStateChanged(int state) {}         });          LayoutParams coordinatorParams =              (LayoutParams) mCardView.getLayoutParams();          coordinatorParams.setBehavior(swipe);     } <\/code><\/pre>\n<\/div>\n<\/div>\n<h1>Custom Behaviors<\/h1>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f (<i>Behavior<\/i>) \u043d\u0435 \u0442\u0430\u043a \u0438 \u0441\u043b\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432: <b>child<\/b> \u0438 <b>dependency<\/b>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/2a3\/166\/4c7\/2a31664c798b8c0f3e3f6319586c1e21.png\" alt=\"image\"\/><\/p>\n<h1>Child \u0438 dependency<\/h1>\n<p>  <b>child<\/b> \u044d\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0441\u0438\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, <b>dependency<\/b> \u2014 \u0442\u043e\u0442 \u043a\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0442\u0440\u0438\u0433\u0435\u0440 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 <b>child<\/b> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440, <b>child<\/b> \u2014 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <i>ImageView<\/i>, \u0430 <i>dependency<\/i> \u044d\u0442\u043e <i>Toolbar<\/i>, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 <i>Toolbar<\/i> \u0434\u0432\u0438\u0436\u0435\u0442\u0441\u044f, <i>ImageView<\/i> \u0442\u043e\u0436\u0435 \u0434\u0432\u0438\u0436\u0435\u0442\u0441\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/1bf\/067\/d73\/1bf067d73d55c206be487deced9d7f39.gif\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u043a\u043e\u043d\u0446\u0435\u043f\u0442, \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0435\u0440\u0432\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442: <code>CoordinatorLayout.Behavior&lt;T&gt;<\/code>, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>T<\/code> \u0431\u0443\u0434\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 view, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043d\u0430\u043c \u0434\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0446\u0438\u0438, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <i>ImageView<\/i>, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:<\/p>\n<ul>\n<li> layoutDependsOn<\/li>\n<li> onDependentViewChanged<\/li>\n<\/ul>\n<p>  \u041c\u0435\u0442\u043e\u0434: <code>layoutDependsOn<\/code> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e-\u0442\u043e \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432 layout, \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c <code>true<\/code>, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 dependency, \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u043d\u0438\u0438 (\u0442.\u043a. <code>Toolbar<\/code> \u0431\u0443\u0434\u0435\u0442 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f), \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u043a \u043d\u0430\u0448\u0435\u043c\u0443 child \u043e\u0442\u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">@Override    public boolean layoutDependsOn(\u2028             CoordinatorLayout parent,        CircleImageView, child,        View dependency) {        return dependency instanceof Toolbar;    }  <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437 \u043a\u043e\u0433\u0434\u0430 <code>layoutDependsOn<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>true<\/code> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u0432\u0442\u043e\u0440\u043e\u0439 <code>onDependentViewChanged<\/code>. \u0412\u043e\u0442 \u0442\u0443\u0442-\u0442\u043e \u043c\u044b \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0438\u043b\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0435\u043c\u043e\u0441\u0442\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public boolean onDependentViewChanged(\u2028       CoordinatorLayout parent,        CircleImageView avatar,        View dependency) {\u2028        modifyAvatarDependingDependencyState(avatar, dependency);    }     private void modifyAvatarDependingDependencyState(     CircleImageView avatar, View dependency) {         \/\/  avatar.setY(dependency.getY());         \/\/  avatar.setBlahBlat(dependency.blah \/ blah);     }  <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u0432\u043c\u0435\u0441\u0442\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public static class AvatarImageBehavior     extends \u2028CoordinatorLayout.Behavior&lt;CircleImageView&gt; {     @Override    public boolean layoutDependsOn(\u2028     CoordinatorLayout parent,      CircleImageView, child,      View dependency) {         return dependency instanceof Toolbar;    } \u2028\u2028       public boolean onDependentViewChanged(\u2028           CoordinatorLayout parent,      CircleImageView avatar,      View dependency) {\u2028       modifyAvatarDependingDependencyState(avatar, dependency);    }    private void modifyAvatarDependingDependencyState(     CircleImageView avatar, View dependency) {         \/\/  avatar.setY(dependency.getY());         \/\/  avatar.setBlahBlah(dependency.blah \/ blah);     }     } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <b>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b<\/b><\/p>\n<p>  <a href=\"https:\/\/github.com\/saulmm\/CoordinatorBehaviorExample\">\u041f\u0440\u0438\u043c\u0435\u0440 Coordinator Behavior<\/a> \u2014 Github<br \/>   <a href=\"https:\/\/github.com\/saulmm\/CoordinatorExamples\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b Coordinator<\/a> \u2014 Github<br \/>   <a href=\"https:\/\/lab.getbase.com\/introduction-to-coordinator-layout-on-android\/\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 coordinator layout \u043d\u0430 Android<\/a> \u2014 Grzesiek Gajewski       <\/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=\"http:\/\/habrahabr.ru\/post\/270121\/\"> http:\/\/habrahabr.ru\/post\/270121\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041d\u0430 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/www.youtube.com\/watch?v=7V-fIGMDsmE\">Google I\/O 15<\/a>, \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Google \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430 <a href=\"http:\/\/android-developers.blogspot.com.es\/2015\/05\/android-design-support-library.html\">\u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438<\/a> \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u043e <a href=\"https:\/\/www.google.com\/design\/spec\/material-design\/introduction.html\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u043c\u0438 Material Design<\/a>, \u0441\u0440\u0435\u0434\u0438 \u044d\u0442\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043d\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b ViewGroup \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>AppbarLayout<\/code>, <code>CollapsingToolbarLayout<\/code> \u0438 <code>CoordinatorLayout<\/code>.<\/p>\n<p>  \u041f\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 Viewgroup \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0438 \u0441\u043e\u0432\u0435\u0442\u0430\u043c\u0438.<\/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-267480","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/267480","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=267480"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/267480\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=267480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=267480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=267480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}