Loading core/java/android/text/method/CharacterPickerDialog.java +11 −16 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ 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 Loading @@ -71,15 +70,13 @@ public class CharacterPickerDialog extends Dialog params.token = mView.getApplicationWindowToken(); params.type = params.TYPE_APPLICATION_ATTACHED_DIALOG; params.flags = params.flags | Window.FEATURE_NO_TITLE; setCanceledOnTouchOutside(true); setContentView(R.layout.character_picker); GridView grid = (GridView) findViewById(R.id.characterPicker); grid.setAdapter(new OptionsAdapter(getContext())); grid.setOnItemClickListener(this); mCancelButton = (Button) findViewById(R.id.cancel); mCancelButton.setOnClickListener(this); } /** Loading @@ -90,6 +87,16 @@ public class CharacterPickerDialog extends Dialog replaceCharacterAndClose(result); } /** * Handles clicks on the character buttons. */ public void onClick(View v) { if (v instanceof Button) { CharSequence result = ((Button) v).getText(); replaceCharacterAndClose(result); } } private void replaceCharacterAndClose(CharSequence replace) { int selEnd = Selection.getSelectionEnd(mText); if (mInsert || selEnd == 0) { Loading @@ -101,18 +108,6 @@ public class CharacterPickerDialog extends Dialog dismiss(); } /** * Handles clicks on the Cancel button. */ public void onClick(View v) { if (v == mCancelButton) { dismiss(); } else if (v instanceof Button) { CharSequence result = ((Button) v).getText(); replaceCharacterAndClose(result); } } private class OptionsAdapter extends BaseAdapter { public OptionsAdapter(Context context) { Loading core/res/res/drawable/btn_keyboard_key_ics_simple.xml 0 → 100644 +28 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2008 The Android Open Source 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. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/btn_keyboard_key_light_pressed_holo" /> <item android:state_pressed="true" android:drawable="@drawable/btn_keyboard_key_light_pressed_holo" /> <item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/btn_keyboard_key_light_normal_holo" /> </selector> core/res/res/layout/character_picker.xml +1 −11 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ android:orientation="horizontal" android:layout_width="304dp" android:layout_height="match_parent" android:background="@drawable/keyboard_popup_panel_trans_background"> android:background="@drawable/keyboard_background"> <GridView android:id="@+id/characterPicker" Loading @@ -36,14 +36,4 @@ android:layout_gravity="center_vertical" android:listSelector="#0000" /> <Button android:id="@+id/cancel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="12dp" android:layout_marginEnd="12dp" android:background="@drawable/btn_close" android:layout_gravity="center_vertical" /> </LinearLayout> core/res/res/layout/character_picker_button.xml +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ android:clickable="true" android:focusable="false" android:textAppearance="?android:attr/textAppearanceLarge" android:background="@drawable/btn_keyboard_key_trans" android:background="@drawable/btn_keyboard_key_ics_simple" android:textColor="#FFFFFFFF" /> Loading
core/java/android/text/method/CharacterPickerDialog.java +11 −16 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ 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 Loading @@ -71,15 +70,13 @@ public class CharacterPickerDialog extends Dialog params.token = mView.getApplicationWindowToken(); params.type = params.TYPE_APPLICATION_ATTACHED_DIALOG; params.flags = params.flags | Window.FEATURE_NO_TITLE; setCanceledOnTouchOutside(true); setContentView(R.layout.character_picker); GridView grid = (GridView) findViewById(R.id.characterPicker); grid.setAdapter(new OptionsAdapter(getContext())); grid.setOnItemClickListener(this); mCancelButton = (Button) findViewById(R.id.cancel); mCancelButton.setOnClickListener(this); } /** Loading @@ -90,6 +87,16 @@ public class CharacterPickerDialog extends Dialog replaceCharacterAndClose(result); } /** * Handles clicks on the character buttons. */ public void onClick(View v) { if (v instanceof Button) { CharSequence result = ((Button) v).getText(); replaceCharacterAndClose(result); } } private void replaceCharacterAndClose(CharSequence replace) { int selEnd = Selection.getSelectionEnd(mText); if (mInsert || selEnd == 0) { Loading @@ -101,18 +108,6 @@ public class CharacterPickerDialog extends Dialog dismiss(); } /** * Handles clicks on the Cancel button. */ public void onClick(View v) { if (v == mCancelButton) { dismiss(); } else if (v instanceof Button) { CharSequence result = ((Button) v).getText(); replaceCharacterAndClose(result); } } private class OptionsAdapter extends BaseAdapter { public OptionsAdapter(Context context) { Loading
core/res/res/drawable/btn_keyboard_key_ics_simple.xml 0 → 100644 +28 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2008 The Android Open Source 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. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/btn_keyboard_key_light_pressed_holo" /> <item android:state_pressed="true" android:drawable="@drawable/btn_keyboard_key_light_pressed_holo" /> <item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/btn_keyboard_key_light_normal_holo" /> </selector>
core/res/res/layout/character_picker.xml +1 −11 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ android:orientation="horizontal" android:layout_width="304dp" android:layout_height="match_parent" android:background="@drawable/keyboard_popup_panel_trans_background"> android:background="@drawable/keyboard_background"> <GridView android:id="@+id/characterPicker" Loading @@ -36,14 +36,4 @@ android:layout_gravity="center_vertical" android:listSelector="#0000" /> <Button android:id="@+id/cancel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="12dp" android:layout_marginEnd="12dp" android:background="@drawable/btn_close" android:layout_gravity="center_vertical" /> </LinearLayout>
core/res/res/layout/character_picker_button.xml +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ android:clickable="true" android:focusable="false" android:textAppearance="?android:attr/textAppearanceLarge" android:background="@drawable/btn_keyboard_key_trans" android:background="@drawable/btn_keyboard_key_ics_simple" android:textColor="#FFFFFFFF" />