#35 Close toast when app is suspended or closed: lastly, added WP8

This commit is contained in:
EddyVerbruggen 2015-05-21 21:37:41 +02:00
parent 9c269fc9ba
commit d175358f36
2 changed files with 10 additions and 5 deletions

View File

@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
id="nl.x-services.plugins.toast" id="nl.x-services.plugins.toast"
version="2.0.6-dev"> version="2.0.6">
<name>Toast</name> <name>Toast</name>

View File

@ -90,10 +90,7 @@ namespace WPCordovaClassLib.Cordova.Commands
pgrid.Width = Application.Current.Host.Content.ActualWidth - 80; pgrid.Width = Application.Current.Host.Content.ActualWidth - 80;
b.Child = pgrid; b.Child = pgrid;
if (popup != null && popup.IsOpen) this.hide(null);
{
popup.IsOpen = false;
}
popup = new Popup(); popup = new Popup();
popup.Child = b; popup.Child = b;
@ -145,6 +142,14 @@ namespace WPCordovaClassLib.Cordova.Commands
}); });
} }
public void hide(string options)
{
if (popup != null && popup.IsOpen)
{
popup.IsOpen = false;
}
}
private async void hidePopup(int delay) private async void hidePopup(int delay)
{ {
await Task.Delay(delay); await Task.Delay(delay);