Skip to content

Commit ad5372e

Browse files
sfanxiangnicolas-raoul
authored andcommitted
DialogUtil: add javadoc
1 parent 7118234 commit ad5372e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

app/src/main/java/fr/free/nrw/commons/utils/DialogUtil.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111

1212
public class DialogUtil {
1313

14+
/**
15+
* Dismisses a dialog safely.
16+
* @param activity the activity
17+
* @param dialog the dialog to be dismissed
18+
*/
1419
public static void dismissSafely(@Nullable Activity activity, @Nullable DialogFragment dialog) {
1520
boolean isActivityDestroyed = false;
1621

@@ -33,6 +38,11 @@ public static void dismissSafely(@Nullable Activity activity, @Nullable DialogFr
3338
}
3439
}
3540

41+
/**
42+
* Shows a dialog safely.
43+
* @param activity the activity
44+
* @param dialog the dialog to be shown
45+
*/
3646
public static void showSafely(Activity activity, Dialog dialog) {
3747
if (activity == null || dialog == null) {
3848
Timber.d("Show called with null activity / dialog. Ignoring.");
@@ -54,6 +64,11 @@ public static void showSafely(Activity activity, Dialog dialog) {
5464
}
5565
}
5666

67+
/**
68+
* Shows a dialog safely.
69+
* @param activity the activity
70+
* @param dialog the dialog to be shown
71+
*/
5772
public static void showSafely(FragmentActivity activity, DialogFragment dialog) {
5873
boolean isActivityDestroyed = false;
5974

0 commit comments

Comments
 (0)