From 0fbdf1035b2ca6a4089bb991fddd5fe5ad973bf9 Mon Sep 17 00:00:00 2001 From: satok Date: Wed, 30 Jun 2010 12:32:04 +0900 Subject: [PATCH] Change color of a shodow behind the current language in Black symbols scheme Change-Id: I8ce049e1d77753a481cd45b53254ba248dca9f15 --- java/res/values/colors.xml | 3 ++- .../android/inputmethod/latin/LatinKeyboard.java | 16 +++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/java/res/values/colors.xml b/java/res/values/colors.xml index 4581cc961..343a9405d 100644 --- a/java/res/values/colors.xml +++ b/java/res/values/colors.xml @@ -22,7 +22,8 @@ #FFE35900 #ff808080 #00000000 - #80000000 + #80000000 + #80FFFFFF #FF808080 #A0000000 #FF000000 diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java index 2dd03389c..3d1e1d3cf 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java @@ -350,7 +350,7 @@ public class LatinKeyboard extends Keyboard { Bitmap buffer = Bitmap.createBitmap(mSpaceKey.width, mSpaceIcon.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(buffer); - drawSpaceBar(canvas, buffer.getWidth(), buffer.getHeight(), 255); + drawSpaceBar(canvas, buffer.getWidth(), buffer.getHeight(), 255, isBlack); mSpaceKey.icon = new BitmapDrawable(mRes, buffer); mSpaceKey.repeatable = mLanguageSwitcher.getLocaleCount() < 2; } else { @@ -360,7 +360,7 @@ public class LatinKeyboard extends Keyboard { } } - private void drawSpaceBar(Canvas canvas, int width, int height, int opacity) { + private void drawSpaceBar(Canvas canvas, int width, int height, int opacity, boolean isBlack) { canvas.drawColor(mRes.getColor(R.color.latinkeyboard_transparent), PorterDuff.Mode.CLEAR); Paint paint = new Paint(); paint.setAntiAlias(true); @@ -370,12 +370,14 @@ public class LatinKeyboard extends Keyboard { paint.setTextAlign(Align.CENTER); final String language = getInputLanguage(mSpaceKey.width, paint); final int ascent = (int) -paint.ascent(); - paint.setColor(mRes.getColor(R.color.latinkeyboard_bar_language_shadow)); - canvas.drawText(language, - width / 2, ascent - 1, paint); + + int shadowColor = isBlack ? mRes.getColor(R.color.latinkeyboard_bar_language_shadow_black) + : mRes.getColor(R.color.latinkeyboard_bar_language_shadow_white); + + paint.setColor(shadowColor); + canvas.drawText(language, width / 2, ascent - 1, paint); paint.setColor(mRes.getColor(R.color.latinkeyboard_bar_language_text)); - canvas.drawText(language, - width / 2, ascent, paint); + canvas.drawText(language, width / 2, ascent, paint); // Put arrows on either side of the text if (mLanguageSwitcher.getLocaleCount() > 1) { Rect bounds = new Rect();