From cba66d3d1d1064fa98d24faab87c610485baff7d Mon Sep 17 00:00:00 2001 From: <> Date: Wed, 22 Jan 2025 14:47:45 +0000 Subject: [PATCH] Deployed aea64b1 with MkDocs version: 1.6.1 --- .nojekyll | 0 404.html | 1 + advanced/buttons/index.html | 18 + advanced/custom-dialog/index.html | 79 + advanced/events/index.html | 38 + advanced/options/index.html | 24 + advanced/styles/index.html | 113 + assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.60a45f97.min.js | 16 + assets/javascripts/bundle.60a45f97.min.js.map | 7 + assets/javascripts/glightbox.min.js | 1 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.f8cc74c7.min.js | 42 + .../workers/search.f8cc74c7.min.js.map | 7 + assets/logo.png | Bin 0 -> 12479 bytes assets/stylesheets/glightbox.min.css | 1 + assets/stylesheets/main.a40c8224.min.css | 1 + assets/stylesheets/main.a40c8224.min.css.map | 1 + assets/stylesheets/palette.06af60db.min.css | 1 + .../stylesheets/palette.06af60db.min.css.map | 1 + dependencies/index.html | 12 + index.html | 12 + me/index.html | 12 + migration/v2/index.html | 12 + modules/core/index.html | 12 + modules/dialog-billing/index.html | 36 + modules/dialog-color/index.html | 64 + modules/dialog-date/index.html | 99 + modules/dialog-info/index.html | 49 + modules/dialog-input/index.html | 179 + modules/dialog-list/index.html | 119 + modules/dialog-menu/index.html | 133 + modules/dialog-number/index.html | 86 + modules/dialog-progress/index.html | 60 + modules/dialog-time/index.html | 61 + other-libraries/index.html | 12 + screenshots/color/demo_color1.jpg | Bin 0 -> 50438 bytes screenshots/color/demo_color2.jpg | Bin 0 -> 27918 bytes screenshots/color/demo_color3.jpg | Bin 0 -> 33547 bytes screenshots/color/demo_color4.jpg | Bin 0 -> 26632 bytes screenshots/date/demo_calendar1.jpg | Bin 0 -> 40435 bytes screenshots/date/demo_calendar2.jpg | Bin 0 -> 25137 bytes screenshots/date/demo_calendar3.jpg | Bin 0 -> 24016 bytes screenshots/info/demo_info1.jpg | Bin 0 -> 21833 bytes screenshots/info/demo_info2.jpg | Bin 0 -> 21761 bytes screenshots/info/demo_info3.jpg | Bin 0 -> 25845 bytes screenshots/info/demo_info4.jpg | Bin 0 -> 26400 bytes screenshots/input/demo_input1.jpg | Bin 0 -> 23458 bytes screenshots/input/demo_input2.jpg | Bin 0 -> 23466 bytes screenshots/list/demo_list1.jpg | Bin 0 -> 24077 bytes screenshots/list/demo_list2.jpg | Bin 0 -> 23541 bytes screenshots/list/demo_list3.jpg | Bin 0 -> 20770 bytes screenshots/list/demo_list4.jpg | Bin 0 -> 29756 bytes screenshots/list/demo_list5.jpg | Bin 0 -> 31139 bytes screenshots/list/demo_list6.jpg | Bin 0 -> 34078 bytes screenshots/list/demo_list7.jpg | Bin 0 -> 36149 bytes screenshots/menu/demo_menu1.jpg | Bin 0 -> 14788 bytes screenshots/number/demo_number1.jpg | Bin 0 -> 24564 bytes screenshots/number/demo_number2.jpg | Bin 0 -> 28731 bytes screenshots/number/demo_number3.jpg | Bin 0 -> 24662 bytes screenshots/overview.jpg | Bin 0 -> 232770 bytes screenshots/progress/demo_progress1.jpg | Bin 0 -> 23392 bytes screenshots/progress/demo_progress2.jpg | Bin 0 -> 21987 bytes screenshots/time/demo_time1.jpg | Bin 0 -> 25906 bytes screenshots/time/demo_time2.jpg | Bin 0 -> 24726 bytes search/search_index.json | 1 + setup/index.html | 62 + sitemap.xml | 95 + sitemap.xml.gz | Bin 0 -> 357 bytes usage/index.html | 51 + 103 files changed, 8719 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 advanced/buttons/index.html create mode 100644 advanced/custom-dialog/index.html create mode 100644 advanced/events/index.html create mode 100644 advanced/options/index.html create mode 100644 advanced/styles/index.html create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.60a45f97.min.js create mode 100644 assets/javascripts/bundle.60a45f97.min.js.map create mode 100644 assets/javascripts/glightbox.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.f8cc74c7.min.js create mode 100644 assets/javascripts/workers/search.f8cc74c7.min.js.map create mode 100644 assets/logo.png create mode 100644 assets/stylesheets/glightbox.min.css create mode 100644 assets/stylesheets/main.a40c8224.min.css create mode 100644 assets/stylesheets/main.a40c8224.min.css.map create mode 100644 assets/stylesheets/palette.06af60db.min.css create mode 100644 assets/stylesheets/palette.06af60db.min.css.map create mode 100644 dependencies/index.html create mode 100644 index.html create mode 100644 me/index.html create mode 100644 migration/v2/index.html create mode 100644 modules/core/index.html create mode 100644 modules/dialog-billing/index.html create mode 100644 modules/dialog-color/index.html create mode 100644 modules/dialog-date/index.html create mode 100644 modules/dialog-info/index.html create mode 100644 modules/dialog-input/index.html create mode 100644 modules/dialog-list/index.html create mode 100644 modules/dialog-menu/index.html create mode 100644 modules/dialog-number/index.html create mode 100644 modules/dialog-progress/index.html create mode 100644 modules/dialog-time/index.html create mode 100644 other-libraries/index.html create mode 100644 screenshots/color/demo_color1.jpg create mode 100644 screenshots/color/demo_color2.jpg create mode 100644 screenshots/color/demo_color3.jpg create mode 100644 screenshots/color/demo_color4.jpg create mode 100644 screenshots/date/demo_calendar1.jpg create mode 100644 screenshots/date/demo_calendar2.jpg create mode 100644 screenshots/date/demo_calendar3.jpg create mode 100644 screenshots/info/demo_info1.jpg create mode 100644 screenshots/info/demo_info2.jpg create mode 100644 screenshots/info/demo_info3.jpg create mode 100644 screenshots/info/demo_info4.jpg create mode 100644 screenshots/input/demo_input1.jpg create mode 100644 screenshots/input/demo_input2.jpg create mode 100644 screenshots/list/demo_list1.jpg create mode 100644 screenshots/list/demo_list2.jpg create mode 100644 screenshots/list/demo_list3.jpg create mode 100644 screenshots/list/demo_list4.jpg create mode 100644 screenshots/list/demo_list5.jpg create mode 100644 screenshots/list/demo_list6.jpg create mode 100644 screenshots/list/demo_list7.jpg create mode 100644 screenshots/menu/demo_menu1.jpg create mode 100644 screenshots/number/demo_number1.jpg create mode 100644 screenshots/number/demo_number2.jpg create mode 100644 screenshots/number/demo_number3.jpg create mode 100644 screenshots/overview.jpg create mode 100644 screenshots/progress/demo_progress1.jpg create mode 100644 screenshots/progress/demo_progress2.jpg create mode 100644 screenshots/time/demo_time1.jpg create mode 100644 screenshots/time/demo_time2.jpg create mode 100644 search/search_index.json create mode 100644 setup/index.html create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 usage/index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..e0bef57 --- /dev/null +++ b/404.html @@ -0,0 +1 @@ +
Every dialog supports up to 2 integrated buttons. Whenever you show a dialog you can decide which buttons you need.
DialogDefaults
does offer the corresponding functions to create buttons.
val buttons1 = DialogDefaults.buttons(
+ positive: DialogButton = DialogButton("Save"),
+ negative: DialogButton = DialogButton("Cancel")
+)
+
+val noButtons = DialogDefaults.buttonsDisabled()
+
Buttons with an empty string will always be considered as disabled (they won't be rendered at all).
In general a custom dialog is made is simple as following (info dialog is exactly the following):
/**
+ * Shows a dialog with an info text and an optional label for that info
+ *
+ *
+ *
+ * **Basic Parameters:** all params not described here are derived from [Dialog], check it out for more details
+ *
+ * @param info the information text for this dialog
+ * @param infoLabel the optional label for the information text
+ */
+@Composable
+fun DialogInfo(
+ state: DialogState,
+ // Custom - Required
+ info: String,
+ // Custom - Optional
+ infoLabel: String = "",
+ // Base Dialog - Optional
+ title: (@Composable () -> Unit)? = null,
+ icon: (@Composable () -> Unit)? = null,
+ style: ComposeDialogStyle = DialogDefaults.defaultDialogStyle(),
+ buttons: DialogButtons = DialogDefaults.buttons(),
+ options: Options = Options(),
+ onEvent: (event: DialogEvent) -> Unit = {}
+)
+{
+ Dialog(state, title, icon, style, buttons, options, onEvent = onEvent) {
+ Column {
+ if (infoLabel.isNotEmpty()) {
+ Text(modifier = Modifier.padding(bottom = 8.dp), text = infoLabel, style = MaterialTheme.typography.titleSmall)
+ }
+ Text(text = info)
+ }
+ }
+}
+
So in the end following is the base structure for a new dialog:
@Composable
+fun DialogInfo(
+ state: DialogState,
+ // Custom
+ // custom data for you custom dialog
+ // ....
+ // Base Dialog - Optional
+ title: (@Composable () -> Unit)? = null,
+ icon: (@Composable () -> Unit)? = null,
+ style: ComposeDialogStyle = DialogDefaults.defaultDialogStyle(),
+ buttons: DialogButtons = DialogDefaults.buttons(),
+ options: Options = Options(),
+ onEvent: (event: DialogEvent) -> Unit = {}
+) {
+ Dialog(state, title, icon, style, buttons, options, onEvent = onEvent) {
+ Column {
+ // custom content - whatever you want
+ }
+ }
+}
+
This dialog will automatically support all the features of this library.
Sometimes you want show some scrollable content inside a dialog and don't want this content to stretch the dialog height in case, that the content does not show a lot of data. You can use following function from the core module in this case.
Both function will take care to show scrollbars if necessary and will not stretch the dialog height if the content inside it is small.
Every dialog offers an onEvent
callback. You can handle the dialog events inside there like e.g. if dialog was closed or if a dialog button was clicked.
DialogInfo(
+ state = state,
+ info = "some info",
+ onEvent = {
+
+ // Variant 1
+ when (event) {
+ is DialogEvent.Button -> {
+ if (event.button == DialogButtonType.Positive) {
+ // positive button was pressed
+ } else {
+ // negatvie button was pressed
+ }
+ }
+ is DialogEvent.Dismissed -> {
+ // dialog was dismissed by click outside or back press
+ }
+ }
+
+ // Variant 2
+ // many times you only want to handle the positive button click
+ if (event.isPositiveButton) {
+ // positive button was pressed
+ }
+ }
+)
+
There are a few common options that you can change for all dialogs. They are all defined inside the Options
class.
/**
+ * the main options for a dialog
+ *
+ * @param dismissOnButtonClick if true, the dialog will be automatically dismissed if a dialog button is clicked
+ * @param dismissOnBackPress if true, the dialog will be dismissed if the user pressed the back button
+ * @param dismissOnClickOutside if true, the dialog will be dismissed if the user clicks outside of the dialog
+ */
+data class Options(
+ val dismissOnButtonClick: Boolean = true,
+ val dismissOnBackPress: Boolean = true,
+ val dismissOnClickOutside: Boolean = true,
+)
+
This library offers 3 styles (actually 4) for dialog. You can always provide the style to a dialog composable and customise it however you want.
DialogDefaults
does offer the corresponding functions to create a style.
/**
+ * the setup of a dialog that shows as a normal dialog popup
+ *
+ * @param swipeDismissable if true, the dialog can be swiped away by an up/down swipe
+ * @param dismissOnBackPress if true, the dialog can be dismissed by a back press
+ * @param dismissOnClickOutside if true, the dialog can be dismissed by clicking outside of its borders
+ * @param options provides custom style options of the dialog
+ * @param shape the [Shape] of the dialog
+ * @param containerColor the [Color] of the container
+ * @param iconColor the content [Color] of the icon
+ * @param titleColor the content [Color] of the title
+ * @param textColor the content [Color] of the text
+ */
+@Composable
+fun styleDialog(
+ swipeDismissable: Boolean = false,
+ // DialogProperties
+ dismissOnBackPress: Boolean = true,
+ dismissOnClickOutside: Boolean = true,
+ // Style
+ options: StyleOptions = StyleOptions(),
+ shape: Shape = DialogStyleDefaults.shape,
+ containerColor: Color = DialogStyleDefaults.containerColor,
+ iconColor: Color = DialogStyleDefaults.iconColor,
+ titleColor: Color = DialogStyleDefaults.titleColor,
+ contentColor: Color = DialogStyleDefaults.contentColor
+): ComposeDialogStyle
+
/**
+ * the setup of a dialog that shows as a normal dialog popup
+ *
+ * @param dragHandle if true, a drag handle will be shown
+ * @param peekHeight the peek height calculation of the bottom sheet
+ * @param expandInitially if true, the bottom sheet is initially displayed in expanded state (even if it has a peek height)
+ * @param velocityThreshold the velocity threshold of the bottom sheet
+ * @param positionalThreshold the positional threshold of the bottom sheet
+ * @param animateShow if true, the sheet will be animated on first show
+ * @param dismissOnBackPress if true, the dialog can be dismissed by a back press
+ * @param dismissOnClickOutside if true, the dialog can be dismissed by clicking outside of its borders
+ * @param options provides custom style options of the dialog
+ * @param shape the [Shape] of the dialog
+ * @param containerColor the [Color] of the container
+ * @param iconColor the content [Color] of the icon
+ * @param titleColor the content [Color] of the title
+ * @param textColor the content [Color] of the text
+ */
+@Composable
+fun styleBottomSheet(
+ dragHandle: Boolean = true,
+ peekHeight: ((containerHeight: Dp, sheetHeight: Dp) -> Dp)? = BottomSheetStyleDefaults.peekHeight,
+ expandInitially: Boolean = false,
+ velocityThreshold: () -> Dp = { 125.dp },
+ positionalThreshold: (totalDistance: Dp) -> Dp = { 56.dp },
+ animateShow: Boolean = false,
+ // DialogProperties
+ dismissOnBackPress: Boolean = true,
+ dismissOnClickOutside: Boolean = true,
+ // Style
+ options: StyleOptions = StyleOptions(),
+ shape: Shape = BottomSheetStyleDefaults.shape,
+ containerColor: Color = BottomSheetStyleDefaults.containerColor,
+ iconColor: Color = BottomSheetStyleDefaults.iconColor,
+ titleColor: Color = BottomSheetStyleDefaults.titleColor,
+ contentColor: Color = BottomSheetStyleDefaults.contentColor
+): ComposeDialogStyle
+
/**
+ * the setup of a dialog that shows as a normal dialog popup
+ *
+ * @param darkStatusBar if true, the dialog icons will be adjusted to a dark status bar
+ * @param menuActions if provided, it replaces the the default close menu action
+ * @param dismissOnBackPress if true, the dialog can be dismissed by a back press
+ * @param toolbarColor the [Color] of the toolbar
+ * @param toolbarActionColor the [Color] of the actions in the toolbar
+ * @param containerColor the [Color] of the container
+ * @param iconColor the content [Color] of the icon
+ * @param titleColor the content [Color] of the title
+ */
+@Composable
+fun styleFullscreenDialog(
+ darkStatusBar: Boolean = false,
+ menuActions: @Composable (RowScope.() -> Unit)? = null,
+ // DialogProperties
+ dismissOnBackPress: Boolean = true,
+ // Style
+ toolbarColor: Color = FullscreenDialogStyleDefaults.toolbarColor,
+ toolbarActionColor: Color = FullscreenDialogStyleDefaults.toolbarActionColor,
+ containerColor: Color = FullscreenDialogStyleDefaults.containerColor,
+ iconColor: Color = FullscreenDialogStyleDefaults.iconColor,
+ titleColor: Color = FullscreenDialogStyleDefaults.titleColor,
+ contentColor: Color = FullscreenDialogStyleDefaults.contentColor
+): ComposeDialogStyle
+
On windows you can also use a windows window based dialog style.
@Composable
+fun DialogDefaults.styleWindowsDialog(
+ dialogTitle: String,
+ position: WindowPosition = WindowPosition(Alignment.Center),
+ width: Dp = 800.dp,
+ height: Dp = 600.dp,
+ // Style
+ iconColor: Color = DialogStyleDefaults.iconColor,
+ titleColor: Color = DialogStyleDefaults.titleColor,
+ contentColor: Color = DialogStyleDefaults.contentColor
+): ComposeDialogStyle
+