From ddceb69d4e5a8eac458b20145fe121580c0d6444 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Thu, 10 Aug 2023 20:48:24 +0200 Subject: [PATCH] LayoutsPreference: Modify custom layout Clicking on a custom layout opens a dialog for modifying the layout description instead of the dialog for selecting a layout. --- srcs/juloo.keyboard2/LayoutsPreference.java | 23 +++++++++++++++---- srcs/juloo.keyboard2/ListGroupPreference.java | 9 ++++++-- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/srcs/juloo.keyboard2/LayoutsPreference.java b/srcs/juloo.keyboard2/LayoutsPreference.java index a65b350..87a7c3b 100644 --- a/srcs/juloo.keyboard2/LayoutsPreference.java +++ b/srcs/juloo.keyboard2/LayoutsPreference.java @@ -146,7 +146,7 @@ public class LayoutsPreference extends ListGroupPreference extends PreferenceGroup return true; } - /** Called when an item is added or modified. Returns [null] to cancel the - action. */ + /** Called when an item is added or modified. */ abstract void select(SelectionCallback callback); + /** Called when an item is modified. */ + void select(SelectionCallback callback, E _old_value) + { + select(callback); + } + /** A separate class is used as the same serializer must be used in the static context. See [Serializer] below. */ abstract Serializer get_serializer();