Fixes to rendering of Webkit on browser

This commit is contained in:
Joe Bowser 2009-11-12 10:51:22 -08:00
parent 72a6748987
commit 99cdf9686d
5 changed files with 15 additions and 8 deletions

View File

@ -1,6 +1,13 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.phonegap" android:versionName="1.1" android:versionCode="3"> package="com.phonegap" android:versionName="1.1" android:versionCode="3">
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:resizeable="true"
android:anyDensity="true"
/>
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

View File

@ -9,11 +9,12 @@
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script> <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
var deviceInfo = function(){ var deviceInfo = function(){
console.log('setting the dom nodes');
document.getElementById("platform").innerHTML = device.platform; document.getElementById("platform").innerHTML = device.platform;
document.getElementById("version").innerHTML = device.version; document.getElementById("version").innerHTML = device.version;
document.getElementById("uuid").innerHTML = device.uuid; document.getElementById("uuid").innerHTML = device.uuid;
console.log("Height:" + window.innerHeight);
console.log("Width:" + window.innerWidth);
} }
var getLocation = function() { var getLocation = function() {
@ -103,8 +104,7 @@
function init(){ function init(){
document.addEventListener("touchmove", preventBehavior, false); document.addEventListener("touchmove", preventBehavior, false);
document.addEventListener("deviceReady", deviceInfo, true); document.addEventListener("deviceReady", deviceInfo, true);
console.log('we are in init');
} }

View File

@ -25,7 +25,7 @@ public class AudioHandler implements OnCompletionListener, OnPreparedListener, O
public AudioHandler(String file, Context ctx) { public AudioHandler(String file, Context ctx) {
this.recording = file; this.recording = file;
this.mCtx = ctx; this.mCtx = ctx;
} }
protected void startRecording(String file){ protected void startRecording(String file){
if (!isRecording){ if (!isRecording){

View File

@ -37,6 +37,7 @@ import android.webkit.JsResult;
import android.webkit.WebChromeClient; import android.webkit.WebChromeClient;
import android.webkit.WebSettings; import android.webkit.WebSettings;
import android.webkit.WebView; import android.webkit.WebView;
import android.webkit.WebSettings.LayoutAlgorithm;
public class DroidGap extends Activity { public class DroidGap extends Activity {
@ -68,6 +69,7 @@ public class DroidGap extends Activity {
WebSettings settings = appView.getSettings(); WebSettings settings = appView.getSettings();
settings.setJavaScriptEnabled(true); settings.setJavaScriptEnabled(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true); settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
/* Bind the appView object to the gap class methods */ /* Bind the appView object to the gap class methods */

View File

@ -47,15 +47,13 @@ public class PhoneGap{
private Context mCtx; private Context mCtx;
private WebView mAppView; private WebView mAppView;
SmsListener mSmsListener; SmsListener mSmsListener;
DirectoryManager fileManager;
AudioHandler audio; AudioHandler audio;
public PhoneGap(Context ctx, WebView appView) { public PhoneGap(Context ctx, WebView appView) {
this.mCtx = ctx; this.mCtx = ctx;
this.mAppView = appView; this.mAppView = appView;
mSmsListener = new SmsListener(ctx,mAppView); mSmsListener = new SmsListener(ctx,mAppView);
fileManager = new DirectoryManager();
audio = new AudioHandler("/sdcard/tmprecording.mp3", ctx); audio = new AudioHandler("/sdcard/tmprecording.mp3", ctx);
uuid = getUuid(); uuid = getUuid();
} }