Commit Graph

8 Commits

Author SHA1 Message Date
Jules Aguillon
5822f98bbb Migrate layouts preferences
The new `layouts` preference replaces three previous preferences:

    layout
    second_layout
    custom_layout

Add a preference migration function, which first migration is to
migrate layouts into the new preference.

The migration must also be called from the SettingsActivity as it might
use a different preference store due to the boot-aware preference copy.
2023-08-16 12:21:40 +02:00
Jules Aguillon
613aa283bd 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.
2023-08-16 12:21:38 +02:00
Jules Aguillon
ddceb69d4e 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.
2023-08-16 12:21:25 +02:00
Jules Aguillon
500f4e41d3 Allow multiple custom layouts
This merges the "Layouts" option with the "Custom layout" option.
A custom layout becomes an item in the "Layouts" list among the other
layouts. It's possible to add several custom layouts.

Selecting the "Custom layout" item in the list opens a second dialog for
entering the layout description.

Layouts are serialized as JSON object and are decoded solely in the
LayoutsPreference class.
2023-08-16 12:21:23 +02:00
Jules Aguillon
8611dbcfa0 CustomExtraKeysPreference: Reusable edit text layout
This layout is generically used by CustomExtraKeysPreference and
LayoutsPreference.
2023-08-16 12:20:40 +02:00
Jules Aguillon
0269cd65ea ListGroupPreference: Make items abstract
Allow items to be of any class instead of strings.

Item serialization and deserialization methods are in a separate class
because they are also used in a static context.
2023-08-16 12:20:40 +02:00
Jules Aguillon
8d7b3efeb1 LayoutsPreference: Show layout display names
The internal name of layouts was rendered.
2023-08-06 19:54:38 +02:00
Jules Aguillon
dad5f57a03 Allow more than 2 layouts
The two layout selection options are replaced by a ListGroupPreference
that allow to enter an arbitrary amount of layouts.

The "switch_second" and "switch_second_back" keys are replaced by
"switch_forward" and "switch_backward", which allow to cycle through the
selected layouts in two directions.

Layouts are changed to place these two key on the space bar.
The backward key is not shown if there's only two layouts.
2023-07-30 21:44:14 +02:00