Skip to content

Commit

Permalink
Make onDismiss optional in the GravatarQuickEditor.show() (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamGrzybkowski authored Oct 17, 2024
1 parent 07c12f2 commit 9792b6b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 4 additions & 0 deletions gravatar-quickeditor/api/gravatar-quickeditor.api
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ public final class com/gravatar/quickeditor/GravatarQuickEditor {
public static final field $stable I
public static final field INSTANCE Lcom/gravatar/quickeditor/GravatarQuickEditor;
public final fun logout (Lcom/gravatar/types/Email;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
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
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
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
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
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
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
}

public final class com/gravatar/quickeditor/ui/avatarpicker/ComposableSingletons$AvatarPickerKt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ public object GravatarQuickEditor {
* @param authenticationMethod The method used for authentication with the Gravatar REST API.
* @param onAvatarSelected The callback for the avatar update.
* Can be invoked multiple times while the Quick Editor is open.
* @param onDismiss The callback for the dismiss action.
* [GravatarQuickEditorError] will be non-null if the dismiss was caused by an error.
* @param onDismiss The callback for the dismiss action containing [GravatarQuickEditorDismissReason]
*/
@JvmStatic
@JvmOverloads
public fun show(
activity: Activity,
gravatarQuickEditorParams: GravatarQuickEditorParams,
authenticationMethod: AuthenticationMethod,
onAvatarSelected: () -> Unit,
onDismiss: (dismissReason: GravatarQuickEditorDismissReason) -> Unit,
onDismiss: (dismissReason: GravatarQuickEditorDismissReason) -> Unit = {},
) {
val viewGroup: ViewGroup = activity.findViewById(android.R.id.content)
addQuickEditorToView(viewGroup, gravatarQuickEditorParams, authenticationMethod, onAvatarSelected, onDismiss)
Expand All @@ -45,16 +45,16 @@ public object GravatarQuickEditor {
* @param authenticationMethod The method used for authentication with the Gravatar REST API.
* @param onAvatarSelected The callback for the avatar update.
* Can be invoked multiple times while the Quick Editor is open.
* @param onDismiss The callback for the dismiss action.
* [GravatarQuickEditorError] will be non-null if the dismiss was caused by an error.
* @param onDismiss The callback for the dismiss action containing [GravatarQuickEditorDismissReason]
*/
@JvmStatic
@JvmOverloads
public fun show(
fragment: Fragment,
gravatarQuickEditorParams: GravatarQuickEditorParams,
authenticationMethod: AuthenticationMethod,
onAvatarSelected: () -> Unit,
onDismiss: (dismissReason: GravatarQuickEditorDismissReason) -> Unit,
onDismiss: (dismissReason: GravatarQuickEditorDismissReason) -> Unit = {},
) {
val viewGroup: ViewGroup = fragment.requireActivity().findViewById(android.R.id.content)
addQuickEditorToView(viewGroup, gravatarQuickEditorParams, authenticationMethod, onAvatarSelected, onDismiss)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ import kotlinx.coroutines.launch
* @param authenticationMethod The method used for authentication with the Gravatar REST API.
* @param onAvatarSelected The callback for the avatar update.
* Can be invoked multiple times while the Quick Editor is open.
* @param onDismiss The callback for the dismiss action.
* [GravatarQuickEditorError] will be non-null if the dismiss was caused by an error.
* @param onDismiss The callback for the dismiss action containing [GravatarQuickEditorDismissReason]
*/
@Composable
public fun GravatarQuickEditorBottomSheet(
Expand Down

0 comments on commit 9792b6b

Please sign in to comment.