summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrimiano Tucci <primiano@google.com>2013-12-02 16:03:33 +0000
committerPrimiano Tucci <primiano@google.com>2013-12-03 15:10:17 +0000
commit79a1e3e73fa3e14642e44a80f4f475660d5e4b57 (patch)
treedc7568c9e65d431b57f974d5f248482824177c0a
parent1c502c56a8964a72ccc1bcb0b6a0d8685aed983e (diff)
downloadandroid_frameworks_webview-79a1e3e73fa3e14642e44a80f4f475660d5e4b57.tar.gz
android_frameworks_webview-79a1e3e73fa3e14642e44a80f4f475660d5e4b57.tar.bz2
android_frameworks_webview-79a1e3e73fa3e14642e44a80f4f475660d5e4b57.zip
Update resources needed for colour picker.
Bug: 7621527 Match the upstream changes of crrev.com/23026006 Change-Id: I5645388cb599affc4ee8ed6e93cada330084286b
-rw-r--r--chromium/java/com/android/webview/chromium/ResourceProvider.java25
-rw-r--r--chromium/overlay/frameworks/base/core/res/res/drawable/webviewchromium_color_button_background.xml36
-rw-r--r--chromium/overlay/frameworks/base/core/res/res/drawable/webviewchromium_color_picker_border.xml2
-rw-r--r--chromium/overlay/frameworks/base/core/res/res/layout/webviewchromium_color_picker_dialog_content.xml42
-rw-r--r--chromium/overlay/frameworks/base/core/res/res/values/chromium-resources.xml11
-rw-r--r--chromium/overlay/frameworks/base/core/res/res/values/chromium-symbols.xml15
-rw-r--r--chromium/overlay/frameworks/base/core/res/res/values/colors.xml1
-rw-r--r--chromium/overlay/frameworks/base/core/res/res/values/dimens.xml1
-rw-r--r--chromium/overlay/frameworks/base/core/res/res/values/strings.xml16
9 files changed, 124 insertions, 25 deletions
diff --git a/chromium/java/com/android/webview/chromium/ResourceProvider.java b/chromium/java/com/android/webview/chromium/ResourceProvider.java
index 240e4d6..24d2a83 100644
--- a/chromium/java/com/android/webview/chromium/ResourceProvider.java
+++ b/chromium/java/com/android/webview/chromium/ResourceProvider.java
@@ -56,11 +56,15 @@ public class ResourceProvider {
com.android.internal.R.dimen.webviewchromium_autofill_text_height;
org.chromium.ui.R.dimen.autofill_text_divider_height =
com.android.internal.R.dimen.webviewchromium_autofill_text_divider_height;
+ org.chromium.ui.R.dimen.color_button_height =
+ com.android.internal.R.dimen.webviewchromium_color_button_height;
// drawable
org.chromium.content.R.drawable.ondemand_overlay =
com.android.internal.R.drawable.webviewchromium_ondemand_overlay;
+ org.chromium.ui.R.drawable.color_button_background =
+ com.android.internal.R.drawable.webviewchromium_color_button_background;
org.chromium.ui.R.drawable.color_picker_advanced_select_handle =
com.android.internal.R.drawable.webviewchromium_color_picker_advanced_select_handle;
@@ -106,10 +110,10 @@ public class ResourceProvider {
com.android.internal.R.id.webviewchromium_color_picker_advanced;
org.chromium.ui.R.id.color_picker_simple =
com.android.internal.R.id.webviewchromium_color_picker_simple;
+ org.chromium.ui.R.id.color_button_swatch =
+ com.android.internal.R.id.webviewchromium_color_button_swatch;
org.chromium.ui.R.id.more_colors_button_border =
com.android.internal.R.id.webviewchromium_color_picker_more_colors_button_border;
- org.chromium.ui.R.id.color_picker_simple_border =
- com.android.internal.R.id.webviewchromium_color_picker_simple_border;
org.chromium.ui.R.id.gradient =
com.android.internal.R.id.webviewchromium_color_picker_gradient;
org.chromium.ui.R.id.text =
@@ -216,6 +220,23 @@ public class ResourceProvider {
com.android.internal.R.string.webviewchromium_color_picker_button_cancel;
org.chromium.ui.R.string.color_picker_dialog_title =
com.android.internal.R.string.webviewchromium_color_picker_dialog_title;
+ org.chromium.ui.R.string.color_picker_button_red =
+ com.android.internal.R.string.webviewchromium_color_picker_button_red;
+ org.chromium.ui.R.string.color_picker_button_cyan =
+ com.android.internal.R.string.webviewchromium_color_picker_button_cyan;
+ org.chromium.ui.R.string.color_picker_button_blue =
+ com.android.internal.R.string.webviewchromium_color_picker_button_blue;
+ org.chromium.ui.R.string.color_picker_button_green =
+ com.android.internal.R.string.webviewchromium_color_picker_button_green;
+ org.chromium.ui.R.string.color_picker_button_magenta =
+ com.android.internal.R.string.webviewchromium_color_picker_button_magenta;
+ org.chromium.ui.R.string.color_picker_button_yellow =
+ com.android.internal.R.string.webviewchromium_color_picker_button_yellow;
+ org.chromium.ui.R.string.color_picker_button_black =
+ com.android.internal.R.string.webviewchromium_color_picker_button_black;
+ org.chromium.ui.R.string.color_picker_button_white =
+ com.android.internal.R.string.webviewchromium_color_picker_button_white;
+
// style
org.chromium.content.R.style.SelectPopupDialog =
diff --git a/chromium/overlay/frameworks/base/core/res/res/drawable/webviewchromium_color_button_background.xml b/chromium/overlay/frameworks/base/core/res/res/drawable/webviewchromium_color_button_background.xml
new file mode 100644
index 0000000..7bb2679
--- /dev/null
+++ b/chromium/overlay/frameworks/base/core/res/res/drawable/webviewchromium_color_button_background.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2013 The Chromium Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style license that can be
+ found in the LICENSE file.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:top="0dp"
+ android:right="0dp"
+ android:bottom="0dp"
+ android:left="0dp">
+ <shape android:shape="rectangle">
+ <solid android:color="@color/webviewchromium_color_picker_border_color"/>
+ </shape>
+ </item>
+ <item android:top="0px"
+ android:right="1px"
+ android:bottom="0px"
+ android:left="1px">
+ <shape android:shape="rectangle">
+ <solid android:color="@color/webviewchromium_color_picker_background_color"/>
+ </shape>
+ </item>
+ <item
+ android:id="@+id/webviewchromium_color_button_swatch"
+ android:top="1px"
+ android:right="2px"
+ android:bottom="1px"
+ android:left="2px">
+ <shape android:shape="rectangle">
+ <solid android:color="#FF0000"/>
+ </shape>
+ </item>
+</layer-list>
diff --git a/chromium/overlay/frameworks/base/core/res/res/drawable/webviewchromium_color_picker_border.xml b/chromium/overlay/frameworks/base/core/res/res/drawable/webviewchromium_color_picker_border.xml
index 6b39744..cfcb39f 100644
--- a/chromium/overlay/frameworks/base/core/res/res/drawable/webviewchromium_color_picker_border.xml
+++ b/chromium/overlay/frameworks/base/core/res/res/drawable/webviewchromium_color_picker_border.xml
@@ -5,6 +5,6 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
- <solid android:color="#00000000"/>
+ <solid android:color="@color/webviewchromium_color_picker_background_color"/>
<stroke android:width="1px" android:color="@color/webviewchromium_color_picker_border_color" />
</shape>
diff --git a/chromium/overlay/frameworks/base/core/res/res/layout/webviewchromium_color_picker_dialog_content.xml b/chromium/overlay/frameworks/base/core/res/res/layout/webviewchromium_color_picker_dialog_content.xml
index 5de9f1f..42d8af4 100644
--- a/chromium/overlay/frameworks/base/core/res/res/layout/webviewchromium_color_picker_dialog_content.xml
+++ b/chromium/overlay/frameworks/base/core/res/res/layout/webviewchromium_color_picker_dialog_content.xml
@@ -4,48 +4,48 @@
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="15dp">
- <com.android.org.chromium.ui.ColorPickerAdvanced
- android:id="@+id/webviewchromium_color_picker_advanced"
+ <ScrollView
android:layout_width="match_parent"
- android:layout_height="wrap_content" />
+ android:layout_height="wrap_content">
- <FrameLayout
- android:id="@+id/webviewchromium_color_picker_simple_border"
+ <com.android.org.chromium.ui.ColorPickerAdvanced
+ android:id="@+id/webviewchromium_color_picker_advanced"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+ </ScrollView>
+
+ <com.android.org.chromium.ui.ColorPickerSimple
+ android:id="@+id/webviewchromium_color_picker_simple"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@drawable/webviewchromium_color_picker_border"
+ android:divider="@color/webviewchromium_color_picker_border_color"
+ android:dividerHeight="1px"
android:paddingStart="1px"
android:paddingEnd="1px"
- android:paddingTop="1px">
-
-
- <com.android.org.chromium.ui.ColorPickerSimple
- android:id="@+id/webviewchromium_color_picker_simple"
- android:layout_width="match_parent"
- android:layout_height="100dp"/>
- </FrameLayout>
+ android:paddingTop="1px"
+ android:background="@drawable/webviewchromium_color_picker_border" />
<FrameLayout
android:id="@+id/webviewchromium_color_picker_more_colors_button_border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_below="@+id/webviewchromium_color_picker_simple_border"
android:background="@drawable/webviewchromium_color_picker_border"
android:padding="1px">
- <Button
+ <com.android.org.chromium.ui.ColorPickerMoreButton
android:id="@+id/webviewchromium_color_picker_more_colors_button"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="60dip"
+ android:minHeight="48dp"
+ android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/webviewchromium_color_picker_button_more" />
</FrameLayout>
-
-</RelativeLayout>
+</LinearLayout>
diff --git a/chromium/overlay/frameworks/base/core/res/res/values/chromium-resources.xml b/chromium/overlay/frameworks/base/core/res/res/values/chromium-resources.xml
index a947ba2..07999f7 100644
--- a/chromium/overlay/frameworks/base/core/res/res/values/chromium-resources.xml
+++ b/chromium/overlay/frameworks/base/core/res/res/values/chromium-resources.xml
@@ -23,14 +23,17 @@
<add-resource type="color" name="webviewchromium_autofill_dark_divider_color" />
<add-resource type="color" name="webviewchromium_autofill_divider_color" />
+ <add-resource type="color" name="webviewchromium_color_picker_background_color" />
<add-resource type="color" name="webviewchromium_color_picker_border_color" />
+ <add-resource type="dimen" name="webviewchromium_color_button_height" />
<add-resource type="dimen" name="webviewchromium_color_picker_gradient_margin" />
<add-resource type="dimen" name="webviewchromium_autofill_text_height" />
<add-resource type="dimen" name="webviewchromium_autofill_text_divider_height" />
<add-resource type="dimen" name="webviewchromium_link_preview_overlay_radius" />
<add-resource type="drawable" name="webviewchromium_color_advanced_select_handle" />
+ <add-resource type="drawable" name="webviewchromium_color_button_background" />
<add-resource type="drawable" name="webviewchromium_color_picker_border" />
<add-resource type="drawable" name="webviewchromium_ondemand_overlay" />
@@ -61,6 +64,14 @@
<add-resource type="string" name="webviewchromium_color_picker_button_more" />
<add-resource type="string" name="webviewchromium_color_picker_button_set" />
<add-resource type="string" name="webviewchromium_color_picker_dialog_title" />
+ <add-resource type="string" name="webviewchromium_color_picker_button_red" />
+ <add-resource type="string" name="webviewchromium_color_picker_button_cyan" />
+ <add-resource type="string" name="webviewchromium_color_picker_button_blue" />
+ <add-resource type="string" name="webviewchromium_color_picker_button_green" />
+ <add-resource type="string" name="webviewchromium_color_picker_button_magenta" />
+ <add-resource type="string" name="webviewchromium_color_picker_button_yellow" />
+ <add-resource type="string" name="webviewchromium_color_picker_button_black" />
+ <add-resource type="string" name="webviewchromium_color_picker_button_white" />
<add-resource type="string" name="webviewchromium_color_picker_hue" />
<add-resource type="string" name="webviewchromium_color_picker_saturation" />
<add-resource type="string" name="webviewchromium_color_picker_value" />
diff --git a/chromium/overlay/frameworks/base/core/res/res/values/chromium-symbols.xml b/chromium/overlay/frameworks/base/core/res/res/values/chromium-symbols.xml
index 0a0f602..2f87a54 100644
--- a/chromium/overlay/frameworks/base/core/res/res/values/chromium-symbols.xml
+++ b/chromium/overlay/frameworks/base/core/res/res/values/chromium-symbols.xml
@@ -26,13 +26,16 @@
<java-symbol type="color" name="webviewchromium_autofill_dark_divider_color" />
<java-symbol type="color" name="webviewchromium_autofill_divider_color" />
+ <java-symbol type="color" name="webviewchromium_color_picker_background_color" />
<java-symbol type="color" name="webviewchromium_color_picker_border_color" />
+ <java-symbol type="dimen" name="webviewchromium_color_button_height" />
<java-symbol type="dimen" name="webviewchromium_color_picker_gradient_margin" />
<java-symbol type="dimen" name="webviewchromium_autofill_text_height" />
<java-symbol type="dimen" name="webviewchromium_autofill_text_divider_height" />
<java-symbol type="dimen" name="webviewchromium_link_preview_overlay_radius" />
+ <java-symbol type="drawable" name="webviewchromium_color_button_background" />
<java-symbol type="drawable" name="webviewchromium_color_picker_advanced_select_handle" />
<java-symbol type="drawable" name="webviewchromium_color_picker_border" />
<java-symbol type="drawable" name="webviewchromium_ondemand_overlay" />
@@ -65,6 +68,16 @@
<java-symbol type="string" name="webviewchromium_color_picker_button_more" />
<java-symbol type="string" name="webviewchromium_color_picker_button_set" />
<java-symbol type="string" name="webviewchromium_color_picker_dialog_title" />
+
+ <java-symbol type="string" name="webviewchromium_color_picker_button_red" />
+ <java-symbol type="string" name="webviewchromium_color_picker_button_cyan" />
+ <java-symbol type="string" name="webviewchromium_color_picker_button_blue" />
+ <java-symbol type="string" name="webviewchromium_color_picker_button_green" />
+ <java-symbol type="string" name="webviewchromium_color_picker_button_magenta" />
+ <java-symbol type="string" name="webviewchromium_color_picker_button_yellow" />
+ <java-symbol type="string" name="webviewchromium_color_picker_button_black" />
+ <java-symbol type="string" name="webviewchromium_color_picker_button_white" />
+
<java-symbol type="string" name="webviewchromium_color_picker_hue" />
<java-symbol type="string" name="webviewchromium_color_picker_saturation" />
<java-symbol type="string" name="webviewchromium_color_picker_value" />
@@ -96,6 +109,7 @@
<java-symbol type="id" name="webviewchromium_autofill_label" />
<java-symbol type="id" name="webviewchromium_autofill_popup_window" />
<java-symbol type="id" name="webviewchromium_autofill_sublabel" />
+ <java-symbol type="id" name="webviewchromium_color_button_swatch" />
<java-symbol type="id" name="webviewchromium_color_picker_advanced" />
<java-symbol type="id" name="webviewchromium_color_picker_gradient" />
<java-symbol type="id" name="webviewchromium_color_picker_more_colors_button" />
@@ -103,7 +117,6 @@
<java-symbol type="id" name="webviewchromium_color_picker_seek_bar" />
<java-symbol type="id" name="webviewchromium_color_picker_selected_color_view" />
<java-symbol type="id" name="webviewchromium_color_picker_simple" />
- <java-symbol type="id" name="webviewchromium_color_picker_simple_border" />
<java-symbol type="id" name="webviewchromium_color_picker_text" />
<java-symbol type="id" name="webviewchromium_color_picker_title" />
<java-symbol type="id" name="webviewchromium_ampm" />
diff --git a/chromium/overlay/frameworks/base/core/res/res/values/colors.xml b/chromium/overlay/frameworks/base/core/res/res/values/colors.xml
index 6d43c93..de262ff 100644
--- a/chromium/overlay/frameworks/base/core/res/res/values/colors.xml
+++ b/chromium/overlay/frameworks/base/core/res/res/values/colors.xml
@@ -5,6 +5,7 @@
-->
<resources>
<color name="webviewchromium_color_picker_border_color">#B0B0B0</color>
+ <color name="webviewchromium_color_picker_background_color">#FFFFFF</color>
<color name="webviewchromium_autofill_divider_color">#E5E5E5</color>
<color name="webviewchromium_autofill_dark_divider_color">#C0C0C0</color>
</resources>
diff --git a/chromium/overlay/frameworks/base/core/res/res/values/dimens.xml b/chromium/overlay/frameworks/base/core/res/res/values/dimens.xml
index b87f944..faeaba2 100644
--- a/chromium/overlay/frameworks/base/core/res/res/values/dimens.xml
+++ b/chromium/overlay/frameworks/base/core/res/res/values/dimens.xml
@@ -13,6 +13,7 @@
14.5 = Seekbar thumb width - border width, but it depends on the width
of the seek bar icon.
-->
+ <dimen name="webviewchromium_color_button_height">60dp</dimen>
<dimen name="webviewchromium_color_picker_gradient_margin">14.5dp</dimen>
<dimen name="webviewchromium_autofill_text_height">44dp</dimen>
<dimen name="webviewchromium_autofill_text_divider_height">1px</dimen>
diff --git a/chromium/overlay/frameworks/base/core/res/res/values/strings.xml b/chromium/overlay/frameworks/base/core/res/res/values/strings.xml
index 27a9ac7..a54a91d 100644
--- a/chromium/overlay/frameworks/base/core/res/res/values/strings.xml
+++ b/chromium/overlay/frameworks/base/core/res/res/values/strings.xml
@@ -92,6 +92,22 @@
<string name="webviewchromium_color_picker_button_cancel">Cancel</string>
<!-- Title of Color Picker dialog. [CHAR-LIMIT=20] -->
<string name="webviewchromium_color_picker_dialog_title">Select color</string>
+ <!-- Label for Color Picker color button. -->
+ <string name="webviewchromium_color_picker_button_red">Red</string>
+ <!-- Label for Color Picker color button. -->
+ <string name="webviewchromium_color_picker_button_cyan">Cyan</string>
+ <!-- Label for Color Picker color button. -->
+ <string name="webviewchromium_color_picker_button_blue">Blue</string>
+ <!-- Label for Color Picker color button. -->
+ <string name="webviewchromium_color_picker_button_green">Green</string>
+ <!-- Label for Color Picker color button. -->
+ <string name="webviewchromium_color_picker_button_magenta">Magenta</string>
+ <!-- Label for Color Picker color button. -->
+ <string name="webviewchromium_color_picker_button_yellow">Yellow</string>
+ <!-- Label for Color Picker color button. -->
+ <string name="webviewchromium_color_picker_button_black">Black</string>
+ <!-- Label for Color Picker color button. -->
+ <string name="webviewchromium_color_picker_button_white">White</string>
<!-- Error shown when the browser is restarted due to low memory during a file picker operation. [CHAR-LIMIT=NONE] -->
<string name="webviewchromium_low_memory_error">Unable to complete previous operation due to low memory</string>