From 82f72d2da73b82232339ccd0ca0c81472533f6dc Mon Sep 17 00:00:00 2001 From: EddyVerbruggen Date: Sun, 11 Nov 2018 17:39:04 +0100 Subject: [PATCH] duration does not seem to accept values on "show" and "showWithOptions"methods (Android 8.0) #117 --- README.md | 1 + package.json | 2 +- plugin.xml | 2 +- src/android/nl/xservices/plugins/Toast.java | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 94833b3..10cd893 100644 --- a/README.md +++ b/README.md @@ -273,6 +273,7 @@ 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.7.2: Even better Android compatibility, but you're limited to short and long durations now, on Android. - 2.7.0: [Android P compatibility.](https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin/issues/116) - 2.6.2: [iOS view hierarchy fix.](https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin/pull/112) - 2.6.0: Windows support! diff --git a/package.json b/package.json index c4ac4e4..24e1b0e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-x-toast", - "version": "2.7.1", + "version": "2.7.2", "description": "This plugin allows you to show a Toast. A Toast is a little non intrusive buttonless popup which automatically disappears.", "cordova": { "id": "cordova-plugin-x-toast", diff --git a/plugin.xml b/plugin.xml index aa08bc3..21486ae 100755 --- a/plugin.xml +++ b/plugin.xml @@ -1,7 +1,7 @@ + version="2.7.2"> Toast diff --git a/src/android/nl/xservices/plugins/Toast.java b/src/android/nl/xservices/plugins/Toast.java index 5942eea..de6b510 100644 --- a/src/android/nl/xservices/plugins/Toast.java +++ b/src/android/nl/xservices/plugins/Toast.java @@ -90,7 +90,7 @@ public void run() { final android.widget.Toast toast = android.widget.Toast.makeText( IS_AT_LEAST_LOLLIPOP ? cordova.getActivity().getWindow().getContext() : cordova.getActivity().getApplicationContext(), message, - android.widget.Toast.LENGTH_LONG // actually controlled by a timer further down + "short".equalsIgnoreCase(duration) ? android.widget.Toast.LENGTH_SHORT : android.widget.Toast.LENGTH_LONG ); if ("top".equals(position)) {