make dialog modal (#6015)

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
Parneet Singh 2024-12-11 11:38:39 +05:30 committed by GitHub
parent c175a4ee03
commit 9a876fa5e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 53 additions and 62 deletions

View file

@ -79,7 +79,6 @@ object DialogUtil {
onPositiveBtnClick: Runnable?,
onNegativeBtnClick: Runnable?,
customView: View?,
cancelable: Boolean,
): AlertDialog? =
createAndShowDialogSafely(
activity = activity,
@ -90,7 +89,6 @@ object DialogUtil {
onPositiveBtnClick = onPositiveBtnClick,
onNegativeBtnClick = onNegativeBtnClick,
customView = customView,
cancelable = cancelable,
)
@JvmStatic
@ -103,7 +101,6 @@ object DialogUtil {
onPositiveBtnClick: Runnable?,
onNegativeBtnClick: Runnable?,
customView: View?,
cancelable: Boolean,
): AlertDialog? =
createAndShowDialogSafely(
activity = activity,
@ -114,7 +111,6 @@ object DialogUtil {
onPositiveBtnClick = onPositiveBtnClick,
onNegativeBtnClick = onNegativeBtnClick,
customView = customView,
cancelable = cancelable,
)
@JvmStatic
@ -124,7 +120,6 @@ object DialogUtil {
message: String?,
positiveButtonText: String?,
onPositiveBtnClick: Runnable?,
cancelable: Boolean,
): AlertDialog? =
createAndShowDialogSafely(
activity = activity,
@ -132,7 +127,6 @@ object DialogUtil {
message = message,
positiveButtonText = positiveButtonText,
onPositiveBtnClick = onPositiveBtnClick,
cancelable = cancelable,
)
/**
@ -156,7 +150,7 @@ object DialogUtil {
onPositiveBtnClick: Runnable? = null,
onNegativeBtnClick: Runnable? = null,
customView: View? = null,
cancelable: Boolean = true,
cancelable: Boolean = false,
): AlertDialog? {
/* If the custom view already has a parent, there is already a dialog showing with the view
* This happens for on resume - return to avoid creating a second dialog - the first one

View file

@ -283,7 +283,8 @@ object ImageUtils {
context,
context.getString(R.string.setting_wallpaper_dialog_title),
context.getString(R.string.setting_wallpaper_dialog_message),
true
true,
false
)
}
@ -293,7 +294,8 @@ object ImageUtils {
context,
context.getString(R.string.setting_avatar_dialog_title),
context.getString(R.string.setting_avatar_dialog_message),
true
true,
false
)
}

View file

@ -186,7 +186,7 @@ object PermissionUtils {
activity.isShowPermissionsDialog = true
}
},
null, null, activity !is UploadActivity
null, null
)
}
else -> Thread(onPermissionDenied).start()
@ -223,7 +223,7 @@ object PermissionUtils {
activity.finish()
}
},
null, false
null
)
}
}).onSameThread().check()