{"id":255466,"date":"2015-04-17T17:20:02","date_gmt":"2015-04-17T13:20:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=255466"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=255466","title":{"rendered":"\u0417\u0430\u043c\u0435\u0442\u043a\u0430 \u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439"},"content":{"rendered":"<br \/>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u044f \u0445\u043e\u0447\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c: \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u0441\u043a\u043e\u0440\u0435\u0435 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u00ab\u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0441 NDK \u043d\u0430 \u0421++\u00bb \u0438 \u00ab\u044d\u043a\u043e\u043d\u043e\u043c\u044c\u0442\u0435 \u043f\u0430\u043c\u044f\u0442\u044c, \u0430 \u0442\u043e \u0441\u0431\u043e\u0440\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f\u00bb, \u0430 \u044d\u0442\u043e \u0446\u0435\u043b\u044b\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441 \u043c\u0435\u0440, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043d\u0435 \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0430 \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u0435.<br \/>  \u041d\u0435 \u0431\u044b\u043b\u043e \u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442, \u0430 \u0432\u044b \u0443\u0436\u0435 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u0440\u043e\u0434\u0435 \u043d\u0435 \u0436\u0440\u0435\u0442, \u0438 \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0435\u0440\u043e\u043c \u0443\u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0441\u0435 \u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u044d\u0442\u0438 \u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u0434\u043b\u044f \u0432\u0430\u0441.<br \/>  \u041f\u043e\u043d\u044f\u0442\u0438\u044f \u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u044b \u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u0442\u0430\u043a \u043a\u0430\u043a \u044f \u0434\u0443\u043c\u0430\u044e \u0447\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u0445 \u043d\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044f\u0442.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h4>\u0421\u0441\u044b\u043b\u043a\u0438 <\/p>\n<h5>(\u0434\u0430, \u0441\u0441\u044b\u043b\u043a\u0438 \u0432\u043d\u0430\u0447\u0430\u043b\u0435)<\/h5>\n<\/h4>\n<p>  \u0412\u0441\u0435 \u0447\u0442\u043e \u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u0437\u0434\u0435\u0441\u044c \u044f \u043f\u043e\u0447\u0435\u0440\u043f\u043d\u0443\u043b \u0438\u0437:<br \/>  1. <a href=\"https:\/\/www.udacity.com\/course\/ud825\">\u041a\u0443\u0440\u0441 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442 Google<\/a> (\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e)<br \/>  2. <a href=\"http:\/\/developer.android.com\/\">developer.android.com<\/a> (\u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u044e\u0434\u0430 \u043d\u0435 \u0437\u0430\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u043b\u0438, \u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043b\u043e\u0445\u0438\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438)<\/p>\n<h4>Overdraw<\/h4>\n<p>  \u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0439 xml-\u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0432 \u0442\u043e, \u0447\u0442\u043e \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435? \u042d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043e\u0434\u043d\u0430 \u0434\u0435\u0442\u0430\u043b\u044c. \u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u044d\u0442\u0430\u043f\u043e\u0432 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 <i>\u0440\u0430\u0441\u0442\u0440\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f (rasterization)<\/i>. \u042d\u0442\u043e \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432\u0440\u043e\u0434\u0435 \u0448\u0440\u0438\u0444\u0442\u043e\u0432 \u0438 \u043a\u0440\u0443\u0436\u043a\u043e\u0432 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 \u043f\u0438\u043a\u0441\u0435\u043b\u0438. <br \/>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     android:layout_width=&quot;match_parent&quot;     android:layout_height=&quot;match_parent&quot;     android:background=&quot;#ffffff&quot;     android:orientation=&quot;vertical&quot;&gt;       &lt;LinearLayout         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;&gt;         ....      &lt;\/LinearLayout&gt;      &lt;LinearLayout         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;         android:background=&quot;#000000&quot;&gt;           &lt;TextView             android:layout_width=&quot;wrap_content&quot;             android:layout_height=&quot;wrap_content&quot;             android:background=&quot;#ff0000&quot;             android:text=&quot;Hello, habrahabr!&quot; \/&gt;      &lt;\/LinearLayout&gt;  &lt;\/LinearLayout&gt;  <\/code><\/pre>\n<p>  \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c TextView, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043b\u0435\u0436\u0438\u0442 \u0432 LinearLayout, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u043e\u0436\u0435 \u043b\u0435\u0436\u0438\u0442 \u0432 LinearLayout. \u0418 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 background. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c\u0441\u044f TextView, \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0443\u0436\u0435 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 LinearLayout, \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u043e\u0436\u0435 \u0431\u044b\u043b\u0430 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043e \u043f\u043e \u0443\u0436\u0435 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443. \u042d\u0442\u043e \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f overdraw. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e, \u043d\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0435\u0439.<br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 overdraw, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 Android:<br \/>  <b>Settings<\/b> -&gt; <b>Developer Options<\/b> -&gt;<b>Debug GPU Overdraw<\/b><br \/>  \u0418 \u0432\u0430\u0448 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f!<br \/>  \u0412\u0441\u0435 \u0441\u0440\u0430\u0437\u0443 \u043e\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0446\u0432\u0435\u0442\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/7c6\/a6e\/1f5\/7c6a6e1f5975493e8961bccc4f90590f.png\"\/><\/p>\n<p>  \u0421\u0438\u043d\u0438\u0439 \u0446\u0432\u0435\u0442 \u2014 \u0432\u0441\u0435 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435<br \/>  \u0417\u0435\u043b\u0435\u043d\u044b\u0439 \u2014 <b>2x<\/b> overdraw<br \/>  \u0421\u0432\u0435\u0442\u043b\u043e\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u2014 <b>3x<\/b> overdraw<br \/>  \u041a\u0440\u0430\u0441\u043d\u044b\u0439 \u2014 <b>4x<\/b> \u0438 \u0431\u043e\u043b\u0435\u0435<\/p>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0433\u0434\u044f\u0434\u0438\u0442 Gmail:<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/230\/b1b\/3f5\/230b1b3f53ba443481c1022cab189da3.png\"\/><\/p>\n<p>  \u0410 \u0432\u043e\u0442 \u0442\u0430\u043a \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0435 \u043c\u043d\u043e\u0433\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 ViVino:<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/180\/e9a\/5ee\/180e9a5ee13041eabac27aeb166446a8.png\"\/><\/p>\n<p>  \u0412\u0438\u0434\u043d\u043e, \u0443 \u043a\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0430 \u0443 \u043a\u043e\u0433\u043e \u043d\u0435\u0442.<br \/>  \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442 overdraw, \u044d\u0442\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f background. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     android:layout_width=&quot;match_parent&quot;     android:layout_height=&quot;match_parent&quot;          android:orientation=&quot;vertical&quot;&gt;       &lt;LinearLayout         android:background=&quot;#ffffff&quot;         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;&gt;         ....      &lt;\/LinearLayout&gt;      &lt;LinearLayout         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;&gt;           &lt;TextView             android:layout_width=&quot;wrap_content&quot;             android:layout_height=&quot;wrap_content&quot;             android:background=&quot;#ff0000&quot;             android:text=&quot;Hello, habrahabr!&quot; \/&gt;      &lt;\/LinearLayout&gt;  &lt;\/LinearLayout&gt; <\/code><\/pre>\n<p>  \u0418, \u0435\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 Activity:<\/p>\n<pre><code class=\"java\">    @Override     public void onCreate(Bundle savedInstanceState) {         getWindow().setBackgroundDrawable(null); ... } <\/code><\/pre>\n<h4>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u044f<\/h4>\n<p>  \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430 \u0432\u044c\u044e\u0445 \u2014 \u0432\u0435\u0441\u044c\u043c\u0430 \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u0418 \u043e\u0431\u0449\u0430\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f \u0437\u0434\u0435\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430 \u2014 \u0447\u0435\u043c \u043f\u0440\u043e\u0449\u0435, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435. \u041f\u043b\u043e\u0441\u043a\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u2014 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e.<br \/>  \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <b>monitor<\/b>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u043d\u0430\u0431\u043e\u0440 Android SDK. \u0412 \u043d\u0435\u043c \u0435\u0441\u0442\u044c \u0432\u0438\u0434 &quot;<b>Hierarchy View<\/b>&quot;, \u0438 \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e.<br \/>  <i>* \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0437\u0434\u0435\u0441\u044c: <a href=\"http:\/\/developer.android.com\/training\/improving-layouts\/optimizing-layout.html\">http:\/\/developer.android.com\/training\/improving-layouts\/optimizing-layout.html<\/a><\/i> <br \/>  \u0438 \u0437\u0434\u0435\u0441\u044c: <a href=\"http:\/\/developer.android.com\/tools\/debugging\/debugging-ui.html\">http:\/\/developer.android.com\/tools\/debugging\/debugging-ui.html<\/a><\/p>\n<p>  \u042d\u0442\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u044e \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u0432\u044c\u044e\u0445 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u0432\u044c\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435 (\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445). \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/developer.android.com\/images\/training\/hierarchy-linearlayout.png\" alt=\"image\"\/><\/p>\n<h5>\u0427\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0446\u0432\u0435\u0442\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438<\/h5>\n<p>  monitor \u043c\u0435\u0440\u044f\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0432\u044c\u044e\u0445 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0444\u0430\u0437\u044b \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 Activity:<br \/>  \u041b\u0435\u0432\u0430\u044f \u2014 <b>Draw<\/b><br \/>  \u0421\u0440\u0435\u0434\u043d\u044f\u044f \u2014 <b>Layout<\/b><br \/>  \u041f\u0440\u0430\u0432\u0430\u044f \u2014 <b>Mesure<\/b><br \/>  \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0446\u0432\u0435\u0442\u0430, \u0442\u043e:<br \/>  \u0417\u0435\u043b\u0435\u043d\u044b\u0439 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044c\u044e \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u0441\u044f <b>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/b> \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0432\u044c\u044e\u0445.<br \/>  Yellow \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044c\u044e \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u0441\u044f <b>\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435<\/b> \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0432\u044c\u044e\u0445.<br \/>  \u041a\u0440\u0430\u0441\u043d\u044b\u0439 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e <strike>\u0432\u0441\u0435 \u043f\u043b\u043e\u0445\u043e<\/strike> \u0432\u044c\u044e \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0432\u0440\u0435\u043c\u044f\u0437\u0430\u0442\u0440\u0430\u0442\u043d\u044b\u0445.<\/p>\n<h5>\u041a\u0430\u043a \u0442\u0440\u0430\u043a\u0442\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0442\u043e\u0447\u043a\u0438?<\/h5>\n<p>  \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u0441\u0435 \u043a\u0440\u0430\u0441\u043d\u043e\u0435 \u0443 \u00ab\u043a\u0440\u0430\u0439\u043d\u0438\u0445\u00bb \u0432\u044c\u044e (\u0442\u0435, \u0447\u0442\u043e \u043b\u0438\u0441\u0442\u044b \u0434\u0435\u0440\u0435\u0432\u0430), \u0442\u043e \u043d\u0430 \u043d\u0438\u0445 \u0442\u043e\u0447\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c.<br \/>  \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 ViewGroup \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0435\u0442\u0435\u0439, \u0438 \u0443 \u043d\u0438\u0445 \u0442\u043e\u0447\u043a\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f measure \u043a\u0440\u0430\u0441\u043d\u0430\u044f, \u0442\u043e \u0442\u0443\u0442 \u0442\u043e\u0447\u043d\u043e \u043d\u0430\u0434\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e.<\/p>\n<p>  \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043b\u043e\u0441\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0435\u0433\u043a\u043e:<\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;RelativeLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     android:layout_width=&quot;match_parent&quot;     android:layout_height=&quot;match_parent&quot;     android:orientation=&quot;vertical&quot;&gt;       &lt;LinearLayout         android:id=&quot;@+id\/my_layout&quot;         android:background=&quot;#ffffff&quot;         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;&gt;         ....      &lt;\/LinearLayout&gt;      &lt;TextView         android:layout_below=&quot;@+id\/my_layout&quot;         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;         android:background=&quot;#ff0000&quot;         android:text=&quot;Hello, habrahabr!&quot; \/&gt;      &lt;\/RelativeLayout&gt; <\/code><\/pre>\n<h4>ViewStub<\/h4>\n<p>  <b>ViewStub<\/b>, \u044d\u0442\u043e \u0432\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0435\u0431\u0435\u043d\u043a\u0430:<\/p>\n<pre><code class=\"xml\">&lt;ViewStub android:id=&quot;@+id\/stub&quot;                android:inflatedId=&quot;@+id\/subTree&quot;                android:layout=&quot;@layout\/mySubTree&quot;                android:layout_width=&quot;120dip&quot;                android:layout_height=&quot;40dip&quot; \/&gt; <\/code><\/pre>\n<p>  \u041d\u043e \u0432\u0441\u044f \u0448\u0442\u0443\u043a\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e layout, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 ViewStub, \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e, \u0435\u0441\u043b\u0438 ViewStub <i>\u0432\u0438\u0434\u0438\u043c\u0430<\/i>, \u0438\u043b\u0438 \u0443 \u043d\u0435\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u044b\u0437\u0432\u0430\u043d \u043c\u0435\u0442\u043e\u0434 <i>inflate().<\/i><br \/>  <i>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435: <a href=\"http:\/\/developer.android.com\/reference\/android\/view\/ViewStub.html\">http:\/\/developer.android.com\/reference\/android\/view\/ViewStub.html<\/a><\/i><br \/>  \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0438\u0434\u0438\u043c\u043e\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438\u043b\u0438 \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043a\u043d\u043e\u043f\u043a\u0443. \u0422\u043e \u0435\u0441\u0442\u044c, \u044d\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u043b\u0435\u043d\u0438\u0432\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u041f\u0438\u0448\u0438\u0442\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u043b\u043b\u0435\u0433\u0438.     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/255997\/\"> http:\/\/habrahabr.ru\/post\/255997\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<br \/>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u044f \u0445\u043e\u0447\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c: \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u0441\u043a\u043e\u0440\u0435\u0435 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u00ab\u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0441 NDK \u043d\u0430 \u0421++\u00bb \u0438 \u00ab\u044d\u043a\u043e\u043d\u043e\u043c\u044c\u0442\u0435 \u043f\u0430\u043c\u044f\u0442\u044c, \u0430 \u0442\u043e \u0441\u0431\u043e\u0440\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f\u00bb, \u0430 \u044d\u0442\u043e \u0446\u0435\u043b\u044b\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441 \u043c\u0435\u0440, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043d\u0435 \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0430 \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u0435.<br \/>  \u041d\u0435 \u0431\u044b\u043b\u043e \u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442, \u0430 \u0432\u044b \u0443\u0436\u0435 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u0440\u043e\u0434\u0435 \u043d\u0435 \u0436\u0440\u0435\u0442, \u0438 \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0435\u0440\u043e\u043c \u0443\u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0441\u0435 \u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u044d\u0442\u0438 \u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u0434\u043b\u044f \u0432\u0430\u0441.<br \/>  \u041f\u043e\u043d\u044f\u0442\u0438\u044f \u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u044b \u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u0442\u0430\u043a \u043a\u0430\u043a \u044f \u0434\u0443\u043c\u0430\u044e \u0447\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u0445 \u043d\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044f\u0442.<\/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-255466","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/255466","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=255466"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/255466\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=255466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=255466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=255466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}