Merge changes I035c48b9,Ib302af47,Iebda5ea6 into gingerbread

* changes:
  Cherrypick 5b61ea6b from hc-mr1
  LayoutLib: enable the LAYOUT_ONLY capability.
  Merge dba35f1b from honeycomb-mr1. do not merge.
This commit is contained in:
Xavier Ducrohet
2011-06-03 18:53:23 -07:00
committed by Android (Google) Code Review
9 changed files with 15 additions and 18 deletions

View File

@ -735,7 +735,7 @@ public final class Canvas_Delegate {
/*package*/ static void native_drawCircle(int nativeCanvas,
float cx, float cy, float radius, int paint) {
native_drawOval(nativeCanvas,
new RectF(cx - radius, cy - radius, radius*2, radius*2),
new RectF(cx - radius, cy - radius, radius, radius),
paint);
}

View File

@ -196,7 +196,7 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge {
Capability.UNBOUND_RENDERING,
Capability.CUSTOM_BACKGROUND_COLOR,
Capability.RENDER,
//Capability.LAYOUT_ONLY, // disable to run on ADT 10.0 which doesn't include this.
Capability.LAYOUT_ONLY,
Capability.EMBEDDED_LAYOUT,
Capability.VIEW_MANIPULATION,
Capability.ADAPTER_BINDING,

View File

@ -69,7 +69,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
@ -337,7 +336,7 @@ public final class BridgeContext extends Activity {
try {
KXmlParser parser = new KXmlParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(new FileReader(xml));
parser.setInput(new FileInputStream(xml), "UTF-8"); //$NON-NLS-1$);
// set the resource ref to have correct view cookies
mBridgeInflater.setResourceReference(resource);

View File

@ -36,7 +36,7 @@ import android.view.View;
import android.view.ViewGroup;
import java.io.File;
import java.io.FileReader;
import java.io.FileInputStream;
/**
* Custom implementation of {@link LayoutInflater} to handle custom views.
@ -177,7 +177,7 @@ public final class BridgeInflater extends LayoutInflater {
try {
KXmlParser parser = new KXmlParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(new FileReader(f));
parser.setInput(new FileInputStream(f), "UTF-8"); //$NON-NLS-1$
BridgeXmlBlockParser bridgeParser = new BridgeXmlBlockParser(
parser, bridgeContext, false);

View File

@ -46,7 +46,6 @@ import android.view.ViewGroup.LayoutParams;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.InputStream;
/**
@ -244,7 +243,7 @@ public final class BridgeResources extends Resources {
// give that to our XmlBlockParser
parser = new KXmlParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(new FileReader(xml));
parser.setInput(new FileInputStream(xml), "UTF-8"); //$NON-NLS-1$);
}
}
@ -282,7 +281,7 @@ public final class BridgeResources extends Resources {
// give that to our XmlBlockParser
parser = new KXmlParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(new FileReader(xml));
parser.setInput(new FileInputStream(xml), "UTF-8"); //$NON-NLS-1$);
return new BridgeXmlBlockParser(parser, mContext, mPlatformResourceFlag[0]);
}
@ -501,7 +500,7 @@ public final class BridgeResources extends Resources {
try {
KXmlParser parser = new KXmlParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(new FileReader(f));
parser.setInput(new FileInputStream(f), "UTF-8"); //$NON-NLS-1$);
return new BridgeXmlBlockParser(parser, mContext, mPlatformResourceFlag[0]);
} catch (XmlPullParserException e) {
@ -536,7 +535,7 @@ public final class BridgeResources extends Resources {
try {
KXmlParser parser = new KXmlParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(new FileReader(f));
parser.setInput(new FileInputStream(f), "UTF-8"); //$NON-NLS-1$);
return new BridgeXmlBlockParser(parser, mContext, mPlatformResourceFlag[0]);
} catch (XmlPullParserException e) {

View File

@ -40,7 +40,7 @@ import android.view.LayoutInflater_Delegate;
import android.view.ViewGroup.LayoutParams;
import java.io.File;
import java.io.FileReader;
import java.io.FileInputStream;
import java.util.Arrays;
import java.util.Map;
@ -316,7 +316,7 @@ public final class BridgeTypedArray extends TypedArray {
try {
KXmlParser parser = new KXmlParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(new FileReader(f));
parser.setInput(new FileInputStream(f), "UTF-8"); //$NON-NLS-1$);
BridgeXmlBlockParser blockParser = new BridgeXmlBlockParser(
parser, mContext, resValue.isFramework());

View File

@ -73,7 +73,7 @@ abstract class CustomBar extends LinearLayout {
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(
getClass().getResourceAsStream(layoutPath),
"UTF8");
"UTF8"); //$NON-NLS-1$
BridgeXmlBlockParser bridgeParser = new BridgeXmlBlockParser(
parser, (BridgeContext) context, false /*platformFile*/);

View File

@ -44,7 +44,6 @@ import android.util.TypedValue;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@ -124,7 +123,7 @@ public final class ResourceHelper {
// providing an XmlPullParser
KXmlParser parser = new KXmlParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(new FileReader(f));
parser.setInput(new FileInputStream(f), "UTF-8"); //$NON-NLS-1$);
BridgeXmlBlockParser blockParser = new BridgeXmlBlockParser(
parser, context, resValue.isFramework());
@ -206,7 +205,7 @@ public final class ResourceHelper {
// let the framework inflate the Drawable from the XML file.
KXmlParser parser = new KXmlParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(new FileReader(f));
parser.setInput(new FileInputStream(f), "UTF-8"); //$NON-NLS-1$);
BridgeXmlBlockParser blockParser = new BridgeXmlBlockParser(
parser, context, value.isFramework());

View File

@ -44,7 +44,7 @@ public class BridgeXmlBlockParserTest extends TestCase {
InputStream input = this.getClass().getClassLoader().getResourceAsStream(
"com/android/layoutlib/testdata/layout1.xml");
parser.setInput(input, null /*encoding*/);
parser.setInput(input, "UTF-8"); //$NON-NLS-1$
assertEquals(XmlPullParser.START_DOCUMENT, parser.next());