From 613aa283bdcab3d8d6e26fbe08aedcc49a8fe571 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Thu, 10 Aug 2023 20:55:42 +0200 Subject: LayoutsPreference: Remove cross button for custom layouts Remove the cross button on the right of custom layouts to reduce accidental removal. A remove button is added in the dialog for modifying the layout. --- srcs/juloo.keyboard2/LayoutsPreference.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'srcs/juloo.keyboard2/LayoutsPreference.java') diff --git a/srcs/juloo.keyboard2/LayoutsPreference.java b/srcs/juloo.keyboard2/LayoutsPreference.java index 87a7c3b..d6669ba 100644 --- a/srcs/juloo.keyboard2/LayoutsPreference.java +++ b/srcs/juloo.keyboard2/LayoutsPreference.java @@ -122,9 +122,9 @@ public class LayoutsPreference extends ListGroupPreference 1); + return (_values.size() > 1 && !(value instanceof CustomLayout)); } @Override @@ -163,7 +163,7 @@ public class LayoutsPreference extends ListGroupPreference 1) + dialog.setNeutralButton(R.string.pref_layouts_remove_custom, new DialogInterface.OnClickListener(){ + public void onClick(DialogInterface _dialog, int _which) + { + callback.select(null); + } + }); + dialog.show(); } /** Called when modifying a layout. Custom layouts behave differently. */ -- cgit v1.2.3