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.
|
* The Cordova activity abstract class that is extended by DroidGap.
|
||||||
* It is used to isolate plugin development, and remove dependency on entire Cordova library.
|
* 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) {
|
private File createCaptureFile(int encodingType) {
|
||||||
File photo = null;
|
File photo = null;
|
||||||
if (encodingType == JPEG) {
|
if (encodingType == JPEG) {
|
||||||
photo = new File(DirectoryManager.getTempDirectoryPath(ctx.getContext()), "Pic.jpg");
|
photo = new File(DirectoryManager.getTempDirectoryPath(ctx), "Pic.jpg");
|
||||||
} else if (encodingType == PNG) {
|
} else if (encodingType == PNG) {
|
||||||
photo = new File(DirectoryManager.getTempDirectoryPath(ctx.getContext()), "Pic.png");
|
photo = new File(DirectoryManager.getTempDirectoryPath(ctx), "Pic.png");
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Invalid Encoding Type: " + encodingType);
|
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
|
// Create an ExifHelper to save the exif data that is lost during compression
|
||||||
ExifHelper exif = new ExifHelper();
|
ExifHelper exif = new ExifHelper();
|
||||||
if (this.encodingType == JPEG) {
|
if (this.encodingType == JPEG) {
|
||||||
exif.createInFile(DirectoryManager.getTempDirectoryPath(ctx.getContext()) + "/Pic.jpg");
|
exif.createInFile(DirectoryManager.getTempDirectoryPath(ctx) + "/Pic.jpg");
|
||||||
exif.readExifData();
|
exif.readExifData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,7 +394,7 @@ public class CameraLauncher extends Plugin {
|
|||||||
Bitmap bitmap = android.graphics.BitmapFactory.decodeStream(resolver.openInputStream(uri));
|
Bitmap bitmap = android.graphics.BitmapFactory.decodeStream(resolver.openInputStream(uri));
|
||||||
bitmap = scaleBitmap(bitmap);
|
bitmap = scaleBitmap(bitmap);
|
||||||
|
|
||||||
String fileName = DirectoryManager.getTempDirectoryPath(ctx.getContext()) + "/resize.jpg";
|
String fileName = DirectoryManager.getTempDirectoryPath(ctx) + "/resize.jpg";
|
||||||
OutputStream os = new FileOutputStream(fileName);
|
OutputStream os = new FileOutputStream(fileName);
|
||||||
bitmap.compress(Bitmap.CompressFormat.JPEG, this.mQuality, os);
|
bitmap.compress(Bitmap.CompressFormat.JPEG, this.mQuality, os);
|
||||||
os.close();
|
os.close();
|
||||||
|
@ -196,7 +196,7 @@ public class Capture extends Plugin {
|
|||||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
|
|
||||||
// Specify file so that large image is captured and returned
|
// 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));
|
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
|
||||||
this.imageUri = Uri.fromFile(photo);
|
this.imageUri = Uri.fromFile(photo);
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ public class Capture extends Plugin {
|
|||||||
try {
|
try {
|
||||||
// Create an ExifHelper to save the exif data that is lost during compression
|
// Create an ExifHelper to save the exif data that is lost during compression
|
||||||
ExifHelper exif = new ExifHelper();
|
ExifHelper exif = new ExifHelper();
|
||||||
exif.createInFile(DirectoryManager.getTempDirectoryPath(ctx.getContext()) + "/Capture.jpg");
|
exif.createInFile(DirectoryManager.getTempDirectoryPath(ctx) + "/Capture.jpg");
|
||||||
exif.readExifData();
|
exif.readExifData();
|
||||||
|
|
||||||
// Read in bitmap of captured image
|
// Read in bitmap of captured image
|
||||||
|
@ -79,7 +79,7 @@ public class ContactManager extends Plugin {
|
|||||||
* older phones.
|
* older phones.
|
||||||
*/
|
*/
|
||||||
if (this.contactAccessor == null) {
|
if (this.contactAccessor == null) {
|
||||||
this.contactAccessor = new ContactAccessorSdk5(this.webView, this.ctx.getContext());
|
this.contactAccessor = new ContactAccessorSdk5(this.webView, this.ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -145,7 +145,7 @@ import android.widget.LinearLayout;
|
|||||||
* ...
|
* ...
|
||||||
* </plugins>
|
* </plugins>
|
||||||
*/
|
*/
|
||||||
public class DroidGap extends Activity implements CordovaInterface {
|
public class DroidGap extends CordovaInterface {
|
||||||
public static String TAG = "DroidGap";
|
public static String TAG = "DroidGap";
|
||||||
|
|
||||||
// The webview for our app
|
// The webview for our app
|
||||||
@ -1404,15 +1404,4 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
return this;
|
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) {
|
public void beep(long count) {
|
||||||
Uri ringtone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
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 phone is not set to silent mode
|
||||||
if (notification != null) {
|
if (notification != null) {
|
||||||
@ -190,7 +190,7 @@ public class Notification extends Plugin {
|
|||||||
Runnable runnable = new Runnable() {
|
Runnable runnable = new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
AlertDialog.Builder dlg = new AlertDialog.Builder(ctx.getContext());
|
AlertDialog.Builder dlg = new AlertDialog.Builder(ctx);
|
||||||
dlg.setMessage(message);
|
dlg.setMessage(message);
|
||||||
dlg.setTitle(title);
|
dlg.setTitle(title);
|
||||||
dlg.setCancelable(false);
|
dlg.setCancelable(false);
|
||||||
@ -226,7 +226,7 @@ public class Notification extends Plugin {
|
|||||||
|
|
||||||
Runnable runnable = new Runnable() {
|
Runnable runnable = new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
AlertDialog.Builder dlg = new AlertDialog.Builder(ctx.getContext());
|
AlertDialog.Builder dlg = new AlertDialog.Builder(ctx);
|
||||||
dlg.setMessage(message);
|
dlg.setMessage(message);
|
||||||
dlg.setTitle(title);
|
dlg.setTitle(title);
|
||||||
dlg.setCancelable(false);
|
dlg.setCancelable(false);
|
||||||
@ -287,7 +287,7 @@ public class Notification extends Plugin {
|
|||||||
final CordovaInterface ctx = this.ctx;
|
final CordovaInterface ctx = this.ctx;
|
||||||
Runnable runnable = new Runnable() {
|
Runnable runnable = new Runnable() {
|
||||||
public void run() {
|
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() {
|
new DialogInterface.OnCancelListener() {
|
||||||
public void onCancel(DialogInterface dialog) {
|
public void onCancel(DialogInterface dialog) {
|
||||||
notification.spinnerDialog = null;
|
notification.spinnerDialog = null;
|
||||||
@ -323,7 +323,7 @@ public class Notification extends Plugin {
|
|||||||
final CordovaInterface ctx = this.ctx;
|
final CordovaInterface ctx = this.ctx;
|
||||||
Runnable runnable = new Runnable() {
|
Runnable runnable = new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
notification.progressDialog = new ProgressDialog(ctx.getContext());
|
notification.progressDialog = new ProgressDialog(ctx);
|
||||||
notification.progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
notification.progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||||
notification.progressDialog.setTitle(title);
|
notification.progressDialog.setTitle(title);
|
||||||
notification.progressDialog.setMessage(message);
|
notification.progressDialog.setMessage(message);
|
||||||
|
@ -38,7 +38,7 @@ import android.net.Uri;
|
|||||||
* The Cordova activity abstract class that is extended by DroidGap.
|
* The Cordova activity abstract class that is extended by DroidGap.
|
||||||
* It is used to isolate plugin development, and remove dependency on entire Cordova library.
|
* It is used to isolate plugin development, and remove dependency on entire Cordova library.
|
||||||
*/
|
*/
|
||||||
public interface CordovaInterface {
|
public abstract class CordovaInterface extends Activity{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
@ -68,13 +68,6 @@ public interface CordovaInterface {
|
|||||||
* @param requestCode The request code that is passed to callback to identify the activity
|
* @param requestCode The request code that is passed to callback to identify the activity
|
||||||
*/
|
*/
|
||||||
abstract public void startActivityForResult(IPlugin command, Intent intent, int requestCode);
|
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.
|
* Set the plugin to be called when a sub-activity exits.
|
||||||
@ -97,47 +90,5 @@ public interface CordovaInterface {
|
|||||||
* @param data The message data
|
* @param data The message data
|
||||||
*/
|
*/
|
||||||
abstract public void postMessage(String id, Object data);
|
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