{"id":231203,"date":"2014-07-27T17:08:03","date_gmt":"2014-07-27T13:08:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=231203"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=231203","title":{"rendered":"<span class=\"post_title\">\u0420\u0438\u0441\u0443\u0435\u043c \u0437\u043d\u0430\u043a \u0440\u0443\u0431\u043b\u044f \u0432 Android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0432\u0441\u0435 \u0447\u0430\u0449\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b \u0440\u0443\u0431\u043b\u044f \u0432 \u0442\u0435\u043a\u0441\u0442\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u0441\u0438\u043c\u0432\u043e\u043b \u0440\u0443\u0431\u043b\u044f <a href=\"http:\/\/ru.wikinews.org\/wiki\/%D0%91%D0%B0%D0%BD%D0%BA_%D0%A0%D0%BE%D1%81%D1%81%D0%B8%D0%B8_%D1%83%D1%82%D0%B2%D0%B5%D1%80%D0%B4%D0%B8%D0%BB_%D1%81%D0%B8%D0%BC%D0%B2%D0%BE%D0%BB_%D1%80%D1%83%D0%B1%D0%BB%D1%8F\">\u0431\u044b\u043b \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u043e<\/a>, \u0441\u0438\u043c\u0432\u043e\u043b \u043f\u043e\u043b\u0443\u0447\u0438\u043b <a href=\"https:\/\/twitter.com\/ken_lunde\/status\/430761051290759168\">\u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0442\u0435 Unicode \u0435\u0449\u0435 \u043f\u043e\u0437\u0436\u0435<\/a>. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u0430 Roboto \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445 \u0435\u0449\u0435 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u043a\u0430 \u0440\u0443\u0431\u043b\u044f.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>\u0418\u0434\u0435\u044f<\/h5>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0440\u0443\u0431\u043b\u044f \u0441 \u043a\u043e\u0434\u043e\u043c <a href=\"http:\/\/www.fileformat.info\/info\/unicode\/char\/20bd\/index.htm\">U+20BD<\/a>, \u0438 \u043f\u0440\u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043b\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0440\u0443\u0431\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u0443.<\/p>\n<h5>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e Span<\/h5>\n<p>  \u0412 \u041e\u0421 Android \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u0442\u0440\u043e\u043a \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0432\u043b\u0438\u044f\u044e\u0449\u0438\u043c\u0438 \u043d\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u0442\u0435\u043a\u0441\u0442\u0430 TextView. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0446\u0432\u0435\u0442\u0430 <a href=\"http:\/\/developer.android.com\/reference\/android\/text\/style\/ForegroundColorSpan.html\">\u0437\u0430\u043b\u0438\u0432\u043a\u0438<\/a>\/<a href=\"http:\/\/developer.android.com\/reference\/android\/text\/style\/BackgroundColorSpan.html\">\u0444\u043e\u043d\u0430<\/a>, <a href=\"http:\/\/developer.android.com\/reference\/android\/text\/style\/StyleSpan.html\">\u0441\u0442\u0438\u043b\u044f <\/a> \u0438\u043b\u0438 <a href=\"http:\/\/developer.android.com\/reference\/android\/text\/style\/TextAppearanceSpan.html\">\u0432\u0441\u0435\u0433\u043e \u0441\u0440\u0430\u0437\u0443<\/a> (<a href=\"http:\/\/developer.android.com\/reference\/android\/text\/style\/package-summary.html\">\u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a<\/a> \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0432 Android \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432). \u041e\u0431 \u044d\u0442\u043e\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0435 \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b\u0435 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 <a href=\"http:\/\/habrahabr.ru\/post\/166351\/\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438 <a href=\"http:\/\/habrahabr.ru\/post\/167343\/\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h5>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e\u0439 \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u044b<\/h5>\n<p>  \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0431\u0443\u0434\u0443\u0449\u0435\u0439 \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u044b \u044f \u0432\u0437\u044f\u043b \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0442 \u0410\u0440\u0442\u0435\u043c\u0438\u044f \u041b\u0435\u0431\u0435\u0434\u0435\u0432\u0430, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c <a href=\"http:\/\/habrahabr.ru\/post\/48084\/\">\u043f\u0438\u0441\u0430\u043b\u0438<\/a> \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435. \u042d\u0442\u0430 \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043d\u0430\u0447\u0435\u0440\u0442\u0430\u043d\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0440\u0443\u0431\u043b\u044f \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u043e\u0433\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0430 (\u043e\u0442 \u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0439 <i>a<\/i> \u0434\u043e <i>s<\/i>).<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/850\/d44\/51d\/850d4451db3fd79abd2009fb7ac8960d.png\" alt=\"\u0421\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0433\u043b\u0438\u0444\u043e\u0432\"\/><\/p>\n<p>  \u042f \u0432\u044b\u0431\u0440\u0430\u043b \u0433\u043b\u0438\u0444, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d \u0437\u0430 \u0431\u0443\u043a\u0432\u043e\u0439 i (<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/bd3\/f8b\/8da\/bd3f8b8da04aebe1e8e5734bb46e1f6d.png\" alt=\"\u0421\u0438\u043c\u0432\u043e\u043b \u0440\u0443\u0431\u043b\u044f\"\/>). \u041a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043e\u043d \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u043e\u0439 Roboto.<br \/>  \u0414\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u044b, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <a href=\"http:\/\/www.glyphsapp.com\/\">Glyphs<\/a>. \u042f \u0443\u0434\u0430\u043b\u0438\u043b \u0432\u0441\u0435 \u0433\u043b\u0438\u0444\u044b \u0438\u0437 \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u044b \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439. \u0415\u043c\u0443 \u044f \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u043b \u043a\u043e\u0434 U+20BD. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u2014\u00a0\u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0432 ttf.<br \/>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c <a href=\"https:\/\/github.com\/pepyakin\/roublesign\/blob\/master\/app\/src\/main\/assets\/fonts\/rouble2.ttf\">\u0442\u0430\u043a<\/a>.<br \/>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u043b\u0438\u0444 \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0420, \u0434\u043e\u0440\u0438\u0441\u043e\u0432\u0430\u0432 \u043f\u0430\u043b\u043e\u0447\u043a\u0443, \u043e\u0434\u043d\u0430\u043a\u043e, \u044f \u043d\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u044e \u0432 \u0441\u0435\u0431\u0435 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0432 \u044d\u0442\u043e\u043c \u0434\u0435\u043b\u0435. \u0423\u0436 \u0431\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043d\u044e\u0430\u043d\u0441\u043e\u0432. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e, \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u043f\u0440\u0438\u043c\u0443 \u0432\u0430\u0448 pull request.<\/p>\n<h5>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h5>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u0430. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0448\u0430\u0431\u043b\u043e\u043d \u0441 Blank Activity \u0438\u0437 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0430 Android Studio, activity \u043d\u0430\u0437\u0432\u0430\u043b MainActivity. <br \/>  \u0420\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0434\u043b\u044f MainActivity \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;LinearLayout     xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     xmlns:tools=&quot;http:\/\/schemas.android.com\/tools&quot;     android:layout_width=&quot;match_parent&quot;     android:layout_height=&quot;match_parent&quot;     android:paddingLeft=&quot;@dimen\/activity_horizontal_margin&quot;     android:paddingRight=&quot;@dimen\/activity_horizontal_margin&quot;     android:paddingTop=&quot;@dimen\/activity_vertical_margin&quot;     android:paddingBottom=&quot;@dimen\/activity_vertical_margin&quot;     tools:context=&quot;.MainActivity&quot;&gt;      &lt;EditText         android:id=&quot;@+id\/main_price_input&quot;         android:layout_width=&quot;match_parent&quot;         android:layout_height=&quot;wrap_content&quot;         android:inputType=&quot;numberDecimal&quot;         tools:hint=&quot;@string\/main_price_hint&quot;         \/&gt;  &lt;\/LinearLayout&gt; <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u0441\u043e\u0437\u0434\u0430\u0435\u043c LinearLayout \u0441 \u043e\u0434\u043d\u0438\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u043c EditText. \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e hint \u0443 EditText \u043c\u044b \u0437\u0430\u0434\u0430\u0435\u043c \u0441 namespace <code>tools<\/code>, \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u043b\u0430\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435. \u0412 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e.<\/p>\n<p>  \u0412 MainActivity#onCreate \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c <a href=\"http:\/\/developer.android.com\/reference\/android\/text\/Spanned.html\">spanned<\/a> string, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0441\u0435 \u0437\u043d\u0430\u043a\u0438 \u0440\u0443\u0431\u043b\u044f \u0431\u0443\u0434\u0443\u0442 \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b <a href=\"http:\/\/developer.android.com\/reference\/android\/text\/style\/TypefaceSpan.html\">TypefaceSpan<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0422\u0443\u0442 \u043d\u0430\u0441 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0441\u0442\u044c: TypefaceSpan \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 font-family \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u0448\u0440\u0438\u0444\u0442\u0430 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0441\u0443\u0434\u044f \u043f\u043e <a href=\"https:\/\/android.googlesource.com\/platform\/frameworks\/base\/+\/refs\/heads\/master\/core\/java\/android\/text\/style\/TypefaceSpan.java\">\u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 TypefaceSpan<\/a>, \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0442\u0435\u043a\u0441\u0442\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e TypefaceSpan, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u044b \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c <a href=\"https:\/\/developer.android.com\/reference\/android\/graphics\/Typeface.html\">Typeface<\/a>. \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c <\/p>\n<pre><code class=\"java\">package me.pepyakin.roublesign;  import android.graphics.Paint; import android.graphics.Typeface; import android.text.TextPaint; import android.text.style.MetricAffectingSpan;  public class TypefaceSpan2 extends MetricAffectingSpan {     private final Typeface mTypeface;      public TypefaceSpan2(Typeface typeface) {         mTypeface = typeface;     }      @Override     public void updateDrawState(TextPaint ds) {         apply(ds, mTypeface);     }      @Override     public void updateMeasureState(TextPaint paint) {         apply(paint, mTypeface);     }      private static void apply(Paint paint, Typeface tf) {         int oldStyle;          Typeface old = paint.getTypeface();         if (old == null) {             oldStyle = 0;         } else {             oldStyle = old.getStyle();         }          int fake = oldStyle & ~tf.getStyle();          if ((fake & Typeface.BOLD) != 0) {             paint.setFakeBoldText(true);         }          if ((fake & Typeface.ITALIC) != 0) {             paint.setTextSkewX(-0.25f);         }          paint.setTypeface(tf);     } } <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 TypefaceSpan2, \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u043d\u0430\u043c \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u043e\u0439.<\/p>\n<pre><code class=\"java\">String priceHint = getString(R.string.main_price_hint);  final Typeface roubleSupportedTypeface =         Typeface.createFromAsset(getAssets(), &quot;fonts\/rouble2.ttf&quot;);  SpannableStringBuilder resultSpan = new SpannableStringBuilder(priceHint); for (int i = 0; i &lt; resultSpan.length(); i++) {     if (resultSpan.charAt(i) == '\\u20BD') {         TypefaceSpan2 roubleTypefaceSpan = new TypefaceSpan2(roubleSupportedTypeface);         resultSpan.setSpan(roubleTypefaceSpan, i, i + 1, 0);     } } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0440\u0443\u0431\u043b\u044f \u0438 \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u0443 \u0441 \u0433\u043b\u0438\u0444\u043e\u043c \u0440\u0443\u0431\u043b\u044f.<br \/>  \u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c <a href=\"https:\/\/developer.android.com\/reference\/android\/text\/SpannableStringBuilder.html\">SpannableStringBuilder<\/a> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/developer.android.com\/reference\/android\/text\/SpannableStringBuilder.html#setSpan(java.lang.Object, int, int, int)\">setSpan<\/a> \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0440\u043a\u0435\u0440\u044b \u0434\u043b\u044f \u0441\u043c\u0435\u043d\u044b \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u044b. <\/p>\n<p>  \u041d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c hint, <\/p>\n<pre><code class=\"java\">priceInput.setHint(resultSpan);  <\/code><\/pre>\n<p>  \u0438 \u0433\u043e\u0442\u043e\u0432\u043e!<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/75d\/5ff\/e95\/75d5ffe95076406e89d3dca7b0535449.gif\" alt=\"\u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\"\/><\/p>\n<p>  <a href=\"https:\/\/github.com\/pepyakin\/roublesign\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438<\/a>      \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/231203\/\"> http:\/\/habrahabr.ru\/post\/231203\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0432\u0441\u0435 \u0447\u0430\u0449\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b \u0440\u0443\u0431\u043b\u044f \u0432 \u0442\u0435\u043a\u0441\u0442\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u0441\u0438\u043c\u0432\u043e\u043b \u0440\u0443\u0431\u043b\u044f <a href=\"http:\/\/ru.wikinews.org\/wiki\/%D0%91%D0%B0%D0%BD%D0%BA_%D0%A0%D0%BE%D1%81%D1%81%D0%B8%D0%B8_%D1%83%D1%82%D0%B2%D0%B5%D1%80%D0%B4%D0%B8%D0%BB_%D1%81%D0%B8%D0%BC%D0%B2%D0%BE%D0%BB_%D1%80%D1%83%D0%B1%D0%BB%D1%8F\">\u0431\u044b\u043b \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u043e<\/a>, \u0441\u0438\u043c\u0432\u043e\u043b \u043f\u043e\u043b\u0443\u0447\u0438\u043b <a href=\"https:\/\/twitter.com\/ken_lunde\/status\/430761051290759168\">\u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0442\u0435 Unicode \u0435\u0449\u0435 \u043f\u043e\u0437\u0436\u0435<\/a>. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0433\u0430\u0440\u043d\u0438\u0442\u0443\u0440\u0430 Roboto \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445 \u0435\u0449\u0435 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u043a\u0430 \u0440\u0443\u0431\u043b\u044f.  <\/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-231203","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/231203","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=231203"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/231203\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=231203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=231203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=231203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}