{"id":301441,"date":"2020-04-07T15:01:08","date_gmt":"2020-04-07T15:01:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=301441"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=301441","title":{"rendered":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ColorPicker \u0432 Android \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u0438\u0431\u043a\u043e\u0433\u043e \u0432\u044b\u0431\u043e\u0440\u0430 \u0446\u0432\u0435\u0442\u0430"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/496136\/\">\u041f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0431\u043e\u0440 \u0446\u0432\u0435\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f? \u042d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440.\u0411\u0435\u0437 \u0434\u043e\u043b\u0433\u0438\u0445 \u043f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0439, \u043d\u0430\u0447\u043d\u0435\u043c.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0444\u0430\u0439\u043b build.gradle(module.app) ):<\/p>\n<p>  <code>implementation 'com.jaredrummler:colorpicker:1.1.0'<\/code><\/p>\n<p>  \u0421 \u044d\u0442\u0438\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0431\u043e\u0440\u0430 \u0446\u0432\u0435\u0442\u0430.<br \/>   <a name=\"habracut\"><\/a><br \/>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443:<\/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;     xmlns:app=&quot;http:\/\/schemas.android.com\/apk\/res-auto&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:id=&quot;@+id\/activityMain&quot;     tools:context=&quot;.MainActivity&quot;&gt;      &lt;Button         android:id=&quot;@+id\/firstButton&quot;         android:layout_width=&quot;match_parent&quot;         android:layout_height=&quot;wrap_content&quot;         android:text=&quot;Color picker \u21161&quot;         android:layout_margin=&quot;5dp&quot;         android:onClick=&quot;onClickButton&quot;         \/&gt;     &lt;Button         android:id=&quot;@+id\/secondButton&quot;         android:layout_width=&quot;match_parent&quot;         android:layout_height=&quot;wrap_content&quot;         android:text=&quot;Color picker \u21162&quot;         android:layout_below=&quot;@id\/firstButton&quot;         android:layout_margin=&quot;5dp&quot;         android:onClick=&quot;onClickButton&quot;         \/&gt;      &lt;TextView         android:id=&quot;@+id\/firstText&quot;         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;         android:layout_centerInParent=&quot;true&quot;         android:text=&quot;First text&quot;         android:textSize=&quot;40sp&quot;         android:textColor=&quot;@android:color\/black&quot;         \/&gt;      &lt;TextView         android:id=&quot;@+id\/secondText&quot;         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;         android:text=&quot;Second text&quot;         android:textSize=&quot;40sp&quot;         android:layout_below=&quot;@+id\/firstText&quot;         android:layout_centerInParent=&quot;true&quot;         android:textColor=&quot;@android:color\/black&quot;         \/&gt;  &lt;\/RelativeLayout&gt;<\/code><\/pre>\n<p>  \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 2 \u043a\u043d\u043e\u043f\u043a\u0438, \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0446\u0432\u0435\u0442\u0430. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0446\u0432\u0435\u0442, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0443 \u0434\u0432\u0443\u0445 \u043d\u0430\u0448\u0438\u0445 TextView. <\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0448\u0438 \u043f\u043e\u043b\u044f \u0432 MainActivity:<\/p>\n<pre><code class=\"java\"> Button firstButton,secondButton;  TextView firstText,secondText;  private static final int firstId = 1,secondId = 2;  \/\/ id \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 onColorSelected \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 ColorPickerDialogListener <\/code><\/pre>\n<p>  \u2026 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u0432 onCreate():   <\/p>\n<pre><code class=\"java\">         firstButton = findViewById(R.id.firstButton);         secondButton = findViewById(R.id.secondButton);          firstText = findViewById(R.id.firstText);         secondText = findViewById(R.id.secondText);<\/code><\/pre>\n<p>  <b>\u0412\u0410\u0416\u041d\u041e<\/b>: \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b MainActivity \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b\u0430 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 ColorPickerDialogListener:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/r8\/lg\/em\/r8lgemlisw5crqdtdz2gtimwj2c.png\" alt=\"image\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/md\/94\/66\/md9466uv_levpg7b_w23zehwane.png\" alt=\"image\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u044b\u0439 \u0432 XML-\u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u043c\u0435\u0442\u043e\u0434 onClick:<\/p>\n<pre><code class=\"java\">private void createColorPickerDialog(int id) {         ColorPickerDialog.newBuilder()                 .setColor(Color.RED)                 .setDialogType(ColorPickerDialog.TYPE_PRESETS)                 .setAllowCustom(true)                 .setAllowPresets(true)                 .setColorShape(ColorShape.SQUARE)                 .setDialogId(id)                 .show(this); \/\/ \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 ColorPickerDialog \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0438\u0436\u0435 } public void onClickButton(View view) {         switch (view.getId()) {             case R.id.firstButton:                 createColorPickerDialog(firstId);                 break;             case R.id.secondButton:                 createColorPickerDialog(secondId);                 break;         } } <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/7f\/cv\/fb\/7fcvfbbd9ausgl9ze_iz6rfmv20.jpeg\" alt=\"image\"><br \/>  <i>\u0432\u0441\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0430 ColorPickerDialog <\/i><br \/>  <cut><\/cut><br \/>  \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 ColorPickerDialogListener:<\/p>\n<pre><code class=\"java\">@Override     public void onColorSelected(int dialogId, int color) {         switch (dialogId) { \/\/ \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u0430\u044f \u043a\u043d\u043e\u043f\u043a\u0430 \u043d\u0430\u0436\u0430\u0442\u0430             case firstId:                 firstText.setTextColor(color);                 break;             case secondId:                 secondText.setTextColor(color);                 break;         }     }      @Override     public void onDialogDismissed(int dialogId) {         Toast.makeText(this, &quot;Dialog dismissed&quot;, Toast.LENGTH_SHORT).show();     }<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438\u2026 \u0433\u043e\u0442\u043e\u0432\u043e!<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zr\/9e\/os\/zr9eosrc-bmbhzwckij7qxzybtg.png\" alt=\"image\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/it\/s5\/mu\/its5mu8k649m4xqaxofxrra-kvy.png\" alt=\"image\"><br \/>  <cut><\/cut><br \/>  \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ColorPicker. \u041e\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 preference \u0434\u043b\u044f PreferenceScreen. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0431\u043e\u0440 \u0446\u0432\u0435\u0442\u0430 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  1) \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u0443\u044e SettingsActivity:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wg\/ry\/tk\/wgrytkepoms6t4aoixjsfur8f6u.png\" alt=\"image\"><\/p>\n<p>  2) \u041e\u0442\u043a\u0440\u043e\u0435\u043c \u0444\u0430\u0439\u043b root_preferences.xml \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"xml\">&lt;PreferenceScreen xmlns:app=&quot;http:\/\/schemas.android.com\/apk\/res-auto&quot;     xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;&gt;     &lt;PreferenceCategory app:title=&quot;\u0412\u044b\u0431\u043e\u0440 \u0446\u0432\u0435\u0442\u0430&quot;&gt;         &lt;com.jaredrummler.android.colorpicker.ColorPreferenceCompat             android:key=&quot;color_picker&quot;             app:title=&quot;\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0446\u0432\u0435\u0442&quot;             \/&gt;     &lt;\/PreferenceCategory&gt;  &lt;\/PreferenceScreen&gt; <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 Preference \u0442\u0438\u043f\u0430 ColorPreferenceCompat<\/p>\n<p>  3) \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 activity_main.xml \u043a\u043d\u043e\u043f\u043a\u0443 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0432 \u043d\u0430\u0448\u0443 SettingsActivty:<\/p>\n<pre><code class=\"xml\">&lt;Button         android:id=&quot;@+id\/settingsButton&quot;         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;         android:text=&quot;\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438&quot;         android:layout_alignParentBottom=&quot;true&quot;         android:layout_alignParentRight=&quot;true&quot;         android:layout_margin=&quot;5dp&quot;         android:onClick=&quot;openSettingsActivity&quot;         \/&gt;<\/code><\/pre>\n<p>  4) \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434 openSettingsActivity \u0432 MainActivity \u0438 \u0443\u043a\u0430\u0436\u0435\u043c \u0435\u0433\u043e \u0432 \u043f\u043e\u043b\u0435 \u00abonClick\u00bb \u044d\u0442\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438:<\/p>\n<pre><code class=\"java\">public void openSettingsActivity(View view) {         startActivity(new Intent(this,SettingsActivity.class));   }<\/code><\/pre>\n<p>   \u0412 \u044d\u0442\u043e\u0439 \u0436\u0435 MainActivity \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0435\u0451 \u0444\u043e\u043d \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0446\u0432\u0435\u0442\u0430 \u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0436 \u0432 onCreate:<\/p>\n<pre><code class=\"plaintext\">private void setBackgroundColorFromSettingsActivity() {         SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);         \/\/SharedPreferences \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a         \/\/\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 - \u0442\u0443\u0442:          \/\/https:\/\/developer.android.com\/reference\/android\/content\/SharedPreferences?hl=ru         int color = sp.getInt(&quot;color_picker&quot;,Color.GREEN);          RelativeLayout layout = findViewById(R.id.activityMain);         layout.setBackgroundColor(color); }<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0435\u0442\u043e\u0434 onResume (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 <a href=\"https:\/\/developer.android.com\/guide\/components\/activities\/activity-lifecycle?hl=ru\" rel=\"nofollow\">\u0442\u0443\u0442<\/a>):<\/p>\n<pre><code class=\"java\">@Override     protected void onResume() {         setBackgroundColorFromSettingsActivity();         super.onResume();  }<\/code><\/pre>\n<p>  5) \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wb\/rf\/x5\/wbrfx5tfpf7-poglu7rzvmxgx24.png\" alt=\"image\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fv\/-w\/fj\/fv-wfjhjswcgi-v542sycxcjbuw.png\" alt=\"image\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/60\/nw\/au\/60nwauns3lskbbuwsb_kf5cxp5w.png\" alt=\"image\"><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<p>  P.S: \u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u043b\u044b\u043a\u0438:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/jaredrummler\/ColorPicker\" rel=\"nofollow\">\u041a\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 GitHub (\u043e\u0444.\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0442\u0430\u043c \u0436\u0435)<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/QuadFlask\/colorpicker\" rel=\"nofollow\">\u041f\u043e\u0445\u043e\u0436\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430(\u0435\u0441\u043b\u0438 \u044d\u0442\u0430 \u0432\u0430\u043c \u0447\u0435\u043c-\u0442\u043e \u043d\u0435 \u043f\u0440\u0438\u0433\u043b\u044f\u043d\u0443\u043b\u0430\u0441\u044c)<\/a><\/li>\n<\/ul>\n<p>  P.S.S: <a href=\"https:\/\/github.com\/wllboy\/ColorPickerApplication\" rel=\"nofollow\">\u041a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 GitHub<\/a><\/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:\/\/habr.com\/ru\/post\/496136\/\"> https:\/\/habr.com\/ru\/post\/496136\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/496136\/\">\u041f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0431\u043e\u0440 \u0446\u0432\u0435\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f? \u042d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440.\u0411\u0435\u0437 \u0434\u043e\u043b\u0433\u0438\u0445 \u043f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0439, \u043d\u0430\u0447\u043d\u0435\u043c.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0444\u0430\u0439\u043b build.gradle(module.app) ):<\/p>\n<p>  <code>implementation 'com.jaredrummler:colorpicker:1.1.0'<\/code><\/p>\n<p>  \u0421 \u044d\u0442\u0438\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0431\u043e\u0440\u0430 \u0446\u0432\u0435\u0442\u0430.   <\/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-301441","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301441","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=301441"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301441\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=301441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=301441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=301441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}