{"id":182750,"date":"2013-06-10T14:01:04","date_gmt":"2013-06-10T10:01:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=182750"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=182750","title":{"rendered":"<span class=\"post_title\">SlideStackView \u0438\u043b\u0438 extending ViewGroup \u0432 Android<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0417\u0430\u043d\u0438\u043c\u0430\u044f\u0441\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434 Android, \u043c\u044b \u0432 Mail.Ru \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0414\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0442\u044c \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0441\u0435, \u043a\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u0438 \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0443\u044e \u0438 \u0431\u044b\u0441\u0442\u0440\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043b\u0438\u0441\u044c. \u0423\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u043d\u043d\u0430\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u2013 \u044d\u0442\u043e \u0442\u043e, \u0437\u0430 \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043b\u0438\u0431\u043e \u043b\u044e\u0431\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043b\u0438\u0431\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0442\u044c \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0435 \u0443\u0441\u0438\u043b\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043e\u0431 \u043f\u043e\u043b.<\/p>\n<p>  <a name=\"habracut\"><\/a>\u0412 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u201csliding menu\u201d \u0435\u0449\u0435 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 ui \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0434\u043b\u044f Android. \u041f\u043e\u0441\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439 \u0432 usability lab \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u043c\u0435\u043d\u044e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043b\u0443\u0447\u0448\u0438\u0439 user experience.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0431\u043b\u0438\u0436\u0435 \u043a \u0434\u0435\u043b\u0443. \u0412\u043c\u0435\u0441\u0442\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0435\u043d\u044e, \u0433\u0434\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0441 \u043f\u0430\u043f\u043a\u0430\u043c\u0438 \u0438 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430\u043c\u0438 \u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u043e \u0441\u0432\u0430\u0439\u043f\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0438\u0441\u0435\u043c, \u043c\u044b \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0441\u043c\u0435\u0449\u0430\u043b\u0438\u0441\u044c \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438, \u043a\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0442\u043e\u043f\u043a\u0430 \u043b\u0438\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0441\u0434\u0432\u0438\u0433\u0430\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/f41\/c84\/b23\/f41c84b235be70dec43cd0e354bc6ed0.jpg\"\/><br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/bd2\/831\/fb2\/bd2831fb29991902a8777027dcedb765.jpg\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/56a\/29e\/dd1\/56a29edd1ef8c3f05c24cb5c174f22ea.jpg\"\/><\/p>\n<p>  \u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b, \u043d\u0430\u0437\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 SlideStackView, \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0435\u0431\u044f \u0432\u0435\u0441\u0442\u0438, \u0431\u044b\u043b\u043e \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a\u0430\u043a \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0442\u0430\u043a \u0438 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430:<\/p>\n<p>  1. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u0430\u0439\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u043c<br \/>  2. \u0414\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u00abbouncing over scroll effect\u00bb \u2014 \u043a\u043e\u0433\u0434\u0430 \u0441\u043b\u0430\u0439\u0434 \u043a\u0430\u043a \u0431\u044b \u043f\u0440\u0443\u0436\u0438\u043d\u0438\u0442 \u043e\u0442 \u043a\u0440\u0430\u044f<br \/>  3. \u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043f\u0438\u0441\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043b\u0430\u0439\u0434\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0447\u0435\u0441\u043a\u0438\u0445 \u0433\u043b\u044e\u043a\u043e\u0432<br \/>  4. \u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\\\u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0441\u043b\u0430\u0439\u0434\u0430 \u0438 \u0442.\u0434.)<\/p>\n<p>  \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u0432\u0442\u043e\u0440\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u044b\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439, \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c ViewGroup, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0447\u0430\u0439\u043b\u0434\u0430\u043c\u0438 \u0442\u0430\u043a, \u043a\u0430\u043a \u043c\u044b \u044d\u0442\u043e \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0438.<\/p>\n<p>  \u0411\u0443\u0434\u0435\u043c \u0438\u0434\u0442\u0438 \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u043c\u0443 \u2014 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0448\u0438\u0442\u044c, \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0430\u043c \u0432\u043a\u043b\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0432 androidFramework, \u0447\u0442\u043e\u0431\u044b, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0438\u0439 user experience. \u0423\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u0432\u044b\u0448\u0435 ViewPager \u043d\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u0430\u0439\u0434\u043e\u0432 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043f\u043e\u0445\u043e\u0436\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0432\u0432\u0435\u0440\u0445 \u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 ViewGroup.<\/p>\n<pre><code class=\"java\">public class SlideStackView extends ViewGroup{      public SlideStackView(Context context, AttributeSet attrs, int defStyle) {         super(context, attrs, defStyle); \t...         initAttributes(context, attrs);         \/\/ we need to draw childs in reverse order         setChildrenDrawingOrderEnabled(true);     }       public SlideStackView(Context context, AttributeSet attrs) {         this(context, attrs, android.R.style.Theme_Black);     }       public SlideStackView(Context context) {         this(context, null);     } <\/code><\/pre>\n<p>  \u0418\u0437 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u044b \u043f\u0440\u043e\u0441\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043f\u0440\u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u043d\u0430\u0448\u0438\u0445 \u0441\u043b\u0430\u0439\u0434\u043e\u0432. \u0417\u0434\u0435\u0441\u044c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0430. \u0412\u0441\u0435 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0438 \u0441\u043b\u0430\u0439\u0434\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0443\u043c\u0435\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u043e, \u0442.\u043a. \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0434\u0442\u0438 \u0441\u043b\u0430\u0439\u0434 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043f\u0438\u0441\u0435\u043c (#0), \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e, \u0442\u043e \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0430\u0439\u0434 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043f\u0430\u043f\u043e\u043a (#1), \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0430\u0439\u0434 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u0432 (#2). \u0412 \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u0436\u0435 \u0441\u0430\u043c\u043e\u0433\u043e ViewGroup \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e, \u043a\u0430\u043a \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0441\u043b\u0430\u0439\u0434\u043e\u0432, \u0442\u0430\u043a \u0438 \u043f\u0440\u0438 \u0438\u0445 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435, \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u0442.\u0434. \u0414\u0435\u043b\u043e \u0442\u0443\u0442 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a \u043f\u0440\u0438\u043d\u044f\u0442\u043e, \u0438\u043b\u0438 \u0442\u0430\u043a \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u0430 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043a\u043e\u0434\u0430. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0441\u0435 \u0443\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 MotionEvent\u2019\u043e\u0432. \u041f\u0440\u0438 \u0438\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 child\u2019\u043e\u0432 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043e\u0442 0 \u0434\u043e childCount, \u0430 \u0442.\u043a. \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0441\u043b\u0430\u0439\u0434 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0438\u0436\u043d\u0438\u0435, \u0442\u043e \u043c\u044b \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043e\u0431\u0445\u043e\u0434 \u043d\u0430\u0448\u0438\u0445 \u0447\u0430\u0439\u043b\u0434\u043e\u0432 \u043e\u0442 \u043d\u0438\u0436\u043d\u0435\u0433\u043e \u043a \u0432\u0435\u0440\u0445\u043d\u0435\u043c\u0443 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u0442\u043e\u0433\u043e \u0441\u043b\u0430\u0439\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 MotionEvent. \u041e\u0431 \u044d\u0442\u043e\u043c \u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 MotionEvent\u2019\u043e\u0432.<br \/>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u043c \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u043d\u0443\u0436\u0435\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"java\">    \/**      * Same as {@link #getChildAt(int)} but uses adapter's      * slide order in depending on the actual child order      * in the view group      * @param position position of the child to be retrieved      * @return view in specified       *\/     private View getChild(int position){         return getChildAt(getChildCount() - 1 - position);     } <\/code><\/pre>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u043d\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e:<\/p>\n<pre><code class=\"java\">    \/**      * Use this to manage child drawing order. We should draw       * the slide #{lastSlide} (in adapter's data set indexes) first. Then draw      * the slide with #{lastSlide - 1} and so on until the slide #0 inclusive      * &lt;p&gt;      * {@inheritDoc}      *\/     @Override     protected int getChildDrawingOrder(int childCount, int i) {         \/\/draw the last slide first.         \/**          *     __________           *  __|0         |          * |1 |          |          * |  |          |          * |  |__________|          * |__________|           *\/         return \/*childCount - *\/i \/*- 1*\/;     }  <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u041c\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u0430\u0439\u0434\u044b, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c. \u0412 Android Framework Team \u0440\u0435\u0448\u0438\u043b\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 Adapter \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u0442\u0430\u043a \u043c\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c. \u041f\u0440\u0438\u0447\u0435\u043c \u0431\u043b\u0438\u0436\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u043c \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043e ViewPager \u2014 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u044d\u0442\u043e\u043c \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0435, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<pre><code class=\"java\">    \/**      * Used in case we have no valid position or actual position      * can not be found.      *\/     static final int INVALID_POSITION = -1;     \/**      * Index of the first element from adapter's data set      * added to the layout of the slide stack      *\/     private int mFirst;     \/**      * Current selected slide position in adapter's data set      *\/     private int mSelected;     \/**      * A data set adapter that prepares view for the slide stack view      * and is responsible for base information about the containing       * data set.              *\/     private SlideStateAdapter mAdapter;     \/**      * {@link DataSetObserver} that indicates about changes in slides      * data set      *\/     private final DataSetObserver mObserver = new Observer();     \/**      * Sets the adapter for providing the SlideStackView with      * slides.      * @param adapter      *\/     public void setAdapter(SlideStateAdapter adapter){         if (mAdapter != null){             mAdapter.unregDataSetObserver(mObserver);             mFirst = INVALID_POSITION;             mScroller.stopScrolling();             removeAllViews();         }         if(adapter != null){             mAdapter = adapter;             mAdapter.regDataSetObserver(mObserver);         }     } <\/code><\/pre>\n<p>  \u0413\u0434\u0435 Class Observer \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430:  <\/p>\n<pre><code class=\"java\">    private final class Observer extends DataSetObserver{           @Override         public void onChanged() {             \/\/empty         }           @Override         public void onInvalidated() {             \/\/empty         }     } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0430\u0434\u0430\u043f\u0442\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u0443\u0436\u0438\u0442 \u0441\u0432\u044f\u0437\u0443\u044e\u0449\u0438\u043c \u0437\u0432\u0435\u043d\u043e\u043c \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438 \u0442\u0435\u043c, \u043a\u0430\u043a \u043c\u044b \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>  \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u043a\u0430\u043a \u043d\u0430\u0448\u0438 \u0441\u043b\u0430\u0439\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 SlideStackView. \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0431\u044a\u0435\u043c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043a\u0430\u043a \u043f\u043e \u0432\u043e\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c\u0443 \u043d\u0430 \u043d\u0435\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0443, \u0442\u0430\u043a \u0438 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043a\u043e\u0434\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u041e\u0442\u0441\u044e\u0434\u0430 \u0432\u044b\u0442\u0435\u043a\u0430\u044e\u0449\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432\u0435\u0441\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u043d\u0433\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0430\u043a \u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<pre><code class=\"java\">    public static class SlideScroller extends Scroller implements OnTouchListener{          private final ScrollingListener mListener;         private final GestureDetector mGestureDetector;          public SlideScroller(Context context, ScrollingListener listener,                 OnGestureListener gestureListener) {             super(context);             this.mListener = listener;             this.mGestureDetector = new GestureDetector(context, gestureListener);             mGestureDetector.setIsLongpressEnabled(false);         }          public void scroll(int distance, int time) { \/\/          ...         }                  public void fling(int velocity){             ...         }           public void stopScrolling() {             ...         }                  @Override         public boolean onTouch(View v, MotionEvent event) {             ...         }                  void finishScrolling() { \t\t...         }                  boolean isScrolling(){             ...         }                  boolean isJustifying(){             ...         }                  boolean isTouchScrolling(){             ...         }     }  <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043c\u043e\u0436\u0435\u043c \u0432\u0441\u044e \u043a\u0443\u0445\u043d\u044e \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u043d\u0433\u0430 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c SlideStackView \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u0447\u0435\u0440\u0435\u0437 ScrollingListener:<\/p>\n<pre><code class=\"java\">    public interface ScrollingListener {         void onScroll(int distance);         void onStarted();         void onFinished();         void onJustify();     }  <\/code><\/pre>\n<p>  \u0421 \u0447\u0435\u0433\u043e \u0436\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043b\u044e\u0431\u043e\u0433\u043e ViewGroup? ViewGroup \u2014 \u044d\u0442\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u043e\u0432\u0449\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u0438\u043c\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443\u043c\u0435\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c View, \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0434\u0440\u0443\u0433\u0438\u0435 View. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043d\u0430\u0448 \u0432\u043e\u043f\u0440\u043e\u0441 \u2013 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f ViewGroup, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 Override:  <\/p>\n<pre><code class=\"java\">    @Override     protected void onLayout(boolean changed, int l, int t, int r, int b) {      }  <\/code><\/pre>\n<p>  \u0433\u0434\u0435 \u043c\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u0441\u043b\u0430\u0439\u0434\u044b:  <\/p>\n<pre><code class=\"java\">   @Override    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {    }  <\/code><\/pre>\n<p>  \u0438 \u0433\u0434\u0435 \u043c\u044b \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u0448\u0438 \u0441\u043b\u0430\u0439\u0434\u044b.<br \/>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"java\">   @Override    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {        setMeasuredDimension(getDefaultSize(0, widthMeasureSpec),                getDefaultSize(0, heightMeasureSpec));                int childHeightSize = getMeasuredHeight();        int mChildHeightMeasureSpec = MeasureSpec.makeMeasureSpec(                childHeightSize, MeasureSpec.EXACTLY);        \/\/ Make sure we have created all fragments that we need to have shown.        mInLayout = true;        fillViewsIn();        mInLayout = false;        \/\/ measure slides        int size = getChildCount();        for (int i = 0; i &lt; size; ++i) {            final View child = getChild(i);            if (child.getVisibility() != GONE) {                int childWidthSize = getMeasuredWidth() - (                        getRightEdgeDelta(mFirst + i - 1) + getLeftEdge(mFirst + i));                final int widthSpec = MeasureSpec.makeMeasureSpec(                        childWidthSize, MeasureSpec.EXACTLY); \/\/                LOG.v(&quot;Measuring #&quot; + i + &quot; &quot; + child \/\/                        + &quot;: &quot; + widthSpec);                child.measure(widthSpec, mChildHeightMeasureSpec);            }        }    }  <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0437\u0430\u0434\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u043b\u044f \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0435\u0445 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0434\u0430\u043b \u043d\u0430\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440. \u0412 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u0435 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a \u2014 \u044d\u0442\u043e \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0441\u044e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c.<\/p>\n<p>  \u0422.\u043a. \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448\u0438 \u0441\u043b\u0430\u0439\u0434\u044b \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u043e \u0432\u044b\u0441\u043e\u0442\u0435, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432\u044b\u0441\u043e\u0442\u044b \u0441 \u0444\u043b\u0430\u0433\u043e\u043c MeasureSpec.EXACTLY, \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u0440\u0430\u0432\u043d\u044b\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0439 \u0432\u044b\u0441\u043e\u0442\u0435 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a\u0430.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c \u043d\u0430\u0448\u0438 \u0441\u043b\u0430\u0439\u0434\u044b, \u043d\u0430\u043c, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0441\u0430\u043c\u0438 \u0441\u043b\u0430\u0439\u0434\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0438 \u0443\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043b\u0430\u0439\u0434\u043e\u0432 \u043e\u0442 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u043a \u043d\u0438\u0436\u043d\u0435\u043c\u0443. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0441\u043b\u0430\u0439\u0434\u0430\u043c, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0438\u0445 \u043d\u0443\u0436\u043d\u0443\u044e \u0448\u0438\u0440\u0438\u043d\u0443 \u0438 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u043c child.measure(widthSpec, mChildHeightMeasureSpec).<\/p>\n<p>  \u0428\u0438\u0440\u0438\u043d\u0430 \u0441\u043b\u0430\u0439\u0434\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0448\u0438\u0440\u0438\u043d\u0430 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a\u0430 \u043c\u0438\u043d\u0443\u0441 \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u0441\u043b\u0435\u0432\u0430 \u0438 \u0441\u043f\u0440\u0430\u0432\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u0430\u0439\u0434\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0441\u043b\u0430\u0439\u0434\u0430 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043f\u0430\u043f\u043e\u043a. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/a00\/7b0\/a0b\/a007b0a0b97671b3edd7ac4e86c1f325.jpg\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u0438\u0437\u043c\u0435\u0440\u0438\u043b\u0438 \u043d\u0430\u0448\u0438 \u0441\u043b\u0430\u0439\u0434\u044b, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c:<\/p>\n<pre><code class=\"java\">    @Override     protected void onLayout(boolean changed, int l, int t, int r, int b) {         mInLayout = true;         fillViewsIn();         mInLayout = false;        for (int i = 0; i &lt; getChildCount(); i++) {            View child = getChild(i);            int position = i + mFirst;            onLayoutChild(child, position, changed);        }        mDirty.setEmpty();     }     \/**      * Layouts child at the specified position (in adapter's data set).      * Measures the child if needed.      * @param child a child we are going to layout       * @param position position of the child in adapter's data set      *\/     protected void onLayoutChild(View child, int position, boolean changed) {         if (child.getVisibility() != GONE) {             LOG.d(&quot;onLayoutChild &quot; + position);             if (position &lt; mSelected && changed){                 closeView(position);                 LOG.v(&quot;close slide at &quot; + position);             }             final LayoutParams lp = (LayoutParams) child.getLayoutParams();             SlideInfo info = getSlideInfo(child);             int childLeft = getLeftEdge(position) + info.mOffset;             int childRight = getRightEdge(position - 1) + info.mOffset;             int childTop = getTop();             if (lp.needsMeasure) {                 lp.needsMeasure = false;                 final int widthSpec = MeasureSpec.makeMeasureSpec(                         childRight - childLeft, MeasureSpec.EXACTLY);                 final int heightSpec = MeasureSpec.makeMeasureSpec(                         getMeasuredHeight(), MeasureSpec.EXACTLY);                 child.measure(widthSpec, heightSpec);             } \/\/          LOG.v(&quot;Positioning #&quot; + position + &quot; &quot; + child + &quot;:&quot; + childLeft \/\/                  + &quot;,&quot; + childTop + &quot; &quot; + child.getMeasuredWidth() + &quot;x&quot; \/\/                  + child.getMeasuredHeight());             child.layout(childLeft, getTop(), childRight, getBottom());         }     }  <\/code><\/pre>\n<p>  \u041c\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0432\u0441\u0435 \u0441\u043b\u0430\u0439\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0430 \u043f\u043e\u0442\u043e\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u043b\u0430\u0439\u0434\u0430 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0430\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u043b\u0430\u0439\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u0431\u044b\u0442\u044c \u0437\u0430\u043a\u0440\u044b\u0442\u044b, \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435, \u0435\u0441\u043b\u0438 \u0441\u043b\u0430\u0439\u0434 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a \u0431\u044b\u043b \u0438\u0437\u043c\u0435\u0440\u0435\u043d, \u0442\u043e \u044d\u0442\u043e\u0442 \u0441\u043b\u0430\u0439\u0434 \u0442\u043e\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c.<\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c SlideInfo \u2013 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 Holder, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u0432 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043b\u0430\u0439\u0434.<\/p>\n<pre><code class=\"java\">    \/**      * Simple info holder for the slide item      * @author k.kharkov      *\/     public static final class SlideInfo implements Parcelable{         \/**          * Describes slide offset relative to the slide stack.          * Note that offset value do not describe actual slide          * position inside the slide stack but only shows the          * offset relative to the left position of the slide.          * &lt;p&gt;          * This means           * &lt;code&gt;getLeftEdge(position) + info.mOffset&lt;\/code&gt;          * equals to actual offset of the slide relative to          * the slide stack view.          *\/         private int mOffset = 0;         \/**          * Indicates whether the slide is visible to the user          * or hidden at near the slide stack side          *\/         private boolean mOpened = true;         \/**          * Position of the slide inside the slide stack          *\/         private int mPosition = INVALID_POSITION;         \/**          * The drawable to fill space between this slide and the          * previous one.          * @see SlideStackView#fillAreaToPrevSlide(Canvas, View)          *\/         private Drawable mSpace;                  public SlideInfo() {             super();         }      }  <\/code><\/pre>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e SlideInfo, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0430 LayoutParams, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0438\u0442\u043e\u0433\u0435 \u044f \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u043b \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u044f \u0442\u0430\u043a \u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u043d\u0435\u0441 \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 layoutParams, \u043d\u043e \u0445\u043e\u0447\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0441\u0430\u043c\u043e\u0435 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f. \u041d\u0438\u0447\u0435\u0433\u043e \u043a\u0440\u0438\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0445\u043e\u043b\u0434\u0435\u0440\u0435 \u043d\u0435\u0442, \u043d\u043e \u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043a \u043f\u043e\u0434\u0445\u043e\u0434\u0430 KISS (Keep It Simple Stupid), \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442 \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0432\u0443\u0445 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043f\u0440\u043e\u0449\u0435 \ud83d\ude42<\/p>\n<p>  \u0418\u0442\u0430\u043a \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u043a\u0430\u043a \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0441\u043e \u0441\u043b\u0430\u0439\u0434\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0443\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432 ViewGroup. \u0412\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u2013 \u043a\u0430\u043a \u0436\u0435 \u0438\u0445 \u0442\u0443\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"java\">    \/**      * Adds all required views in layout first.      * Then adjusts visibility for each child.      * @see #addViewsInside(int, int)      * @see #adjustViewsVisibility()      *\/     private void fillViewsIn() {         int position  = 0;         int left = 0;         if (getChildCount() &gt; 0){             position = getLastVisiblePosition() + 1;             View lastView = getChild(position - mFirst - 1);             left = lastView.getLeft() - lastView.getScrollX();         }         addViewsInside(position, left);         adjustViewsVisibility();     }  <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u043b\u0430\u0439\u0434 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u043b\u0430\u0439\u0434\u044b \u0432 SlideStackView, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0435\u0441\u0442\u044c \u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u0438\u0434\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">    \/**      * Uses the adapter to add views to the slide stack view.      * @param position last visible position of the view      * @param left left coordinate of the last visible slide      *\/     private void addViewsInside(int position, int left) {         if (mAdapter == null || mAdapter.getCount() == 0){             return;         }         mAdapter.startUpdate(this);         while ((position &lt;= mSelected + 1 || left &gt; getLeft())                 && position &lt; mAdapter.getCount()){             if (mFirst == INVALID_POSITION){                 mFirst = 0;             }             LOG.d(&quot;addView inside &quot; + position + &quot; mSelected &quot; + mSelected);             mAdapter.instantiateItem(this, position);             left = mSelected &gt; position ?                     getLeftEdge(position) : getRightEdge(position - 1);             position ++;         }         mAdapter.finishUpdate(this);     }  <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u0430\u0448\u0438\u0445 \u0441\u043b\u0430\u0439\u0434\u043e\u0432, \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043b\u0430\u0439\u0434\u044b \u043b\u0443\u0447\u0448\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u0443 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043b\u0430\u0439\u0434\u043e\u0432 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043b\u0430\u0439\u0434\u0430 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043b\u0438\u0431\u043e \u0441\u043b\u0430\u0439\u0434\u044b \u043d\u0435 \u043a\u043e\u043d\u0447\u0430\u0442\u0441\u044f, \u043b\u0438\u0431\u043e \u0441\u043b\u0430\u0439\u0434\u044b \u043d\u0435 \u0432\u044b\u0439\u0434\u0443\u0442 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a\u0430. \u0415\u0441\u043b\u0438 left \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f &lt;= getLeft() \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u043b\u0430\u0439\u0434 \u0438\u0437 \u0442\u0435\u0445, \u0447\u0442\u043e \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438, \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a\u0430. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043b\u0430\u0439\u0434 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043b\u0438\u0431\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0434 \u044d\u0442\u0438\u043c \u0441\u043b\u0430\u0439\u0434\u043e\u043c, \u043b\u0438\u0431\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0438\u0434\u0435\u043d \u043b\u0435\u0432\u0435\u0435, \u043d\u043e \u044d\u0442\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u0432 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a\u0430 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0432\u0438\u0434\u043d\u0430. \u0410 \u0442.\u043a. \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u043b\u0430\u0439\u0434 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u0435\u043d, \u0442\u043e \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430.<\/p>\n<p>  \u00ab\u041d\u043e \u0433\u0434\u0435 \u0436\u0435 \u0441\u0430\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u0430\u0439\u0434\u0430?\u00bb \u2014 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u0435 \u0432\u044b. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c mAdapter.finishUpdate(this); adapter \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e \u0438 FragmentManager \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 (this \u2013 \u0442\u043e \u0435\u0441\u0442\u044c SlideStackView). \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0441\u043b\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u043d\u0430 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \ud83d\ude42 \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f lifecycle\u2019a \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 \u043d\u0430\u0448 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 ViewGroup.addView(View,int,LayoutParams); \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u043e\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0441\u043b\u0430\u0439\u0434, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434:  <\/p>\n<pre><code class=\"java\">    \/**      * Specifies correct layout parameters for the child and      * adds it according the the current {@link #mInLayout}      * status.      * &lt;p&gt;      * {@inheritDoc}      *\/     @Override     public void addView(View child, int index, ViewGroup.LayoutParams params) {         LOG.d(&quot;Add view from outside &quot; + child);        if (!checkLayoutParams(params)) {            params = generateLayoutParams(params);        }        final LayoutParams lp = (LayoutParams) params;          SlideInfo info = getSlideInfo(child);        info.mPosition = getChildCount();        if (mAdapter != null){            info.mSpace = mAdapter.getSpaceDrawable(info.mPosition);        }        if (mInLayout) {            lp.needsMeasure = true;            addViewInLayout(child, 0, params);        } else {            super.addView(child, 0, params);        }        if (info.mPosition &lt; mSelected){            closeView(info.mPosition);        }     }  <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0417\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0441\u043b\u0430\u0439\u0434 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043b\u0435\u0439\u0430\u0443\u0442\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442, \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u043b\u0430\u0439\u0434, \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0441\u043b\u0430\u0439\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0435\u0439\u0447\u0430\u0441 \u0430\u043a\u0442\u0438\u0432\u0435\u043d.<\/p>\n<p>  \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0432 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0445 \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c. \u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044e, \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0438\u0449\u0435\u043c \u0442\u0435 \u0441\u043b\u0430\u0439\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u043d\u0435 \u0432\u0438\u0434\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0438 \u0438\u0445 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0438\u0437 ViewGroup, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0430\u0448 adapter.<\/p>\n<p>  \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 fillViewsIn(); \u043e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043d\u0435\u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 adjustViewsVisibility;<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043b\u0430\u0439\u0434\u043e\u0432. \u041d\u0443\u0436\u043d\u043e \u044d\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u0442\u0435\u0445 \u0441\u043b\u0430\u0439\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0449\u0435 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u044b \u0438\u0437 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438, \u043d\u043e \u0443\u0436\u0435 \u043d\u0435 \u0432\u0438\u0434\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u0421\u0430\u043c\u0430 \u043f\u043e \u0441\u0435\u0431\u0435 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430 \u2013 \u043c\u044b \u043b\u0438\u0448\u044c \u0441\u0442\u0430\u0432\u0438\u043c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0441\u043b\u0430\u0439\u0434\u0430 \u0447\u0435\u0440\u0435\u0437 View.setVisibility(int), \u0433\u0434\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043b\u0438\u0431\u043e View.VISIBLE, \u043b\u0438\u0431\u043e View.INVISIBLE. \u0421\u0430\u043c \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044c \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<pre><code class=\"java\">    \/**      * Sets visibility parameter for each child according      * to the actual visibility on the screen. Takes into      * account that child shouldn't be invisible if it's      * shadow is visible on the screen because it would      * prevent from triggering {@link #drawChild(Canvas, View, long)}      * method over that child.      *\/     private void adjustViewsVisibility() {         \/**          * init the rect to align right edge if the slide stack view          *\/         Rect drawingRect = new Rect();         drawingRect.left = getRight();         drawingRect.top = getTop();         drawingRect.right = getRight();         drawingRect.bottom = getTop() + getHeight();         Rect parent = getChildDrawingRectPositive(this);         \/**          * Then union each child drawing rect          * with drawingRect of the slide stack          * in order to determine when the views           * behind the last actually visible view           * in the slideStack view and hide all          * the following views in order to prevent          * re-drawing non-visible views          *  ________________________________          * | slideStackView       __________|          * | ____________________|          |          * || _   _   _   _      |          |          * |||             |     |visible   |          * ||                    |slide #0  |          * ||| hidden slide|     |          |          * ||  #2                |          |          * |||_   _   _   _|     |          |          * ||last actual visible |          |          * ||slide #1            |__________|          * ||__________________________|    |          * |________________________________|          *\/         for (int i = 0; i &lt; getChildCount(); i ++){             boolean hideNext = false; \/\/          LOG.v(&quot;adjustVisibility &quot; + i);             View child = getChild(i);             Rect childRect = getChildDrawingRectPositive(child); \/\/          LOG.v(&quot;child.left &quot; + childRect.left + \/\/                  &quot; drawing.left&quot; + drawingRect.left + \/\/                  &quot; parent &quot; + parent.toShortString() +  \/\/                  &quot; child&quot; + childRect.toShortString());             if (childRect.left &lt; drawingRect.left                     && Rect.intersects(parent, childRect)){                 drawingRect.union(childRect); \/\/              LOG.d(&quot;drawingRect after union with child &quot; + i + &quot; = &quot; +  \/\/                  drawingRect.toShortString());                 hideNext = false;             } else { \/\/              LOG.d(&quot;hide view &quot; + i); \/\/              LOG.v(&quot;child &quot; + childRect.toShortString() + \/\/                      &quot; drawing &quot; + drawingRect.toShortString() + \/\/                      &quot; parent &quot; + parent.toShortString());                 Rect childShadow = getShadowRect(childRect);                 if (childShadow.isEmpty()){                     hideNext = true;                 }                 \/\/ if shadow visible - do not hide the slide                 \/\/ and let the shadow to be drawn                 if (childShadow.left &lt; drawingRect.left                         && Rect.intersects(parent, childShadow)){                     hideNext = false;                 } else {                     hideNext = true;                 }             } \/\/          LOG.d(&quot;set visibility for child &quot; + i + &quot; = &quot; +  \/\/                  (hideNext ? &quot;Invisible&quot; : &quot;Visible&quot;));             child.setVisibility(hideNext ? View.INVISIBLE : View.VISIBLE);         }     }  <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<p>  \u041e\u0431\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>  1. \u0411\u0435\u0440\u0435\u043c \u043f\u0440\u0430\u0432\u0443\u044e \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a\u0430 (\u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u0430\u0432\u044b\u0439 \u0441\u043b\u0430\u0439\u0434 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0438\u0434\u0435\u043d \u0438 \u0442\u0435, \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043b\u0435\u0432\u0435\u0435 \u2013 \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u043c. \u041d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442.)<br \/>  2. \u0418\u0434\u0435\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043b\u0430\u0439\u0434\u0430\u043c \u0438 \u043a\u0430\u043a-\u0431\u044b \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u0437\u0430\u043d\u044f\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u0430\u0439\u0434.<br \/>  3. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0435\u0441\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0441\u043b\u0430\u0439\u0434 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a\u0430, \u043b\u0438\u0431\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043a\u0440\u044b\u0442 \u0441\u043b\u0430\u0439\u0434\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0435\u0436\u0430\u0442 \u0432\u044b\u0448\u0435 \u043d\u0435\u0433\u043e, \u0442\u043e \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u043c \u0435\u0433\u043e \u043a\u0430\u043a \u00ab\u043d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u0439\u00bb. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043b\u0430\u0439\u0434 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u00ab\u0432\u0438\u0434\u0438\u043c\u044b\u043c\u00bb.<\/p>\n<p>  \u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 drawingRect \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0436\u0435 \u0437\u0430\u043d\u044f\u0442\u0430 \u0441\u043b\u0430\u0439\u0434\u0430\u043c\u0438, \u0430 childRect \u2013 \u044d\u0442\u043e \u043e\u0431\u043b\u0430\u0441\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0441\u043b\u0430\u0439\u0434 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u0443 \u043d\u0430 \u0442\u0435\u043d\u044c. \u0422\u0435\u043d\u044c \u043c\u044b \u0440\u0438\u0441\u0443\u0435\u043c \u0441\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u0435\u043d\u044c, \u043f\u0440\u0438 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0435 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043b\u0430\u0439\u0434\u043e\u0432, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435 \u043c\u0438\u0433\u0430\u043d\u0438\u0435 \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0441\u043b\u0430\u0439\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f\\\u0441\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c. \u0412\u0441\u0435 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u043e ViewGroup \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0447\u0430\u0439\u043b\u0434 \u0432\u0438\u0434\u0438\u043c\u044b\u043c \u0438\u043b\u0438 \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u043c. \u0415\u0441\u043b\u0438 \u043e\u043d \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u0439, \u0442\u043e \u043c\u0435\u0442\u043e\u0434 drawChild(Canvas, View, long) \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0447\u0430\u0439\u043b\u0434\u0430, \u0447\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043b\u043e\u0433\u0438\u0447\u043d\u043e. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043b\u0430\u0439\u0434 \u0432\u0438\u0434\u0438\u043c\u044b\u043c \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u0442 \u043d\u0435\u0433\u043e \u0432\u0438\u0434\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043d\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438 \u0432\u043d\u043e\u0441\u0438\u043c \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u0443 \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0440\u0435\u0448\u0438\u043b\u0438, \u0447\u0442\u043e \u0441\u043b\u0430\u0439\u0434 \u043d\u0435 \u0432\u0438\u0434\u0435\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.  <\/p>\n<pre><code class=\"java\">                Rect childShadow = getShadowRect(childRect);                 if (childShadow.isEmpty()){                     hideNext = true;                 }                 \/\/ if shadow visible - do not hide the slide                 \/\/ and let the shadow to be drawn                 if (childShadow.left &lt; drawingRect.left                         && Rect.intersects(parent, childShadow)){                     hideNext = false;                 } else {                     hideNext = true;                 }  <\/code><\/pre>\n<p>  \u0412 \u0446\u0435\u043b\u043e\u043c, \u0432\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0432\u0435\u0441\u044c \u043c\u0435\u0442\u043e\u0434 adjustViewsVisibility() \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0446\u0435\u043b\u044f\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u0412\u0435\u0434\u044c \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u043d \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u0442. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043b\u0438\u0448\u043d\u0435\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0430 \u043f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u041d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u0445 \u0441\u043b\u0430\u0439\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0432\u0438\u0434\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u043d\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e. \u0423 \u043d\u0430\u0441 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u00ab\u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u00bb \u0441\u043b\u0430\u0439\u0434\u043e\u0432. \u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u0434\u0432\u0438\u0433\u0430\u0435\u043c \u043e\u0434\u0438\u043d \u0441\u043b\u0430\u0439\u0434 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0438 \u0432\u0438\u0434\u0438\u043c \u0438\u0437-\u043f\u043e\u0434 \u043d\u0435\u0433\u043e \u0447\u0430\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043b\u0430\u0439\u0434\u0430. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a, \u0447\u0442\u043e \u0432\u0438\u0434\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u044c \u0441\u043b\u0430\u0439\u0434\u0430 (\u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043d\u044c\\\u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043d\u0438 \u043e\u0442 \u043d\u0435\u0433\u043e), \u0430 \u0440\u0438\u0441\u0443\u0435\u043c \u043c\u044b \u0432\u0435\u0441\u044c \u0441\u043b\u0430\u0439\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c. \u0417\u0430\u0442\u0435\u043c, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0440\u0438\u0441\u0443\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043b\u0430\u0439\u0434 \u043f\u043e\u0432\u0435\u0440\u0445 \u043d\u0435\u0433\u043e.<\/p>\n<p>  \u041b\u0438\u0447\u043d\u043e \u044f \u043d\u0435 \u0437\u043d\u0430\u044e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043a\u0440\u043e\u043c\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 Canvas.clipRect(Rect). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u043b\u0430\u0439\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u0430\u0434\u0440\u0435, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u043a\u0430\u043d\u0432\u0430\u0441\u0435 \u0442\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0430\u0439\u0434\u0430, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0430\u0439\u0434.<\/p>\n<p>  \u0423\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u0432\u044b\u0448\u0435 \u043c\u0435\u0442\u043e\u0434 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u0430\u0439\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0443 \u043c\u0435\u043d\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"java\">    \/**      * Clips the canvas to the child current bounds plus shadow.      * &lt;p&gt;      * Draws the shadow as well for each child.      * &lt;p&gt;      * {@inheritDoc}      * @see #applyShadowToChild(Canvas, View)      *\/     @Override     protected boolean drawChild(Canvas canvas, View child, long drawingTime) {         Rect childClip = getChildClipRect(child); \/\/      LOG.d(&quot;canvas &quot; + canvas.getClipBounds().toShortString()); \/\/      LOG.d(&quot;draw Child &quot; + child + &quot; clip = &quot; + childClip.toShortString());         \/\/ first         \/\/ draw spaces between slides         fillAreaToPrevSlide(canvas, child);         \/\/ second         \/\/ draw shadow for the slide         applyShadowToChild(canvas, child);         \/\/ third         \/\/ actually draw child         try{             canvas.save();             canvas.clipRect(childClip);             boolean r = super.drawChild(canvas, child, drawingTime);             return r;         } finally {             canvas.restore();         }     }  <\/code><\/pre>\n<p>  \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u044b \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u0434\u043b\u044f \u0441\u043b\u0430\u0439\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u0435\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435, \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0437\u0430\u043b\u0438\u0432\u043a\u0443 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u0430\u0439\u0434\u0430\u043c\u0438 (\u0435\u0441\u043b\u0438 \u043e\u043d\u043e\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442), \u0440\u0438\u0441\u0443\u0435\u043c \u0442\u0435\u043d\u044c \u0434\u043b\u044f \u0441\u043b\u0430\u0439\u0434\u0430, \u0438 \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u0430\u043d\u0432\u0430\u0441 \u0432\u044b\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u043c childClip, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u043b\u0430\u0439\u0434\u0430 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a, \u043a\u0430\u043a \u043e\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0432\u043e ViewGroup.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435 \u2013 \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u0412\u0441\u044f \u043c\u0430\u0433\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0443\u0436\u043d\u043e \u00ab\u043e\u0431\u0440\u0435\u0437\u0430\u0442\u044c\u00bb canvas.  <\/p>\n<pre><code class=\"java\">    \/**      * Retrieves children's visible position on the screen      * without it's shadow.      * @param child we should retrieve visible bounds for      * @return a child's visible bounds      *\/     private Rect getChildClipRect(View child) {         Rect childClip = getChildDrawingRectPositive(child);         int position = getPositionForView(child);         subtractRectWithChilds(childClip, position); \/\/      LOG.v(&quot;child clip &quot; + position + &quot; &quot; + childClip.toShortString());         return childClip;     }     \/**      * Changes the specified clip rectangle, to subtract all the       * following children from it.      * @param childClip initial child rectangle in the screen      * @param position child position within adapter's data set      * @see #subtractToLeft(Rect, Rect)      *\/     private void subtractRectWithChilds(Rect childClip, int position) {         if (position &gt;= 0){             position -= mFirst;             for (int i = position - 1; i &gt;= 0; i --){                 View c = getChild(i);                 Rect r = getChildDrawingRectPositive(c);                 boolean changed = subtractToLeft(childClip, r);                 if (changed){ \/\/                  LOG.v(&quot;child clipped &quot; + childClip.toShortString());                 }             }         }     }  <\/code><\/pre>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0441\u043b\u0430\u0439\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a\u0430, \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0435\u0433\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0432 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0445 \u0441\u043b\u0430\u0439\u0434 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u00ab\u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c\u00bb \u0432\u0441\u0435 \u043b\u0438\u0448\u043d\u0435\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u043a\u0430\u043a \u0440\u0430\u0437 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u00ab\u0432\u044b\u0447\u0438\u0442\u0430\u0435\u0442\u00bb \u044d\u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u043b\u0438\u0448\u043d\u0435\u0435. \u041b\u0438\u0448\u043d\u0435\u0439 \u043c\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u0441\u043b\u0430\u0439\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u0430\u0439\u0434\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043f\u0440\u0430\u0432\u0435\u0435 (\u043b\u0438\u0431\u043e \u0431\u043b\u0438\u0436\u0435 \u043a \u043d\u0430\u0447\u0430\u043b\u0443 \u0432 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0445 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430).<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043b\u0438\u0448\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e.<\/p>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u0441\u043b\u0430\u0439\u0434\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0441\u043e\u0442\u044b.  <\/p>\n<pre><code class=\"java\">    \/**      * Same as {@link #subtract(Rect, Rect)} method, but processes      * the case where source rectangle wasn't changed because it      * contains &lt;code&gt;r&lt;\/code&gt;. In this case it adjusts &lt;code&gt;r&lt;\/code&gt;      * from this:      * &lt;pre&gt;      *  _______________________      * | source   _________    |      * |         | r       |   |      * |         |         |   |      * |         |         |   |      * |         |         |   |      * |         |_________|   |      * |_______________________|      * &lt;\/pre&gt;      *       * to this: in order to leave only left side of the source rectangle.      * &lt;pre&gt;      *  ___________________________      * | source  | r           |1px|      * |         |             |&lt;-&gt;|      * |         |             |   |      * |         |             |   |      * |         |             |   |      * |         |             |   |      * |         |             |   |      * |_________|_____________|___|      * &lt;\/pre&gt;      * @param source the rectangle we are going to subtract from      * @param r the rectangle we are going to subtract from      * source      * @return &lt;code&gt;true&lt;\/code&gt; in case the source rectangle      * has been changed. &lt;code&gt;false&lt;\/code&gt; otherwise      *\/     private static boolean subtractToLeft(Rect source, Rect r){         boolean changed = subtract(source, r);         if (!changed && source.contains(r)){             \/\/ adjust intersected rect manually             r.right = source.right + 1;             r.top = source.top;             r.bottom = source.bottom;             changed = subtract(source, r);         }         return changed;     }     \/**      * Subtracts &lt;code&gt;r&lt;\/code&gt; from the &lt;code&gt;source&lt;\/code&gt;.      * Sets &lt;code&gt;r&lt;\/code&gt; rectangle to the intersection as well.      * @param source       * @param r      * @return &lt;code&gt;true&lt;\/code&gt; if rectangle has been subtracted,      * &lt;code&gt;false&lt;\/code&gt; otherwise.      *\/     private static boolean subtract(Rect source, Rect r) {         if (source.isEmpty() || r.isEmpty()){             return false;         }         if (r.contains(source)){ \/\/          LOG.w(&quot;return empty rect&quot;);             source.setEmpty();             return true;         }         if (source.contains(r)){             return false;         }         if (!r.intersect(source)){             return false;         }         boolean changed = false;         if (source.left == r.left){             source.left = r.right;             changed = true;         }         if (source.right == r.right){             source.right = r.left;             changed = true;         }         if (source.top == r.top){             source.top = r.bottom;             changed = true;         }         if (source.bottom == r.bottom){             source.bottom = r.top;             changed = true;         }         source.sort();         return changed;     }  <\/code><\/pre>\n<p>  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439, \u0438 \u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043c\u043e\u0438 \u00ab\u0440\u0438\u0441\u0443\u043d\u043a\u0438\u00bb \u0432\u043d\u043e\u0441\u044f\u0442 \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u044f\u0441\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043d\u0435 \ud83d\ude42<\/p>\n<p>  \u042f \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u044f \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a \u0434\u0435\u0442\u0430\u043b\u044f\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u2013 \u0432 \u043a\u043e\u0434\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 Rect. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e\u0433\u043e \u0441\u0442\u043e\u0438\u0442 \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u0432 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0430\u043c\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u0421\u0430\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0438 \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u043d\u0430\u043d\u0435\u0441\u0443\u0442 \u0432\u0440\u0435\u0434\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u043e \u043f\u0430\u043c\u044f\u0442\u0438. \u041d\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u0430\u0434\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u00ab\u043d\u0435\u043c\u043d\u043e\u0433\u043e\u00bb \u043c\u0443\u0441\u043e\u0440\u0430, \u0442\u043e \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0433\u043e \u043d\u0430\u043a\u043e\u043f\u0438\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0435\u0433\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c. \u042d\u0442\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0435 \u043b\u0430\u0433\u0438 \u0432 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438. \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e\u0439 \u043f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 \u043d\u0435\u0442 \u0432\u0441\u044e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0438 \u0441\u043c\u0430\u0437\u0430\u0442\u044c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a\u0430 \u044f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u043f\u0440\u0435\u0436\u0434\u0435\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b. \u0418 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0442\u0430\u043a, \u043a\u0430\u043a \u0431\u044b\u043b\u043e \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043e, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043b \u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043b\u0430\u0439\u0434\u044b, \u043a\u0430\u043a \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0438\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a\u0430, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u0445 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0432\u0430\u043c \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0438\u0437\u043b\u0438\u0448\u043d\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0440\u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u043b\u0430\u0439\u0434\u043e\u0432.<\/p>\n<p>  \u041c\u044b \u043f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u043b\u0430\u0439\u0434 \u0441\u0442\u0435\u043a \u2013 \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u043d\u0433. \u0421\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u043d\u0433 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0435\u0448\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u041e \u043d\u0438\u0445 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u043e\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0432 \u0441\u0430\u043c\u044b\u0435 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0435 \u0441\u0440\u043e\u043a\u0438. \u0412 \u043d\u0435\u0435, \u043f\u043e\u043c\u0438\u043c\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u043d\u0433\u0430, \u0432\u043e\u0439\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438 \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u043d\u0438\u0435 MotionEvent\u2019\u043e\u0432 \u0434\u043b\u044f \u0442\u0435\u0445 \u0441\u043b\u0430\u0439\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0430\u044e\u0442\u0441\u044f, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043f\u0440\u0438 \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u043d\u0433\u0435 \u0438 \u043e\u0432\u0435\u0440-\u0441\u043a\u0440\u043e\u043b\u043b\u0438\u043d\u0433\u0435, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043c\u0443\u043b\u044c\u0442\u0438\u0442\u0430\u0447\u0430 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043e \u0442\u043e\u043c, \u043e \u0447\u0435\u043c \u0435\u0449\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445, \u043b\u0438\u0431\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0434\u0440\u0443\u0433\u0438\u0445 ViewGroup.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u2013 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435-\u043f\u043e\u0442\u0435\u0441\u0442\u0438\u0442\u0435 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0435\u0439\u0447\u0430\u0441 \u0432 \u043d\u0430\u0448\u0435\u043c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u041f\u043e\u0447\u0442\u044b Mail.Ru. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0432\u0430\u0448\u0438 \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043f\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0418 \u0433\u043e\u0442\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043c\u043e\u0447\u044c \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0432\u0430\u0448\u0438\u0445 \u0437\u0430\u0434\u0430\u0447.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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\/company\/mailru\/blog\/182750\/\"> http:\/\/habrahabr.ru\/company\/mailru\/blog\/182750\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0417\u0430\u043d\u0438\u043c\u0430\u044f\u0441\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434 Android, \u043c\u044b \u0432 Mail.Ru \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0414\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0442\u044c \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0441\u0435, \u043a\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u0438 \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0443\u044e \u0438 \u0431\u044b\u0441\u0442\u0440\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043b\u0438\u0441\u044c. \u0423\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u043d\u043d\u0430\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u2013 \u044d\u0442\u043e \u0442\u043e, \u0437\u0430 \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043b\u0438\u0431\u043e \u043b\u044e\u0431\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043b\u0438\u0431\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0442\u044c \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0435 \u0443\u0441\u0438\u043b\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043e\u0431 \u043f\u043e\u043b.<\/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-182750","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/182750","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=182750"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/182750\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=182750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=182750"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=182750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}