diff --git a/res/layout/custom_extra_key_add_dialog.xml b/res/layout/dialog_edit_text.xml similarity index 58% rename from res/layout/custom_extra_key_add_dialog.xml rename to res/layout/dialog_edit_text.xml index 9b799e0..ad07947 100644 --- a/res/layout/custom_extra_key_add_dialog.xml +++ b/res/layout/dialog_edit_text.xml @@ -1,4 +1,4 @@ - + diff --git a/srcs/juloo.keyboard2/CustomExtraKeysPreference.java b/srcs/juloo.keyboard2/CustomExtraKeysPreference.java index 465b2e7..b17ff8d 100644 --- a/srcs/juloo.keyboard2/CustomExtraKeysPreference.java +++ b/srcs/juloo.keyboard2/CustomExtraKeysPreference.java @@ -48,18 +48,17 @@ public class CustomExtraKeysPreference extends ListGroupPreference void select(final SelectionCallback callback) { new AlertDialog.Builder(getContext()) - .setView(R.layout.custom_extra_key_add_dialog) + .setView(R.layout.dialog_edit_text) .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog, int which) { - EditText input = (EditText)((AlertDialog)dialog).findViewById(R.id.key_name); + EditText input = (EditText)((AlertDialog)dialog).findViewById(R.id.text); final String k = input.getText().toString(); if (!k.equals("")) callback.select(k); } }) - .setNegativeButton(android.R.string.cancel, null) - .setIcon(android.R.drawable.ic_dialog_alert) + .setNegativeButton(android.R.string.cancel, null) .show(); } diff --git a/srcs/juloo.keyboard2/LayoutsPreference.java b/srcs/juloo.keyboard2/LayoutsPreference.java index a891ed8..ba28630 100644 --- a/srcs/juloo.keyboard2/LayoutsPreference.java +++ b/srcs/juloo.keyboard2/LayoutsPreference.java @@ -72,13 +72,14 @@ public class LayoutsPreference extends ListGroupPreference @Override Serializer get_serializer() { return SERIALIZER; } + @Override void select(final SelectionCallback callback) { ArrayAdapter layouts = new ArrayAdapter(getContext(), android.R.layout.simple_list_item_1, _layout_display_names); new AlertDialog.Builder(getContext()) - .setView(R.layout.custom_extra_key_add_dialog) + .setView(R.layout.dialog_edit_text) .setAdapter(layouts, new DialogInterface.OnClickListener(){ - public void onClick(DialogInterface dialog, int which) + public void onClick(DialogInterface _dialog, int which) { callback.select(_layout_names.get(which)); }