Merge branch 'master' into start_location

This commit is contained in:
Braden Shepherdson 2013-01-11 12:13:43 -05:00
commit e14edf134d
8 changed files with 26 additions and 31 deletions

View File

@ -69,7 +69,7 @@ function on_error {
echo "An unexpected error occurred: $previous_command exited with $?" echo "An unexpected error occurred: $previous_command exited with $?"
echo "Deleting project..." echo "Deleting project..."
[ -d "$PROJECT_PATH" ] && rm -rf "$PROJECT_PATH" [ -d "$PROJECT_PATH" ] && rm -rf "$PROJECT_PATH"
exit "$?" exit 1
} }
function replace { function replace {

View File

@ -64,7 +64,7 @@ public class App extends CordovaPlugin {
this.loadUrl(args.getString(0), args.optJSONObject(1)); this.loadUrl(args.getString(0), args.optJSONObject(1));
} }
else if (action.equals("cancelLoadUrl")) { else if (action.equals("cancelLoadUrl")) {
this.cancelLoadUrl(); //this.cancelLoadUrl();
} }
else if (action.equals("clearHistory")) { else if (action.equals("clearHistory")) {
this.clearHistory(); this.clearHistory();
@ -160,14 +160,6 @@ public class App extends CordovaPlugin {
this.webView.showWebPage(url, openExternal, clearHistory, params); this.webView.showWebPage(url, openExternal, clearHistory, params);
} }
/**
* Cancel loadUrl before it has been loaded (Only works on a CordovaInterface class)
*/
@Deprecated
public void cancelLoadUrl() {
this.cordova.cancelLoadUrl();
}
/** /**
* Clear page history for the app. * Clear page history for the app.
*/ */

View File

@ -322,7 +322,8 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
} }
// If all this is true we shouldn't compress the image. // If all this is true we shouldn't compress the image.
if (this.targetHeight == -1 && this.targetWidth == -1 && this.mQuality == 100 && rotate == 0) { if (this.targetHeight == -1 && this.targetWidth == -1 && this.mQuality == 100 &&
!this.correctOrientation) {
writeUncompressedImage(uri); writeUncompressedImage(uri);
this.callbackContext.success(uri.toString()); this.callbackContext.success(uri.toString());

View File

@ -40,6 +40,7 @@ import android.graphics.Color;
import android.media.AudioManager; import android.media.AudioManager;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.util.Log;
import android.view.Display; import android.view.Display;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.Menu; import android.view.Menu;
@ -169,7 +170,7 @@ public class DroidGap extends Activity implements CordovaInterface {
// Draw a splash screen using an image located in the drawable resource directory. // Draw a splash screen using an image located in the drawable resource directory.
// This is not the same as calling super.loadSplashscreen(url) // This is not the same as calling super.loadSplashscreen(url)
protected int splashscreen = 0; protected int splashscreen = 0;
protected int splashscreenTime = 0; protected int splashscreenTime = 3000;
// LoadUrl timeout value in msec (default of 20 sec) // LoadUrl timeout value in msec (default of 20 sec)
protected int loadUrlTimeoutValue = 20000; protected int loadUrlTimeoutValue = 20000;
@ -1048,7 +1049,7 @@ public class DroidGap extends Activity implements CordovaInterface {
} }
else { else {
// If the splash dialog is showing don't try to show it again // If the splash dialog is showing don't try to show it again
if (this.splashDialog != null && !this.splashDialog.isShowing()) { if (this.splashDialog == null || !this.splashDialog.isShowing()) {
this.splashscreen = this.getIntegerProperty("splashscreen", 0); this.splashscreen = this.getIntegerProperty("splashscreen", 0);
this.showSplashScreen(this.splashscreenTime); this.showSplashScreen(this.splashscreenTime);
} }

View File

@ -676,10 +676,11 @@ public class FileTransfer extends CordovaPlugin {
progress.setTotal(connection.getContentLength()); progress.setTotal(connection.getContentLength());
} }
FileOutputStream outputStream = new FileOutputStream(file); FileOutputStream outputStream = null;
InputStream inputStream = null; InputStream inputStream = null;
try { try {
outputStream = new FileOutputStream(file);
inputStream = getInputStream(connection); inputStream = getInputStream(connection);
synchronized (context) { synchronized (context) {
if (context.aborted) { if (context.aborted) {

View File

@ -1019,9 +1019,12 @@ public class FileUtils extends CordovaPlugin {
* @return a mime type * @return a mime type
*/ */
public static String getMimeType(String filename) { public static String getMimeType(String filename) {
if (filename != null) {
// Stupid bug in getFileExtensionFromUrl when the file name has a space // Stupid bug in getFileExtensionFromUrl when the file name has a space
// So we need to replace the space with a url encoded %20 // So we need to replace the space with a url encoded %20
String url = filename.replace(" ", "%20");
// CB-2185: Stupid bug not putting JPG extension in the mime-type map
String url = filename.replace(" ", "%20").toLowerCase();
MimeTypeMap map = MimeTypeMap.getSingleton(); MimeTypeMap map = MimeTypeMap.getSingleton();
String extension = MimeTypeMap.getFileExtensionFromUrl(url); String extension = MimeTypeMap.getFileExtensionFromUrl(url);
if (extension.toLowerCase().equals("3ga")) { if (extension.toLowerCase().equals("3ga")) {
@ -1029,6 +1032,9 @@ public class FileUtils extends CordovaPlugin {
} else { } else {
return map.getMimeTypeFromExtension(extension); return map.getMimeTypeFromExtension(extension);
} }
} else {
return "";
}
} }
/** /**

View File

@ -54,11 +54,6 @@ public interface CordovaInterface {
*/ */
public abstract Activity getActivity(); public abstract Activity getActivity();
@Deprecated
public abstract Context getContext();
@Deprecated
public abstract void cancelLoadUrl();
/** /**
* Called when a message is sent to plugin. * Called when a message is sent to plugin.

View File

@ -43,7 +43,6 @@ public class LegacyContext implements CordovaInterface {
@Deprecated @Deprecated
public void cancelLoadUrl() { public void cancelLoadUrl() {
Log.i(LOG_TAG, "Replace ctx.cancelLoadUrl() with cordova.cancelLoadUrl()"); Log.i(LOG_TAG, "Replace ctx.cancelLoadUrl() with cordova.cancelLoadUrl()");
this.cordova.cancelLoadUrl();
} }
@Deprecated @Deprecated
@ -55,7 +54,7 @@ public class LegacyContext implements CordovaInterface {
@Deprecated @Deprecated
public Context getContext() { public Context getContext() {
Log.i(LOG_TAG, "Replace ctx.getContext() with cordova.getContext()"); Log.i(LOG_TAG, "Replace ctx.getContext() with cordova.getContext()");
return this.cordova.getContext(); return this.cordova.getActivity();
} }
@Deprecated @Deprecated