mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-07 23:03:11 +08:00
Fixing scale, setting legacy scale
This commit is contained in:
parent
7840448133
commit
71ea25f40a
@ -219,7 +219,7 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
// when another application (activity) is started.
|
// when another application (activity) is started.
|
||||||
protected boolean keepRunning = true;
|
protected boolean keepRunning = true;
|
||||||
|
|
||||||
private boolean clasicRender;
|
private boolean classicRender;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the activity is first created.
|
* Called when the activity is first created.
|
||||||
@ -283,9 +283,7 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
this.setWebViewClient(this.appView, new GapViewClient(this));
|
this.setWebViewClient(this.appView, new GapViewClient(this));
|
||||||
|
|
||||||
//14 is Ice Cream Sandwich!
|
//14 is Ice Cream Sandwich!
|
||||||
if(android.os.Build.VERSION.SDK_INT < 14)
|
if(android.os.Build.VERSION.SDK_INT < 14 && this.classicRender)
|
||||||
this.appView.setInitialScale(100);
|
|
||||||
else if(this.clasicRender)
|
|
||||||
{
|
{
|
||||||
//This hack fixes legacy PhoneGap apps
|
//This hack fixes legacy PhoneGap apps
|
||||||
//We should be using real pixels, not pretend pixels
|
//We should be using real pixels, not pretend pixels
|
||||||
@ -293,6 +291,10 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
int initialScale = (int) (scale * 100);
|
int initialScale = (int) (scale * 100);
|
||||||
this.appView.setInitialScale(initialScale);
|
this.appView.setInitialScale(initialScale);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.appView.setInitialScale(0);
|
||||||
|
}
|
||||||
this.appView.setVerticalScrollBarEnabled(false);
|
this.appView.setVerticalScrollBarEnabled(false);
|
||||||
this.appView.requestFocusFromTouch();
|
this.appView.requestFocusFromTouch();
|
||||||
|
|
||||||
@ -1766,7 +1768,7 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
String enabled = xml.getAttributeValue(null, "enabled");
|
String enabled = xml.getAttributeValue(null, "enabled");
|
||||||
if(enabled != null)
|
if(enabled != null)
|
||||||
{
|
{
|
||||||
this.clasicRender = enabled.equals("true");
|
this.classicRender = enabled.equals("true");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user