summaryrefslogtreecommitdiffstats
path: root/core/res
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2010-08-13 14:43:10 -0700
committerGilles Debunne <debunne@google.com>2010-08-17 10:52:04 -0700
commita6d7ee19cc1f72f279b338bddcee3a1648c6c84c (patch)
tree3093664a41648ac770cbc3f931a6b410dc1715f0 /core/res
parentf6105cfd735bfebb0072023402a7b8b7e1d555b2 (diff)
downloadframeworks_base-a6d7ee19cc1f72f279b338bddcee3a1648c6c84c.zip
frameworks_base-a6d7ee19cc1f72f279b338bddcee3a1648c6c84c.tar.gz
frameworks_base-a6d7ee19cc1f72f279b338bddcee3a1648c6c84c.tar.bz2
Fixes in TextView's selection.
Handles are now centered on selection corners. Touch regions tuned, especially for the one line / last line case. Selection mode is stopped when text is entered or modified. New temporary assets. New selection background color. Using references to theme for some hard-coded colors. Change-Id: I820ec39bb6d5a3c6598c7c34b9c8f90b848da9f3
Diffstat (limited to 'core/res')
-rw-r--r--core/res/res/drawable-hdpi/cursor_controller.pngbin2886 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/selection_end_handle.pngbin2077 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/selection_start_handle.pngbin2107 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/text_select_handle.pngbin0 -> 6605 bytes
-rw-r--r--core/res/res/drawable-mdpi/cursor_controller.pngbin1622 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/selection_end_handle.pngbin1139 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/selection_start_handle.pngbin1199 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/text_select_handle.pngbin0 -> 6605 bytes
-rwxr-xr-xcore/res/res/values/attrs.xml7
-rw-r--r--core/res/res/values/colors.xml6
-rw-r--r--core/res/res/values/dimens.xml2
-rw-r--r--core/res/res/values/public.xml2
-rw-r--r--core/res/res/values/styles.xml13
-rw-r--r--core/res/res/values/themes.xml12
14 files changed, 34 insertions, 8 deletions
diff --git a/core/res/res/drawable-hdpi/cursor_controller.png b/core/res/res/drawable-hdpi/cursor_controller.png
deleted file mode 100644
index 720aded..0000000
--- a/core/res/res/drawable-hdpi/cursor_controller.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/selection_end_handle.png b/core/res/res/drawable-hdpi/selection_end_handle.png
deleted file mode 100644
index 624ab58..0000000
--- a/core/res/res/drawable-hdpi/selection_end_handle.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/selection_start_handle.png b/core/res/res/drawable-hdpi/selection_start_handle.png
deleted file mode 100644
index 7d6f24c..0000000
--- a/core/res/res/drawable-hdpi/selection_start_handle.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/text_select_handle.png b/core/res/res/drawable-hdpi/text_select_handle.png
new file mode 100644
index 0000000..93a5a15
--- /dev/null
+++ b/core/res/res/drawable-hdpi/text_select_handle.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/cursor_controller.png b/core/res/res/drawable-mdpi/cursor_controller.png
deleted file mode 100644
index 1a8a459..0000000
--- a/core/res/res/drawable-mdpi/cursor_controller.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/selection_end_handle.png b/core/res/res/drawable-mdpi/selection_end_handle.png
deleted file mode 100644
index 7e075eb..0000000
--- a/core/res/res/drawable-mdpi/selection_end_handle.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/selection_start_handle.png b/core/res/res/drawable-mdpi/selection_start_handle.png
deleted file mode 100644
index d8022f7..0000000
--- a/core/res/res/drawable-mdpi/selection_start_handle.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/text_select_handle.png b/core/res/res/drawable-mdpi/text_select_handle.png
new file mode 100644
index 0000000..93a5a15
--- /dev/null
+++ b/core/res/res/drawable-mdpi/text_select_handle.png
Binary files differ
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 67327b2..4362c04 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -46,6 +46,7 @@
theme does not set this value, meaning it is based on whether the
window is floating. -->
<attr name="backgroundDimEnabled" format="boolean" />
+
<!-- =========== -->
<!-- Text styles -->
@@ -95,6 +96,12 @@
<!-- Text color for urls in search suggestions, used by things like global search and the browser. @hide -->
<attr name="textColorSearchUrl" format="reference|color" />
+
+ <!-- Color of highlighted text, when used in a light theme. @hide -->
+ <attr name="textColorHighlightInverse" format="reference|color" />
+ <!-- Color of link text (URLs), when used in a light theme. @hide -->
+ <attr name="textColorLinkInverse" format="reference|color" />
+
<!-- Search widget more corpus result item background. -->
<attr name="searchWidgetCorpusItemBackground" format="reference|color" />
diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml
index a2316e0..3a0c651 100644
--- a/core/res/res/values/colors.xml
+++ b/core/res/res/values/colors.xml
@@ -54,6 +54,12 @@
<color name="dim_foreground_light_inverse">#bebebe</color>
<color name="dim_foreground_light_inverse_disabled">#80bebebe</color>
<color name="hint_foreground_light">#808080</color>
+ <color name="highlight_background">#cc475925</color>
+ <color name="highlight_background_inverse">#ccd2e461</color>
+ <color name="highlighted_text_dark">#cc475925</color>
+ <color name="highlighted_text_light">#ccd2e461</color>
+ <color name="link_text_dark">#5c5cff</color>
+ <color name="link_text_light">#0000ee</color>
<drawable name="stat_notify_sync_noanim">@drawable/stat_notify_sync_anim0</drawable>
<drawable name="stat_sys_download_done">@drawable/stat_sys_download_anim0</drawable>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index fdafaf1..3b38bd5 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -47,6 +47,4 @@
<dimen name="password_keyboard_key_height_numeric">56dip</dimen>
<!-- Default correction for the space key in the password keyboard -->
<dimen name="password_keyboard_spacebar_vertical_correction">4dip</dimen>
- <!-- Distance between the text base line and virtual finger position used to position cursor -->
- <dimen name="cursor_controller_vertical_offset">12dp</dimen>
</resources>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index b84a613..f413a12 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1329,7 +1329,7 @@
<!-- Context menu ID for the "Select text..." menu item to switch to text
selection context mode in text views. -->
<public type="id" name="selectTextMode" />
-
+
<public type="style" name="Theme.WithActionBar" />
<public type="style" name="Widget.Spinner.DropDown" />
<public type="style" name="Widget.ActionButton" />
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 2ae3ccd..4294c22 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -640,9 +640,9 @@
<style name="TextAppearance">
<item name="android:textColor">?textColorPrimary</item>
- <item name="android:textColorHighlight">#D077A14B</item>
+ <item name="android:textColorHighlight">?textColorHighlight</item>
<item name="android:textColorHint">?textColorHint</item>
- <item name="android:textColorLink">#5C5CFF</item>
+ <item name="android:textColorLink">?textColorLink</item>
<item name="android:textSize">16sp</item>
<item name="android:textStyle">normal</item>
</style>
@@ -650,7 +650,8 @@
<style name="TextAppearance.Inverse">
<item name="textColor">?textColorPrimaryInverse</item>
<item name="android:textColorHint">?textColorHintInverse</item>
- <item name="android:textColorLink">#0000EE</item>
+ <item name="android:textColorHighlight">?textColorHighlightInverse</item>
+ <item name="android:textColorLink">?textColorLinkInverse</item>
</style>
<style name="TextAppearance.Theme">
@@ -671,6 +672,8 @@
<style name="TextAppearance.Large.Inverse">
<item name="android:textColor">?textColorPrimaryInverse</item>
<item name="android:textColorHint">?textColorHintInverse</item>
+ <item name="android:textColorHighlight">?textColorHighlightInverse</item>
+ <item name="android:textColorLink">?textColorLinkInverse</item>
</style>
<style name="TextAppearance.Medium">
@@ -682,6 +685,8 @@
<style name="TextAppearance.Medium.Inverse">
<item name="android:textColor">?textColorPrimaryInverse</item>
<item name="android:textColorHint">?textColorHintInverse</item>
+ <item name="android:textColorHighlight">?textColorHighlightInverse</item>
+ <item name="android:textColorLink">?textColorLinkInverse</item>
</style>
<style name="TextAppearance.Small">
@@ -693,6 +698,8 @@
<style name="TextAppearance.Small.Inverse">
<item name="android:textColor">?textColorSecondaryInverse</item>
<item name="android:textColorHint">?textColorHintInverse</item>
+ <item name="android:textColorHighlight">?textColorHighlightInverse</item>
+ <item name="android:textColorLink">?textColorLinkInverse</item>
</style>
<style name="TextAppearance.Theme.Dialog" parent="TextAppearance.Theme">
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index f9e20f7..348a7de 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -53,6 +53,10 @@
<item name="textColorHint">@android:color/hint_foreground_dark</item>
<item name="textColorHintInverse">@android:color/hint_foreground_light</item>
<item name="textColorSearchUrl">@android:color/search_url_text</item>
+ <item name="textColorHighlight">@android:color/highlighted_text_dark</item>
+ <item name="textColorHighlightInverse">@android:color/highlighted_text_light</item>
+ <item name="textColorLink">@android:color/link_text_dark</item>
+ <item name="textColorLinkInverse">@android:color/link_text_light</item>
<item name="textAppearanceLarge">@android:style/TextAppearance.Large</item>
<item name="textAppearanceMedium">@android:style/TextAppearance.Medium</item>
@@ -233,7 +237,7 @@
<item name="colorBackground">@android:color/background_light</item>
<item name="colorForeground">@color/bright_foreground_light</item>
<item name="colorForegroundInverse">@android:color/bright_foreground_light_inverse</item>
-
+
<item name="textColorPrimary">@android:color/primary_text_light</item>
<item name="textColorSecondary">@android:color/secondary_text_light</item>
<item name="textColorTertiary">@android:color/tertiary_text_light</item>
@@ -247,7 +251,11 @@
<item name="textColorPrimaryInverseNoDisable">@android:color/primary_text_dark_nodisable</item>
<item name="textColorSecondaryInverseNoDisable">@android:color/secondary_text_dark_nodisable</item>
<item name="textColorHint">@android:color/hint_foreground_light</item>
- <item name="textColorHintInverse">@android:color/hint_foreground_dark</item>
+ <item name="textColorHintInverse">@android:color/hint_foreground_dark</item>
+ <item name="textColorHighlight">@android:color/highlighted_text_light</item>
+ <item name="textColorHighlightInverse">@android:color/highlighted_text_dark</item>
+ <item name="textColorLink">@android:color/link_text_light</item>
+ <item name="textColorLinkInverse">@android:color/link_text_dark</item>
<item name="popupWindowStyle">@android:style/Widget.PopupWindow</item>