You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+89-2Lines changed: 89 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,10 +26,12 @@
26
26
-[Modifiers](#modifiers)
27
27
-[Flow Collectors](#flow-collectors)
28
28
-[Lifecycle Observers](#lifecycle-observers)
29
-
-[Orientation Utilities](#orientation-utilities)
29
+
-[Orientation](#orientation)
30
30
-[Dimension Conversion](#dimension-conversion)
31
31
-[Color Conversion](#color-conversion)
32
+
-[Map Conversion](#map-conversion)
32
33
-[Drawer State](#drawer-state)
34
+
-[Permission States](#permission-states)
33
35
34
36
## State Savers
35
37
@@ -152,7 +154,7 @@ Runs a callback when removed from composition.
152
154
funOnRemoveFromComposition(callback: () ->Unit)
153
155
```
154
156
155
-
## Orientation Utilities
157
+
## Orientation
156
158
157
159
### `isLandscapeModeActive`
158
160
@@ -214,6 +216,12 @@ Converts a hex color string to `Color`.
214
216
fun String.toComposeColor(): Color
215
217
```
216
218
219
+
## Map Conversion
220
+
221
+
```kotlin
222
+
fun <K, V> Map<K, V>.toMutableStateMap(): SnapshotStateMap<K, V>
223
+
```
224
+
217
225
## Drawer State
218
226
219
227
### `DrawerState.visibilityPercentage()`
@@ -230,3 +238,82 @@ fun DrawerState.visibilityPercentage(@FloatRange(from = 0.0) maxWidthPx: Float):
230
238
@Composable
231
239
fun DrawerState.rememberVisibilityPercentage(@FloatRange(from =0.0) maxWidthPx:Float = DrawerDefaults.MaximumDrawerWidth.toPx()): State<Float> =
232
240
```
241
+
242
+
## Permission States
243
+
244
+
### `ExtendedPermissionState`
245
+
246
+
```kotlin
247
+
/**
248
+
* Permission state which, as opposed to the accompanist ones,
249
+
* - exposes a [grantedFromRequest] shared flow to allow for distributed subscription and callback invocation, instead of only being able to pass a onPermissionResult callback upon instantiation, which needs to cover all granting reactions, possibly impacting various components
250
+
* - allows for callbacks upon permission requesting being suppressed
251
+
*/
252
+
253
+
@Stable
254
+
interfaceExtendedPermissionState {
255
+
val granted:Boolean
256
+
257
+
/**
258
+
* The result of a launched permission request.
259
+
*/
260
+
val grantedFromRequest:SharedFlow<Boolean>
261
+
262
+
/**
263
+
* Launches the permission request if launching is not suppressed, otherwise invokes [onSuppressed].
Copy file name to clipboardExpand all lines: composeutils-permissions/src/main/kotlin/com/w2sv/composeutils/permissions/extendedpermissionstate/ExtendedPermissionState.kt
* Permission state which, as opposed to the accompanist ones,
9
+
* - exposes a [grantedFromRequest] shared flow to allow for distributed subscription and callback invocation, instead of only being able to pass a onPermissionResult callback upon instantiation, which needs to cover all granting reactions, possibly impacting various components
10
+
* - allows for callbacks upon permission requesting being suppressed
Copy file name to clipboardExpand all lines: composeutils-permissions/src/main/kotlin/com/w2sv/composeutils/permissions/extendedpermissionstate/ExtendedSinglePermissionState.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ open class ExtendedSinglePermissionState(
0 commit comments