abouttreesummaryrefslogcommitdiff
path: root/srcs
diff options
context:
space:
mode:
authorJules Aguillon2023-08-10 12:55:27 +0200
committerJules Aguillon2023-08-16 12:20:40 +0200
commit8611dbcfa0ef6d551bf3acb65e5a1990a3ced75b (patch)
treecd6ab6b3be1ed3e93eef4d97e83c1718515b3961 /srcs
parent03f2b8df7031baf5bc95ad1d1530e327c9d3ca7c (diff)
downloadunexpected-keyboard-8611dbcfa0ef6d551bf3acb65e5a1990a3ced75b.tar.gz
unexpected-keyboard-8611dbcfa0ef6d551bf3acb65e5a1990a3ced75b.zip
CustomExtraKeysPreference: Reusable edit text layout
This layout is generically used by CustomExtraKeysPreference and LayoutsPreference.
Diffstat (limited to 'srcs')
-rw-r--r--srcs/juloo.keyboard2/CustomExtraKeysPreference.java7
-rw-r--r--srcs/juloo.keyboard2/LayoutsPreference.java5
2 files changed, 6 insertions, 6 deletions
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<String>
void select(final SelectionCallback<String> 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<String>
@Override
Serializer<String> 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));
}