mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
Reverting interface change, not enough time for testing, need to remove it manually
This commit is contained in:
parent
bf69362709
commit
403b87b68b
@ -24,5 +24,5 @@ import android.app.Activity;
|
||||
* The Cordova activity abstract class that is extended by DroidGap.
|
||||
* It is used to isolate plugin development, and remove dependency on entire Cordova library.
|
||||
*/
|
||||
public abstract class PhonegapActivity extends Activity implements org.apache.cordova.api.CordovaInterface {
|
||||
public abstract class PhonegapActivity extends org.apache.cordova.api.CordovaInterface {
|
||||
}
|
||||
|
@ -175,9 +175,9 @@ public class CameraLauncher extends Plugin {
|
||||
private File createCaptureFile(int encodingType) {
|
||||
File photo = null;
|
||||
if (encodingType == JPEG) {
|
||||
photo = new File(DirectoryManager.getTempDirectoryPath(ctx.getContext()), "Pic.jpg");
|
||||
photo = new File(DirectoryManager.getTempDirectoryPath(ctx), "Pic.jpg");
|
||||
} else if (encodingType == PNG) {
|
||||
photo = new File(DirectoryManager.getTempDirectoryPath(ctx.getContext()), "Pic.png");
|
||||
photo = new File(DirectoryManager.getTempDirectoryPath(ctx), "Pic.png");
|
||||
} else {
|
||||
throw new IllegalArgumentException("Invalid Encoding Type: " + encodingType);
|
||||
}
|
||||
@ -281,7 +281,7 @@ public class CameraLauncher extends Plugin {
|
||||
// Create an ExifHelper to save the exif data that is lost during compression
|
||||
ExifHelper exif = new ExifHelper();
|
||||
if (this.encodingType == JPEG) {
|
||||
exif.createInFile(DirectoryManager.getTempDirectoryPath(ctx.getContext()) + "/Pic.jpg");
|
||||
exif.createInFile(DirectoryManager.getTempDirectoryPath(ctx) + "/Pic.jpg");
|
||||
exif.readExifData();
|
||||
}
|
||||
|
||||
@ -394,7 +394,7 @@ public class CameraLauncher extends Plugin {
|
||||
Bitmap bitmap = android.graphics.BitmapFactory.decodeStream(resolver.openInputStream(uri));
|
||||
bitmap = scaleBitmap(bitmap);
|
||||
|
||||
String fileName = DirectoryManager.getTempDirectoryPath(ctx.getContext()) + "/resize.jpg";
|
||||
String fileName = DirectoryManager.getTempDirectoryPath(ctx) + "/resize.jpg";
|
||||
OutputStream os = new FileOutputStream(fileName);
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, this.mQuality, os);
|
||||
os.close();
|
||||
|
@ -196,7 +196,7 @@ public class Capture extends Plugin {
|
||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
|
||||
// Specify file so that large image is captured and returned
|
||||
File photo = new File(DirectoryManager.getTempDirectoryPath(ctx.getContext()), "Capture.jpg");
|
||||
File photo = new File(DirectoryManager.getTempDirectoryPath(ctx), "Capture.jpg");
|
||||
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
|
||||
this.imageUri = Uri.fromFile(photo);
|
||||
|
||||
@ -249,7 +249,7 @@ public class Capture extends Plugin {
|
||||
try {
|
||||
// Create an ExifHelper to save the exif data that is lost during compression
|
||||
ExifHelper exif = new ExifHelper();
|
||||
exif.createInFile(DirectoryManager.getTempDirectoryPath(ctx.getContext()) + "/Capture.jpg");
|
||||
exif.createInFile(DirectoryManager.getTempDirectoryPath(ctx) + "/Capture.jpg");
|
||||
exif.readExifData();
|
||||
|
||||
// Read in bitmap of captured image
|
||||
|
@ -79,7 +79,7 @@ public class ContactManager extends Plugin {
|
||||
* older phones.
|
||||
*/
|
||||
if (this.contactAccessor == null) {
|
||||
this.contactAccessor = new ContactAccessorSdk5(this.webView, this.ctx.getContext());
|
||||
this.contactAccessor = new ContactAccessorSdk5(this.webView, this.ctx);
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -145,7 +145,7 @@ import android.widget.LinearLayout;
|
||||
* ...
|
||||
* </plugins>
|
||||
*/
|
||||
public class DroidGap extends Activity implements CordovaInterface {
|
||||
public class DroidGap extends CordovaInterface {
|
||||
public static String TAG = "DroidGap";
|
||||
|
||||
// The webview for our app
|
||||
@ -1404,15 +1404,4 @@ public class DroidGap extends Activity implements CordovaInterface {
|
||||
return this;
|
||||
}
|
||||
|
||||
public void bindBackButton(boolean override) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public boolean isBackButtonBound() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ public class Notification extends Plugin {
|
||||
*/
|
||||
public void beep(long count) {
|
||||
Uri ringtone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
||||
Ringtone notification = RingtoneManager.getRingtone(this.ctx.getContext(), ringtone);
|
||||
Ringtone notification = RingtoneManager.getRingtone(this.ctx, ringtone);
|
||||
|
||||
// If phone is not set to silent mode
|
||||
if (notification != null) {
|
||||
@ -190,7 +190,7 @@ public class Notification extends Plugin {
|
||||
Runnable runnable = new Runnable() {
|
||||
public void run() {
|
||||
|
||||
AlertDialog.Builder dlg = new AlertDialog.Builder(ctx.getContext());
|
||||
AlertDialog.Builder dlg = new AlertDialog.Builder(ctx);
|
||||
dlg.setMessage(message);
|
||||
dlg.setTitle(title);
|
||||
dlg.setCancelable(false);
|
||||
@ -226,7 +226,7 @@ public class Notification extends Plugin {
|
||||
|
||||
Runnable runnable = new Runnable() {
|
||||
public void run() {
|
||||
AlertDialog.Builder dlg = new AlertDialog.Builder(ctx.getContext());
|
||||
AlertDialog.Builder dlg = new AlertDialog.Builder(ctx);
|
||||
dlg.setMessage(message);
|
||||
dlg.setTitle(title);
|
||||
dlg.setCancelable(false);
|
||||
@ -287,7 +287,7 @@ public class Notification extends Plugin {
|
||||
final CordovaInterface ctx = this.ctx;
|
||||
Runnable runnable = new Runnable() {
|
||||
public void run() {
|
||||
notification.spinnerDialog = ProgressDialog.show(ctx.getContext(), title , message, true, true,
|
||||
notification.spinnerDialog = ProgressDialog.show(ctx, title , message, true, true,
|
||||
new DialogInterface.OnCancelListener() {
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
notification.spinnerDialog = null;
|
||||
@ -323,7 +323,7 @@ public class Notification extends Plugin {
|
||||
final CordovaInterface ctx = this.ctx;
|
||||
Runnable runnable = new Runnable() {
|
||||
public void run() {
|
||||
notification.progressDialog = new ProgressDialog(ctx.getContext());
|
||||
notification.progressDialog = new ProgressDialog(ctx);
|
||||
notification.progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||
notification.progressDialog.setTitle(title);
|
||||
notification.progressDialog.setMessage(message);
|
||||
|
@ -38,7 +38,7 @@ import android.net.Uri;
|
||||
* The Cordova activity abstract class that is extended by DroidGap.
|
||||
* It is used to isolate plugin development, and remove dependency on entire Cordova library.
|
||||
*/
|
||||
public interface CordovaInterface {
|
||||
public abstract class CordovaInterface extends Activity{
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
@ -69,13 +69,6 @@ public interface CordovaInterface {
|
||||
*/
|
||||
abstract public void startActivityForResult(IPlugin command, Intent intent, int requestCode);
|
||||
|
||||
/**
|
||||
* Launch an activity for which you would not like a result when it finished.
|
||||
*
|
||||
* @param intent The intent to start
|
||||
*/
|
||||
abstract public void startActivity(Intent intent);
|
||||
|
||||
/**
|
||||
* Set the plugin to be called when a sub-activity exits.
|
||||
*
|
||||
@ -98,46 +91,4 @@ public interface CordovaInterface {
|
||||
*/
|
||||
abstract public void postMessage(String id, Object data);
|
||||
|
||||
public abstract Resources getResources();
|
||||
|
||||
public abstract String getPackageName();
|
||||
|
||||
public abstract Object getSystemService(String service);
|
||||
|
||||
public abstract Context getContext();
|
||||
|
||||
public abstract Context getBaseContext();
|
||||
|
||||
public abstract Intent registerReceiver(BroadcastReceiver receiver,
|
||||
IntentFilter intentFilter);
|
||||
|
||||
public abstract ContentResolver getContentResolver();
|
||||
|
||||
public abstract void unregisterReceiver(BroadcastReceiver receiver);
|
||||
|
||||
public abstract Cursor managedQuery(Uri uri, String[] projection, String selection,
|
||||
String[] selectionArgs, String sortOrder);
|
||||
|
||||
public abstract void runOnUiThread(Runnable runnable);
|
||||
|
||||
public abstract AssetManager getAssets();
|
||||
|
||||
public abstract void clearCache();
|
||||
|
||||
public abstract void clearHistory();
|
||||
|
||||
public abstract boolean backHistory();
|
||||
|
||||
//public abstract void addWhiteListEntry(String origin, boolean subdomains);
|
||||
|
||||
public abstract void bindBackButton(boolean override);
|
||||
|
||||
public abstract boolean isBackButtonBound();
|
||||
|
||||
public abstract void cancelLoadUrl();
|
||||
|
||||
public abstract void showWebPage(String url, boolean openExternal,
|
||||
boolean clearHistory, HashMap<String, Object> params);
|
||||
|
||||
public abstract Context getApplicationContext();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user