Compare commits

..
Author SHA1 Message Date
Eddy Verbruggen 95fe5ce19b creating different failures 2014-07-16 17:20:26 +02:00
Eddy Verbruggen 9def9e77f5 Creating a failing test 2014-07-16 17:11:18 +02:00
5 changed files with 10 additions and 30 deletions
-2
View File
@@ -160,8 +160,6 @@ The Android code was entirely created by me.
For iOS most credits go to this excellent [Toast for iOS project by Charles Scalesse] (https://github.com/scalessec/Toast).
## 6. CHANGELOG
2.0.1: iOS messages are hidden when another one is shown. [Thanks Richie Min!](https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin/pull/13)
2.0: WP8 support
1.0: initial version supporting Android and iOS
+1 -1
View File
@@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="nl.x-services.plugins.toast"
version="2.0.1">
version="2.0">
<name>Toast</name>
-6
View File
@@ -46,8 +46,6 @@ static const BOOL CSToastHidesOnTap = YES; // excludes activity
static const NSString * CSToastTimerKey = @"CSToastTimerKey";
static const NSString * CSToastActivityViewKey = @"CSToastActivityViewKey";
static UIView *prevToast = NULL;
@interface UIView (ToastPrivate)
- (void)hideToast:(UIView *)toast;
@@ -93,10 +91,6 @@ static UIView *prevToast = NULL;
}
- (void)showToast:(UIView *)toast duration:(NSTimeInterval)duration position:(id)point {
if(prevToast){
[self hideToast:prevToast];
}
prevToast = toast;
toast.center = [self centerPointForPosition:point withToast:toast];
toast.alpha = 0.0;
+4 -18
View File
@@ -82,30 +82,16 @@ namespace WPCordovaClassLib.Cordova.Commands
popup.VerticalAlignment = VerticalAlignment.Bottom;
popup.VerticalOffset = -100; // TODO can do better
}
else if ("center".Equals(position))
else // center
{
popup.VerticalAlignment = VerticalAlignment.Center;
popup.VerticalOffset = -50; // TODO can do way better
}
else
{
DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "invalid position. valid options are 'top', 'center' and 'bottom'"));
return;
}
int hideDelay = 2800;
if ("long".Equals(duration))
{
hideDelay = 5500;
}
else if (!"short".Equals(duration))
{
DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "invalid duration. valid options are 'short' and 'long'"));
return;
}
grid.Children.Add(popup);
popup.IsOpen = true;
int hideDelay = "long".Equals(duration) ? 5500 : 2800;
this.hidePopup(hideDelay);
}
}
@@ -122,4 +108,4 @@ namespace WPCordovaClassLib.Cordova.Commands
popup.IsOpen = false;
}
}
}
}
+5 -3
View File
@@ -1,11 +1,11 @@
exports.defineAutoTests = function() {
cordova.define("nl.x-services.plugins.toast.tests", function(require, exports, module) { exports.defineAutoTests = function() {
var fail = function (done) {
expect(true).toBe(false);
expect(false).toBe(true);
done();
},
succeed = function (done) {
expect(true).toBe(true);
expect(false).toBe(false);
done();
};
@@ -55,3 +55,5 @@ exports.defineAutoTests = function() {
});
});
};
});