{"id":290798,"date":"2018-10-15T12:30:02","date_gmt":"2018-10-15T08:30:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=290798"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=290798","title":{"rendered":"\u041a\u0430\u043a \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043b\u043b\u0430\u043f\u0441\u0438\u0440\u0443\u044e\u0449\u0438\u0439 Toolbar"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zh\/b7\/ww\/zhb7wwgfsojnv97m_13bam0hkqs.gif\"><\/p>\n<p>  \u0425\u043e\u0447\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c CollapsingToolbar, \u0441 \u0430\u043a\u0446\u0435\u043d\u0442\u043e\u043c \u043d\u0430 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 CoordinatorLayout.Behavior. \u0415\u0441\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0435\u0439, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 <a href=\"https:\/\/habr.com\/post\/270121\/\">\u043d\u0430 \u0445\u0430\u0431\u0440\u0435<\/a>. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u2014 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e: \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 CollapsingToolbar \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 CoordinatorLayout.Behavior \u0438 OnOffsetChangedListener.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0422\u0435\u0440\u043c\u0438\u043d\u044b<\/h4>\n<p>  <\/p>\n<ul>\n<li>\u0422\u0443\u043b\u0431\u0430\u0440 \u2014 \u043d\u0430\u0431\u043e\u0440 \u0432\u044c\u044e\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0442\u0438\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0432\u0432\u0435\u0440\u0445\u0443 \u044d\u043a\u0440\u0430\u043d\u0430 (\u043d\u0435 android.widget.Toolbar).<\/li>\n<li>NestedScroll \u2014 \u043b\u044e\u0431\u0430\u044f \u0441\u043a\u0440\u043e\u043b\u043b\u044f\u0449\u0430\u044f\u0441\u044f \u0432\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0441 AppBarLayout (RecyclerView, NestedScrollView).<\/li>\n<\/ul>\n<p>  <\/p>\n<h3>\u0417\u0430\u0447\u0435\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u042f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0432 \u00ab\u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\u0445\u00bb, \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u0431\u044b\u043b\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<ol>\n<li>\u0417\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u044b\u0441\u043e\u0442\u0430 \u0434\u043b\u044f AppBarLayout.<\/li>\n<li>\u041f\u0438\u0448\u0435\u0442\u0441\u044f CoordinatorLayout.Behavior, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u0430\u043a\u0438\u043c\u0438-\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c\u0438 (\u0437\u0430\u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u044b\u0441\u043e\u0442\u0430 view \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 bottom \u0434\u0440\u0443\u0433\u043e\u0433\u043e view \u0438 \u0437\u0430 \u0432\u044b\u0447\u0435\u0442\u043e\u043c margin \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0441\u043a\u0440\u043e\u043b\u043b, \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u0437\u0434\u0435\u0441\u044c \u0436\u0435) \u043c\u0435\u043d\u044f\u044e\u0442 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0432\u044c\u044e.<\/li>\n<li>\u0414\u0440\u0443\u0433\u0438\u0435 \u0432\u044c\u044e \u043c\u0435\u043d\u044f\u044e\u0442 \u0432 OnOffsetChangedListener AppBarLayout-\u0430.<\/li>\n<\/ol>\n<p>  \u0412\u043e\u0442 <a href=\"https:\/\/github.com\/saulmm\/CoordinatorBehaviorExample\">\u043f\u0440\u0438\u043c\u0435\u0440 Behavior<\/a> \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c, 2.5\u043a \u0437\u0432\u0435\u0437\u0434 \u043d\u0430 \u0413\u0438\u0442\u0445\u0430\u0431\u0435.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0436\u0438\u0434\u0430\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/7q\/vv\/7e\/7qvv7emfjzhrkn_shib-a0pivxu.gif\"><\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c: \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043d\u0430 \u0441\u0432\u043e\u0439 OnePlus<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fo\/zu\/po\/fozupokp5sgdcbkr2l_5rloo2ts.jpeg\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mu\/ml\/x_\/mumlx_drddgvoi4oirojwsrmqsk.jpeg\"><\/div>\n<\/div>\n<p>  \u041f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0442\u043a\u0443 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u043c\u0435\u043d\u044f \u0441\u043c\u0443\u0449\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0435. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044c\u044e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 OnOffsetChangedListener, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u2014 \u0447\u0435\u0440\u0435\u0437 Behavior, \u0447\u0442\u043e-\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u0432\u0441\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u0435\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0443 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0438 \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0439 \u0432\u044c\u044e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 Behavior-\u043e\u0432 \u0438 \u043e\u0442 \u0432\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0432 OnOffsetChangedListener, \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0440\u0430\u0441\u0442\u0438 \u043a\u043e\u0441\u0442\u044b\u043b\u0438 \u0438 \u0431\u0430\u0433\u0438 \u043d\u0430 \u0440\u043e\u0432\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u0431\u044b\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432 \u0442\u0443\u043b\u0431\u0430\u0440 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0432\u044b\u0441\u043e\u0442\u0443 \u044d\u0442\u043e\u0433\u043e \u0442\u0443\u043b\u0430\u0431\u0430\u0440\u0430.<\/p>\n<p>  \u0412 \u0433\u0438\u0444\u043a\u0435 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0438\u0434\u043d\u043e, \u043a\u0430\u043a \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f TextView \u2014 \u0438 NestedScroll \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0448\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e \u043f\u0443\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430).  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0433\u0438\u0444\u043a\u0430 \u0435\u0449\u0435 \u0440\u0430\u0437<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zh\/b7\/ww\/zhb7wwgfsojnv97m_13bam0hkqs.gif\"><\/div>\n<\/div>\n<p>  \u041a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c? \u0420\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0432\u044b\u043c\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043d\u0430 \u0443\u043c, \u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d CoordinatorLayout.Behavior \u0434\u043b\u044f NestedScroll (\u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0432 \u043b\u043e\u0433\u0438\u043a\u0443 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e AppBarLayout.Behavior) \u0438\u043b\u0438 \u0437\u0430\u0441\u0443\u043d\u0443\u0442\u044c \u0442\u0443\u043b\u0431\u0430\u0440 \u0432 AppBarLayout \u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u043d\u0430 OnOffsetChangedListener. \u042f \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043e\u0431\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0441\u044f \u0437\u0430\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0434\u0435\u0442\u0430\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0443-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. <\/p>\n<p>  \u0411\u0443\u0434\u0443 \u0440\u0430\u0434, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c, \u0433\u0434\u0435 \u0442\u0430\u043a\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u00ab\u0447\u0438\u0441\u0442\u043e\u00bb, \u0430 \u043f\u043e\u043a\u0430 \u043f\u043e\u043a\u0430\u0436\u0443 \u0441\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0418\u0434\u0435\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c <b>\u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435<\/b>, \u043a\u0430\u043a\u0438\u0435 \u0432\u044c\u044e\u0445\u0438 \u0438 \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0435\u0431\u044f \u0432\u0435\u0441\u0442\u0438.<\/p>\n<h3>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0430\u043f\u0438<\/h3>\n<p>  \u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f CoordinatorLayout.Behavior \u043d\u0443\u0436\u043d\u043e:<\/p>\n<ul>\n<li>\u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c BehaviorByRules; <\/li>\n<li>\u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0435 AppBarLayout, CollapsingToolbarLayout \u0438 \u0434\u043b\u0438\u043d\u0443 \u0441\u043a\u0440\u043e\u043b\u043b\u0430 (\u0432\u044b\u0441\u043e\u0442\u0443 AppBarLayout).<\/li>\n<li>\u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 setUpViews \u2014 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043a\u0430\u043a \u0432\u044c\u044e \u0431\u0443\u0434\u0435\u0442 \u0441\u0435\u0431\u044f \u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u0438\u0438 \u043f\u0440\u043e\u0441\u043a\u0440\u043e\u043b\u043b\u0430 \u0430\u043f\u043f\u0411\u0430\u0440\u0430.<\/li>\n<\/ul>\n<p>  TopInfoBehavior \u0434\u043b\u044f \u0442\u0443\u043b\u0431\u0430\u0440\u0430 \u0438\u0437 \u0433\u0438\u0444\u043a\u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a (\u0434\u0430\u043b\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u044e, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442):  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">TopInfoBehavior.kt<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>class TopInfoBehavior(         context: Context?,         attrs: AttributeSet? ) : BehaviorByRules(context, attrs) {      override fun calcAppbarHeight(child: View): Int = with(child) {         return (height + pixels(R.dimen.toolbar_height)).toInt()     }      override fun View.provideAppbar(): AppBarLayout = ablAppbar     override fun View.provideCollapsingToolbar(): CollapsingToolbarLayout             = ctlToolbar      override fun View.setUpViews(): List&lt;RuledView&gt; = listOf(         RuledView(                 viewGroupTopDetails,                 BRuleYOffset(                     min = pixels(R.dimen.zero),                     max = pixels(R.dimen.toolbar_height)                 )         ),         RuledView(                 textViewTopDetails,                 BRuleAlpha(min = 0.6f, max = 1f),                 BRuleXOffset(                     min = 0f, max = pixels(R.dimen.big_margin),                     interpolator =                     ReverseInterpolator(AccelerateInterpolator())                 ),                 BRuleYOffset(                     min = pixels(R.dimen.zero), max = pixels(R.dimen.pad),                     interpolator = ReverseInterpolator(LinearInterpolator())                 ),                 BRuleAppear(0.1f),                 BRuleScale(min = 0.8f, max = 1f)         ),         RuledView(                 textViewPainIsTheArse,                 BRuleAppear(isAppearedUntil = GONE_VIEW_THRESHOLD)         ),         RuledView(                 textViewCollapsedTop,                 BRuleAppear(0.1f, true)         ),         RuledView(                 textViewTop,                 BRuleAppear(isAppearedUntil = GONE_VIEW_THRESHOLD)         ),         buildRuleForIcon(ivTop, LinearInterpolator()),         buildRuleForIcon(ivTop2, AccelerateInterpolator(0.7f)),         buildRuleForIcon(ivTop3, AccelerateInterpolator())     )      private fun View.buildRuleForIcon(             view: ImageView,             interpolator: Interpolator     ) = RuledView(         view,         BRuleYOffset(                 min = -(ivTop3.y - tvCollapsedTop.y),                 max = 0f,                 interpolator = DecelerateInterpolator(1.5f)         ),         BRuleXOffset(                 min = 0f,                 max = tvCollapsedTop.width.toFloat() + pixels(R.dimen.huge_margin),                 interpolator = ReverseInterpolator(interpolator)         )     )      companion object {         const val GONE_VIEW_THRESHOLD = 0.8f     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u043c\u0430\u043a\u0435\u0442 Xml (\u0443\u0434\u0430\u043b\u0438\u043b \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0434\u043b\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438)<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;android.support.design.widget.CoordinatorLayout&gt;      &lt;android.support.design.widget.AppBarLayout         android:layout_height=\"wrap_content\"&gt;          &lt;android.support.design.widget.CollapsingToolbarLayout             app:layout_scrollFlags=\"scroll|exitUntilCollapsed\"&gt;              &lt;android.support.v7.widget.Toolbar                 android:layout_height=\"@dimen\/toolbar_height\"                 app:layout_collapseMode=\"pin\"\/&gt;          &lt;\/android.support.design.widget.CollapsingToolbarLayout&gt;      &lt;\/android.support.design.widget.AppBarLayout&gt;      &lt;!--\u0432\u0435\u0441\u044c \u0442\u0443\u043b\u0431\u0430\u0440 \u0437\u0434\u0435\u0441\u044c--&gt;     &lt;RelativeLayout          android:translationZ=\"5dp\"         app:layout_behavior=\"TopInfoBehavior\"\/&gt;      &lt;android.support.v4.widget.NestedScrollView         app:layout_behavior=\"@string\/appbar_scrolling_view_behavior\"&gt;     &lt;\/android.support.v4.widget.NestedScrollView&gt;      &lt;android.support.design.widget.FloatingActionButton         app:layout_anchor=\"@id\/nesteScroll\"         app:layout_anchorGravity=\"right\"\/&gt;  &lt;\/android.support.design.widget.CoordinatorLayout&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h3>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043f\u0440\u0430\u0432\u0438\u043b: <\/p>\n<pre><code>interface BehaviorRule {     \/**      * @param view to be changed      * @param details view's data when first attached      * @param ratio in range [0, 1]; 0 when toolbar is collapsed      *\/     fun manage(ratio: Float, details: InitialViewDetails, view: View) } <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0435 \u044f\u0441\u043d\u043e \u2014 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 float-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442 0 \u0434\u043e 1, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0435\u0435 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u043f\u0440\u043e\u0441\u043a\u0440\u043e\u043b\u043b\u0430 ActionBar, \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432\u044c\u044e \u0438 \u0435\u0435 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0435\u0439\u0442. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 BaseBehaviorRule \u2014 \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430.<\/p>\n<pre><code>abstract class BaseBehaviorRule : BehaviorRule {     abstract val interpolator: Interpolator     abstract val min: Number     abstract val max: Number      final override fun manage(             ratio: Float,              details: InitialViewDetails,             view: View     ) {         perform(interpolator.getInterpolation(ratio), details, view)     }      abstract fun perform(ratio: Float, details: InitialViewDetails, view: View) } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0430\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (min, max) \u0438 interpolator. \u042d\u0442\u043e\u0433\u043e \u0445\u0432\u0430\u0442\u0438\u0442 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. <\/p>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u0434\u0430\u0442\u044c \u0430\u043b\u044c\u0444\u0443 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u044c\u044e \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 0.5 \u0434\u043e 0.9. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u043a\u0440\u043e\u043b\u043b\u0430 \u0432\u044c\u044e \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0439, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043f\u0430\u0434\u0430\u043b\u0430.<br \/>  \u041f\u0440\u0430\u0432\u0438\u043b\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code>BRuleAlpha(min = 0.5f, max = 0.9f, interpolator = DecelerateInterpolator())<\/code><\/pre>\n<p>  \u0410 \u0432\u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f BRuleAlpha:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">BRuleAlpha.kt<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>\/**  * [min], [max] \u2014 values in range [0, 1]  *\/ class BRuleAlpha(         override val min: Float,         override val max: Float,         override val interpolator: Interpolator = LinearInterpolator() ) : BaseBehaviorRule() {     override fun perform(ratio: Float, details: InitialViewDetails, view: View) = with(view) {         this.alpha = normalize(oldValue = ratio, newMin = min, newMax = max)     } }  \/**  * Affine transform value form one range into another  *\/ fun normalize(         oldValue: Float,         newMin: Float, newMax: Float,         oldMin: Float = 0f, oldMax: Float = 1f ): Float = newMin + ((oldValue - oldMin) * (newMax - newMin)) \/ (oldMax - oldMin) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043a\u043e\u0434 BehaviorByRules. \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u043f\u0438\u0441\u0430\u043b \u0441\u0432\u043e\u0439 Behavior, \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e (\u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 onMeasureChild, \u043e\u0431 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043d\u0438\u0436\u0435):  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">BehaviorByRules.kt<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>abstract class BehaviorByRules(         context: Context?,         attrs: AttributeSet? ) : CoordinatorLayout.Behavior&lt;View&gt;(context, attrs) {      private var views: List&lt;RuledView&gt; = emptyList()     private var lastChildHeight = -1     private var needToUpdateHeight: Boolean = true      override fun layoutDependsOn(             parent: CoordinatorLayout,             child: View,             dependency: View     ): Boolean {         return dependency is AppBarLayout     }      override fun onDependentViewChanged(             parent: CoordinatorLayout,             child: View,             dependency: View     ): Boolean {         firstInit(child, dependency)         val progress = calcProgress(parent)         views.forEach { performRules(offsetView = it, percent = progress) }         return true     }      override fun onMeasureChild(             parent: CoordinatorLayout, child: View, parentWidthMeasureSpec: Int,             widthUsed: Int, parentHeightMeasureSpec: Int, heightUsed: Int     ): Boolean {          val canUpdateHeight = canUpdateHeight(calcProgress(parent))         if (canUpdateHeight) {             parent.post {                 val newChildHeight = child.height                 if (newChildHeight != lastChildHeight) {                     lastChildHeight = newChildHeight                     setUpAppbarHeight(child, parent)                 }             }         } else {             needToUpdateHeight = true         }         return super.onMeasureChild(                 parent, child, parentWidthMeasureSpec,                 widthUsed, parentHeightMeasureSpec, heightUsed         )     }      \/**      * If you use fitsSystemWindows=true in your coordinator layout,      * you will have to include statusBar height in the appbarHeight      *\/     protected abstract fun calcAppbarHeight(child: View): Int     protected abstract fun View.setUpViews(): List&lt;RuledView&gt;     protected abstract fun View.provideAppbar(): AppBarLayout     protected abstract fun View.provideCollapsingToolbar(): CollapsingToolbarLayout      \/**      * You man not want to update height, if height depends on views, that are currently invisible      *\/     protected open fun canUpdateHeight(progress: Float): Boolean = true      private fun calcProgress(parent: CoordinatorLayout): Float {         val appBar = parent.provideAppbar()         val scrollRange = appBar.totalScrollRange.toFloat()         val scrollY = Math.abs(appBar.y)         val scroll = 1 - scrollY \/ scrollRange         return when {             scroll.isNaN() -&gt; 1f             else -&gt; scroll         }     }      private fun setUpAppbarHeight(child: View, parent: ViewGroup) {         parent.provideCollapsingToolbar().setHeight(calcAppbarHeight(child))     }      private fun firstInit(child: View, dependency: View) {         if (needToUpdateHeight) {             setUpAppbarHeight(child, dependency as ViewGroup)             needToUpdateHeight = false         }          if (views.isEmpty()) {             views = child.setUpViews()         }     }      private fun performRules(offsetView: RuledView, percent: Float) {         val view = offsetView.view         val details = offsetView.details         offsetView.rules.forEach { rule -&gt;             rule.manage(percent, details, view)         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0430\u043a \u0447\u0442\u043e \u0442\u0430\u043c \u0441 onMeasureChild?<\/p>\n<p>  \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435: \u0435\u0441\u043b\u0438 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u0442\u0443\u043b\u0431\u0430\u0440\u0430 \u0438\u0441\u0447\u0435\u0437\u0430\u0435\u0442, NestedScroll \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u044a\u0435\u0445\u0430\u0442\u044c \u0432\u044b\u0448\u0435. \u0427\u0442\u043e\u0431\u044b \u043e\u043d \u043f\u043e\u0434\u044a\u0435\u0445\u0430\u043b \u0432\u044b\u0448\u0435, \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0432\u044b\u0441\u043e\u0442\u0443 CollapsingToolbarLayout. <br \/>  \u0415\u0441\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u2014 canUpdateHeight. \u041e\u043d \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0443 \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043b\u044c\u0437\u044f \u043c\u0435\u043d\u044f\u0442\u044c \u0432\u044b\u0441\u043e\u0442\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 view, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0432\u044b\u0441\u043e\u0442\u0430, \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043a\u0440\u044b\u0442\u0430. \u041d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u043e\u043a\u0440\u043e\u0435\u0442 \u0432\u0441\u0435 \u043a\u0435\u0439\u0441\u044b, \u043d\u043e \u0435\u0441\u043b\u0438 \u0443 \u043a\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0438\u0434\u0435\u0438, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435, \u2014 \u043e\u0442\u043f\u0438\u0448\u0438\u0442\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438\u043b\u0438 \u0432 \u043b\u0438\u0447\u043a\u0443.<\/p>\n<h3>\u0413\u0440\u0430\u0431\u043b\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 CollapsingToolbarLayout<\/h3>\n<p>  <\/p>\n<ul>\n<li>\u041c\u0435\u043d\u044f\u044f \u0432\u044c\u044e\u0445\u0438, \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c onLayout. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c layoutParams \u0438\u043b\u0438 textSize \u0432\u043d\u0443\u0442\u0440\u0438 BehaviorRule, \u0438\u043d\u0430\u0447\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u044f\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0442\u0443\u043b\u0431\u0430\u0440\u043e\u043c \u0447\u0435\u0440\u0435\u0437 OnOffsetChangedListener, onLayout \u0435\u0449\u0435 \u043e\u043f\u0430\u0441\u043d\u0435\u0435 \u2014 \u043c\u0435\u0442\u043e\u0434 onOffsetChanged \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0438\u0442\u044c\u0441\u044f \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e.<\/li>\n<li>CoordinatorLayout.Behavior \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0432\u044c\u044e (layoutDependsOn), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0443\u0439\u0442\u0438 \u0432 visibility GONE. \u041a\u043e\u0433\u0434\u0430 \u044d\u0442\u0430 \u0432\u044c\u044e \u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f \u0432\u043e View.VISIBLE, Behavior \u043d\u0435 \u0441\u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0442\u0443\u043b\u0431\u0430\u0440 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u043d\u0435 AppBarLayout, \u0442\u043e \u0447\u0442\u043e\u0431\u044b \u0435\u0433\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u043b \u0442\u0443\u043b\u0431\u0430\u0440, \u043d\u0443\u0436\u043d\u043e \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e ViewGroup \u0442\u0443\u043b\u0431\u0430\u0440\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 android:translationZ=\u00ab5dp\u00bb.<\/li>\n<\/ul>\n<h3>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <\/h3>\n<p>  \u0418\u043c\u0435\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0431\u0440\u043e\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 CollapsingToolbarLayout \u0441 \u043b\u043e\u0433\u0438\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0431\u0443\u0434\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c. \u0412\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u2014 CoordinatorLayout.Behavior. \u041a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/Liverm0r\/BehavioRule\">\u0433\u0438\u0442\u0445\u0430\u0431\u0435<\/a>.<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/426369\/\"> https:\/\/habr.com\/post\/426369\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zh\/b7\/ww\/zhb7wwgfsojnv97m_13bam0hkqs.gif\"><\/p>\n<p>  \u0425\u043e\u0447\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c CollapsingToolbar, \u0441 \u0430\u043a\u0446\u0435\u043d\u0442\u043e\u043c \u043d\u0430 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0438 \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 CoordinatorLayout.Behavior. \u0415\u0441\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0435\u0439, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 <a href=\"https:\/\/habr.com\/post\/270121\/\">\u043d\u0430 \u0445\u0430\u0431\u0440\u0435<\/a>. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u2014 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e: \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 CollapsingToolbar \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 CoordinatorLayout.Behavior \u0438 OnOffsetChangedListener.  <\/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-290798","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290798","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=290798"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290798\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=290798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=290798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=290798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}