-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from x0b/dev-x0b
Bugfix release 1.10.1
- Loading branch information
Showing
29 changed files
with
207 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/src/main/java/ca/pkay/rcloneexplorer/Dialogs/Dialogs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package ca.pkay.rcloneexplorer.Dialogs; | ||
|
||
import androidx.annotation.Nullable; | ||
import androidx.fragment.app.DialogFragment; | ||
|
||
public class Dialogs { | ||
|
||
/** | ||
* Dismiss a dialog, but only if it is still attached to a host activity. | ||
* <br><br> | ||
* This should be used especially in callbacks, since they have a higher | ||
* chance of being executed in a different lifecycle phase and thus an | ||
* elevated propability of calling DialogFrament.dismiss() on an invalid | ||
* fragment. | ||
* @param dialog the dialog to dismiss | ||
*/ | ||
public static void dismissSilently(@Nullable DialogFragment dialog) { | ||
if(dialog != null) { | ||
if(dialog.isStateSaved()){ | ||
dialog.dismissAllowingStateLoss(); | ||
} else if(dialog.isAdded()) { | ||
dialog.dismiss(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.