OmniControl: What the world needs is a new color picker with round corners

also dialogs are so 80s - make it an activity

Change-Id: Id9f869005a813668c1ff1e31fdb3a81839697ceb
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index 7e42cec..f4c45ba 100644
--- a/.idea/kotlinc.xml
+++ b/.idea/kotlinc.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="KotlinJpsPluginSettings">
-    <option name="version" value="1.8.0-release" />
+    <option name="version" value="1.8.20-release" />
   </component>
 </project>
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a4ce9b7..0eec2e6 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -40,6 +40,12 @@
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
+        <activity
+            android:name=".ColorBrowseActivity"
+            android:excludeFromRecents="true"
+            android:exported="false"
+            android:label="@string/color_activity_title"
+            android:launchMode="singleTop" />
     </application>
 
 </manifest>
diff --git a/app/src/main/java/org/omnirom/control/ColorBrowseActivity.kt b/app/src/main/java/org/omnirom/control/ColorBrowseActivity.kt
new file mode 100644
index 0000000..7768fdf
--- /dev/null
+++ b/app/src/main/java/org/omnirom/control/ColorBrowseActivity.kt
@@ -0,0 +1,196 @@
+package org.omnirom.control
+
+import android.content.Intent
+import android.graphics.Color
+import android.graphics.Outline
+import android.graphics.drawable.ColorDrawable
+import android.os.Bundle
+import android.text.Editable
+import android.text.InputFilter
+import android.text.InputFilter.LengthFilter
+import android.text.TextWatcher
+import android.view.MenuItem
+import android.view.View
+import android.view.ViewOutlineProvider
+import android.widget.GridLayout
+import android.widget.ImageView
+import androidx.appcompat.app.AppCompatActivity
+import androidx.appcompat.widget.Toolbar
+import androidx.core.view.WindowCompat
+import com.google.android.material.button.MaterialButton
+import com.google.android.material.textfield.TextInputEditText
+import com.google.android.material.textfield.TextInputLayout
+import org.omnirom.control.widget.ColorPickerView
+import java.util.Locale
+
+
+class ColorBrowseActivity : AppCompatActivity(), ColorPickerView.OnColorChangedListener,
+    TextWatcher {
+
+    companion object {
+        val DATA_SELECT_COLOR_EXTRA = "select_color"
+    }
+
+    private val STATE_KEY_COLOR = "color"
+
+    private lateinit var mHexColorInput: TextInputEditText
+    private lateinit var mNewColor: ImageView
+    private val mWithAlpha = false
+    private lateinit var mColorPicker: ColorPickerView
+
+    val PRESET_COLORS = arrayOf(
+        Color.parseColor("#a1c729"),
+        Color.parseColor("#ff8000"),
+        Color.parseColor("#a020f0"),
+        Color.parseColor("#ff005a"),
+        Color.parseColor("#e5141b"),
+        Color.parseColor("#f0b50b"),
+        Color.parseColor("#009ed8"),
+        Color.parseColor("#00897b"),
+        Color.parseColor("#11811a"),
+        Color.parseColor("#3c42d1"),
+    )
+
+    class RoundRectViewOutline(var mRadius: Int) :
+        ViewOutlineProvider() {
+        override fun getOutline(view: View, outline: Outline) {
+            outline.setRoundRect(0, 0, view.width, view.height, mRadius.toFloat())
+        }
+    }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        WindowCompat.setDecorFitsSystemWindows(window, true)
+
+        setContentView(R.layout.color_browse_activity)
+        val toolbar: Toolbar = findViewById(R.id.toolbar)
+        setSupportActionBar(toolbar)
+        supportActionBar!!.setDisplayHomeAsUpEnabled(true)
+
+        val outlineProvider = RoundRectViewOutline(
+            resources.getDimensionPixelSize(
+                R.dimen.image_corner_radius_small
+            )
+        )
+
+        val startColor = intent.getIntExtra(DATA_SELECT_COLOR_EXTRA, 0)
+
+        mColorPicker = findViewById(R.id.color_picker_view)
+        mHexColorInput = findViewById(R.id.hex_color_input)
+        val corner = resources.getDimensionPixelSize(R.dimen.text_field_corner_radius).toFloat()
+        val hexColorInputLayout: TextInputLayout = findViewById(R.id.hex_color_input_layout)
+        hexColorInputLayout.setBoxCornerRadii(corner, corner, corner, corner)
+
+        mNewColor = findViewById(R.id.color_panel)
+        mNewColor.outlineProvider = outlineProvider
+        mNewColor.clipToOutline = true
+
+        mColorPicker.setOnColorChangedListener(this)
+        mHexColorInput.addTextChangedListener(this)
+        val colorPresetView: GridLayout = findViewById(R.id.color_preset_view)
+
+        for (presetColor in PRESET_COLORS) {
+            val colorPresetItem: View = layoutInflater.inflate(R.layout.color_preset_item, null)
+            val colorPresetItemView =
+                colorPresetItem.findViewById<View>(R.id.color_preset_item_view)
+            colorPresetItemView.outlineProvider = outlineProvider
+            colorPresetItemView.clipToOutline = true
+            colorPresetItemView.background = ColorDrawable(presetColor)
+
+            val layoutParams = GridLayout.LayoutParams(
+                GridLayout.spec(GridLayout.UNDEFINED, 1f),
+                GridLayout.spec(GridLayout.UNDEFINED, 1f)
+            )
+
+            layoutParams.width = 0
+            layoutParams.height = resources.getDimensionPixelSize(R.dimen.color_preset_item_size)
+
+            colorPresetItem.layoutParams = layoutParams
+
+            colorPresetView.addView(colorPresetItem)
+            colorPresetItem.setOnClickListener { v ->
+                val presetColor =
+                    (colorPresetItemView.background as ColorDrawable).color
+                mColorPicker.setColor(presetColor, true)
+            }
+        }
+
+        setAlphaSliderVisible(mWithAlpha)
+
+        val selectColorView: MaterialButton = findViewById(R.id.select_color)
+        selectColorView.setOnClickListener {
+            val intent = Intent()
+            intent.putExtra(DATA_SELECT_COLOR_EXTRA, getColor())
+            setResult(RESULT_OK, intent)
+            finish()
+        }
+
+        mColorPicker.setColor(startColor, true)
+    }
+
+    override fun onOptionsItemSelected(item: MenuItem): Boolean {
+        when (item.itemId) {
+            android.R.id.home -> {
+                setResult(RESULT_CANCELED)
+                finish()
+                return true
+            }
+
+            else -> {}
+        }
+        return super.onOptionsItemSelected(item)
+    }
+
+    private fun setAlphaSliderVisible(visible: Boolean) {
+        mHexColorInput.filters = arrayOf<InputFilter>(LengthFilter(if (visible) 8 else 6))
+        mColorPicker.isAlphaSliderVisible = visible
+    }
+
+    override fun onColorChanged(color: Int) {
+        val hasAlpha = mWithAlpha
+        val format = if (hasAlpha) "%08x" else "%06x"
+        val mask = if (hasAlpha) -0x1 else 0x00FFFFFF
+
+        mNewColor.setImageDrawable(ColorDrawable(color))
+        mHexColorInput.setText(String.format(Locale.US, format, color and mask))
+    }
+
+    override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
+    }
+
+    override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
+    }
+
+    override fun afterTextChanged(s: Editable?) {
+        val hexColor = mHexColorInput.text.toString()
+        if (hexColor.isNotEmpty()) {
+            try {
+                var color = Color.parseColor("#$hexColor")
+                if (!mWithAlpha) {
+                    color = color or -0x1000000 // set opaque
+                }
+                mColorPicker.color = color
+                mNewColor.setImageDrawable(ColorDrawable(color))
+            } catch (ex: IllegalArgumentException) {
+                // Number format is incorrect, ignore
+            }
+        }
+    }
+
+    fun getColor(): Int {
+        return mColorPicker.color
+    }
+
+    override fun onSaveInstanceState(state: Bundle) {
+        super.onSaveInstanceState(state)
+        state.putInt(STATE_KEY_COLOR, getColor())
+    }
+
+    override fun onRestoreInstanceState(state: Bundle) {
+        super.onRestoreInstanceState(state)
+        mColorPicker.setColor(
+            state.getInt(STATE_KEY_COLOR),
+            true
+        )
+    }
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/omnirom/control/OverlaysFragment.kt b/app/src/main/java/org/omnirom/control/OverlaysFragment.kt
index 59d96c7..50c4b07 100644
--- a/app/src/main/java/org/omnirom/control/OverlaysFragment.kt
+++ b/app/src/main/java/org/omnirom/control/OverlaysFragment.kt
@@ -17,8 +17,12 @@
  */
 package org.omnirom.control
 
+import android.app.Activity
 import android.content.Context
+import android.content.Intent
 import android.content.res.Resources.NotFoundException
+import android.graphics.Bitmap
+import android.graphics.Canvas
 import android.graphics.Color
 import android.graphics.Path
 import android.graphics.drawable.AdaptiveIconDrawable
@@ -26,14 +30,22 @@
 import android.graphics.drawable.Drawable
 import android.graphics.drawable.ShapeDrawable
 import android.graphics.drawable.shapes.PathShape
+import android.net.Uri
 import android.os.AsyncTask
 import android.os.Bundle
+import android.provider.MediaStore
 import android.provider.Settings
 import android.view.*
 import android.widget.ImageView
 import android.widget.LinearLayout
 import android.widget.Switch
+import androidx.activity.result.ActivityResult
+import androidx.activity.result.ActivityResultCallback
+import androidx.activity.result.ActivityResultLauncher
+import androidx.activity.result.contract.ActivityResultContract
+import androidx.activity.result.contract.ActivityResultContracts
 import androidx.appcompat.app.AlertDialog
+import androidx.appcompat.app.AppCompatActivity
 import androidx.core.graphics.PathParser
 import androidx.fragment.app.Fragment
 import androidx.recyclerview.widget.LinearLayoutManager
@@ -41,8 +53,8 @@
 import com.google.android.material.snackbar.Snackbar
 import org.json.JSONArray
 import org.json.JSONObject
-import org.omnirom.control.widget.ColorSelectDialog
 import org.omnirom.control.widget.DynamicAdaptiveIconDrawable
+import java.io.IOException
 
 
 class OverlaysFragment : Fragment() {
@@ -78,17 +90,6 @@
         "system_accent1_600"
     )
 
-    val CUSTOM_ACCENT_COLORS = arrayOf(
-        Color.parseColor("#a1c729"),
-        Color.parseColor("#ff8000"),
-        Color.parseColor("#a020f0"),
-        Color.parseColor("#ff005a"),
-        Color.parseColor("#e5141b"),
-        Color.parseColor("#f0b50b"),
-        Color.parseColor("#009ed8"),
-        Color.parseColor("#00897b"),
-    )
-
     abstract class GridItem(
         packageName: String,
         isEnabled: Boolean,
@@ -461,6 +462,37 @@
         }
     }
 
+    private val mBrowseColor: ActivityResultLauncher<Intent> =
+        registerForActivityResult<Intent, ActivityResult>(
+            ActivityResultContracts.StartActivityForResult(),
+            ActivityResultCallback<ActivityResult> { result: ActivityResult ->
+                if (result.resultCode == AppCompatActivity.RESULT_OK) {
+                    val data = result.data
+                    if (data != null && data.hasExtra(ColorBrowseActivity.DATA_SELECT_COLOR_EXTRA)) {
+                        val selectedColor =
+                            data.getIntExtra(ColorBrowseActivity.DATA_SELECT_COLOR_EXTRA, 0)
+                        if (mChangeColor != null && mChangeAccentColor!= null) {
+                            if (mChangeDark) mChangeColor!!.darkColor = selectedColor
+                            else mChangeColor!!.lightColor = selectedColor
+                            saveCustomAccentColors()
+
+                            if (mChangeAccentColor!!.isEnabled) {
+                                overlayProvider.enableFabricatedAccentOverlayTransaction(
+                                    mChangeColor!!
+                                )
+                            } else {
+                                loadAccentColorsOverlays()
+                                accentColorsListView.adapter!!.notifyDataSetChanged()
+                            }
+                        }
+                    }
+                }
+            })
+
+    private var mChangeAccentColor: FabricatedAccentColorsGridItem? = null
+    private var mChangeColor: CustomAccentColor? = null
+    private var mChangeDark: Boolean = false
+
     fun getFragmentTitle(): String {
         return resources.getString(R.string.overlays_settings_title)
     }
@@ -676,30 +708,13 @@
     ) {
         val color = accentColor.customAccentColor
         val oldColor = if (changeDark) color.darkColor else color.lightColor
-        val dialog = ColorSelectDialog(
-            requireContext(),
-            oldColor, false, CUSTOM_ACCENT_COLORS
-        )
-        dialog.setButton(
-            AlertDialog.BUTTON_POSITIVE, resources.getString(android.R.string.ok)
-        ) { _, _ ->
-            if (changeDark) color.darkColor = dialog.color
-            else color.lightColor = dialog.color
-            saveCustomAccentColors()
+        mChangeAccentColor = accentColor
+        mChangeColor = color
+        mChangeDark = changeDark
 
-            if (accentColor.isEnabled) {
-                overlayProvider.enableFabricatedAccentOverlayTransaction(color)
-            } else {
-                loadAccentColorsOverlays()
-                accentColorsListView.adapter!!.notifyDataSetChanged()
-            }
-        }
-        dialog.setButton(
-            AlertDialog.BUTTON_NEGATIVE, resources.getString(android.R.string.cancel)
-        ) { _, _ ->
-            dialog.dismiss()
-        }
-        dialog.show()
+        val intent = Intent(context, ColorBrowseActivity::class.java)
+        intent.putExtra(ColorBrowseActivity.DATA_SELECT_COLOR_EXTRA, oldColor)
+        mBrowseColor.launch(intent)
     }
 
     private fun doDeleteCustomAccentColor(accentColor: FabricatedAccentColorsGridItem) {
diff --git a/app/src/main/java/org/omnirom/control/widget/ColorPanelView.java b/app/src/main/java/org/omnirom/control/widget/ColorPanelView.java
deleted file mode 100644
index 9cd42cf..0000000
--- a/app/src/main/java/org/omnirom/control/widget/ColorPanelView.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (C) 2010 Daniel Nilsson
- * Copyright (C) 2012 The CyanogenMod Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.omnirom.control.widget;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.RectF;
-import android.util.AttributeSet;
-import android.view.View;
-
-/**
- * This class draws a panel which which will be filled with a color which can be
- * set. It can be used to show the currently selected color which you will get
- * from the {@link ColorPickerView}.
- *
- * @author Daniel Nilsson
- */
-public class ColorPanelView extends View {
-
-    /**
-     * The width in pixels of the border surrounding the color panel.
-     */
-    private final static float BORDER_WIDTH_PX = 1;
-
-    private static float mDensity = 1f;
-
-    private int mBorderColor = 0xff6E6E6E;
-    private int mColor = 0xff000000;
-
-    private Paint mBorderPaint;
-    private Paint mColorPaint;
-
-    private RectF mDrawingRect;
-    private RectF mColorRect;
-
-    private AlphaPatternDrawable mAlphaPattern;
-
-    public ColorPanelView(Context context) {
-        this(context, null);
-    }
-
-    public ColorPanelView(Context context, AttributeSet attrs) {
-        this(context, attrs, 0);
-    }
-
-    public ColorPanelView(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-
-        init();
-    }
-
-    private void init() {
-        mBorderPaint = new Paint();
-        mColorPaint = new Paint();
-        mDensity = getContext().getResources().getDisplayMetrics().density;
-    }
-
-    @Override
-    protected void onDraw(Canvas canvas) {
-
-        final RectF rect = mColorRect;
-
-        if (BORDER_WIDTH_PX > 0) {
-            mBorderPaint.setColor(mBorderColor);
-            canvas.drawRect(mDrawingRect, mBorderPaint);
-        }
-
-        if (mAlphaPattern != null) {
-            mAlphaPattern.draw(canvas);
-        }
-
-        mColorPaint.setColor(mColor);
-
-        canvas.drawRect(rect, mColorPaint);
-    }
-
-    @Override
-    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-
-        int width = MeasureSpec.getSize(widthMeasureSpec);
-        int height = MeasureSpec.getSize(heightMeasureSpec);
-
-        setMeasuredDimension(width, height);
-    }
-
-    @Override
-    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
-        super.onSizeChanged(w, h, oldw, oldh);
-
-        mDrawingRect = new RectF();
-        mDrawingRect.left = getPaddingLeft();
-        mDrawingRect.right = w - getPaddingRight();
-        mDrawingRect.top = getPaddingTop();
-        mDrawingRect.bottom = h - getPaddingBottom();
-
-        setUpColorRect();
-
-    }
-
-    private void setUpColorRect() {
-        final RectF dRect = mDrawingRect;
-
-        float left = dRect.left + BORDER_WIDTH_PX;
-        float top = dRect.top + BORDER_WIDTH_PX;
-        float bottom = dRect.bottom - BORDER_WIDTH_PX;
-        float right = dRect.right - BORDER_WIDTH_PX;
-
-        mColorRect = new RectF(left, top, right, bottom);
-
-        mAlphaPattern = new AlphaPatternDrawable((int) (5 * mDensity));
-
-        mAlphaPattern.setBounds(Math.round(mColorRect.left),
-                Math.round(mColorRect.top),
-                Math.round(mColorRect.right),
-                Math.round(mColorRect.bottom));
-
-    }
-
-    /**
-     * Set the color that should be shown by this view.
-     *
-     * @param color
-     */
-    public void setColor(int color) {
-        mColor = color;
-        invalidate();
-    }
-
-    /**
-     * Get the color currently show by this view.
-     *
-     * @return
-     */
-    public int getColor() {
-        return mColor;
-    }
-
-    /**
-     * Set the color of the border surrounding the panel.
-     *
-     * @param color
-     */
-    public void setBorderColor(int color) {
-        mBorderColor = color;
-        invalidate();
-    }
-
-    /**
-     * Get the color of the border surrounding the panel.
-     */
-    public int getBorderColor() {
-        return mBorderColor;
-    }
-
-}
diff --git a/app/src/main/java/org/omnirom/control/widget/ColorPickerView.java b/app/src/main/java/org/omnirom/control/widget/ColorPickerView.java
index 2465f3b..5364e1c 100644
--- a/app/src/main/java/org/omnirom/control/widget/ColorPickerView.java
+++ b/app/src/main/java/org/omnirom/control/widget/ColorPickerView.java
@@ -23,18 +23,20 @@
 import android.graphics.ComposeShader;
 import android.graphics.LinearGradient;
 import android.graphics.Paint;
+import android.graphics.Paint.Align;
+import android.graphics.Paint.Style;
 import android.graphics.Point;
 import android.graphics.PorterDuff.Mode;
 import android.graphics.RectF;
 import android.graphics.Shader;
-import android.graphics.Paint.Align;
-import android.graphics.Paint.Style;
 import android.graphics.Shader.TileMode;
 import android.os.Build;
 import android.util.AttributeSet;
 import android.view.MotionEvent;
 import android.view.View;
 
+import org.omnirom.control.R;
+
 /**
  * Displays a color picker to the user and allow them to select a color. A
  * slider for the alpha channel is also available. Enable it by setting
@@ -44,6 +46,8 @@
  */
 public class ColorPickerView extends View {
 
+    private float mCornerRadius;
+
     public interface OnColorChangedListener {
         public void onColorChanged(int color);
     }
@@ -55,7 +59,7 @@
     /**
      * The width in pixels of the border surrounding all color panels.
      */
-    private final static float BORDER_WIDTH_PX = 1;
+    private final static float BORDER_WIDTH_PX = 0;
 
     /**
      * The width in dp of the hue panel.
@@ -77,7 +81,7 @@
      * The dp which the tracker of the hue or alpha panel will extend outside of
      * its bounds.
      */
-    private float RECTANGLE_TRACKER_OFFSET = 2f;
+    private float RECTANGLE_TRACKER_OFFSET = 0f;
 
     private static float mDensity = 1f;
 
@@ -105,8 +109,8 @@
     private float mVal = 0f;
 
     private String mAlphaSliderText = "Alpha";
-    private int mSliderTrackerColor = 0xff1c1c1c;
-    private int mBorderColor = 0xff6E6E6E;
+    private int mSliderTrackerColor;
+    private int mBorderColor;
     private boolean mShowAlphaPanel = false;
 
     /*
@@ -151,9 +155,13 @@
         mDensity = getContext().getResources().getDisplayMetrics().density;
         PALETTE_CIRCLE_TRACKER_RADIUS *= mDensity;
         RECTANGLE_TRACKER_OFFSET *= mDensity;
-        HUE_PANEL_WIDTH *= mDensity;
-        ALPHA_PANEL_HEIGHT *= mDensity;
+        HUE_PANEL_WIDTH = getContext().getResources().getDimensionPixelSize(R.dimen.color_preset_item_size);
+        ALPHA_PANEL_HEIGHT = getContext().getResources().getDimensionPixelSize(R.dimen.color_preset_item_size);
         PANEL_SPACING = PANEL_SPACING * mDensity;
+        mCornerRadius = getContext().getResources().getDimensionPixelSize(R.dimen.image_corner_radius_small);
+
+        mSliderTrackerColor = Color.WHITE;
+        mBorderColor = Color.DKGRAY;
 
         mDrawingOffset = calculateRequiredOffset();
         initPaintTools();
@@ -177,7 +185,7 @@
         mSatValTrackerPaint.setStrokeWidth(2f * mDensity);
         mSatValTrackerPaint.setAntiAlias(true);
 
-        mHueTrackerPaint.setColor(mSliderTrackerColor);
+        mHueTrackerPaint.setColor(Color.WHITE);
         mHueTrackerPaint.setStyle(Style.STROKE);
         mHueTrackerPaint.setStrokeWidth(2f * mDensity);
         mHueTrackerPaint.setAntiAlias(true);
@@ -244,15 +252,15 @@
                 0xffffffff, rgb, TileMode.CLAMP);
         ComposeShader mShader = new ComposeShader(mValShader, mSatShader, Mode.MULTIPLY);
         mSatValPaint.setShader(mShader);
-        canvas.drawRect(rect, mSatValPaint);
+        canvas.drawRoundRect(rect, mCornerRadius, mCornerRadius, mSatValPaint);
 
         Point p = satValToPoint(mSat, mVal);
-        mSatValTrackerPaint.setColor(0xff000000);
-        canvas.drawCircle(p.x, p.y, PALETTE_CIRCLE_TRACKER_RADIUS - 1f * mDensity,
+        mSatValTrackerPaint.setColor(Color.WHITE);
+        canvas.drawCircle(p.x, p.y, PALETTE_CIRCLE_TRACKER_RADIUS,
                 mSatValTrackerPaint);
 
-        mSatValTrackerPaint.setColor(0xffdddddd);
-        canvas.drawCircle(p.x, p.y, PALETTE_CIRCLE_TRACKER_RADIUS, mSatValTrackerPaint);
+        //mSatValTrackerPaint.setColor(0xffdddddd);
+        //canvas.drawCircle(p.x, p.y, PALETTE_CIRCLE_TRACKER_RADIUS, mSatValTrackerPaint);
     }
 
     private void drawHuePanel(Canvas canvas) {
@@ -273,9 +281,9 @@
             mHuePaint.setShader(mHueShader);
         }
 
-        canvas.drawRect(rect, mHuePaint);
+        canvas.drawRoundRect(rect, mCornerRadius, mCornerRadius, mHuePaint);
 
-        float rectHeight = 4 * mDensity / 2;
+        float rectHeight = PALETTE_CIRCLE_TRACKER_RADIUS;
 
         Point p = hueToPoint(mHue);
 
@@ -285,7 +293,7 @@
         r.top = p.y - rectHeight;
         r.bottom = p.y + rectHeight;
 
-        canvas.drawRoundRect(r, 2, 2, mHueTrackerPaint);
+        canvas.drawRect(r, mHueTrackerPaint);
 
     }
 
diff --git a/app/src/main/java/org/omnirom/control/widget/ColorSelectDialog.java b/app/src/main/java/org/omnirom/control/widget/ColorSelectDialog.java
deleted file mode 100644
index b6e01ce..0000000
--- a/app/src/main/java/org/omnirom/control/widget/ColorSelectDialog.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (C) 2010 Daniel Nilsson
- * Copyright (C) 2012 The CyanogenMod Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.omnirom.control.widget;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.res.Configuration;
-import android.graphics.Color;
-import android.graphics.PixelFormat;
-import android.graphics.drawable.ColorDrawable;
-import android.os.Bundle;
-import android.text.Editable;
-import android.text.InputFilter;
-import android.text.TextWatcher;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.View.OnFocusChangeListener;
-import android.view.ViewGroup;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.EditText;
-import android.widget.GridLayout;
-import android.widget.LinearLayout;
-
-import org.omnirom.control.R;
-
-import java.util.Locale;
-
-import androidx.appcompat.app.AlertDialog;
-
-import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
-
-public class ColorSelectDialog extends AlertDialog implements
-        ColorPickerView.OnColorChangedListener, TextWatcher, OnFocusChangeListener {
-
-    private static final String TAG = "ColorSelectDialog";
-    private final static String STATE_KEY_COLOR = "color";
-
-    private ColorPickerView mColorPicker;
-
-    private EditText mHexColorInput;
-    private ColorPanelView mNewColor;
-    private LayoutInflater mInflater;
-    private LinearLayout mColorPanelView;
-    private boolean mWithAlpha;
-    private Context mContext;
-    private ViewGroup mColorPresetView;
-    private Integer[] mPresetColors;
-
-    public ColorSelectDialog(Context context, int initialColor, boolean withAlpha, Integer[] presetColors) {
-        super(context);
-        mContext = context;
-        mWithAlpha = withAlpha;
-        mPresetColors = presetColors;
-        init(initialColor);
-    }
-
-    private void init(int color) {
-        // To fight color banding.
-        getWindow().setFormat(PixelFormat.RGBA_8888);
-        setUp(color);
-    }
-
-    /**
-     * This function sets up the dialog with the proper values.  If the speedOff parameters
-     * has a -1 value disable both spinners
-     *
-     * @param color - the color to set
-     */
-    private void setUp(int color) {
-        mInflater = (LayoutInflater) getContext()
-                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-        View layout = mInflater.inflate(R.layout.color_select_dialog, null);
-
-        mColorPicker = (ColorPickerView) layout.findViewById(R.id.color_picker_view);
-        mHexColorInput = (EditText) layout.findViewById(R.id.hex_color_input);
-        mNewColor = (ColorPanelView) layout.findViewById(R.id.color_panel);
-        mColorPanelView = (LinearLayout) layout.findViewById(R.id.color_panel_view);
-        mColorPresetView = layout.findViewById(R.id.color_preset_view);
-        if (mPresetColors != null && mPresetColors.length != 0) {
-            mColorPresetView.setVisibility(View.VISIBLE);
-            for (Integer presetColor : mPresetColors) {
-                Log.d(TAG, "presetColor = " + presetColor);
-                View colorPresetItem = mInflater.inflate(R.layout.color_preset_item, null);
-                colorPresetItem.findViewById(R.id.color_preset_item_view).setBackground(new ColorDrawable(presetColor));
-                int colorPresetItemSize = getContext().getResources().getDimensionPixelSize(R.dimen.color_preset_item_size);
-                if (getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
-                    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(colorPresetItemSize, colorPresetItemSize);
-                    colorPresetItem.setLayoutParams(lp);
-                } else {
-                    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(0, colorPresetItemSize);
-                    lp.weight = 0.1f;
-                    colorPresetItem.setLayoutParams(lp);
-                }
-                mColorPresetView.addView(colorPresetItem);
-                colorPresetItem.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
-                        int presetColor = ((ColorDrawable) v.findViewById(R.id.color_preset_item_view).getBackground()).getColor();
-                        mColorPicker.setColor(presetColor, true);
-                    }
-                });
-            }
-        }
-
-        mColorPicker.setOnColorChangedListener(this);
-        mHexColorInput.setOnFocusChangeListener(this);
-        setAlphaSliderVisible(mWithAlpha);
-        mColorPicker.setColor(color, true);
-
-        setView(layout);
-
-        mColorPicker.setVisibility(View.VISIBLE);
-        mColorPanelView.setVisibility(View.VISIBLE);
-    }
-
-    @Override
-    public Bundle onSaveInstanceState() {
-        Bundle state = super.onSaveInstanceState();
-        state.putInt(STATE_KEY_COLOR, getColor());
-        return state;
-    }
-
-    @Override
-    public void onRestoreInstanceState(Bundle state) {
-        super.onRestoreInstanceState(state);
-        mColorPicker.setColor(state.getInt(STATE_KEY_COLOR), true);
-    }
-
-    @Override
-    public void onColorChanged(int color) {
-        final boolean hasAlpha = mWithAlpha;
-        final String format = hasAlpha ? "%08x" : "%06x";
-        final int mask = hasAlpha ? 0xFFFFFFFF : 0x00FFFFFF;
-
-        mNewColor.setColor(color);
-        mHexColorInput.setText(String.format(Locale.US, format, color & mask));
-    }
-
-    public void setAlphaSliderVisible(boolean visible) {
-        mHexColorInput.setFilters(new InputFilter[]{new InputFilter.LengthFilter(visible ? 8 : 6)});
-        mColorPicker.setAlphaSliderVisible(visible);
-    }
-
-    public int getColor() {
-        return mColorPicker.getColor();
-    }
-
-    @Override
-    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
-    }
-
-    @Override
-    public void onTextChanged(CharSequence s, int start, int before, int count) {
-    }
-
-    @Override
-    public void afterTextChanged(Editable s) {
-        String hexColor = mHexColorInput.getText().toString();
-        if (!hexColor.isEmpty()) {
-            try {
-                int color = Color.parseColor('#' + hexColor);
-                if (!mWithAlpha) {
-                    color |= 0xFF000000; // set opaque
-                }
-                mColorPicker.setColor(color);
-                mNewColor.setColor(color);
-            } catch (IllegalArgumentException ex) {
-                // Number format is incorrect, ignore
-            }
-        }
-    }
-
-    @Override
-    public void onFocusChange(View v, boolean hasFocus) {
-        if (!hasFocus) {
-            mHexColorInput.removeTextChangedListener(this);
-            InputMethodManager inputMethodManager = (InputMethodManager) getContext()
-                    .getSystemService(Activity.INPUT_METHOD_SERVICE);
-            inputMethodManager.hideSoftInputFromWindow(v.getWindowToken(), 0);
-        } else {
-            mHexColorInput.addTextChangedListener(this);
-        }
-    }
-}
diff --git a/app/src/main/res/layout-land/color_preset_item.xml b/app/src/main/res/layout-land/color_preset_item.xml
deleted file mode 100644
index f45ae48..0000000
--- a/app/src/main/res/layout-land/color_preset_item.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="@dimen/color_preset_item_size"
-    android:layout_height="@dimen/color_preset_item_size"
-    android:background="?android:attr/selectableItemBackground">
-
-    <View
-        android:id="@+id/color_preset_item_view"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_margin="2dp"/>
-
-</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout-land/color_select_dialog.xml b/app/src/main/res/layout-land/color_select_dialog.xml
index 6d39048..ae3aec1 100644
--- a/app/src/main/res/layout-land/color_select_dialog.xml
+++ b/app/src/main/res/layout-land/color_select_dialog.xml
@@ -13,56 +13,90 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="horizontal"
-    android:padding="@dimen/alert_dialog_padding_material">
-
-    <org.omnirom.control.widget.ColorPickerView
-        android:id="@+id/color_picker_view"
-        android:layout_width="300dp"
-        android:layout_height="match_parent" />
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
 
     <LinearLayout
-        android:layout_width="300dp"
+        android:layout_width="wrap_content"
         android:layout_height="match_parent"
-        android:orientation="horizontal">
+        android:layout_gravity="center_horizontal"
+        android:layout_marginStart="@dimen/color_select_side_margin"
+        android:layout_marginEnd="@dimen/color_select_side_margin"
+        android:orientation="horizontal"
+        android:padding="@dimen/color_select_content_padding">
 
-        <GridLayout
-            android:id="@+id/color_preset_view"
-            android:layout_width="0dp"
+        <org.omnirom.control.widget.ColorPickerView
+            android:id="@+id/color_picker_view"
+            android:layout_width="@dimen/color_select_picker_width"
             android:layout_height="match_parent"
-            android:layout_gravity="top"
-            android:layout_marginTop="6dp"
-            android:layout_marginBottom="6dp"
-            android:layout_weight="2"
-            android:columnCount="2"
-            android:rowCount="4"
-            android:visibility="gone" />
+            android:layout_gravity="center_vertical" />
 
         <LinearLayout
             android:id="@+id/color_panel_view"
             android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:layout_gravity="top"
-            android:layout_marginTop="6dp"
-            android:layout_marginBottom="6dp"
-            android:layout_weight="3"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+            android:layout_marginStart="10dp"
+            android:layout_weight="1"
+            android:minWidth="@dimen/color_select_panel_minwidth"
             android:orientation="vertical">
 
-            <EditText
-                android:id="@+id/hex_color_input"
+            <GridLayout
+                android:id="@+id/color_preset_view"
                 android:layout_width="match_parent"
-                android:layout_height="@dimen/color_preset_item_size"
-                android:digits="0123456789ABCDEFabcdef"
-                android:inputType="textNoSuggestions"
-                android:maxLength="6" />
+                android:layout_height="wrap_content"
+                android:columnCount="5"
+                android:rowCount="2" />
 
-            <org.omnirom.control.widget.ColorPanelView
+            <Space
+                android:layout_width="wrap_content"
+                android:layout_height="10dp" />
+
+            <com.google.android.material.textfield.TextInputLayout
+                android:id="@+id/hex_color_input_layout"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_vertical"
+                android:hint="@string/hex_color_input_hint">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/hex_color_input"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:digits="0123456789ABCDEFabcdef"
+                    android:inputType="textNoSuggestions"
+                    android:maxLength="6" />
+
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <Space
+                android:layout_width="wrap_content"
+                android:layout_height="10dp"/>
+
+            <ImageView
                 android:id="@+id/color_panel"
                 android:layout_width="match_parent"
                 android:layout_height="@dimen/color_preset_item_size" />
         </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_gravity="center_vertical"
+            android:layout_marginStart="16dp"
+            android:orientation="vertical">
+
+            <Space
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="1" />
+
+            <com.google.android.material.button.MaterialButton
+                android:id="@+id/select_color"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
+                android:text="@android:string/ok" />
+        </LinearLayout>
+
     </LinearLayout>
-</LinearLayout>
+</merge>
\ No newline at end of file
diff --git a/app/src/main/res/layout/color_browse_activity.xml b/app/src/main/res/layout/color_browse_activity.xml
new file mode 100644
index 0000000..ccc96a4
--- /dev/null
+++ b/app/src/main/res/layout/color_browse_activity.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+/*
+ *  Copyright (C) 2015-2016 The OmniROM Project
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+-->
+<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:focusableInTouchMode="true"
+    android:orientation="vertical">
+
+    <com.google.android.material.appbar.AppBarLayout
+        android:id="@+id/app_bar_top"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:fitsSystemWindows="true"
+        app:liftOnScroll="true">
+
+        <com.google.android.material.appbar.MaterialToolbar
+            android:id="@+id/toolbar"
+            android:layout_width="match_parent"
+            android:layout_height="?attr/actionBarSize" />
+
+    </com.google.android.material.appbar.AppBarLayout>
+
+    <FrameLayout
+        android:id="@+id/fragment_container"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        app:layout_behavior="@string/appbar_scrolling_view_behavior">
+
+        <include layout="@layout/color_select_dialog" />
+    </FrameLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
diff --git a/app/src/main/res/layout/color_preset_item.xml b/app/src/main/res/layout/color_preset_item.xml
index f7e108c..ce8edfd 100644
--- a/app/src/main/res/layout/color_preset_item.xml
+++ b/app/src/main/res/layout/color_preset_item.xml
@@ -1,14 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="0dp"
+    android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:layout_weight="1"
     android:background="?android:attr/selectableItemBackground">
 
     <View
         android:id="@+id/color_preset_item_view"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_margin="2dp"/>
+        android:layout_margin="4dp" />
 
 </LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/color_select_dialog.xml b/app/src/main/res/layout/color_select_dialog.xml
index f17a54c..48d75e4 100644
--- a/app/src/main/res/layout/color_select_dialog.xml
+++ b/app/src/main/res/layout/color_select_dialog.xml
@@ -13,50 +13,60 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical"
-    android:padding="@dimen/alert_dialog_padding_material">
-
-    <org.omnirom.control.widget.ColorPickerView
-        android:id="@+id/color_picker_view"
-        android:layout_width="match_parent"
-        android:layout_height="300dp" />
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
 
     <LinearLayout
-        android:id="@+id/color_preset_view"
         android:layout_width="match_parent"
-        android:layout_height="@dimen/color_preset_item_size"
-        android:layout_marginStart="3dp"
-        android:layout_marginTop="6dp"
-        android:layout_marginBottom="6dp"
-        android:orientation="horizontal"
-        android:visibility="gone" />
+        android:layout_height="match_parent"
+        android:layout_marginStart="@dimen/color_select_side_margin"
+        android:layout_marginEnd="@dimen/color_select_side_margin"
+        android:orientation="vertical"
+        android:padding="@dimen/color_select_content_padding">
 
-    <LinearLayout
-        android:id="@+id/color_panel_view"
-        android:layout_width="wrap_content"
-        android:layout_height="@dimen/color_preset_item_size"
-        android:layout_marginStart="3dp"
-        android:layout_marginTop="6dp"
-        android:layout_marginBottom="6dp"
-        android:orientation="horizontal">
+        <org.omnirom.control.widget.ColorPickerView
+            android:id="@+id/color_picker_view"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/color_select_picker_width"
+            android:layout_gravity="center_horizontal" />
 
-        <EditText
-            android:id="@+id/hex_color_input"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:layout_weight="1"
-            android:digits="0123456789ABCDEFabcdef"
-            android:inputType="textNoSuggestions"
-            android:maxLength="6" />
+        <GridLayout
+            android:id="@+id/color_preset_view"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dp"
+            android:columnCount="5"
+            android:rowCount="2" />
 
-        <org.omnirom.control.widget.ColorPanelView
+        <com.google.android.material.textfield.TextInputLayout
+            android:id="@+id/hex_color_input_layout"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+            android:layout_marginTop="10dp"
+            android:hint="@string/hex_color_input_hint">
+
+            <com.google.android.material.textfield.TextInputEditText
+                android:id="@+id/hex_color_input"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:digits="0123456789ABCDEFabcdef"
+                android:inputType="textNoSuggestions"
+                android:maxLength="6" />
+
+        </com.google.android.material.textfield.TextInputLayout>
+
+        <ImageView
             android:id="@+id/color_panel"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:layout_marginStart="10dp"
-            android:layout_weight="1" />
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/color_preset_item_size"
+            android:layout_marginTop="10dp" />
+
+        <com.google.android.material.button.MaterialButton
+            android:id="@+id/select_color"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="end"
+            android:layout_marginTop="20dp"
+            android:text="@android:string/ok" />
     </LinearLayout>
-</LinearLayout>
+</merge>
diff --git a/app/src/main/res/values-land/dimens.xml b/app/src/main/res/values-land/dimens.xml
index 3126217..9185fd8 100644
--- a/app/src/main/res/values-land/dimens.xml
+++ b/app/src/main/res/values-land/dimens.xml
@@ -6,4 +6,6 @@
     <dimen name="color_item_container_width">@dimen/color_item_container_height</dimen>
     <dimen name="overlay_fragment_side_margin">20dp</dimen>
     <dimen name="toolbar_placeholder_height">60dp</dimen>
+    <dimen name="color_select_side_margin">20dp</dimen>
+    <dimen name="color_select_content_padding">10dp</dimen>
 </resources>
\ No newline at end of file
diff --git a/app/src/main/res/values-sw600dp-land/dimens.xml b/app/src/main/res/values-sw600dp-land/dimens.xml
index 7e1a5d7..993d22c 100644
--- a/app/src/main/res/values-sw600dp-land/dimens.xml
+++ b/app/src/main/res/values-sw600dp-land/dimens.xml
@@ -2,4 +2,8 @@
 <resources>
     <dimen name="color_item_column_width">@dimen/color_item_column_height</dimen>
     <dimen name="color_item_container_width">@dimen/color_item_container_height</dimen>
+    <dimen name="color_select_side_margin">100dp</dimen>
+    <dimen name="color_select_content_padding">64dp</dimen>
+    <dimen name="color_select_picker_width">400dp</dimen>
+    <dimen name="color_select_panel_minwidth">400dp</dimen>
 </resources>
\ No newline at end of file
diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml
index cecab27..1ed609d 100644
--- a/app/src/main/res/values-sw600dp/dimens.xml
+++ b/app/src/main/res/values-sw600dp/dimens.xml
@@ -11,4 +11,8 @@
     <dimen name="edit_accent_color_item_height">50dp</dimen>
     <dimen name="color_item_column_width">150dp</dimen>
     <dimen name="color_item_column_height">180dp</dimen>
+    <dimen name="color_select_side_margin">150dp</dimen>
+    <dimen name="color_select_content_padding">64dp</dimen>
+    <dimen name="color_preset_item_size">52dp</dimen>
+    <dimen name="color_select_picker_width">400dp</dimen>
 </resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 4849bbd..eb629ec 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -32,4 +32,10 @@
     <dimen name="grid_item_margin_start">16dp</dimen>
     <dimen name="search_result_title_text_size">16sp</dimen>
     <dimen name="search_result_summary_text_size">12sp</dimen>
+    <dimen name="image_corner_radius_small">8dp</dimen>
+    <dimen name="text_field_corner_radius">512dp</dimen>
+    <dimen name="color_select_content_padding">36dp</dimen>
+    <dimen name="color_select_side_margin">0dp</dimen>
+    <dimen name="color_select_picker_width">300dp</dimen>
+    <dimen name="color_select_panel_minwidth">220dp</dimen>
 </resources>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 328c88c..7cc563c 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -157,4 +157,7 @@
     <string name="search_fragment_title">Search</string>
     <string name="search_fragment_summary">Find settings by text</string>
     <string name="search_result_hint">Search settings</string>
+    <string name="hex_color_input_hint">Hex</string>
+    <string name="color_activity_title">Select color</string>
+
 </resources>