Fixing scale, setting legacy scale

This commit is contained in:
Joe Bowser 2011-11-25 14:31:53 -08:00
parent 7840448133
commit 71ea25f40a

View File

@ -219,7 +219,7 @@ public class DroidGap extends PhonegapActivity {
// when another application (activity) is started.
protected boolean keepRunning = true;
private boolean clasicRender;
private boolean classicRender;
/**
* Called when the activity is first created.
@ -283,9 +283,7 @@ public class DroidGap extends PhonegapActivity {
this.setWebViewClient(this.appView, new GapViewClient(this));
//14 is Ice Cream Sandwich!
if(android.os.Build.VERSION.SDK_INT < 14)
this.appView.setInitialScale(100);
else if(this.clasicRender)
if(android.os.Build.VERSION.SDK_INT < 14 && this.classicRender)
{
//This hack fixes legacy PhoneGap apps
//We should be using real pixels, not pretend pixels
@ -293,6 +291,10 @@ public class DroidGap extends PhonegapActivity {
int initialScale = (int) (scale * 100);
this.appView.setInitialScale(initialScale);
}
else
{
this.appView.setInitialScale(0);
}
this.appView.setVerticalScrollBarEnabled(false);
this.appView.requestFocusFromTouch();
@ -1766,7 +1768,7 @@ public class DroidGap extends PhonegapActivity {
String enabled = xml.getAttributeValue(null, "enabled");
if(enabled != null)
{
this.clasicRender = enabled.equals("true");
this.classicRender = enabled.equals("true");
}
}