mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
DialogUtil: add javadoc
This commit is contained in:
parent
7118234ebf
commit
ad5372e38b
1 changed files with 15 additions and 0 deletions
|
|
@ -11,6 +11,11 @@ import timber.log.Timber;
|
||||||
|
|
||||||
public class DialogUtil {
|
public class DialogUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dismisses a dialog safely.
|
||||||
|
* @param activity the activity
|
||||||
|
* @param dialog the dialog to be dismissed
|
||||||
|
*/
|
||||||
public static void dismissSafely(@Nullable Activity activity, @Nullable DialogFragment dialog) {
|
public static void dismissSafely(@Nullable Activity activity, @Nullable DialogFragment dialog) {
|
||||||
boolean isActivityDestroyed = false;
|
boolean isActivityDestroyed = false;
|
||||||
|
|
||||||
|
|
@ -33,6 +38,11 @@ public class DialogUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows a dialog safely.
|
||||||
|
* @param activity the activity
|
||||||
|
* @param dialog the dialog to be shown
|
||||||
|
*/
|
||||||
public static void showSafely(Activity activity, Dialog dialog) {
|
public static void showSafely(Activity activity, Dialog dialog) {
|
||||||
if (activity == null || dialog == null) {
|
if (activity == null || dialog == null) {
|
||||||
Timber.d("Show called with null activity / dialog. Ignoring.");
|
Timber.d("Show called with null activity / dialog. Ignoring.");
|
||||||
|
|
@ -54,6 +64,11 @@ public class DialogUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows a dialog safely.
|
||||||
|
* @param activity the activity
|
||||||
|
* @param dialog the dialog to be shown
|
||||||
|
*/
|
||||||
public static void showSafely(FragmentActivity activity, DialogFragment dialog) {
|
public static void showSafely(FragmentActivity activity, DialogFragment dialog) {
|
||||||
boolean isActivityDestroyed = false;
|
boolean isActivityDestroyed = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue