diff --git a/core/java/android/text/method/CharacterPickerDialog.java b/core/java/android/text/method/CharacterPickerDialog.java
index 3c40675118049..880e46daf1aa8 100644
--- a/core/java/android/text/method/CharacterPickerDialog.java
+++ b/core/java/android/text/method/CharacterPickerDialog.java
@@ -25,15 +25,14 @@ import android.text.*;
import android.view.LayoutInflater;
import android.view.View.OnClickListener;
import android.view.View;
-import android.view.ViewGroup.LayoutParams;
import android.view.ViewGroup;
+import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.GridView;
-import android.widget.TextView;
/**
* Dialog for choosing accented characters related to a base character.
@@ -45,6 +44,7 @@ public class CharacterPickerDialog extends Dialog
private String mOptions;
private boolean mInsert;
private LayoutInflater mInflater;
+ private Button mCancelButton;
/**
* Creates a new CharacterPickerDialog that presents the specified
@@ -54,7 +54,7 @@ public class CharacterPickerDialog extends Dialog
public CharacterPickerDialog(Context context, View view,
Editable text, String options,
boolean insert) {
- super(context);
+ super(context, com.android.internal.R.style.Theme_Panel);
mView = view;
mText = text;
@@ -70,28 +70,32 @@ public class CharacterPickerDialog extends Dialog
WindowManager.LayoutParams params = getWindow().getAttributes();
params.token = mView.getApplicationWindowToken();
params.type = params.TYPE_APPLICATION_ATTACHED_DIALOG;
+ params.flags = params.flags | Window.FEATURE_NO_TITLE;
- setTitle(R.string.select_character);
setContentView(R.layout.character_picker);
GridView grid = (GridView) findViewById(R.id.characterPicker);
grid.setAdapter(new OptionsAdapter(getContext()));
grid.setOnItemClickListener(this);
- findViewById(R.id.cancel).setOnClickListener(this);
+ mCancelButton = (Button) findViewById(R.id.cancel);
+ mCancelButton.setOnClickListener(this);
}
/**
* Handles clicks on the character buttons.
*/
public void onItemClick(AdapterView parent, View view, int position, long id) {
- int selEnd = Selection.getSelectionEnd(mText);
String result = String.valueOf(mOptions.charAt(position));
+ replaceCharacterAndClose(result);
+ }
+ private void replaceCharacterAndClose(CharSequence replace) {
+ int selEnd = Selection.getSelectionEnd(mText);
if (mInsert || selEnd == 0) {
- mText.insert(selEnd, result);
+ mText.insert(selEnd, replace);
} else {
- mText.replace(selEnd - 1, selEnd, result);
+ mText.replace(selEnd - 1, selEnd, replace);
}
dismiss();
@@ -101,21 +105,25 @@ public class CharacterPickerDialog extends Dialog
* Handles clicks on the Cancel button.
*/
public void onClick(View v) {
- dismiss();
+ if (v == mCancelButton) {
+ dismiss();
+ } else if (v instanceof Button) {
+ CharSequence result = ((Button) v).getText();
+ replaceCharacterAndClose(result);
+ }
}
private class OptionsAdapter extends BaseAdapter {
- private Context mContext;
public OptionsAdapter(Context context) {
super();
- mContext = context;
}
public View getView(int position, View convertView, ViewGroup parent) {
Button b = (Button)
mInflater.inflate(R.layout.character_picker_button, null);
b.setText(String.valueOf(mOptions.charAt(position)));
+ b.setOnClickListener(CharacterPickerDialog.this);
return b;
}
diff --git a/core/res/res/drawable-hdpi/btn_close_normal.png b/core/res/res/drawable-hdpi/btn_close_normal.png
index df3d56cbbb1f3..38b49f1a392cb 100644
Binary files a/core/res/res/drawable-hdpi/btn_close_normal.png and b/core/res/res/drawable-hdpi/btn_close_normal.png differ
diff --git a/core/res/res/drawable-hdpi/btn_close_pressed.png b/core/res/res/drawable-hdpi/btn_close_pressed.png
index ef88fe08662fb..aa9ea49f00c5a 100644
Binary files a/core/res/res/drawable-hdpi/btn_close_pressed.png and b/core/res/res/drawable-hdpi/btn_close_pressed.png differ
diff --git a/core/res/res/drawable-hdpi/btn_close_selected.png b/core/res/res/drawable-hdpi/btn_close_selected.png
new file mode 100644
index 0000000000000..870c670f72364
Binary files /dev/null and b/core/res/res/drawable-hdpi/btn_close_selected.png differ
diff --git a/core/res/res/drawable-hdpi/btn_keyboard_key_trans_normal.9.png b/core/res/res/drawable-hdpi/btn_keyboard_key_trans_normal.9.png
new file mode 100644
index 0000000000000..9c7e483351ba9
Binary files /dev/null and b/core/res/res/drawable-hdpi/btn_keyboard_key_trans_normal.9.png differ
diff --git a/core/res/res/drawable-hdpi/btn_keyboard_key_trans_pressed.9.png b/core/res/res/drawable-hdpi/btn_keyboard_key_trans_pressed.9.png
new file mode 100644
index 0000000000000..e01a49db1d420
Binary files /dev/null and b/core/res/res/drawable-hdpi/btn_keyboard_key_trans_pressed.9.png differ
diff --git a/core/res/res/drawable-hdpi/btn_keyboard_key_trans_selected.9.png b/core/res/res/drawable-hdpi/btn_keyboard_key_trans_selected.9.png
new file mode 100644
index 0000000000000..544655e43cb95
Binary files /dev/null and b/core/res/res/drawable-hdpi/btn_keyboard_key_trans_selected.9.png differ
diff --git a/core/res/res/drawable-hdpi/keyboard_popup_panel_trans_background.9.png b/core/res/res/drawable-hdpi/keyboard_popup_panel_trans_background.9.png
new file mode 100644
index 0000000000000..fd7366e204321
Binary files /dev/null and b/core/res/res/drawable-hdpi/keyboard_popup_panel_trans_background.9.png differ
diff --git a/core/res/res/drawable-mdpi/btn_close_normal.png b/core/res/res/drawable-mdpi/btn_close_normal.png
index ecc4ddee6bc7a..4c6e79dc88817 100644
Binary files a/core/res/res/drawable-mdpi/btn_close_normal.png and b/core/res/res/drawable-mdpi/btn_close_normal.png differ
diff --git a/core/res/res/drawable-mdpi/btn_close_pressed.png b/core/res/res/drawable-mdpi/btn_close_pressed.png
index 49223c54df821..fc983afdcf060 100644
Binary files a/core/res/res/drawable-mdpi/btn_close_pressed.png and b/core/res/res/drawable-mdpi/btn_close_pressed.png differ
diff --git a/core/res/res/drawable-mdpi/btn_close_selected.png b/core/res/res/drawable-mdpi/btn_close_selected.png
new file mode 100644
index 0000000000000..f2bf91a2d7169
Binary files /dev/null and b/core/res/res/drawable-mdpi/btn_close_selected.png differ
diff --git a/core/res/res/drawable-mdpi/btn_keyboard_key_trans_normal.9.png b/core/res/res/drawable-mdpi/btn_keyboard_key_trans_normal.9.png
new file mode 100644
index 0000000000000..652c05f6cf12a
Binary files /dev/null and b/core/res/res/drawable-mdpi/btn_keyboard_key_trans_normal.9.png differ
diff --git a/core/res/res/drawable-mdpi/btn_keyboard_key_trans_pressed.9.png b/core/res/res/drawable-mdpi/btn_keyboard_key_trans_pressed.9.png
new file mode 100644
index 0000000000000..1d1e9c075c281
Binary files /dev/null and b/core/res/res/drawable-mdpi/btn_keyboard_key_trans_pressed.9.png differ
diff --git a/core/res/res/drawable-mdpi/btn_keyboard_key_trans_selected.9.png b/core/res/res/drawable-mdpi/btn_keyboard_key_trans_selected.9.png
new file mode 100644
index 0000000000000..b168e0c9fc293
Binary files /dev/null and b/core/res/res/drawable-mdpi/btn_keyboard_key_trans_selected.9.png differ
diff --git a/core/res/res/drawable-mdpi/keyboard_popup_panel_trans_background.9.png b/core/res/res/drawable-mdpi/keyboard_popup_panel_trans_background.9.png
new file mode 100644
index 0000000000000..4ba2a4908cb81
Binary files /dev/null and b/core/res/res/drawable-mdpi/keyboard_popup_panel_trans_background.9.png differ
diff --git a/core/res/res/drawable/btn_close.xml b/core/res/res/drawable/btn_close.xml
index 9d90e4b6eb527..598ab0f4685a0 100644
--- a/core/res/res/drawable/btn_close.xml
+++ b/core/res/res/drawable/btn_close.xml
@@ -16,10 +16,12 @@
-
+
diff --git a/core/res/res/drawable/btn_keyboard_key_trans.xml b/core/res/res/drawable/btn_keyboard_key_trans.xml
new file mode 100644
index 0000000000000..970aed759d216
--- /dev/null
+++ b/core/res/res/drawable/btn_keyboard_key_trans.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/core/res/res/layout/character_picker.xml b/core/res/res/layout/character_picker.xml
index 03448497f5fdd..70867d076b007 100644
--- a/core/res/res/layout/character_picker.xml
+++ b/core/res/res/layout/character_picker.xml
@@ -15,35 +15,35 @@
-->
+ android:layout_height="fill_parent"
+ android:background="@drawable/keyboard_popup_panel_trans_background">
diff --git a/core/res/res/layout/character_picker_button.xml b/core/res/res/layout/character_picker_button.xml
index 40078fe8ad6e1..b74e620c8bcf0 100644
--- a/core/res/res/layout/character_picker_button.xml
+++ b/core/res/res/layout/character_picker_button.xml
@@ -15,11 +15,12 @@
-->