{"id":276770,"date":"2016-03-23T11:46:02","date_gmt":"2016-03-23T08:46:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=276770"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=276770","title":{"rendered":"\u0414\u0440\u0443\u0436\u0438\u043c Scala \u0438 Android \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Macroid"},"content":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/170\/6db\/4b5\/1706db4b52424bda85b598999465ca31.png\" alt=\"image\" align=\"left\"\/>\u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u044f \u043f\u0438\u0448\u0443 \u043d\u0430 \u0441\u0442\u0430\u0440\u043e\u0439 \u0434\u043e\u0431\u0440\u043e\u0439 Enterprise Java, \u043c\u0435\u043d\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u044f\u043d\u0435\u0442 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u0422\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u044d\u0442\u0438\u043c \u043d\u043e\u0432\u044b\u043c \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c Scala. \u0418 \u0432\u043e\u0442 \u043e\u0434\u043d\u0430\u0436\u0434\u044b, \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u0434\u043e\u043a\u043b\u0430\u0434\u044b \u0441\u043e Scala Days, \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0434\u043e\u043a\u043b\u0430\u0434 \u041d\u0438\u043a\u0430 \u0421\u0442\u0430\u043d\u0447\u0435\u043d\u043a\u043e \u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Macroid, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u043b. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0435\u0451 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0438\u0448\u043a\u0430\u0445 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/cheshirrrr\/macroid-for-habr\">Github<\/a>.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c Scala \u0438 Android, \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a><br clear=\"left\"\/>  <\/p>\n<h3>\u0427\u0442\u043e \u0436\u0435 \u0442\u0430\u043a\u043e\u0435 Macroid?<\/h3>\n<p>  Macroid \u2014 \u044d\u0442\u043e DSL \u043d\u0430 Scala \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u0445 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Android-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c. \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c XML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a:<\/p>\n<ul>\n<li>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u043b\u0435\u0436\u0430\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435;<\/li>\n<li>\u0418\u0437\u0431\u044b\u0442\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0432\u043e\u0439 \u0444\u0430\u0439\u043b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0437-\u0437\u0430 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0438 \u043f\u0440\u043e\u0447\u0435\u0433\u043e;<\/li>\n<li>\u0414\u0430\u0436\u0435 \u0441 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u043e\u0439 \u0432 XML \u0444\u0430\u0439\u043b\u0435, \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u0436\u0435\u043d \u043a\u043e\u0434 (\u0434\u043b\u044f \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u0442\u0435\u0445 \u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439).<\/li>\n<\/ul>\n<p>  Macroid \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043d\u0430 Scala \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u0443\u0434\u043e\u0431\u043d\u043e. \u0410 \u0442\u0430\u043a \u0436\u0435: <\/p>\n<ul>\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u043a\u0443\u0441\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445. <\/li>\n<li>Macroid \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0435\u0442 AppContext \u0438 ActivityContext, \u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u0445 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0432 \u0432\u0438\u0434\u0435 implicit \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. ActivityContext \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u0430\u0431\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0443\u0442\u0435\u0447\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/li>\n<li>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f UI Action, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043b\u044e\u0431\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c, \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0440\u0430\u0437\u043e\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043f\u043e\u0442\u043e\u043a UI \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435.<\/li>\n<\/ul>\n<p>  \u041d\u0443 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u0441\u0435 \u043f\u043b\u044e\u0441\u044b Scala \u0442\u043e\u0436\u0435 \u0437\u0434\u0435\u0441\u044c: \u043f\u0430\u0442\u0442\u0435\u0440\u043d-\u043c\u0430\u0442\u0447\u0438\u043d\u0433, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0441\u0448\u0435\u0433\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0430, \u0442\u0440\u0435\u0439\u0442\u044b, \u043a\u0435\u0439\u0441 \u043a\u043b\u0430\u0441\u0441\u044b, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 \u0442\u0438\u043f\u043e\u0432 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<h3>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e<\/h3>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0434 Android. \u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 <a href=\"http:\/\/developer.android.com\/intl\/ru\/training\/basics\/firstapp\/index.html\">developer.android.com<\/a>, \u0442\u0430\u043a \u0447\u0442\u043e \u0442\u0443\u0442 \u0435\u0451 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430 \u043d\u0435\u0442.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e, \u0441\u043e\u0437\u0434\u0430\u0451\u043c SBT \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c android-sbt-plugin.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">build.sbt:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"scala\">import android.Keys._  \/\/\u0437\u0430\u0434\u0430\u0451\u043c \u0432\u0435\u0440\u0441\u0438\u044e Android android.Plugin.androidBuild platformTarget in Android := &quot;android-23&quot;  packagingOptions in Android := PackagingOptions( Seq.empty[String], Seq(&quot;reference.conf&quot;), Seq.empty[String])  name := &quot;macroid-for-habr&quot;  scalaVersion := &quot;2.11.7&quot; javacOptions ++= Seq(&quot;-target&quot;, &quot;1.7&quot;, &quot;-source&quot;, &quot;1.7&quot;)  \/\/ \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0441\u0431\u043e\u0440\u043a\u0438 \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 Android:run run &lt;&lt;= run in Android  resolvers ++= Seq( Resolver.sonatypeRepo(&quot;releases&quot;), &quot;jcenter&quot; at &quot;http:\/\/jcenter.bintray.com&quot; )  \/\/ \u0434\u043e\u0431\u0430\u0432\u0438\u043c linter scalacOptions in (Compile, compile) ++= (dependencyClasspath in Compile).value.files.map(&quot;-P:wartremover:cp:&quot; + _.toURI.toURL) ++ Seq(&quot;-P:wartremover:traverser:macroid.warts.CheckUi&quot;)  libraryDependencies ++= Seq( aar(&quot;org.macroid&quot; %% &quot;macroid&quot; % &quot;2.0.0-M4&quot;), &quot;com.android.support&quot; % &quot;support-v4&quot; % &quot;23.1.1&quot;, compilerPlugin(&quot;org.brianmckenna&quot; %% &quot;wartremover&quot; % &quot;0.11&quot;) )  \/\/ \u0412\u043a\u043b\u044e\u0447\u0438\u043c proguard \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 proguardScala in Android := true <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">plugin.sbt:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"scala\">addSbtPlugin(&quot;com.hanhuy.sbt&quot; % &quot;android-sdk-plugin&quot; % &quot;1.5.13&quot;) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 AndroidManifest.xml:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">AndroidManifest.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;manifest xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot; package=&quot;tutorial.macroidforhabr&quot; android:versionCode=&quot;0&quot; android:versionName=&quot;0.1&quot;&gt;  &lt;uses-sdk android:minSdkVersion=&quot;9&quot; android:targetSdkVersion=&quot;23&quot;\/&gt;  &lt;application android:label=&quot;Macroid for Habr&quot; android:icon=&quot;@drawable\/android:star_big_on&quot;&gt;  &lt;activity android:label=&quot;Macroid for Habr&quot; android:name=&quot;.MainActivity&quot;&gt; &lt;intent-filter&gt; &lt;action android:name=&quot;android.intent.action.MAIN&quot;\/&gt; &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot;\/&gt; &lt;\/intent-filter&gt; &lt;\/activity&gt;  &lt;\/application&gt; &lt;\/manifest&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043b\u0438\u0448\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 MainActivity \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0442\u0440\u0435\u0439\u0442 \u0441 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u043c\u0438:<\/p>\n<pre><code class=\"scala\">class MainActivity extends Activity with Contexts[Activity] <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0442\u0435\u0433\u0443 <a href=\"https:\/\/github.com\/cheshirrrr\/macroid-for-habr\/tree\/Step1\">Step1<\/a>.<\/p>\n<h3>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0430\u0437\u043e\u0432<\/h3>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432 Macroid \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u00abBrick\u00bb. Brick \u2014 \u044d\u0442\u043e \u043a\u0438\u0440\u043f\u0438\u0447\u0438\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434\u0436\u0435\u0442. \u0420\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u00ablayout\u00bb \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u00abl\u00bb, \u0430 \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u2014 \u00abwidget\u00bb \u0438\u043b\u0438 \u00abw\u00bb. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0441\u0442\u043e\u0439 LinearLayout \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u0435\u043c \u0438 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"scala\">l[LinearLayout](   w[TextView],   w[Button] )  <\/code><\/pre>\n<p>  \u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043a\u0443\u0441\u043a\u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c \u0442\u0430\u043c \u0438 \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"scala\">val view = l[LinearLayout](               w[TextView],               w[Button]            ) <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u043c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0438\u043d\u0430\u0447\u0435 \u0432 \u043d\u0438\u0445 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430. <br \/>  \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0448\u0442\u0443\u043a\u0430 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Tweak. \u0414\u043b\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438 \u0442\u0432\u0438\u043a\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c &lt;~. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u043b\u044e \u0438 \u043a\u043d\u043e\u043f\u043a\u0435:<\/p>\n<pre><code class=\"scala\">w[TextView] &lt;~ text(&quot;\u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0434\u043f\u0438\u0441\u044c&quot;), w[Button] &lt;~ text(&quot;\u041d\u0430\u0436\u043c\u0438 \u043c\u0435\u043d\u044f&quot;) <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0448 \u0432\u0438\u0434\u0436\u0435\u0442 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0442\u0432\u0438\u043a\u0430 vertical:<\/p>\n<pre><code class=\"scala\">val view = l[LinearLayout](               w[TextView] &lt;~ text(&quot;\u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0434\u043f\u0438\u0441\u044c&quot;),               w[Button] &lt;~ text(&quot;\u041d\u0430\u0436\u043c\u0438 \u043c\u0435\u043d\u044f&quot;)            ) &lt;~ vertical <\/code><\/pre>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043a\u0430\u043a\u0430\u044f \u0436\u0435 \u043a\u043d\u043e\u043f\u043a\u0430 \u0431\u0435\u0437 onClickListener. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0432 \u043f\u043e\u043b\u0435 \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043a\u043d\u043e\u043f\u043a\u0438:<\/p>\n<pre><code class=\"scala\">w[Button] &lt;~ text(&quot;\u041d\u0430\u0436\u043c\u0438 \u043c\u0435\u043d\u044f&quot;) &lt;~ On.click(changeText) <\/code><\/pre>\n<p>  \u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 On, \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u043c\u044f Listener \u0438\u0437 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0447\u043a\u0438, \u0438 \u043d\u0430\u0439\u0442\u0438 \u0435\u0433\u043e \u0443 \u0432\u0438\u0434\u0436\u0435\u0442\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043e\u043d \u043f\u0440\u0438\u043c\u0435\u043d\u0451\u043d. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043e\u043d \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 onClickListener \u0443 \u0432\u0438\u0434\u0436\u0435\u0442\u0430 Button \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043d\u0451\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e changeText.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u043a-\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432\u0438\u0434\u0436\u0435\u0442 \u043f\u043e\u043b\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e changeText. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 slot, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0438\u0434\u0436\u0435\u0442 \u0432 Option, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<pre><code class=\"scala\">var textView = slot[TextView] <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0432\u0438\u0434\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a \u0441\u043b\u043e\u0442\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0442\u0432\u0438\u043a\u0430 wire:<\/p>\n<pre><code class=\"scala\">w[TextView] &lt;~ wire(textView) <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u0430 changeText:<\/p>\n<pre><code class=\"scala\">def changeText : Ui[Any] = {     textView &lt;~ text(&quot;\u0414\u0440\u0443\u0433\u0430\u044f \u043d\u0430\u0434\u043f\u0438\u0441\u044c&quot;) } <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0432\u0438\u043a\u0430 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 Ui Action, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0431\u043e\u0439 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u0432 \u043f\u043e\u0442\u043e\u043a\u0435 UI.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0430\u0441\u044c \u043a MainActivity, \u0432\u044b\u0437\u043e\u0432\u0435\u043c setContentView(getUi(view)) \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 onCreate. \u041c\u0435\u0442\u043e\u0434 getUi(view) \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 UI \u043a\u043e\u0434 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0438 \u0432\u0435\u0440\u043d\u0451\u0442 \u043d\u0430\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f View, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0432 ContentView \u043d\u0430\u0448\u0435\u0439 Activity.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0442\u0435\u0433\u0443 <a href=\"https:\/\/github.com\/cheshirrrr\/macroid-for-habr\/tree\/Step2\">Step2<\/a>.<\/p>\n<h3>\u041c\u0435\u043d\u044f\u0435\u043c \u0440\u0430\u0437\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e<\/h3>\n<p>  \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e Ui \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0432\u0438\u043a\u043e\u0432, \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u044b. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0432\u0438\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c. <\/p>\n<p>  \u0410 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e? \u0422\u0443\u0442 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u0442\u0432\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Snail \u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c &lt;~~. Snail \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u00ab\u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u043b \u0438 \u0437\u0430\u0431\u044b\u043b\u00bb. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0437\u0430\u0442\u0443\u0445\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f:<\/p>\n<pre><code class=\"scala\">textView &lt;~~ fadeOut(500) <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 Snail \u0432 \u043e\u0434\u0438\u043d, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 ++. \u0412\u043e\u0442 \u0442\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c Snail \u0434\u043b\u044f \u043c\u0438\u0433\u0430\u043d\u0438\u044f \u043b\u044e\u0431\u044b\u043c View:<\/p>\n<pre><code class=\"scala\">def flashElement : Snail[View] = {     fadeOut(500) ++ fadeIn(500) ++ fadeOut(500) ++ fadeIn(500) } <\/code><\/pre>\n<p>  \u0421 \u0442\u0432\u0438\u043a\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 +.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043a\u0443\u0441\u043e\u043a \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0441 \u0435\u0449\u0451 \u043e\u0434\u043d\u0438\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u0435\u043c \u0438 \u043f\u0440\u0438\u0432\u044f\u0436\u0435\u043c \u0435\u0433\u043e \u043a \u0441\u043b\u043e\u0442\u0443:<\/p>\n<pre><code class=\"scala\">var layout = slot[LinearLayout]  val view = l[LinearLayout](     w[TextView] &lt;~ text(&quot;\u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0434\u043f\u0438\u0441\u044c&quot;) &lt;~ wire(textView),     w[Button] &lt;~ text(&quot;\u041d\u0430\u0436\u043c\u0438 \u043c\u0435\u043d\u044f&quot;) &lt;~ On.click(changeText),     l[LinearLayout](         w[TextView] &lt;~ text(&quot;\u041c\u0438\u0433\u0430\u044e\u0449\u0438\u0439 \u043b\u044d\u0439\u0430\u0443\u0442&quot;)     ) &lt;~ wire(layout)   ) &lt;~ vertical <\/code><\/pre>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0434\u0438\u043c \u043d\u0430\u0448\u0435\u0439 \u043a\u043d\u043e\u043f\u043a\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043b\u0438\u044f\u043d\u0438\u044f \u043d\u0430 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"scala\">def changeText : Ui[Any] = {     (textView &lt;~ text(&quot;\u041f\u043e\u043c\u0438\u0433\u0430\u0435\u043c?&quot;)) ~ (layout &lt;~~ flashElement) ~~ (textView &lt;~ text(&quot;\u041d\u0443 \u0438 \u0445\u0432\u0430\u0442\u0438\u0442&quot;)) } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u043b\u0435 \u0441\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0442\u0435\u043a\u0441\u0442 \u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441 \u044d\u0442\u0438\u043c \u043d\u0430\u0448 \u043d\u043e\u0432\u0435\u043d\u044c\u043a\u0438\u0439 \u043a\u0443\u0441\u043e\u043a \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u043d\u0430\u0447\u043d\u0451\u0442 \u043c\u0438\u0433\u0430\u0442\u044c, \u0430 \u043f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0435\u0449\u0451 \u0440\u0430\u0437. \u0414\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0434\u0432\u0443\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 ~ \u0438 ~~. \u041f\u0435\u0440\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043e\u0431\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0442\u0435\u0433\u0443 <a href=\"https:\/\/github.com\/cheshirrrr\/macroid-for-habr\/tree\/Step3\">Step3<\/a>.<\/p>\n<h3>\u0421\u043f\u0438\u0441\u043a\u0438, \u0441\u043f\u0438\u0441\u043a\u0438, \u0441\u043f\u0438\u0441\u043a\u0438<\/h3>\n<p>  \u041d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043f\u0438\u0441\u043e\u043a. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a Macroid \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u044d\u0442\u0438\u043c. <br \/>  \u0415\u0441\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f Listable. \u0422\u0440\u0435\u0439\u0442 Listable[A, W &lt;: View] \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 A \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0432\u0438\u0434\u0436\u0435\u0442\u0430 W, \u0438 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0432 \u0434\u0432\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0448\u0430\u0433\u0430:<\/p>\n<ol>\n<li>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 View<\/li>\n<li>\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/li>\n<\/ol>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043c\u0435\u0442\u043e\u0434 basicListable, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 TextView, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0442\u0432\u0438\u043a\u0430 text() \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 Listable[String, TextView]:<\/p>\n<pre><code class=\"scala\">def basicListable(implicit appCtx: AppContext): Listable[String, TextView] = {     Listable[String].tw { w[TextView] } { text(_) } } <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043b\u0438\u0448\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c ListView \u0432 \u043d\u0430\u0448\u0443 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u0442\u0432\u0438\u043a Listable.listAdapterTweak \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u043e\u043c\u0443 \u0442\u0432\u0438\u043a\u0443 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 \u0441\u0442\u0440\u043e\u043a:<\/p>\n<pre><code class=\"scala\">w[ListView] &lt;~ basicListable.listAdapterTweak(contactList) <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0442\u0435\u0433\u0443 <a href=\"https:\/\/github.com\/cheshirrrr\/macroid-for-habr\/tree\/Step4\">Step4<\/a>.<\/p>\n<h3>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b<\/h3>\n<p>  \u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0442\u043e \u0438 \u0442\u0443\u0442 Macroid \u0435\u0441\u0442\u044c \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u0448\u0443 Activity \u0432\u043e FragmentActivity:<\/p>\n<pre><code class=\"scala\">class MainActivity extends FragmentActivity <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0442\u0443\u0434\u0430 \u0432\u0441\u0435, \u0447\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a ListView:<\/p>\n<pre><code class=\"scala\">class ListableFragment extends Fragment with Contexts[Fragment]{  def basicListable(implicit appCtx: AppContext): Listable[String, TextView] = {     Listable[String].tw { w[TextView] } { text(_) } } override def onCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle): View = getUi {   l[LinearLayout](     w[ListView] &lt;~ basicListable.listAdapterTweak(contactList) &lt;~ matchWidth   ) } <\/code><\/pre>\n<p>  \u0417\u0430\u043e\u0434\u043d\u043e \u043f\u0440\u0438\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432 \u043a\u043e\u0434\u0435 \u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0440\u0435\u0439\u0442 Contacts, \u0430 \u0442\u0432\u0438\u043a flashElement \u0432 \u0442\u0440\u0435\u0439\u0442 Tweaks.<\/p>\n<p>  \u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u00abfragment\u00bb \u0438\u043b\u0438 \u00abf\u00bb \u0438 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e FrameLayout \u043c\u0435\u0442\u043e\u0434\u043e\u043c framed.<\/p>\n<p>  \u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0443 \u043d\u0443\u0436\u043d\u044b Id \u0438 Tag, \u0438 \u0434\u043b\u044f \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0435\u0439\u0442 IdGeneration \u0438 \u043a\u043b\u0430\u0441\u0441\u044b IdGen \u0438 TagGen. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0435 tag \u0438 id \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0432 Tag \u0438 Id \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u0443 framed:<\/p>\n<pre><code class=\"scala\">f[ListableFragment].framed(Id.contactList, Tag.contactList) <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0442\u0435\u0433\u0443 <a href=\"https:\/\/github.com\/cheshirrrr\/macroid-for-habr\/tree\/Step5\">Step5<\/a><\/p>\n<h3>\u0418 \u0441\u043d\u043e\u0432\u0430 \u0441\u043f\u0438\u0441\u043a\u0438<\/h3>\n<p>  \u0412 Android \u043f\u0440\u0438 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u043c\u0438 \u0438\u0437 \u043a\u0443\u0447\u043a\u0438 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u043e\u0438\u0441\u043a \u043f\u043e id(findViewById()). \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0448\u0430\u0431\u043b\u043e\u043d View Holder.<\/p>\n<p>  \u0412 Macroid \u0435\u0441\u0442\u044c \u0442\u0440\u0435\u0439\u0442 SlottedListable, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u043f\u043b\u043e\u0449\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d, \u0438 \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0430\u0432\u0442\u043e\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u043e\u0432\u0435\u0442\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e. \u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0435\u0439\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0442\u0438\u043f \u0438 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 ContactListable \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c:<\/p>\n<ol>\n<li>class Slots, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c View Holder \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0441\u043b\u043e\u0442\u044b \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043d\u0443\u0436\u043d\u044b\u0445 View<\/li>\n<li>\u043c\u0435\u0442\u043e\u0434 makeSlots, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430<\/li>\n<li>\u043c\u0435\u0442\u043e\u0434 fillSlots, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438<\/li>\n<\/ol>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u0435\u0439\u0441 \u043a\u043b\u0430\u0441\u0441 Contact(name:String, phone: String, photo: Int), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0430\u043a\u0442 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c, \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u043c \u0438 \u0444\u043e\u0442\u043e.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434 fullContactList, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0440\u043d\u0451\u0442 \u043d\u0430\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 \u0442\u0440\u0451\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u0431\u044b\u043b \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439, \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u0432 \u0432\u0438\u0434\u0435 RoundedBitmapDrawable \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0442\u0432\u0438\u043a\u0430:<\/p>\n<pre><code class=\"scala\">def roundedDrawable(id: Int)(implicit appCtx: AppContext) = Tweak[ImageView]({   val res = appCtx.app.getResources   val rounded = RoundedBitmapDrawableFactory.create(res,BitmapFactory.decodeResource(res, id))   rounded.setCornerRadius(Math.min(rounded.getMinimumWidth(),rounded.getMinimumHeight))   _.setImageDrawable(rounded) }) <\/code><\/pre>\n<p>  \u0410 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0430\u0440\u0443 \u0442\u0432\u0438\u043a\u043e\u0432 \u0434\u043b\u044f \u0432\u0441\u044f\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439 \u0432\u0440\u043e\u0434\u0435 ImageView.ScaleType.CENTER_INSIDE, \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u044e\u0449\u0435\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043e \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043b\u0438\u0448\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 SlottedListableFragment, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432.<\/p>\n<p>  \u0414\u0432\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u044d\u043a\u0440\u0430\u043d\u0435 \u044d\u0442\u043e \u043c\u043d\u043e\u0433\u043e\u0432\u0430\u0442\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0439 ListableFragment, \u043d\u0430 \u043d\u043e\u0432\u0435\u043d\u044c\u043a\u0438\u0439 \u0438 \u0431\u043b\u0435\u0441\u0442\u044f\u0449\u0438\u0439 SlottedListableFragment. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0442\u0432\u0438\u043a, \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0439 \u043e\u0434\u0438\u043d \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u0440\u0435\u0439\u0442 FragmentApi, \u043b\u044e\u0431\u0435\u0437\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 Macroid:<\/p>\n<pre><code class=\"scala\">def replaceListableWithSlotted = Ui {   activityManager(this).beginTransaction().replace(Id.contactList,new SlottedListableFragment,Tag.slottedList).commit() } <\/code><\/pre>\n<p>  \u0410 \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u044d\u0442\u043e\u0442 \u0442\u0432\u0438\u043a \u0432 \u043a\u043e\u043d\u0435\u0446 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 changeText, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f changeTextAndShowFragment.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0442\u0435\u0433\u0443 <a href=\"https:\/\/github.com\/cheshirrrr\/macroid-for-habr\/tree\/Step6\">Step6<\/a>.<\/p>\n<h3>\u041a\u0430\u043a\u0430\u044f \u0436\u0435 Scala \u0431\u0435\u0437 Akka<\/h3>\n<p>  \u0413\u043e\u0432\u043e\u0440\u044f \u043e Scala, \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0431\u043e\u0439\u0442\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439 \u0430\u043a\u0442\u043e\u0440\u044b \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 Akka.<\/p>\n<p>  Macroid \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043a\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0435\u0439\u0442 AkkaFragment. \u041d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 AkkaFragment \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0441\u0432\u043e\u0439 \u0430\u043a\u0442\u043e\u0440. \u0410\u043a\u0442\u043e\u0440\u044b \u0436\u0438\u0432\u0443\u0442 \u043f\u043e\u043a\u0430 \u0436\u0438\u0432\u0451\u0442 Activity, \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0436\u0435 \u0436\u0438\u0432\u0443\u0442 \u0432 \u0441\u0432\u043e\u0451\u043c \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0430\u043a\u0442\u043e\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0442\u044c\u0441\u044f \u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443 \u0438\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 \u0438 \u043e\u0442\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u0433\u043e.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 macroid-akka \u0438 akka-actor \u0432 build.sbt. \u0410 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043d\u0451\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f Proguard:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">proguard<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"scala\">proguardOptions in Android ++= Seq( &quot;-keep class akka.actor.Actor$class { *; }&quot;, &quot;-keep class akka.actor.LightArrayRevolverScheduler { *; }&quot;, &quot;-keep class akka.actor.LocalActorRefProvider { *; }&quot;, &quot;-keep class akka.actor.CreatorFunctionConsumer { *; }&quot;, &quot;-keep class akka.actor.TypedCreatorFunctionConsumer { *; }&quot;, &quot;-keep class akka.dispatch.BoundedDequeBasedMessageQueueSemantics { *; }&quot;, &quot;-keep class akka.dispatch.UnboundedMessageQueueSemantics { *; }&quot;, &quot;-keep class akka.dispatch.UnboundedDequeBasedMessageQueueSemantics { *; }&quot;, &quot;-keep class akka.dispatch.DequeBasedMessageQueueSemantics { *; }&quot;, &quot;-keep class akka.dispatch.MultipleConsumerSemantics { *; }&quot;, &quot;-keep class akka.actor.LocalActorRefProvider$Guardian { *; }&quot;, &quot;-keep class akka.actor.LocalActorRefProvider$SystemGuardian { *; }&quot;, &quot;-keep class akka.dispatch.UnboundedMailbox { *; }&quot;, &quot;-keep class akka.actor.DefaultSupervisorStrategy { *; }&quot;, &quot;-keep class macroid.akka.AkkaAndroidLogger { *; }&quot;, &quot;-keep class akka.event.Logging$LogExt { *; }&quot; ) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0441 \u043e\u0434\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439, \u0446\u0432\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u0432\u044b\u0437\u0432\u0430\u0432 \u043c\u0435\u0442\u043e\u0434 receiveColor. \u0418\u043c\u044f \u0430\u043a\u0442\u043e\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"scala\">class TweakerFragment extends AkkaFragment with Contexts[AkkaFragment]{    lazy val actorName = getArguments.getString(&quot;name&quot;)   lazy val actor = Some(actorSystem.actorSelection(s&quot;\/user\/$actorName&quot;))    var button = slot[Button]    def receiveColor(textColor: Int) = button &lt;~ color(textColor)    def tweak = Ui(actor.foreach(_ ! TweakerActor.TweakHim))    override def onCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle) = getUi {     l[FrameLayout](       w[Button] &lt;~ wire(button) &lt;~ text(&quot;TweakHim&quot;) &lt;~ On.click(tweak)     )   } } <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0430\u043a\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u044d\u0442\u0438\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u043c:<\/p>\n<pre><code class=\"scala\">class TweakerActor(var tweakTarget:Option[ActorRef]) extends FragmentActor[TweakerFragment]{   import TweakerActor._    \/\/ receiveUi \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0442\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\/\u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u043c   def receive = receiveUi andThen {     case TweakHim =&gt; tweakTarget.foreach(_ ! TweakYou)      case TweakYou =&gt;        val chosenColor = randomColor       tweakTarget = Some(sender)        \/\/withUi \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u043c       withUi(f =&gt; f.receiveColor(chosenColor))      case SetTweaked(target) =&gt; tweakTarget = Some(target)      \/\/ \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0451 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\/\u043e\u0442\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c\u0443     case AttachUi(_) =&gt;     case DetachUi =&gt;   }    def randomColor: Int = {     val random = new Random()     val red = random.nextInt(255)     val green = random.nextInt(255)     val blue = random.nextInt(255)     Color.rgb(red, green, blue)   } } <\/code><\/pre>\n<p>  \u0412 MainActivity \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0440\u0435\u0439\u0442 AkkaActivity. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u0430\u0440\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<pre><code class=\"scala\">val actorSystemName = &quot;tutorialsystem&quot; lazy val tweakerOne = actorSystem.actorOf(TweakerActor.props(None), &quot;tweakerOne&quot;) lazy val tweakerTwo = actorSystem.actorOf(TweakerActor.props(Some(tweakerOne)), &quot;tweakerTwo&quot;) <\/code><\/pre>\n<p>  \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0430\u043a\u0442\u043e\u0440\u044b \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 onCreate \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443:<\/p>\n<pre><code class=\"scala\">l[LinearLayout](   f[TweakerFragment].pass(&quot;name&quot; -&gt; &quot;tweakerOne&quot;).framed(Id.tweakerOne, Tag.tweakerOne),   f[TweakerFragment].pass(&quot;name&quot; -&gt; &quot;tweakerTwo&quot;).framed(Id.tweakerTwo, Tag.tweakerTwo) ) &lt;~ horizontal <\/code><\/pre>\n<p>  \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 onStart \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u0430\u043a\u0442\u043e\u0440\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0430 \u0432 onDestroy \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<pre><code class=\"scala\">override def onStart() = {   super.onStart()    tweakerOne ! TweakerActor.SetTweaked(tweakerTwo) }  override def onDestroy() = {   actorSystem.shutdown() } <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0432\u0430 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0441 \u043a\u043d\u043e\u043f\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0441\u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0443 \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u0446\u0432\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0442\u0435\u0433\u0443 <a href=\"https:\/\/github.com\/cheshirrrr\/macroid-for-habr\/tree\/Step7\">Step7<\/a>.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u044f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e \u0441\u0432\u043e\u044e \u0441\u0442\u0430\u0442\u044c\u044e. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Macroid \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0437\u0430 \u043a\u0430\u0434\u0440\u043e\u043c, \u043d\u043e \u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0431\u0443\u0434\u0438\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0437\u0443\u0431 \u044d\u0442\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f \u043a \u043d\u0435\u0439. \u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0431\u044f\u0442\u0430\u043c\u0438 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b 47 Degrees \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043d\u0430 <a href=\"https:\/\/github.com\/47deg\/macroid\">Github<\/a>.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.       <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/279973\/\"> https:\/\/habrahabr.ru\/post\/279973\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/170\/6db\/4b5\/1706db4b52424bda85b598999465ca31.png\" alt=\"image\" align=\"left\"\/>\u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u044f \u043f\u0438\u0448\u0443 \u043d\u0430 \u0441\u0442\u0430\u0440\u043e\u0439 \u0434\u043e\u0431\u0440\u043e\u0439 Enterprise Java, \u043c\u0435\u043d\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u044f\u043d\u0435\u0442 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u0422\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u044d\u0442\u0438\u043c \u043d\u043e\u0432\u044b\u043c \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c Scala. \u0418 \u0432\u043e\u0442 \u043e\u0434\u043d\u0430\u0436\u0434\u044b, \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u0434\u043e\u043a\u043b\u0430\u0434\u044b \u0441\u043e Scala Days, \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0434\u043e\u043a\u043b\u0430\u0434 \u041d\u0438\u043a\u0430 \u0421\u0442\u0430\u043d\u0447\u0435\u043d\u043a\u043e \u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Macroid, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u043b. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0435\u0451 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0438\u0448\u043a\u0430\u0445 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/cheshirrrr\/macroid-for-habr\">Github<\/a>.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c Scala \u0438 Android, \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\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-276770","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/276770","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=276770"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/276770\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=276770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=276770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=276770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}