Skip to content

Commit 9792b6b

Browse files
Make onDismiss optional in the GravatarQuickEditor.show() (#396)
1 parent 07c12f2 commit 9792b6b

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

gravatar-quickeditor/api/gravatar-quickeditor.api

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ public final class com/gravatar/quickeditor/GravatarQuickEditor {
22
public static final field $stable I
33
public static final field INSTANCE Lcom/gravatar/quickeditor/GravatarQuickEditor;
44
public final fun logout (Lcom/gravatar/types/Email;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
5+
public static final fun show (Landroid/app/Activity;Lcom/gravatar/quickeditor/ui/editor/GravatarQuickEditorParams;Lcom/gravatar/quickeditor/ui/editor/AuthenticationMethod;Lkotlin/jvm/functions/Function0;)V
56
public static final fun show (Landroid/app/Activity;Lcom/gravatar/quickeditor/ui/editor/GravatarQuickEditorParams;Lcom/gravatar/quickeditor/ui/editor/AuthenticationMethod;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)V
7+
public static final fun show (Landroidx/fragment/app/Fragment;Lcom/gravatar/quickeditor/ui/editor/GravatarQuickEditorParams;Lcom/gravatar/quickeditor/ui/editor/AuthenticationMethod;Lkotlin/jvm/functions/Function0;)V
68
public static final fun show (Landroidx/fragment/app/Fragment;Lcom/gravatar/quickeditor/ui/editor/GravatarQuickEditorParams;Lcom/gravatar/quickeditor/ui/editor/AuthenticationMethod;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)V
9+
public static synthetic fun show$default (Landroid/app/Activity;Lcom/gravatar/quickeditor/ui/editor/GravatarQuickEditorParams;Lcom/gravatar/quickeditor/ui/editor/AuthenticationMethod;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
10+
public static synthetic fun show$default (Landroidx/fragment/app/Fragment;Lcom/gravatar/quickeditor/ui/editor/GravatarQuickEditorParams;Lcom/gravatar/quickeditor/ui/editor/AuthenticationMethod;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
711
}
812

913
public final class com/gravatar/quickeditor/ui/avatarpicker/ComposableSingletons$AvatarPickerKt {

gravatar-quickeditor/src/main/java/com/gravatar/quickeditor/GravatarQuickEditor.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ public object GravatarQuickEditor {
2121
* @param authenticationMethod The method used for authentication with the Gravatar REST API.
2222
* @param onAvatarSelected The callback for the avatar update.
2323
* Can be invoked multiple times while the Quick Editor is open.
24-
* @param onDismiss The callback for the dismiss action.
25-
* [GravatarQuickEditorError] will be non-null if the dismiss was caused by an error.
24+
* @param onDismiss The callback for the dismiss action containing [GravatarQuickEditorDismissReason]
2625
*/
2726
@JvmStatic
27+
@JvmOverloads
2828
public fun show(
2929
activity: Activity,
3030
gravatarQuickEditorParams: GravatarQuickEditorParams,
3131
authenticationMethod: AuthenticationMethod,
3232
onAvatarSelected: () -> Unit,
33-
onDismiss: (dismissReason: GravatarQuickEditorDismissReason) -> Unit,
33+
onDismiss: (dismissReason: GravatarQuickEditorDismissReason) -> Unit = {},
3434
) {
3535
val viewGroup: ViewGroup = activity.findViewById(android.R.id.content)
3636
addQuickEditorToView(viewGroup, gravatarQuickEditorParams, authenticationMethod, onAvatarSelected, onDismiss)
@@ -45,16 +45,16 @@ public object GravatarQuickEditor {
4545
* @param authenticationMethod The method used for authentication with the Gravatar REST API.
4646
* @param onAvatarSelected The callback for the avatar update.
4747
* Can be invoked multiple times while the Quick Editor is open.
48-
* @param onDismiss The callback for the dismiss action.
49-
* [GravatarQuickEditorError] will be non-null if the dismiss was caused by an error.
48+
* @param onDismiss The callback for the dismiss action containing [GravatarQuickEditorDismissReason]
5049
*/
5150
@JvmStatic
51+
@JvmOverloads
5252
public fun show(
5353
fragment: Fragment,
5454
gravatarQuickEditorParams: GravatarQuickEditorParams,
5555
authenticationMethod: AuthenticationMethod,
5656
onAvatarSelected: () -> Unit,
57-
onDismiss: (dismissReason: GravatarQuickEditorDismissReason) -> Unit,
57+
onDismiss: (dismissReason: GravatarQuickEditorDismissReason) -> Unit = {},
5858
) {
5959
val viewGroup: ViewGroup = fragment.requireActivity().findViewById(android.R.id.content)
6060
addQuickEditorToView(viewGroup, gravatarQuickEditorParams, authenticationMethod, onAvatarSelected, onDismiss)

gravatar-quickeditor/src/main/java/com/gravatar/quickeditor/ui/editor/bottomsheet/GravatarQuickEditorBottomSheet.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ import kotlinx.coroutines.launch
5656
* @param authenticationMethod The method used for authentication with the Gravatar REST API.
5757
* @param onAvatarSelected The callback for the avatar update.
5858
* Can be invoked multiple times while the Quick Editor is open.
59-
* @param onDismiss The callback for the dismiss action.
60-
* [GravatarQuickEditorError] will be non-null if the dismiss was caused by an error.
59+
* @param onDismiss The callback for the dismiss action containing [GravatarQuickEditorDismissReason]
6160
*/
6261
@Composable
6362
public fun GravatarQuickEditorBottomSheet(

0 commit comments

Comments
 (0)