● displayName: The name to show for the group within the Settings screen.
○ Can be a string literal, or refer to a (localizable) string resource using the format:
“@string/<string_res_name>” (probably defined in res/values/strings_settings.xml
)
○ To make a group visible you must have a display name.
● newPage: “true
” if the group should open in a new page (the default), “false
” if the group should
be shown in a section on the current page.
● description: A description for the group.
○ Can be a string literal, or refer to a (localizable) string resource in the same way as
displayName
.
○ You can use Markdown syntax to add simple styling (not all syntax is supported).
● exposed: “true
” to show this group in the settings screen (the default), “false
” to hide the group
and all of its settings (regardless of their individual exposed
attribute) on the setting screen.
It is possible to nest groups within other groups, to create a complex hierarchy of settings.
Settings
You can add Settings
to Groups
by adding a <setting> element inside a <group> element.
Each Setting element can have the following attributes:
● id: A unique ID for the setting.
○ This will be how you refer to the setting from Omnis (with a “_SETTING_” prefix).
● displayName: The name to show for the group within the Settings screen.
○ Can be a string literal, or refer to a (localizable) string resource using the format:
“@string/<string_res_name>” (probably defined in res/values/strings_settings.xml
)
● dataType: The data type of the setting. Determines the type of data that is stored with the setting,
and the UI exposed to change it in the Settings screen:
○ “string”: (The default)
○ “bool”: The <value>
(see below) should be true or false.
○ “int”
○ “float”
○ “button”: (Advanced) A button which will call custom (native Kotlin/Java) code when
clicked. You will need to extend OMPrefButton’s onButtonClicked function to add your
own custom handling.
● exposed: “true
” to show this setting in the settings screen (the default, if a displayName
is
provided), “false
” to hide it (e.g. it is some configuration constant).
○ If it is not exposed, its value will be read from settings.xml
on each launch of the app, so
can be changed in updated builds of your app.
Settings may also contain the following child elements: